home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d5xx / d502 / cells.lha / CELLS / CELLSSource.lzh / cParts.h < prev    next >
C/C++ Source or Header  |  1991-04-20  |  1KB  |  57 lines

  1. /*
  2.  *  CELLS       An Implementation of the WireWorld cellular automata
  3.  *              as described in Scientific American, Jan 1990.
  4.  *
  5.  *              Copyright 1990 by Davide P. Cervone.
  6.  *  You may use this code, provided this copyright notice is kept intact.
  7.  *  See the CELLS.HELP file for complete information on distribution conditions.
  8.  */
  9.  
  10. /*
  11.  *  File:  cParts.h             structures for Parts and Library lists
  12.  */
  13.  
  14.  
  15. #include "cMemory.h"
  16.  
  17. typedef struct Part PART;
  18. typedef struct PartLibrary LIBRARY;
  19.  
  20. /*
  21.  *  Linked list of Parts (in a library)
  22.  */
  23.  
  24. struct Part
  25. {
  26.    PART    *Next,*Prev;
  27.    char    *Name;
  28.    UWORD    NameLen;
  29.    UWORD    Flags;
  30.       #define PT_STATIC     BIT(15)     /* don't FREE this structure */
  31.    UWORD    w,h;            /* size of part's bounding box */
  32.    UBYTE   *Data;           /* array of cells for this part */
  33. };
  34.  
  35.  
  36. /*
  37.  *  Linked list of Libraries loaded in a circuit
  38.  */
  39.  
  40. struct PartLibrary
  41. {
  42.    LIBRARY *Next,*Prev;
  43.    char    *Name;
  44.    UWORD    NameLen;
  45.    UWORD    Flags;
  46.       #define PL_STATIC     BIT(15)     /* don't FREE this structure */
  47.       #define PL_NODELETE   BIT(14)     /* this library may not be REMOVED */
  48.       #define PL_ASPARTS    BIT(13)     /* save as PARTS */
  49.    PART    *FirstPart;
  50. };
  51.  
  52. #define CANCELPART       ((PART *)TRUE)
  53.  
  54. extern LIBRARY PartsList;               /* main parts list */
  55. extern LIBRARY *FirstLibrary;           /* first library */
  56. extern LIBRARY *SelectedLibrary;        /* current library */
  57.