bundle.h 982 B

12345678910111213141516171819202122232425262728293031
  1. /*****************************************************************************
  2. * Project: dcc
  3. * File: bundle.h
  4. * Purpose: Module to handle the bundle type (array of pointers to strings).
  5. * (C) Cristina Cifuentes
  6. ****************************************************************************/
  7. #include <stdio.h>
  8. typedef struct {
  9. Int numLines; /* Number of lines in the table */
  10. Int allocLines; /* Number of lines allocated in the table */
  11. char **str; /* Table of strings */
  12. } strTable;
  13. typedef struct {
  14. strTable decl; /* Declarations */
  15. strTable code; /* C code */
  16. } bundle;
  17. #define lineSize 360 /* 3 lines in the mean time */
  18. void newBundle (bundle *procCode);
  19. void appendStrTab (strTable *strTab, char *format, ...);
  20. Int nextBundleIdx (strTable *strTab);
  21. void addLabelBundle (strTable *strTab, Int idx, Int label);
  22. void writeBundle (FILE *fp, bundle procCode);
  23. void freeBundle (bundle *procCode);