home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbmsghandle.ex < prev    next >
Encoding:
Text File  |  1993-04-22  |  654 b   |  31 lines

  1. #include <sybfront.h>
  2. #include <sybdb.h>
  3.  
  4. int msg_handler(dbproc, msgno, msgstate, severity, msgtext, 
  5.                 srvname, procname, line)
  6.  
  7. DBPROCESS       *dbproc;
  8. DBINT           msgno;
  9. int             msgstate;
  10. int             severity;
  11. char            *msgtext;
  12. char            *srvname;
  13. char            *procname;
  14. DBUSMALLINT     line;
  15.  
  16. {
  17.     printf ("Msg %ld, Level %d, State %d\en", 
  18.             msgno, severity, msgstate);
  19.  
  20.     if (strlen(srvname) > 0)
  21.         printf ("Server '%s', ", srvname);
  22.     if (strlen(procname) > 0)
  23.         printf ("Procedure '%s', ", procname);
  24.     if (line > 0)
  25.         printf ("Line %d", line);
  26.  
  27.     printf("\en\et%s\en", msgtext);
  28.  
  29.     return(0);
  30. }
  31.