]> git.sur5r.net Git - cc65/blobdiff - src/ca65/macro.h
atari5200: name conio constructor 'initconio'
[cc65] / src / ca65 / macro.h
index 61ec567610baca996a4501fa3518932c5bd47508..bb7b817a8bfb0c034a82ea6aa34b0ecd3438b18e 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                 macro.h                                  */
+/*                                  macro.h                                  */
 /*                                                                           */
-/*                   Macros for the ca65 macroassembler                     */
+/*                    Macros for the ca65 macroassembler                     */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
@@ -49,19 +49,23 @@ struct StrBuf;
 
 
 /*****************************************************************************/
-/*                                  Data                                    */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
 
 /* Macro styles */
-#define MAC_STYLE_CLASSIC      0
-#define MAC_STYLE_DEFINE       1
+#define MAC_STYLE_CLASSIC       0
+#define MAC_STYLE_DEFINE        1
 
+/* Macro as an opaque data type */
+struct Macro;
+typedef struct Macro Macro;
 
+                                
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -69,22 +73,26 @@ struct StrBuf;
 void MacDef (unsigned Style);
 /* Parse a macro definition */
 
-void MacUndef (const StrBuf* Name, unsigned char Style);
+void MacUndef (const struct StrBuf* Name, unsigned char Style);
 /* Undefine the macro with the given name and style. A style mismatch is
- * treated as if the macro didn't exist.
- */
+** treated as if the macro didn't exist.
+*/
 
-void MacExpandStart (void);
-/* Start expanding the macro in SVal */
+void MacExpandStart (Macro* M);
+/* Start expanding a macro */
 
 void MacAbort (void);
 /* Abort the current macro expansion */
 
-int IsMacro (const StrBuf* Name);
-/* Return true if the given name is the name of a macro */
+Macro* FindMacro (const struct StrBuf* Name);
+/* Try to find the macro with the given name and return it. If no macro with
+** this name was found, return NULL.
+*/
 
-int IsDefine (const StrBuf* Name);
-/* Return true if the given name is the name of a define style macro */
+Macro* FindDefine (const struct StrBuf* Name);
+/* Try to find the define style macro with the given name and return it. If no
+** such macro was found, return NULL.
+*/
 
 int InMacExpansion (void);
 /* Return true if we're currently expanding a macro */
@@ -94,14 +102,11 @@ void DisableDefineStyleMacros (void);
 
 void EnableDefineStyleMacros (void);
 /* Re-enable define style macros previously disabled with
- * DisableDefineStyleMacros.
- */
+** DisableDefineStyleMacros.
+*/
 
 
 
 /* End of macro.h */
 
 #endif
-
-
-