bundle.h 909 B

123456789101112131415161718192021222324252627282930
  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. #pragma once
  8. #include <stdio.h>
  9. #include <vector>
  10. #include <string>
  11. typedef std::vector<std::string> strTable;
  12. struct bundle
  13. {
  14. public:
  15. void appendCode(const char *format, ...);
  16. void appendDecl(const char *format, ...);
  17. strTable decl; /* Declarations */
  18. strTable code; /* C code */
  19. };
  20. #define lineSize 360 /* 3 lines in the mean time */
  21. void newBundle (bundle *procCode);
  22. Int nextBundleIdx (strTable *strTab);
  23. void addLabelBundle (strTable &strTab, Int idx, Int label);
  24. void writeBundle (std::ostream &ios, bundle procCode);
  25. void freeBundle (bundle *procCode);