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-signals.c
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : monnier 249 /* gen-unix-signals.c
2 :     *
3 :     * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.
4 :     *
5 :     * Generate the "system-signals.h" file for UNIX systems.
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 "system-signals.h"
15 :     #endif
16 :    
17 :    
18 : blume 569 int main (void)
19 : monnier 249 {
20 :     sig_info_t *sigInfo;
21 :     int i;
22 :     int numSigs;
23 :     FILE *f;
24 :    
25 :     sigInfo = SortSignalTbl ();
26 :     numSigs = sigInfo->numSysSigs+sigInfo->numRunSigs;
27 :    
28 :     f = OpenFile (DST_FILE, "_SYSTEM_SIGNALS_");
29 :    
30 :     fprintf (f, "#define NUM_SYSTEM_SIGS %2d\n", sigInfo->numSysSigs);
31 :     fprintf (f, "#define MAX_SYSTEM_SIG %2d /* %s */\n",
32 :     sigInfo->maxSysSig, sigInfo->sigs[sigInfo->numSysSigs-1]->sigName);
33 :     fprintf (f, "#define NUM_SIGS %2d\n", numSigs);
34 :     fprintf (f, "#define MAX_SIG %2d /* %s */\n",
35 :     sigInfo->sigs[numSigs-1]->sig, sigInfo->sigs[numSigs-1]->sigName);
36 :     fprintf (f, "\n");
37 :     for (i = sigInfo->numSysSigs; i < numSigs; i++) {
38 :     fprintf(f, "#define %s %2d\n",
39 :     sigInfo->sigs[i]->sigName, sigInfo->sigs[i]->sig);
40 :     }
41 :     fprintf (f, "\n");
42 :     fprintf (f, "#define IS_SYSTEM_SIG(S) ((S) <= MAX_SYSTEM_SIG)\n");
43 :    
44 :     CloseFile (f, "_SYSTEM_SIGNALS_");
45 :    
46 :     exit (0);
47 :    
48 :     } /* end of main */
49 :    

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