May 2005
Intermediate to advanced
738 pages
18h 22m
English
Example A-6 shows the source code for the spmi_file.c program.
#include <stdio.h> #include <stdlib.h> #include <sys/Spmidef.h> extern errno; extern charSpmiErrmsg[]; extern intSpmiErrno; struct SpmiStatSet*SPMIset = NULL; void SPMIerror(char *s) { /* We do not want the \n that the SpmiErrmsg have at the * end since we will use our own error reporting format. */ SpmiErrmsg[strlen(SpmiErrmsg)-1] = 0x0; fprintf(stderr,"%s: %s (%d)\n",s,SpmiErrmsg,SpmiErrno); } /* * This subroutine is called when a user interrupts it or * when the main program exits. If called by a signal handler * it will have a value in parameter s. If s is not set, then * it is called when the main program exits. To not have this ... |
Read now
Unlock full access