CS_RETCODE clientmsg_cb(CS_CONTEXT * context, CS_CONNECTION * connection, CS_CLIENTMSG * errmsg) { clientmsg_cb_invoked++; fprintf(stderr, "\nOpen Client Message:\n"); fprintf(stderr, "number %d layer %d origin %d severity %d number %d\n", errmsg->msgnumber, CS_LAYER(errmsg->msgnumber), CS_ORIGIN(errmsg->msgnumber), CS_SEVERITY(errmsg->msgnumber), CS_NUMBER(errmsg->msgnumber)); fprintf(stderr, "msgstring: %s\n", errmsg->msgstring); fprintf(stderr, "osstring: %s\n", (errmsg->osstringlen > 0) ? errmsg->osstring : "(null)"); return CS_SUCCEED; }
CS_INT cslibmsg_cb(CS_CONTEXT * connection, CS_CLIENTMSG * errmsg) { cslibmsg_cb_invoked++; fprintf(stderr, "\nCS-Library Message:\n"); fprintf(stderr, "number %d layer %d origin %d severity %d number %d\n", errmsg->msgnumber, CS_LAYER(errmsg->msgnumber), CS_ORIGIN(errmsg->msgnumber), CS_SEVERITY(errmsg->msgnumber), CS_NUMBER(errmsg->msgnumber)); fprintf(stderr, "msgstring: %s\n", errmsg->msgstring); fprintf(stderr, "osstring: %s\n", (errmsg->osstringlen > 0) ? errmsg->osstring : "(null)"); return CS_SUCCEED; }
static CS_RETCODE ex_clientmsg_cb(CS_CONTEXT * context, CS_CONNECTION * connection, CS_CLIENTMSG * errmsg) { printf("\nOpen Client Message:\n"); printf("Message number: LAYER = (%d) ORIGIN = (%d) ", CS_LAYER(errmsg->msgnumber), CS_ORIGIN(errmsg->msgnumber)); printf("SEVERITY = (%d) NUMBER = (%d)\n", CS_SEVERITY(errmsg->msgnumber), CS_NUMBER(errmsg->msgnumber)); printf("Message String: %s\n", errmsg->msgstring); if (errmsg->osstringlen > 0) { printf("Operating System Error: %s\n", errmsg->osstring); } fflush(stdout); return CS_SUCCEED; }