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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 651 - (download) (as text) (annotate)
Thu Jun 1 18:34:03 2000 UTC (20 years, 1 month ago) by monnier
File size: 1257 byte(s)
bring revisions from the vendor branch to the trunk
/* gen-unix-signals.c
 * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.
 * Generate the "system-signals.h" file for UNIX systems.

#include <signal.h>
#include <stdio.h>
#include "gen.h"
#include "gen-unix-signals.h"

#ifndef DST_FILE
#define DST_FILE "system-signals.h"

int main (void)
    sig_info_t	    *sigInfo;
    int		    i;
    int		    numSigs;
    FILE	    *f;

    sigInfo = SortSignalTbl ();
    numSigs = sigInfo->numSysSigs+sigInfo->numRunSigs;

    f = OpenFile (DST_FILE, "_SYSTEM_SIGNALS_");

    fprintf (f, "#define NUM_SYSTEM_SIGS %2d\n", sigInfo->numSysSigs);
    fprintf (f, "#define MAX_SYSTEM_SIG  %2d /* %s */\n",
	sigInfo->maxSysSig, sigInfo->sigs[sigInfo->numSysSigs-1]->sigName);
    fprintf (f, "#define NUM_SIGS        %2d\n", numSigs);
    fprintf (f, "#define MAX_SIG         %2d /* %s */\n",
	sigInfo->sigs[numSigs-1]->sig, sigInfo->sigs[numSigs-1]->sigName);
    fprintf (f, "\n");
    for (i = sigInfo->numSysSigs;  i < numSigs;  i++) {
	fprintf(f, "#define %s %2d\n",
	    sigInfo->sigs[i]->sigName, sigInfo->sigs[i]->sig);
    fprintf (f, "\n");
    fprintf (f, "#define IS_SYSTEM_SIG(S) ((S) <= MAX_SYSTEM_SIG)\n");

    CloseFile (f, "_SYSTEM_SIGNALS_");

    exit (0);

} /* end of main */

ViewVC Help
Powered by ViewVC 1.0.0