| iMatix home page
| << | < | > | >>
SMT Logo SMT
Version 2.81

 

smt_init

#include "smtlib.h"
int
smt_init (void)

Synopsis

Initialises the SMT. Returns 0 if there were no errors. Else returns -1, after seting smt_errno to one of these values:
SMT OUTOFMEMORY Not enough heap memory left

Source Code - (smtlib.c)

{
    int feedback = 0;
#if (defined (SMT_TRACE))
    trace ("smt_init");
#endif
    if (!smt_alive)
      {
        dict = sym_create_table ();
        if (dict == NULL)
          {
            smt_errno = SMT_OUTOFMEMORY;
            feedback = -1;
          }
        /*  Initialise list of agents                                        */
        node_reset (&agents);

        /*  Initialise list of exit functions                                */
        node_reset (&exitfcts);

        /*  Initialise list of semaphores                                    */
        node_reset (&semaphs);

        /*  Initialise list of active threads                                */
        active_threads.left  = &active_threads;
        active_threads.right = &active_threads;
        cur_threads = 0;

        /*  Handle interrupt signals                                         */
        handle_signals ();

        /*  On some systems we get a 'broken pipe' when a connection fails   */
#       if defined (SIGPIPE)
        signal (SIGPIPE, SIG_IGN);
#       endif

        /*  We pass through handle_atexit() before closing-down              */
        atexit (handle_atexit);

        smt_alive = TRUE;               /*  SMT kernel is now active         */
      }
    return (feedback);
}

| << | < | > | >> iMatix Copyright © 1996-99 iMatix Corporation