lists.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef AVM_LISTS_H
  2. #define AVM_LISTS_H 1
  3. #include <avm/common.h>
  4. #ifdef __cplusplus
  5. extern "C"
  6. {
  7. #endif
  8. typedef unsigned short flag;
  9. struct node;
  10. struct avm_packet;
  11. struct port_pair;
  12. typedef struct node *list;
  13. typedef struct avm_packet *port;
  14. typedef struct port_pair *portal;
  15. struct port_pair
  16. {
  17. port left;
  18. port right;
  19. portal alters;
  20. };
  21. struct avm_packet
  22. {
  23. port parent;
  24. counter errors;
  25. portal descendents;
  26. list impetus, contents;
  27. flag predicating;
  28. };
  29. struct node
  30. {
  31. list head, tail;
  32. counter sharers; /* reference count */
  33. counter known_weight; /* number of nodes */
  34. port facilitator; /* impetus points back here */
  35. int characterization; /* character it represents */
  36. void *value; /* used by library functions */
  37. flag discontiguous; /* -> not to be combined by comparison */
  38. flag internal; /* -> part of the interpreter */
  39. flag characteristic; /* -> represents a character */
  40. list interpretation; /* virtual code equivalent */
  41. };
  42. extern void avm_dispose (list front);
  43. extern list avm_recoverable_join (list left, list right);
  44. extern list avm_join (list left, list right);
  45. extern list avm_copied (list operand);
  46. extern void avm_enqueue (list * front, list *back, list operand);
  47. extern void avm_recoverable_enqueue (list *front, list *back, list operand, int *fault);
  48. extern counter avm_length (list operand);
  49. extern counter avm_recoverable_length (list operand);
  50. extern counter avm_area (list operand);
  51. extern counter avm_recoverable_area (list operand, int *fault);
  52. extern list avm_natural (counter number);
  53. extern list avm_recoverable_natural (counter number);
  54. extern counter avm_counter (list number);
  55. extern void avm_print_list (list operand);
  56. extern void avm_initialize_lists ();
  57. extern void avm_count_lists ();
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* !AVM_LISTS_H */