Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

fchput.c

Go to the documentation of this file.
00001 /*
00002  * $Id: fchput.c,v 1.2 2009/02/16 08:04:36 schubert Exp $
00003  *
00004  * Revision 1.1.1.1  2002/06/16 15:18:46  hristov
00005  * Separate distribution  of Geant3
00006  *
00007  * Revision 1.1.1.1  1999/05/18 15:55:29  fca
00008  * AliRoot sources
00009  *
00010  * Revision 1.1.1.1  1996/02/15 17:49:40  mclareni
00011  * Kernlib
00012  *
00013  */
00014 #include "kerngen/pilot.h"
00015 /*>    ROUTINE FCHPUT
00016   CERN PROGLIB#         FCHPUT          .VERSION KERNFOR  4.31  911111
00017   ORIG. 22/02/91, JZ
00018 
00019       Copy a zero-terminated C character string
00020       to a Fortran character string of length NTEXT,
00021       return length and blank-fill
00022 */
00023 #include <stdio.h>
00024 #include "kerngen/fortchar.h"
00025 int fchput(pttext,ftext,lgtext)
00026       char *pttext;
00027 #if defined(CERNLIB_QMCRY)
00028       _fcd ftext;
00029 #endif
00030 #if !defined(CERNLIB_QMCRY)
00031       char *ftext;
00032 #endif
00033       int  lgtext;
00034 {
00035       char *utext;
00036       int  limit, jcol;
00037       int  nhave;
00038 
00039       limit = lgtext;
00040       jcol  = 0;
00041 #if defined(CERNLIB_QMCRY)
00042       utext = _fcdtocp(ftext);
00043 #endif
00044 #if !defined(CERNLIB_QMCRY)
00045       utext = ftext;
00046 #endif
00047       if (pttext == NULL)          goto out;
00048 
00049 /*--      copy the text to the caller   */
00050       for (jcol = 0; jcol < limit; jcol++)
00051       {   if (*pttext == '\0')  break;
00052           *utext++ = *pttext++;
00053         }
00054 
00055 out:  nhave = jcol;
00056       for (; jcol < limit; jcol++)   *utext++ = ' ';
00057       return nhave;
00058 }
00059 /*> END <----------------------------------------------------------*/

Generated on Mon Feb 15 11:06:41 2010 for loon by  doxygen 1.3.9.1