| iMatix home page | << | < | > | >> |
SMT Version 2.81 |
#include "smtlib.h" SEMAPH * semaph_lookup ( const char *semaph_name /* Name of semaph to look for */ )
Checks whether a specific semaphore exists; returns the address of the semaphore information block, or NULL if there was an error, setting smt_errno to one of these values:
SMT NOTREADY | smt_init() was not called, or failed |
SMT NOSUCHSEMAPH | Specified semaphore was not declared |
{ SYMBOL *dict_entry; /* Dictionary symbol */ #if (defined (SMT_TRACE)) trace ("semaph_lookup: semaph=%s", semaph_name); #endif if (!smt_alive) /* If SMT API was not correctly */ { /* initialised, forget it */ smt_errno = SMT_NOTREADY; return (NULL); } dict_entry = sym_lookup_symbol (dict, get_semaph_name (semaph_name)); if (dict_entry == NULL) { smt_errno = SMT_NOSUCHSEMAPH; return (NULL); } return (dict_entry-> data); /* Return pointer to SEMAPH */ }
| << | < | > | >> | Copyright © 1996-99 iMatix Corporation |