fchtak.c File Reference

#include "kerngen/pilot.h"
#include <stdio.h>
#include <stdlib.h>
#include "kerngen/fortchar.h"

Go to the source code of this file.

Functions

char * fchtak (char *ftext, int lgtext)

Function Documentation

char* fchtak ( char *  ftext,
int  lgtext 
)

Definition at line 26 of file fchtak.c.

References exit().

00034 {
00035 //#if 0  /* malloc() is declared in <stdlib.h> */
00036 //      char *malloc();
00037 //#endif
00038       char *ptalc, *ptuse;
00039       char *utext;
00040       int  nalc;
00041       int  ntx, jcol;
00042 
00043       nalc  = lgtext + 8;
00044       ptalc = malloc (nalc);
00045       if (ptalc == NULL)     goto exit;
00046 #if defined(CERNLIB_QMCRY)
00047       utext = _fcdtocp(ftext);
00048 #endif
00049 #if !defined(CERNLIB_QMCRY)
00050       utext = ftext;
00051 #endif
00052 
00053       ptuse = ptalc;
00054       ntx   = lgtext;
00055       for (jcol = 0; jcol < ntx; jcol++)  *ptuse++ = *utext++;
00056 
00057       *ptuse = '\0';
00058 exit: return  ptalc;
00059 }


Generated on 15 Jul 2018 for loon by  doxygen 1.6.1