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/runtime/config/gen-unix-sigtbl.c
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2162 - (download) (as text) (annotate)
Thu Nov 2 21:20:47 2006 UTC (13 years, 3 months ago) by blume
File size: 1250 byte(s)
eliminated src dir
/* gen-unix-sigtbl.c
 *
 * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.
 *
 * Generate the "unix-sigtbl.c" file.
 */

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

#ifndef DST_FILE
#define DST_FILE "unix-sigtbl.c"
#endif

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

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

    f = OpenFile (DST_FILE, NIL(char *));

    fprintf (f, "\n");
    fprintf (f, "PVT sys_const_t SigInfo[NUM_SIGS] = {\n");
    for (i = 0;  i < sigInfo->numSysSigs;  i++) {
	fprintf(f, "    { %s, \"%s\" },\n",
	    sigInfo->sigs[i]->sigName, sigInfo->sigs[i]->shortName);
    }
    fprintf (f, "  /* Run-time signals */\n");
    for (i = sigInfo->numSysSigs;  i < numSigs;  i++) {
      fprintf(f, "    { %s, \"%s\" },\n",
          sigInfo->sigs[i]->sigName, sigInfo->sigs[i]->shortName);
    }
    fprintf (f, "};\n");
    fprintf (f, "PVT sysconst_tbl_t SigTbl = {\n");
    fprintf (f, "    /* numConsts */ NUM_SIGS,\n");
    fprintf (f, "    /* consts */    SigInfo\n");
    fprintf (f, "};\n");

    CloseFile (f, NIL(char *));

    exit (0);

} /* end of main */


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