home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbsetidle.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  2.0 KB  |  68 lines

  1. .Na "dbsetidle" 
  2. .Aa
  3. .Fu
  4. Call a user-supplied function when \*L is finished reading from \*S.
  5. .Ih "function, calling when \*L is finished reading from \*S"
  6. .Sy
  7. .Sf "void dbsetidle(dbproc, idlefunc)"
  8. .Sp "DBPROCESS" "*dbproc"
  9. .mc |
  10. .Sp "void" "(*idlefunc)()"
  11. .Co
  12. .mc
  13. .Bl
  14. This routine associates a user-supplied function with the
  15. specified \f2dbproc\f1.
  16. The user-supplied function will automatically be called when
  17. \*L is finished reading or waiting to read a packet of output from \*S.
  18. For example, an application may want to print a message 
  19. whenever \*S has finished sending data to the host.
  20. .I "dbsetidle()"
  21. will cause the user-supplied function
  22. .I "idlefunc()"
  23. to be called in this case.
  24. .Bl
  25. Similarly,
  26. .I "dbsetbusy()"
  27. may also be used to associate a user-supplied function, \f2busyfunc()\f1, with a
  28. .I "dbproc."
  29. \f2busyfunc()\f1 will automatically be 
  30. called whenever \*L is reading or waiting to read a packet of
  31. output from \*S.
  32. .Bl
  33. The server sends result data to the application in packets of 512 bytes.
  34. (The final packet in a set of results may be less than 512 bytes.)
  35. \*L calls \f2busyfunc()\f1 at the beginning of
  36. each packet and \f2idlefunc()\f1 at
  37. the end of each packet.
  38. If the output from the server spans multiple packets,
  39. \f2busyfunc()\f1 and \f2idlefunc()\f1 will be called
  40. multiple times.
  41. .Bl
  42. See the \f2dbsetbusy()\f1 manual page for an example of
  43. installing and defining \f2busyfunc()\f1 and \f2idlefunc()\f1.
  44. .Bz
  45. .Pa
  46. .Pi dbproc
  47. A pointer to the DBPROCESS structure that provides the connection
  48. for a particular front-end/\*S process.  It contains all the
  49. information that \*L uses to manage communications and data between the
  50. front end and \*S.
  51. .mc |
  52. .Pi idlefunc
  53. The user-supplied function that will be called by \*L whenever
  54. \*S has finished sending data to the host.
  55. \*L calls \f2idlefunc()\f1 with two parameters\(emthe return value
  56. from \f2busyfunc()\f1 (a pointer to a function that
  57. returns an integer) and a pointer to the
  58. DBPROCESS from the \f2dbsetidle()\f1 call.
  59. .sp
  60. \f2idlefunc()\f1 returns void.
  61. .in -.375i
  62. .Re
  63. .mc
  64. .br
  65. None.
  66. .Sa
  67. dbsetbusy
  68.