home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer) / NeXT_Developer-3.3.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dbstrcpy.nr < prev    next >
Encoding:
Text File  |  1993-04-22  |  1.7 KB  |  67 lines

  1. .Na "dbstrcpy" 
  2. .Aa
  3. .Fu
  4. Copy a portion of the command buffer.
  5. .Ih "command buffer, copying a portion of"
  6. .Ih "debugging"
  7. .Sy
  8. .Sf "RETCODE dbstrcpy(dbproc, start, numbytes, dest)"
  9. .Sp "DBPROCESS" "*dbproc"
  10. .Sp "int" "start"
  11. .Sp "int" "numbytes"
  12. .Sp "char" "*dest"
  13. .Co
  14. .Bl
  15. .I "dbstrcpy()"
  16. copies a portion of the command buffer to a program variable.
  17. The copy is null-terminated.
  18. .Bl
  19. Internally,
  20. the command buffer is a linked list of non-null-terminated text strings.
  21. .I "dbgetchar(), dbstrcpy(),"
  22. and
  23. .I "dbstrlen()"
  24. together provide a way to locate and copy parts of the command buffer.
  25. .Bl
  26. .I "dbstrcpy()"
  27. assumes that the destination is large enough to receive the
  28. source string.  If not, a segmentation fault is likely.
  29. .Bz
  30. .Pa
  31. .Pi dbproc
  32. A pointer to the DBPROCESS structure that provides the connection
  33. for a particular front-end/\*S process.  It contains all the
  34. information that \*L uses to manage communications and data between the
  35. front end and \*S.
  36. .Pi start
  37. Indicates which character in the command buffer to start copying from.
  38. The first character is the 0'th character.
  39. If \f2start\f1 is greater than the length of the command buffer,
  40. \f2dbstrcpy()\f1 inserts
  41. a null terminator at dest[0].
  42. .Pi numbytes
  43. The number of characters to copy.  If 
  44. .I numbytes
  45. is -1, \f2dbstrcpy()\f1 will copy as many bytes as possible.
  46. It is legal to copy 0 bytes, in which case 
  47. \f2dbstrcpy()\f1 inserts a null
  48. terminator at dest[0].  If there are not 
  49. .I numbytes
  50. available to copy, \f2dbstrcpy()\f1 copies the number of bytes available
  51. and returns SUCCEED.
  52. .Pi dest
  53. A pointer to the data space to copy the source string into.
  54. .in -.375i
  55. .Re
  56. .br
  57. SUCCEED or FAIL.  
  58. \f2dbstrcpy()\f1 returns FAIL if
  59. .I start
  60. is negative.
  61. .Sa
  62. dbcmd,
  63. dbfcmd,
  64. dbfreebuf,
  65. dbgetchar,
  66. dbstrlen
  67.