summaryrefslogtreecommitdiff
path: root/includes/oslib.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-10-19 21:16:13 +0100
committerAsh Wolf <ninji@wuffs.org>2022-10-19 21:16:13 +0100
commitd1f153d34b023d81768f6087f67dbfff714bafc9 (patch)
treea694d470a60655d0cda15a70791fbdb90a2398cf /includes/oslib.h
parent775b6861666af36d317fb577cf489e2c6377f878 (diff)
downloadMWCC-d1f153d34b023d81768f6087f67dbfff714bafc9.tar.gz
MWCC-d1f153d34b023d81768f6087f67dbfff714bafc9.zip
let's commit all this before my VM blows up and nukes my work
Diffstat (limited to 'includes/oslib.h')
-rw-r--r--includes/oslib.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/includes/oslib.h b/includes/oslib.h
index 22e8ddc..dfa3827 100644
--- a/includes/oslib.h
+++ b/includes/oslib.h
@@ -7,6 +7,8 @@
* OS abstraction layer
*/
+#define OPTION_ASSERT(cond) do { if (!!(cond) == 0) { printf("%s:%u: failed assertion\n", __FILE__, __LINE__); abort(); } } while(0)
+
typedef struct uOSTypePair {
int perm;
} uOSTypePair; // unknown name
@@ -73,13 +75,17 @@ typedef struct OSFileTypeMappingList {
} OSFileTypeMappingList;
typedef struct OSFileTypeMappings {
- OSFileTypeMappingList *mappingList;
+ const OSFileTypeMappingList *mappingList;
struct OSFileTypeMappings *next;
} OSFileTypeMappings;
#ifdef __MWERKS__
#pragma options align=reset
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/********************************/
/* Generic */
extern int WildCardMatch(char *wild, char *name);
@@ -128,7 +134,7 @@ extern int OS_IsLegalPath(const char *path);
extern int OS_IsFullPath(const char *path);
extern char *OS_GetDirPtr(char *path);
extern int OS_EqualPath(const char *a, const char *b);
-extern int OS_CanonPath(char *src, char *dst);
+extern int OS_CanonPath(const char *src, char *dst);
extern int OS_MakeSpec(const char *path, OSSpec *spec, Boolean *isfile);
extern int OS_MakeFileSpec(const char *path, OSSpec *spec);
extern int OS_MakePathSpec(const char *vol, const char *dir, OSPathSpec *spec);
@@ -168,7 +174,7 @@ extern int OS_OpenLibrary(const char *a, void **lib);
extern int OS_GetLibrarySymbol(void *a, void *b, void **sym);
extern int OS_CloseLibrary(void *a);
extern int OS_LoadMacResourceFork(const OSSpec *spec, void **file_data, SInt32 *file_len);
-extern int OS_IsMultiByte(const char *str, int offset);
+extern Boolean OS_IsMultiByte(const char *str, int offset);
/********************************/
/* FileHandles */
@@ -180,7 +186,7 @@ extern void OS_GetFileHandleSpec(const OSFileHandle *hand, OSSpec *spec);
/********************************/
/* MacFileTypes */
-extern void OS_AddFileTypeMappingList(OSFileTypeMappings **list, OSFileTypeMappingList *entry);
+extern void OS_AddFileTypeMappingList(OSFileTypeMappings **list, const OSFileTypeMappingList *entry);
extern void OS_UseFileTypeMappings(OSFileTypeMappings *list);
extern void OS_MacType_To_OSType(OSType mactype, uOSTypePair *type);
extern int OS_SetMacFileType(const OSSpec *spec, OSType mactype);
@@ -226,3 +232,7 @@ extern void p2cstrcpy(char *dst, ConstStringPtr src);
extern char *mvprintf(char *mybuf, unsigned int len, const char *format, va_list va);
extern char *mprintf(char *mybuf, unsigned int len, const char *format, ...);
extern int HPrintF(Handle text, const char *format, ...);
+
+#ifdef __cplusplus
+}
+#endif