// common.h // // by John D. de Boer #include "abcdefg.h" #include "base.h" #include "colour.h" // System error message strings char *osmemerrormsg(int E); // Text controls ControlRef gettextcontrol(WindowRef W, OSType Sig, SInt32 ID); void setstatictext(ControlRef C, const char *S); void setedittext(ControlRef C, const char *S, bool Sel); void getedittext(ControlRef C, char **S); // Basic modal dialog boxes bool modalokay(void); void initnibdialog(IBNibRef Nib, const char *Name, WindowRef *WP); void halt(const char *Msg); void error(const char *Msg); void notification(const char *Msg); bool modaltextentry(const char *Msg, char **S); // Dynamic memory allocation void *pointer(ulong N); void old(void *P); void **handle(ulong N); #define release(H) releasehandle((void **)(H)) #define lock(H) lockhandle((void **)(H)) #define unlock(H) unlockhandle((void **)(H)) #define purgeable(H) purgeablehandle((void **)(H)) #define unpurgeable(H) unpurgeablehandle((void **)(H)) #define resizehandle(H,N) resizevoidhandle((void **)(H),N) #define minimumsize(H,N,S) minimumsizehandle((void **)(H),N,S) #define fuzzyresize(H,N,S) fuzzyresizehandle((void **)(H),N,S) void releasehandle(void **H); void lockhandle(void **H); void unlockhandle(void **H); //void purgeablehandle(void **H); //void unpurgeablehandle(void **H); void resizevoidhandle(void **H, ulong SIZE); void minimumsizehandle(void **H, ulong N, ulong SIZE); void fuzzyresizehandle(void **H, ulong N, ulong SIZE); // Sorting typedef bool (*orderprocptr)(const void *A, const void *B); #define sort(L,N,P) sortlist((void **)(L),N,P) void sortlist(void **List, int NUM, orderprocptr InOrder); // This function must be called first by all programs using this library. void initmacintosh(void);