dcc/include/bundle.h
2012-02-29 00:59:19 +01:00

31 lines
909 B
C++

/*****************************************************************************
* Project: dcc
* File: bundle.h
* Purpose: Module to handle the bundle type (array of pointers to strings).
* (C) Cristina Cifuentes
****************************************************************************/
#pragma once
#include <stdio.h>
#include <vector>
#include <string>
typedef std::vector<std::string> strTable;
struct bundle
{
public:
void appendCode(const char *format, ...);
void appendDecl(const char *format, ...);
strTable decl; /* Declarations */
strTable code; /* C code */
};
#define lineSize 360 /* 3 lines in the mean time */
void newBundle (bundle *procCode);
int nextBundleIdx (strTable *strTab);
void addLabelBundle (strTable &strTab, int idx, int label);
void writeBundle (std::ostream &ios, bundle procCode);
void freeBundle (bundle *procCode);