build.h 802 B

123456789101112131415161718192021222324252627282930313233
  1. /** @file
  2. * @brief Routines to build new labels and label-types.
  3. */
  4. #ifndef _BUILD_H_
  5. #define _BUILD_H_
  6. /**
  7. * @brief Copy a string to a new block of memory.
  8. *
  9. * If we run out of memory, the process exits.
  10. * @param str the string to copy
  11. * @return a pointer to the copy
  12. */
  13. char *copy(char *str);
  14. /**
  15. * @brief Allocate a new type struct and add it to the global list of types.
  16. * @param name the type name
  17. * @return a pointer to the new struct
  18. */
  19. Type *addtype(char *name);
  20. /**
  21. * @brief Define a new label.
  22. * @param lbltype type of label to define. Will be created if it doesn't already exist.
  23. * @param lbllevel nesting level of label.
  24. * @param lblname name by which label will be referred to in cross-references.
  25. */
  26. void addlbl(char *lbltype, char *lbllevel, char *lblname);
  27. #endif