2012-02-27 21:14:46 +00:00
|
|
|
// ACME - a crossassembler for producing 6502/65c02/65816 code.
|
2015-06-14 23:16:23 +00:00
|
|
|
// Copyright (C) 1998-2015 Marco Baye
|
2012-02-27 21:14:46 +00:00
|
|
|
// Have a look at "acme.c" for further info
|
|
|
|
//
|
|
|
|
// Section stuff
|
|
|
|
#ifndef section_H
|
|
|
|
#define section_H
|
|
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
|
|
// "section" structure type definition
|
2014-03-11 12:07:11 +00:00
|
|
|
struct section {
|
2012-02-27 21:14:46 +00:00
|
|
|
zone_t zone; // current zone value
|
|
|
|
const char *type; // "Zone", "Subzone" or "Macro"
|
|
|
|
char *title; // zone title, subzone title or macro title
|
|
|
|
int allocated; // whether title was malloc()'d
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Constants
|
2015-06-14 23:16:23 +00:00
|
|
|
// TODO: rename internal stuff from "zone" to "scope",
|
|
|
|
// then add cheap locals (so there's SCOPE_GLOBAL, scope_zone and scope_cheap)
|
2012-02-27 21:14:46 +00:00
|
|
|
#define ZONE_GLOBAL 0 // Number of "global zone"
|
|
|
|
|
|
|
|
|
|
|
|
// Variables
|
|
|
|
|
|
|
|
// current section structure
|
2014-03-11 12:07:11 +00:00
|
|
|
extern struct section *Section_now;
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
// Prototypes
|
|
|
|
|
|
|
|
// Write given info into given zone structure and activate it
|
2014-03-11 12:07:11 +00:00
|
|
|
extern void Section_new_zone(struct section *section, const char *type, char *title, int allocated);
|
2012-02-27 21:14:46 +00:00
|
|
|
// Setup outermost section
|
|
|
|
extern void Section_passinit(void);
|
|
|
|
// Tidy up: If necessary, release section title.
|
2014-03-11 12:07:11 +00:00
|
|
|
extern void Section_finalize(struct section *section);
|
2012-02-27 21:14:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
#endif
|