-/* alloc.c */
-void *alloc(unsigned int nbytes);
-/* allocnum.c */
-float *alloc_float(int n);
-double *alloc_double(int n);
-int *alloc_int(int n);
-/* cant.c */
-void cant(const char *fname);
-/* cdate.c */
-char *td_str_cdate(DATE *d);
-char *td_month_name(int n);
-char *td_day_name(int n);
-/* ctoi.c */
-char *ctoi(const char *s, int *ival);
-/* fexist.c */
-int file_exists(const char *fname);
-/* fmax.c */
-double fmax(double a, double b);
-/* get_yn.c */
-int get_yn(const char *prompt);
-/* getbits.c */
-unsigned int getbits(unsigned int x, int p, int n);
-/* getch.c */
-int getch(void);
-void ungetch(int c);
-/* getdate.c */
-DATE *td_get_date(DATE *d);
-/* gettime.c */
-TIME *td_get_time(TIME *t);
-/* iclip.c */
-int iclip(int n, int lb, int ub);
-/* infofn.c */
-int infofn(unsigned int *attrib, long int *filesize, TIMEDATE *td);
-/* irand.c */
-unsigned int irand(unsigned int n);
-/* itostr.c */
-int itostr(int n, char str[], int size);
-/* ltostr.c */
-int ltostr(long val, char *cp, int base);
-/* makefnam.c */
-int makefnam(const char *rawfn, const char *template_str, char *result);
-int getfnam(const char fullname[], char pathname[], char filename[]);
-int getexten(const char *fullname, char *exten);
-int validfn(const char filename[]);
-/* putdec.c */
-void putdec(const int n, int w, FILE *fd_out);
-/* s_clip.c */
-char *str_clip_tail(char *str, unsigned int nclip);
-/* s_esc.c */
-char *str_conv_esc(const char *from, char *to);
-/* s_esc_c.c */
-char *s_esc_char(const char *str, char *c);
-/* s_get.c */
-unsigned int str_get_last_char(const char *str);
-/* s_head.c */
-char *str_skip_head(const char *str, const char *charlist);
-/* s_lower.c */
+/*----------------------------------------------------------------------*/
+
+#if defined(MICROSOFT) || ! defined(SIZEOF_INT)
+ #define SIZEOF_INT 4
+ #define SIZEOF_LONG 4
+ #define SIZEOF_SHORT 2
+ #define SIZEOF_FLOAT 4
+ #define SIZEOF_DOUBLE 8
+#endif
+
+typedef signed char kint8;
+typedef unsigned char kuint8;
+
+#if SIZEOF_INT == 4
+ typedef int kint32;
+ typedef unsigned int kuint32;
+#elif SIZEOF_LONG == 4
+ typedef long int kint32;
+ typedef unsigned int kuint32;
+#endif
+
+#if SIZEOF_SHORT == 2
+ typedef short int kint16;
+ typedef unsigned short int kuint16;
+#elif SIZEOF_INT == 2
+ typedef int kint16;
+ typedef unsigned int kuint16;
+#endif
+
+#if SIZEOF_FLOAT == 4
+ typedef float kfloat32;
+#endif
+#if SIZEOF_DOUBLE == 8
+ typedef double kfloat64;
+#endif
+
+
+/* filefuncs.cpp */
+bool file_exists(const char* fname);
+const char* fileBasename(const char* filename);
+FILE *sys_fopen(const char *filename, const char *mode, const char *progname);
+
+/* strfuncs.cpp */
+char* str_skip_head(const char* str, const char* const charlist);
+char* str_skip_head(const char* str, char* charlist);