source: trunk/src/gcc/libf2c/libI77/util.c@ 410

Last change on this file since 410 was 2, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 936 bytes
Line 
1#include "config.h"
2#ifndef NON_UNIX_STDIO
3#define _INCLUDE_POSIX_SOURCE /* for HP-UX */
4#define _INCLUDE_XOPEN_SOURCE /* for HP-UX */
5#include <sys/types.h>
6#include <sys/stat.h>
7#endif
8#include "f2c.h"
9#include "fio.h"
10
11 VOID
12#ifdef KR_headers
13g_char(a,alen,b) char *a,*b; ftnlen alen;
14#else
15g_char(char *a, ftnlen alen, char *b)
16#endif
17{
18 char *x = a + alen, *y = b + alen;
19
20 for(;; y--) {
21 if (x <= a) {
22 *b = 0;
23 return;
24 }
25 if (*--x != ' ')
26 break;
27 }
28 *y-- = 0;
29 do *y-- = *x;
30 while(x-- > a);
31 }
32
33 VOID
34#ifdef KR_headers
35b_char(a,b,blen) char *a,*b; ftnlen blen;
36#else
37b_char(char *a, char *b, ftnlen blen)
38#endif
39{ int i;
40 for(i=0;i<blen && *a!=0;i++) *b++= *a++;
41 for(;i<blen;i++) *b++=' ';
42}
43#ifndef NON_UNIX_STDIO
44#ifdef KR_headers
45long f__inode(a, dev) char *a; int *dev;
46#else
47long f__inode(char *a, int *dev)
48#endif
49{ struct stat x;
50 if(stat(a,&x)<0) return(-1);
51 *dev = x.st_dev;
52 return(x.st_ino);
53}
54#endif
Note: See TracBrowser for help on using the repository browser.