bundle.h 951 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. void appendDecl(const std::string &);
  18. strTable decl; /* Declarations */
  19. strTable code; /* C code */
  20. };
  21. #define lineSize 360 /* 3 lines in the mean time */
  22. void newBundle (bundle *procCode);
  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);