1 /* get the sizes and signedness of basic system types. Doing this by
2 * hand is basically just too tedious.
4 * In the current system this doesn't get built or run automatically,
5 * because I (Dan) am lazy and do not want to think too hard about the
6 * interaction between generated source files, build trees, and CVS.
7 * You have to build it yourself when porting to a new architecture -
8 * which I'd guess doesn't happen too often anyway
10 * The output from this is generally in code/$(architecture)-$(os)-types.h */
12 #include <sys/types.h>
13 #include <sys/times.h>
17 #define DEFTYPE(lispname,cname) { cname foo; \
18 printf("(def-alien-type "##lispname##" (%s %d))\n", (((foo=-1)<0) ? "sb!alien:signed" : "unsigned"), (8 * (sizeof foo))); }
20 #define DEFCONSTANT(lispname,cname) { printf("(defconstant %s %d) ;; 0x%x\n",lispname,cname,cname);}
23 main(int argc, char *argv[])
25 /* don't need no steenking command line arguments */
27 fprintf(stderr, "argh! command line argument(s)\n");
31 /* don't need no steenking hand-editing */
33 ";;;; This is an automatically generated file, please do not hand-edit it.
34 ;;;; See the program \"grovel_headers.c\".
37 printf("(in-package \"SB!UNIX\")\n\n");
39 DEFTYPE("dev-t", dev_t);
40 DEFTYPE("ino-t", ino_t);
41 DEFTYPE("mode-t", mode_t);
42 DEFTYPE("nlink-t", nlink_t);
43 DEFTYPE("uid-t", uid_t);
44 DEFTYPE("gid-t", gid_t);
45 DEFTYPE("clock-t", clock_t);
46 DEFTYPE("off-t", off_t);
47 DEFTYPE("time-t", time_t);
50 DEFCONSTANT("r_ok", R_OK);
51 DEFCONSTANT("w_ok", W_OK);
52 DEFCONSTANT("x_ok", X_OK);
53 DEFCONSTANT("f_ok", F_OK);
56 DEFCONSTANT("o_rdonly", O_RDONLY);
57 DEFCONSTANT("o_wronly", O_WRONLY);
58 DEFCONSTANT("o_rdwr", O_RDWR);
59 DEFCONSTANT("o_accmode", O_ACCMODE);
60 DEFCONSTANT("o_creat", O_CREAT);
61 DEFCONSTANT("o_excl", O_EXCL);
62 DEFCONSTANT("o_noctty", O_NOCTTY);
63 DEFCONSTANT("o_trunc", O_TRUNC);
64 DEFCONSTANT("o_append", O_APPEND);
66 DEFCONSTANT( "s-ifmt", S_IFMT);
67 DEFCONSTANT( "s-ififo", S_IFIFO);
68 DEFCONSTANT( "s-ifchr", S_IFCHR);
69 DEFCONSTANT( "s-ifdir", S_IFDIR);
70 DEFCONSTANT( "s-ifblk", S_IFBLK);
71 DEFCONSTANT( "s-ifreg", S_IFREG);
73 DEFCONSTANT( "s-iflnk", S_IFLNK);
74 DEFCONSTANT( "s-ifsock", S_IFSOCK);