bundle.h 977 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. #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. //void appendStrTab (strTable *strTab, const char *format, ...);
  23. Int nextBundleIdx (strTable *strTab);
  24. void addLabelBundle (strTable &strTab, Int idx, Int label);
  25. void writeBundle (std::ostream &ios, bundle procCode);
  26. void freeBundle (bundle *procCode);