home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume41 / ddb / patch02 < prev    next >
Encoding:
Text File  |  1994-01-09  |  3.1 KB  |  110 lines

  1. Newsgroups: comp.sources.misc
  2. From: pefv700@hermes.chpc.utexas.edu (Christopher Phillips)
  3. Subject: v41i081:  ddb - dynamic memory database library, Patch02
  4. Message-ID: <1994Jan10.033243.10732@sparky.sterling.com>
  5. X-Md4-Signature: 68a50b37f1dc1af64eee16eeaa5fe209
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: The University of Texas System - CHPC
  8. Date: Mon, 10 Jan 1994 03:32:43 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: pefv700@hermes.chpc.utexas.edu (Christopher Phillips)
  12. Posting-number: Volume 41, Issue 81
  13. Archive-name: ddb/patch02
  14. Environment: ANSI-C
  15. Patch-To: ddb: Volume 40, Issue 82
  16.  
  17. This is patch02 for ddb, a library of dynamic memory database routines.
  18.  
  19. There are a few changes:
  20.  
  21. - DDB_TAIL didn't work right for DDB_INSERT and DDB_REPLACE
  22. - ddb_lnext return value fixed
  23. - ddb_new had a memory problem when data was NULL
  24.  
  25. Thanks to Robert Allgeuer (fs_allge@aaf.alcatel.at) for pointing
  26. these out.
  27.  
  28. Just cd to the source directory and unshar this file.  Then type 
  29.  
  30.         patch -p0 < Patch02
  31.  
  32. Chris
  33. pefv700@utpe.pe.utexas.edu
  34. --------------------
  35. #! /bin/sh
  36. # This is a shell archive.  Remove anything before this line, then unpack
  37. # it by saving it into a file and typing "sh file".  To overwrite existing
  38. # files, type "sh file -c".  You can also feed this as standard input via
  39. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  40. # will see the following message at the end:
  41. #        "End of shell archive."
  42. # Contents:  Patch02
  43. # Wrapped by pefv700@hermes on Mon Dec 20 11:21:07 1993
  44. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  45. if test -f 'Patch02' -a "${1}" != "-c" ; then 
  46.   echo shar: Will not clobber existing file \"'Patch02'\"
  47. else
  48. echo shar: Extracting \"'Patch02'\" \(1163 characters\)
  49. sed "s/^X//" >'Patch02' <<'END_OF_FILE'
  50. X*** ../ddb.old/list.c    Tue Nov 30 09:09:55 1993
  51. X--- list.c    Mon Dec 20 09:47:48 1993
  52. X***************
  53. X*** 106,112 ****
  54. X      if (mode & DDB_DUPLICATE) {
  55. X          if (mode & DDB_TAIL)
  56. X              (void)find(ld, NULL, cmp, &le_prev);
  57. X!     } else if (le = find(ld, key, cmp, NULL))
  58. X          if (mode & DDB_INSERT) {
  59. X              errno = EEXIST;
  60. X              return -1;
  61. X--- 106,112 ----
  62. X      if (mode & DDB_DUPLICATE) {
  63. X          if (mode & DDB_TAIL)
  64. X              (void)find(ld, NULL, cmp, &le_prev);
  65. X!     } else if (le = find(ld, key, cmp, &le_prev))
  66. X          if (mode & DDB_INSERT) {
  67. X              errno = EEXIST;
  68. X              return -1;
  69. X***************
  70. X*** 274,280 ****
  71. X  
  72. X      if (le = lp->nextkey) {
  73. X          lp->nextkey = lp->nextkey->next;
  74. X!         return &le->data;
  75. X      } else
  76. X          return NULL;
  77. X  }
  78. X--- 274,280 ----
  79. X  
  80. X      if (le = lp->nextkey) {
  81. X          lp->nextkey = lp->nextkey->next;
  82. X!         return &le->key;
  83. X      } else
  84. X          return NULL;
  85. X  }
  86. X*** ../ddb.old/new.c    Tue Nov 30 09:09:55 1993
  87. X--- new.c    Mon Nov 29 13:00:10 1993
  88. X***************
  89. X*** 45,53 ****
  90. X      if (data) {
  91. X          (void)memcpy((*ptr)[1].addr, data->addr, data->size);
  92. X          (*ptr)[1].size = data->size;
  93. X-     } else {
  94. X-         (*ptr)[1].addr = NULL;
  95. X-         (*ptr)[1].size = 0;
  96. X      }
  97. X  
  98. X      return ptr;
  99. X--- 45,50 ----
  100. END_OF_FILE
  101. if test 1163 -ne `wc -c <'Patch02'`; then
  102.     echo shar: \"'Patch02'\" unpacked with wrong size!
  103. fi
  104. # end of 'Patch02'
  105. fi
  106. echo shar: End of shell archive.
  107. exit 0
  108.  
  109. exit 0 # Just in case...
  110.