Stamp ChangeLogs for release
[official-gcc.git] / libf2c / libI77 / util.c
blobccaad2d3b6f2e0b6f757d7a6631096ef3fd72ec2
1 #ifndef NON_UNIX_STDIO
2 #define _INCLUDE_POSIX_SOURCE /* for HP-UX */
3 #define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #endif
7 #include "f2c.h"
8 #include "fio.h"
10 VOID
11 #ifdef KR_headers
12 g_char(a,alen,b) char *a,*b; ftnlen alen;
13 #else
14 g_char(char *a, ftnlen alen, char *b)
15 #endif
17 char *x = a + alen, *y = b + alen;
19 for(;; y--) {
20 if (x <= a) {
21 *b = 0;
22 return;
24 if (*--x != ' ')
25 break;
27 *y-- = 0;
28 do *y-- = *x;
29 while(x-- > a);
32 VOID
33 #ifdef KR_headers
34 b_char(a,b,blen) char *a,*b; ftnlen blen;
35 #else
36 b_char(char *a, char *b, ftnlen blen)
37 #endif
38 { int i;
39 for(i=0;i<blen && *a!=0;i++) *b++= *a++;
40 for(;i<blen;i++) *b++=' ';
42 #ifndef NON_UNIX_STDIO
43 #ifdef KR_headers
44 long f__inode(a, dev) char *a; int *dev;
45 #else
46 long f__inode(char *a, int *dev)
47 #endif
48 { struct stat x;
49 if(stat(a,&x)<0) return(-1);
50 *dev = x.st_dev;
51 return(x.st_ino);
53 #endif