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

fchtak.c

Go to the documentation of this file.
00001 /*
00002  * $Id: fchtak.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 FCHTAK
00016   CERN PROGLIB#         FCHTAK          .VERSION KERNFOR  4.31  911111
00017   ORIG. 22/02/91, JZ
00018 
00019       copy a Fortran character string
00020       to allocated memory zero-terminated,
00021       return the memory pointer
00022 */
00023 #include <stdio.h>
00024 #include "kerngen/fortchar.h"
00025 char *fchtak(ftext,lgtext)
00026 #if defined(CERNLIB_QMCRY)
00027       _fcd  ftext;
00028 #endif
00029 #if !defined(CERNLIB_QMCRY)
00030       char *ftext;
00031 #endif
00032       int  lgtext;
00033 {
00034       char *malloc();
00035       char *ptalc, *ptuse;
00036       char *utext;
00037       int  nalc;
00038       int  ntx, jcol;
00039 
00040       nalc  = lgtext + 8;
00041       ptalc = malloc (nalc);
00042       if (ptalc == NULL)     goto exit;
00043 #if defined(CERNLIB_QMCRY)
00044       utext = _fcdtocp(ftext);
00045 #endif
00046 #if !defined(CERNLIB_QMCRY)
00047       utext = ftext;
00048 #endif
00049 
00050       ptuse = ptalc;
00051       ntx   = lgtext;
00052       for (jcol = 0; jcol < ntx; jcol++)  *ptuse++ = *utext++;
00053 
00054       *ptuse = '\0';
00055 exit: return  ptalc;
00056 }
00057 /*> END <----------------------------------------------------------*/

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