util.c
Go to the documentation of this file.
00001 #include "sysdep1.h"    /* here to get stat64 on some badly designed Linux systems */
00002 #include "f2c.h"
00003 #include "fio.h"
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007 
00008  VOID
00009 #ifdef KR_headers
00010 #define Const /*nothing*/
00011 g_char(a,alen,b) char *a,*b; ftnlen alen;
00012 #else
00013 #define Const const
00014 g_char(const char *a, ftnlen alen, char *b)
00015 #endif
00016 {
00017         Const char *x = a + alen;
00018         char *y = b + alen;
00019 
00020         for(;; y--) {
00021                 if (x <= a) {
00022                         *b = 0;
00023                         return;
00024                         }
00025                 if (*--x != ' ')
00026                         break;
00027                 }
00028         *y-- = 0;
00029         do *y-- = *x;
00030                 while(x-- > a);
00031         }
00032 
00033  VOID
00034 #ifdef KR_headers
00035 b_char(a,b,blen) char *a,*b; ftnlen blen;
00036 #else
00037 b_char(const char *a, char *b, ftnlen blen)
00038 #endif
00039 {       int i;
00040         for(i=0;i<blen && *a!=0;i++) *b++= *a++;
00041         for(;i<blen;i++) *b++=' ';
00042 }
00043 #ifndef NON_UNIX_STDIO
00044 #ifdef KR_headers
00045 long f__inode(a, dev) char *a; int *dev;
00046 #else
00047 long f__inode(char *a, int *dev)
00048 #endif
00049 {       struct STAT_ST x;
00050         if(STAT(a,&x)<0) return(-1);
00051         *dev = x.st_dev;
00052         return(x.st_ino);
00053 }
00054 #endif
00055 #ifdef __cplusplus
00056 }
00057 #endif


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:16