Ask a Question related to UNIX Programming, Design and Development.
-
DL #1
signal
/* function declarations */
int func1(void*);
int func2(void*);
....
int funcn(void*);
/* table of names and pointers */
struct { /* description of a function: */
const char *name; /* externally-visible name */
int (*func)(void*); /* pointer to actual function */
} function[] = {
{ "Function 1", func1 },
{ "Function Two", func2 },
...
{ "Catered Function", funcn },
};
/* number of functions in table */
#define FUNCTIONS (sizeof function / sizeof function[0])
/* call a named function and return its value, or complain
* and return -42 if the function is unknown
*/
int call_named_func(const char *name, void *args) {
int i;
for (i = 0; i < FUNCTIONS; ++i) {
if (strcmp(name, function[i].name) == 0)
return function[i].func(args);
}
fprintf (stderr, "No such function: %s\n", name);
return -42;
}
DL Guest
-
[7.4.1] signal 11 while accesing DB
Hi, Yesterday morning one of our PostgreSQL engines stopped unexpectedly, with the following log: postgres: LOG: server process (PID 26678)... -
Weal wireless signal
I have a brand new Linksys WAP54g that is transmitting my wirless signal. A brand new Imac with an "airport extreme" wirless card to "receive"... -
Signal to noise ratio
Folks, I first want to thank all of the experts who have helped me along my way toward crawling up from the ranks of Perl initiate to Perl novice (I... -
signal problem
Hi, I have a cod as following : .... my $stop = 0; sub my_sigint_catcher { $stop = 1; }; $SIG{'INT'} = 'my_sigint_catcher'; -
How to ignore SIGSEGV signal
hi there, how to ignore SIGSEGV signal, 'cause i tried to handle or ignore that signal on the code but it keep raised signal. is this one-shot...



Reply With Quote

