diff options
author | bnewbold <bnewbold@eta.mit.edu> | 2009-05-11 13:45:12 -0400 |
---|---|---|
committer | bnewbold <bnewbold@eta.mit.edu> | 2009-05-11 13:45:12 -0400 |
commit | 38e10dc81d5f8f1a2bbededb790e775c0c637d6c (patch) | |
tree | c1c97634df0c0ff31f70d87462ad1f1390fd301f /final_project/work/prhello-const.c | |
parent | ca6558941cf604b2e5ddb8fe38261091a99f6d09 (diff) | |
download | 6.945-38e10dc81d5f8f1a2bbededb790e775c0c637d6c.tar.gz 6.945-38e10dc81d5f8f1a2bbededb790e775c0c637d6c.zip |
files from laura
Diffstat (limited to 'final_project/work/prhello-const.c')
-rw-r--r-- | final_project/work/prhello-const.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/final_project/work/prhello-const.c b/final_project/work/prhello-const.c new file mode 100644 index 0000000..4d5f3f5 --- /dev/null +++ b/final_project/work/prhello-const.c @@ -0,0 +1,50 @@ +/* -*-C-*- */ + +/* Prefix */ +#include <gtk/gtk.h> +/* End Prefix */ + +void +grovel_basics (FILE * out) +{ + fprintf (out, " ((sizeof char) . %d)\n", sizeof (char)); + fprintf (out, " ((sizeof uchar) . %d)\n", sizeof (unsigned char)); + fprintf (out, " ((sizeof short) . %d)\n", sizeof (short)); + fprintf (out, " ((sizeof ushort) . %d)\n", sizeof (unsigned short)); + fprintf (out, " ((sizeof int) . %d)\n", sizeof (int)); + fprintf (out, " ((sizeof uint) . %d)\n", sizeof (unsigned int)); + fprintf (out, " ((sizeof long) . %d)\n", sizeof (long)); + fprintf (out, " ((sizeof ulong) . %d)\n", sizeof (unsigned long)); + fprintf (out, " ((sizeof float) . %d)\n", sizeof (float)); + fprintf (out, " ((sizeof double) . %d)\n", sizeof (double)); + fprintf (out, " ((sizeof *) . %d)\n", sizeof (void*)); +} + +void +grovel_enums (FILE * out) +{ + fprintf (out, " (|GTK_WINDOW_POPUP| . %ld)\n", ((long)GTK_WINDOW_POPUP)); + fprintf (out, " (|GTK_WINDOW_TOPLEVEL| . %ld)\n", ((long)GTK_WINDOW_TOPLEVEL)); +} + +int +main (void) +{ + FILE * out = fopen ("prhello-const.scm", "w"); + if (out == NULL) { + perror ("could not open prhello-const.scm"); + return 1; + } + fprintf (out, "'( ;; prhello constants\n"); + fprintf (out, " ( ;; enum member values\n"); + grovel_enums(out); + fprintf (out, " )\n"); + fprintf (out, " ( ;; struct values\n"); + grovel_basics(out); + fprintf (out, " ))\n"); + if (fclose (out)) { + perror ("could not close prhello-const.scm"); + return 1; + } + return 0; +} |