#ifndef _LISTS_H_ #define _LISTS_H_ /* * Copyright 1993, 1995 Christopher Seiwald. * * This file is part of Jam - see jam.c for Copyright information. */ /* * lists.h - the LIST structure and routines to manipulate them * * The whole of jam relies on lists of strings as a datatype. This * module, in conjunction with newstr.c, handles these relatively * efficiently. * * Structures defined: * * LIST - list of strings * LOL - list of LISTs * * External routines: * * list_append() - append a list onto another one, returning total * list_new() - tack a string onto the end of a list of strings * list_copy() - copy a whole list of strings * list_sublist() - copy a subset of a list of strings * list_free() - free a list of strings * list_print() - print a list of strings to stdout * list_length() - return the number of items in the list * * lol_init() - initialize a LOL (list of lists) * lol_add() - append a LIST onto an LOL * lol_free() - free the LOL and its LISTs * lol_get() - return one of the LISTs in the LOL * lol_print() - debug print LISTS separated by ":" * * 04/13/94 (seiwald) - added shorthand L0 for null list pointer * 08/23/94 (seiwald) - new list_append() */ /* * LIST - list of strings */ namespace Jam { class List { public: static List * list_append( List *l, List *nl ); static List * list_copy( List *l, const List *nl ); static void list_free( List *head ); static List * list_new( List *head, const char *string ); static void list_print( const List *l ); static int list_length( const List *l ); static List * list_sublist( const List *l, const int start, const int count ); static List* list_next(const List* pItem); static const List* list_const_next(const List* pItem); private: List(List*& head, const char* string); public: List *next; List *tail; /* only valid in head node */ const char *string; /* private copy */ static List* freelist; }; } /* * LOL - list of LISTs */ typedef struct _lol LOL; enum { LOL_MAX = 9 }; struct _lol { int count; Jam::List *list[ LOL_MAX ]; } ; void lol_add( LOL *lol, Jam::List *l ); void lol_init( LOL *lol ); void lol_free( LOL *lol ); Jam::List * lol_get( const LOL *lol, const int i ); void lol_print( const LOL *lol ); #endif
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 1163 | bob_summerwill | Added a private constructor to List. | ||
#2 | 1162 | bob_summerwill | Converted LIST into a List class, with all static methods. | ||
#1 | 1130 | bob_summerwill | More .C to .CPP conversions. | ||
//guest/bob_summerwill/jam/src/lists.h | |||||
#5 | 1129 | bob_summerwill | Some const-correctness fixes. | ||
#4 | 1126 | bob_summerwill | #include dependencies between headers are now modelled explicitly, with #includes as required in header files, rather than it being a client-code responsibility. | ||
#3 | 1120 | bob_summerwill | A fair-size chunk of char* const-correctness modifications. | ||
#2 | 1118 | bob_summerwill | Various const-correctness fixes. | ||
#1 | 1106 | bob_summerwill | Integrated Jam from "public" to "guest/bob_summerwill". | ||
//guest/perforce_software/jam/src/lists.h | |||||
#2 | 486 | Perforce staff |
Jam 2.3. See RELNOTES for a list of changes from 2.2.x. Just about every source file was touched when jam got ANSI-fied. |
||
#1 | 2 | laura | Add Jam/MR 2.2 source |