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 1880 - (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 : jhr 1880 #include <stdlib.h>
11 : monnier 249 #include "gen.h"
12 :     #include "gen-unix-signals.h"
13 :    
14 :     #ifndef DST_FILE
15 :     #define DST_FILE "system-signals.h"
16 :     #endif
17 :    
18 :    
19 : blume 569 int main (void)
20 : monnier 249 {
21 :     sig_info_t *sigInfo;
22 :     int i;
23 :     int numSigs;
24 :     FILE *f;
25 :    
26 :     sigInfo = SortSignalTbl ();
27 :    
28 :     f = OpenFile (DST_FILE, "_SYSTEM_SIGNALS_");
29 :    
30 : jhr 1781 numSigs = sigInfo->numSysSigs + sigInfo->numRunSigs;
31 :    
32 : monnier 249 fprintf (f, "#define NUM_SYSTEM_SIGS %2d\n", sigInfo->numSysSigs);
33 : jhr 1781 fprintf (f, "#define MIN_SYSTEM_SIG %2d /* %s */\n",
34 :     sigInfo->minSysSig, sigInfo->sigs[0]->sigName);
35 : monnier 249 fprintf (f, "#define MAX_SYSTEM_SIG %2d /* %s */\n",
36 :     sigInfo->maxSysSig, sigInfo->sigs[sigInfo->numSysSigs-1]->sigName);
37 :     fprintf (f, "#define NUM_SIGS %2d\n", numSigs);
38 : jhr 1781 fprintf (f, "#define SIGMAP_SZ %2d\n",
39 :     sigInfo->maxSysSig + sigInfo->numRunSigs + 1);
40 : monnier 249 fprintf (f, "\n");
41 :     for (i = sigInfo->numSysSigs; i < numSigs; i++) {
42 :     fprintf(f, "#define %s %2d\n",
43 :     sigInfo->sigs[i]->sigName, sigInfo->sigs[i]->sig);
44 :     }
45 :     fprintf (f, "\n");
46 : jhr 1781
47 : monnier 249 fprintf (f, "#define IS_SYSTEM_SIG(S) ((S) <= MAX_SYSTEM_SIG)\n");
48 :    
49 :     CloseFile (f, "_SYSTEM_SIGNALS_");
50 :    
51 :     exit (0);
52 :    
53 :     } /* end of main */
54 :    

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