Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/src/runtime/config/gen-unix-sigtbl.c
ViewVC logotype

Annotation of /sml/trunk/src/runtime/config/gen-unix-sigtbl.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 250 - (view) (download) (as text)

1 : monnier 249 /* gen-unix-sigtbl.c
2 :     *
3 :     * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.
4 :     *
5 :     * Generate the "unix-sigtbl.c" file.
6 :     */
7 :    
8 :     #include <signal.h>
9 :     #include <stdio.h>
10 :     #include "gen.h"
11 :     #include "gen-unix-signals.h"
12 :    
13 :     #ifndef DST_FILE
14 :     #define DST_FILE "unix-sigtbl.c"
15 :     #endif
16 :    
17 :     main ()
18 :     {
19 :     sig_info_t *sigInfo;
20 :     int i;
21 :     int numSigs;
22 :     FILE *f;
23 :    
24 :     sigInfo = SortSignalTbl ();
25 :     numSigs = sigInfo->numSysSigs+sigInfo->numRunSigs;
26 :    
27 :     f = OpenFile (DST_FILE, NIL(char *));
28 :    
29 :     fprintf (f, "\n");
30 :     fprintf (f, "PVT sys_const_t SigInfo[NUM_SIGS] = {\n");
31 :     for (i = 0; i < sigInfo->numSysSigs; i++) {
32 :     fprintf(f, " { %s, \"%s\" },\n",
33 :     sigInfo->sigs[i]->sigName, sigInfo->sigs[i]->shortName);
34 :     }
35 :     fprintf (f, " /* Run-time signals */\n");
36 :     for (i = sigInfo->numSysSigs; i < numSigs; i++) {
37 :     fprintf(f, " { %s, \"%s\" },\n",
38 :     sigInfo->sigs[i]->sigName, sigInfo->sigs[i]->shortName);
39 :     }
40 :     fprintf (f, "};\n");
41 :     fprintf (f, "PVT sysconst_tbl_t SigTbl = {\n");
42 :     fprintf (f, " /* numConsts */ NUM_SIGS,\n");
43 :     fprintf (f, " /* consts */ SigInfo\n");
44 :     fprintf (f, "};\n");
45 :    
46 :     CloseFile (f, NIL(char *));
47 :    
48 :     exit (0);
49 :    
50 :     } /* end of main */
51 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0