00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "kerngen/pilot.h"
00015
00016
00017
00018
00019
00020
00021
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