home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3193 < prev    next >
Internet Message Format  |  1991-04-16  |  3KB

  1. From: timcc@csv.viccol.edu.au (Tim Cook)
  2. Newsgroups: alt.sources
  3. Subject: dls/describe patch 1
  4. Message-ID: <1991Apr16.184208.6629@csv.viccol.edu.au>
  5. Date: 16 Apr 91 23:42:08 GMT
  6.  
  7. Enclosed is a small patch for my dls/describe file description system.
  8. Basically, I needed to add some sanity checks to my list manipulation
  9. routines.
  10.  
  11. I have received many requests/suggestions for features to be added, and I
  12. will be considering how dls can interact with the archie system and other
  13. programs like ftpget.  Trust me, I will be working on dls/describe, but I
  14. am rather busy at the moment because I am looking for a new place to live.
  15.  
  16. By the time you read this, the version of dls/describe in
  17. pub/dls/dls.shar.Z in admin.viccol.edu.au's Anonymous FTP area will be
  18. updated.
  19.  
  20. *** list.c.orig    Tue Apr 16 18:28:40 1991
  21. --- list.c    Tue Apr 16 18:28:58 1991
  22. ***************
  23. *** 36,40 ****
  24.    */
  25.   
  26. ! static char rcsid[] = "$Header: list.c 1.1 91/03/27 $" ;
  27.   
  28.   #define _LIST_C
  29. --- 36,40 ----
  30.    */
  31.   
  32. ! static char rcsid[] = "$Header: list.c 1.2 91/04/16 $" ;
  33.   
  34.   #define _LIST_C
  35. ***************
  36. *** 54,59 ****
  37.      struct list *list ;
  38.   {
  39. !    free (list->s_start) ;
  40. !    list->s_start = (VOID_PTR_PTR) NULL ;
  41.      }
  42.   
  43. --- 54,61 ----
  44.      struct list *list ;
  45.   {
  46. !    if (list->start != (VOID_PTR_PTR) NULL
  47. !          && list->s_start != (VOID_PTR_PTR) NULL) {
  48. !       free (list->s_start) ;
  49. !       list_init (list) ; }        /* May as well */
  50.      }
  51.   
  52. ***************
  53. *** 93,97 ****
  54.         return (VOID_PTR) NULL ; }
  55.      else
  56. !       return *list->start++ ;
  57.      }
  58.   
  59. --- 95,102 ----
  60.         return (VOID_PTR) NULL ; }
  61.      else
  62. !       if (list->start == (VOID_PTR_PTR) NULL)
  63. !      return (VOID_PTR) NULL ;
  64. !       else
  65. !      return *list->start++ ;
  66.      }
  67.   
  68. ***************
  69. *** 117,122 ****
  70.      register unsigned int x ;
  71.   
  72. !    x = (unsigned int) list->end - (unsigned int) list->start ;
  73. !    x = x / sizeof (VOID_PTR)  + 1 ;
  74. !    qsort (list->start, x, sizeof (VOID_PTR), compare) ;
  75.      }
  76. --- 122,128 ----
  77.      register unsigned int x ;
  78.   
  79. !    if (list->start != (VOID_PTR_PTR) NULL) {
  80. !       x = (unsigned int) list->end - (unsigned int) list->start ;
  81. !       x = x / sizeof (VOID_PTR) + 1 ;
  82. !       qsort (list->start, x, sizeof (VOID_PTR), compare) ; }
  83.      }
  84. *** list.h.orig    Tue Apr 16 18:28:48 1991
  85. --- list.h    Tue Apr 16 18:29:00 1991
  86. ***************
  87. *** 4,8 ****
  88.    * Non-profit distribution allowed.  See README for details.
  89.    *
  90. !  * $Header: list.h 1.1 91/03/27 $
  91.    */
  92.   
  93. --- 4,8 ----
  94.    * Non-profit distribution allowed.  See README for details.
  95.    *
  96. !  * $Header: list.h 1.2 91/04/16 $
  97.    */
  98.   
  99. ***************
  100. *** 22,27 ****
  101.      } ;
  102.   
  103. - #ifndef _LIST_C
  104.   #define list_init(l)    ((l)->start = (VOID_PTR_PTR) 0)
  105.   extern void list_push () ;
  106.   extern VOID_PTR list_pop () ;
  107. --- 22,28 ----
  108.      } ;
  109.   
  110.   #define list_init(l)    ((l)->start = (VOID_PTR_PTR) 0)
  111. + #ifndef _LIST_C
  112.   extern void list_push () ;
  113.   extern VOID_PTR list_pop () ;
  114. ***************
  115. *** 32,34 ****
  116.   
  117.   #endif    /* _LIST_H */
  118. --- 33,34 ----
  119.