Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
util.c
Go to the documentation of this file.00001 #ifndef NON_UNIX_STDIO
00002 #include "sys/types.h"
00003 #include "sys/stat.h"
00004 #endif
00005 #include "f2c.h"
00006 #include "fio.h"
00007
00008 VOID
00009 #ifdef KR_headers
00010 g_char(a,alen,b) char *a,*b; ftnlen alen;
00011 #else
00012 g_char(char *a, ftnlen alen, char *b)
00013 #endif
00014 {
00015 char *x = a + alen, *y = b + alen;
00016
00017 for(;; y--) {
00018 if (x <= a) {
00019 *b = 0;
00020 return;
00021 }
00022 if (*--x != ' ')
00023 break;
00024 }
00025 *y-- = 0;
00026 do *y-- = *x;
00027 while(x-- > a);
00028 }
00029
00030 VOID
00031 #ifdef KR_headers
00032 b_char(a,b,blen) char *a,*b; ftnlen blen;
00033 #else
00034 b_char(char *a, char *b, ftnlen blen)
00035 #endif
00036 { int i;
00037 for(i=0;i<blen && *a!=0;i++) *b++= *a++;
00038 for(;i<blen;i++) *b++=' ';
00039 }
00040 #ifndef NON_UNIX_STDIO
00041 #ifdef KR_headers
00042 long f__inode(a, dev) char *a; int *dev;
00043 #else
00044 long f__inode(char *a, int *dev)
00045 #endif
00046 { struct stat x;
00047 if(stat(a,&x)<0) return(-1);
00048 *dev = x.st_dev;
00049 return(x.st_ino);
00050 }
00051 #endif