This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / MINICERN / packlib / kernlib / kerngen / ccgenu / fchput.c
CommitLineData
fe4da5cc 1/*
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1 1996/02/15 17:49:40 mclareni
6 * Kernlib
7 *
8 */
9#include "kerngen/pilot.h"
10/*> ROUTINE FCHPUT
11 CERN PROGLIB# FCHPUT .VERSION KERNFOR 4.31 911111
12 ORIG. 22/02/91, JZ
13
14 Copy a zero-terminated C character string
15 to a Fortran character string of length NTEXT,
16 return length and blank-fill
17*/
18#include <stdio.h>
19#include "kerngen/fortchar.h"
20int fchput(pttext,ftext,lgtext)
21 char *pttext;
22#if defined(CERNLIB_QMCRY)
23 _fcd ftext;
24#endif
25#if !defined(CERNLIB_QMCRY)
26 char *ftext;
27#endif
28 int lgtext;
29{
30 char *utext;
31 int limit, jcol;
32 int nhave;
33
34 limit = lgtext;
35 jcol = 0;
36#if defined(CERNLIB_QMCRY)
37 utext = _fcdtocp(ftext);
38#endif
39#if !defined(CERNLIB_QMCRY)
40 utext = ftext;
41#endif
42 if (pttext == NULL) goto out;
43
44/*-- copy the text to the caller */
45 for (jcol = 0; jcol < limit; jcol++)
46 { if (*pttext == '\0') break;
47 *utext++ = *pttext++;
48 }
49
50out: nhave = jcol;
51 for (; jcol < limit; jcol++) *utext++ = ' ';
52 return nhave;
53}
54/*> END <----------------------------------------------------------*/