#include <stdio.h>
#include <string.h>
+// if this is used as a path use stdin or stdout instead
+#define ULAS_STDFILEPATH "-"
+
#define ULAS_PATHMAX 4096
#define ULAS_LINEMAX 4096
#define ULAS_OUTBUFMAX 64
}
/**
- * Output target files
+ * Output target files
*/
-// input file for source reader
+// input file for source reader
extern FILE *ulasin;
-// source code output target
+// source code output target
extern FILE *ulasout;
// error output target
extern FILE *ulaserr;
-// assembly listing output
+// assembly listing output
extern FILE *ulaslstout;
// symbol list output
extern FILE *ulassymout;
}
FILE *ulas_fopen(const char *path, const char *mode, FILE *stdfile) {
- if (!path || strncmp(path, "-", 1) == 0) {
+ if (!path || strncmp(path, ULAS_STDFILEPATH, 1) == 0) {
return stdfile;
}
FILE *f = fopen(path, mode);