/* -*-C-*- */ /* Prefix */ #include /* 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; }