]> git.draconx.ca Git - cdecl99.git/blobdiff - src/cdecl.h
Use #n in strtab.sed.
[cdecl99.git] / src / cdecl.h
index c4dad87a38106c6c107fa5ffc7515b5411cd878b..1493d4db53c17f940a3c99b554a87de2eb82879d 100644 (file)
 
 /* Declaration specifier kinds. */
 enum {
-       CDECL_SPEC_TYPE = 0,
-       CDECL_SPEC_STOR = 256,
-       CDECL_SPEC_QUAL = 512,
-       CDECL_SPEC_FUNC = 1024,
+       CDECL_SPEC_TYPE = 256,
+       CDECL_SPEC_STOR = 512,
+       CDECL_SPEC_QUAL = 1024,
+       CDECL_SPEC_FUNC = 2048,
 };
 
 enum {
@@ -104,7 +104,20 @@ size_t cdecl_declare(char *buf, size_t n, struct cdecl *decl);
 
 static inline int cdecl_spec_kind(struct cdecl_declspec *spec)
 {
-       return spec->type & ~0xffu;
+       return spec->type & ~(CDECL_SPEC_TYPE-1u);
 }
 
+/* Error handling. */
+enum {
+       CDECL_ENOMEM,
+       CDECL_ENOPARSE,
+};
+
+struct cdecl_error {
+       unsigned code;
+       const char *str;
+};
+
+const struct cdecl_error *cdecl_get_error(void);
+
 #endif