source: vendor/gcc/3.3.4/libf2c/libI77/util.c

Last change on this file was 1391, checked in by bird, 21 years ago

GCC v3.3.3 sources.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 785 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
11void
12g_char (char *a, ftnlen alen, char *b)
13{
14 char *x = a + alen, *y = b + alen;
15
16 for (;; y--)
17 {
18 if (x <= a)
19 {
20 *b = 0;
21 return;
22 }
23 if (*--x != ' ')
24 break;
25 }
26 *y-- = 0;
27 do
28 *y-- = *x;
29 while (x-- > a);
30}
31
32void
33b_char (char *a, char *b, ftnlen blen)
34{
35 int i;
36 for (i = 0; i < blen && *a != 0; i++)
37 *b++ = *a++;
38 for (; i < blen; i++)
39 *b++ = ' ';
40}
41
42#ifndef NON_UNIX_STDIO
43long
44f__inode (char *a, int *dev)
45{
46 struct stat x;
47 if (stat (a, &x) < 0)
48 return (-1);
49 *dev = x.st_dev;
50 return (x.st_ino);
51}
52#endif
Note: See TracBrowser for help on using the repository browser.