home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / LinkList / c / ListLength < prev    next >
Encoding:
Text File  |  1992-04-02  |  1008 b   |  37 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    LinkList.ListLength.c
  12.     Author:  Copyright © 1992 Jason Williams
  13.     Version: 1.00 (2 Apr 1992)
  14.     Purpose: Linked list handling functions
  15. */
  16.  
  17.  
  18. #include "LinkList.h"
  19. #include <stdlib.h>
  20. #include <stdio.h>
  21.  
  22.  
  23. extern int LinkList_ListLength(linklist_header *anchor)
  24. {
  25.   linklist_header *ptr;
  26.   register int    length = 0;
  27.  
  28.   ptr = anchor->next;
  29.   while (ptr != NULL)
  30.   {
  31.     length ++;
  32.     ptr = ptr->next;
  33.   }
  34.  
  35.   return(length);
  36. }
  37.