-/* alloc.c */
-void *alloc(unsigned int nbytes);
-/* allocnum.c */
-float *alloc_float(int n);
-double *alloc_double(int n);
-int *alloc_int(int n);
-/* 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);
-/* getch.c */
-int getch(void);
-void ungetch(int c);
-/* iclip.c */
-int iclip(int n, int lb, int ub);
-/* irand.c */
-unsigned int irand(unsigned int n);
-/* ltostr.c */
-int ltostr(long val, char *cp, int base);
-/* s_clip.c */
-char *str_clip_tail(char *str, unsigned int nclip);
-/* 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 */
+const char* str_skip_head(char* const str, const char* const charlist);
+char* str_skip_head(char* str, char* charlist);