home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilsd / explain / !AWMerge / h / misc
Encoding:
Text File  |  1994-05-11  |  3.5 KB  |  109 lines

  1. /* misc.h */
  2.  
  3. #ifdef DEVELOPER
  4. #define MEMTRACE
  5. #endif
  6.  
  7. #ifndef __misc_h
  8. #define __misc_h
  9.  
  10. #include "os.h"
  11. #include "wimp.h"
  12.  
  13. extern int misc_xeig, misc_yeig, misc_pixx, misc_pixy;
  14. extern wimp_palettestr misc_wimpcols;
  15.  
  16. os_error *misc_err(char *msg, ...);
  17. void misc_boxby(wimp_box *b, int dx, int dy);
  18. void misc_boxto(wimp_box *b, int x, int y);
  19. void misc_clipbox(wimp_box *obox, wimp_box *clip);
  20. os_error *misc_template(char *name, wimp_wind **wdefp);
  21. BOOL misc_overlap(wimp_box *boxa, wimp_box *boxb);
  22. BOOL misc_commonbox(wimp_box *obox, wimp_box *ibox);
  23. void misc_boundbox(wimp_box *obox, wimp_box *ibox);
  24. void misc_makebox(wimp_box *obox, int x0, int y0, int x1, int y1);
  25. BOOL misc_inbox(wimp_box *box, int x, int y);
  26. void misc_newmode(void);
  27. os_error *misc_sprput(sprite_area *area, sprite_id *id, int x, int y);
  28. os_error *misc_sprputn(sprite_area *area, char *name, int x, int y);
  29. os_error *misc_settype(char *name, int ftype);
  30. os_error *misc_windowbox(wimp_box *box, BOOL shrink);
  31. os_error *misc_opendir(char *dirname);
  32.  
  33. int misc_min(int a, int b);
  34. int misc_max(int a, int b);
  35.  
  36. #ifdef MEMTRACE
  37.  
  38. #include "flex.h"
  39. #include <stdlib.h>
  40.  
  41. int __flex_alloc(char *name, int line, flex_ptr anchor, int n);
  42. int __flex_extend(char *name, int line, flex_ptr anchor, int n);
  43. void __flex_free(char *name, int line, flex_ptr anchor);
  44.  
  45. void *__malloc(char *name, int line, size_t size);
  46. void *__realloc(char *name, int line, void *m, size_t size);
  47. void __free(char *name, int line, void *m);
  48.  
  49. #define flex_alloc(anc, n)   __flex_alloc(__FILE__, __LINE__, anc, n)
  50. #define flex_extend(anc, n)  __flex_extend(__FILE__, __LINE__, anc, n)
  51. #define flex_free(anc)       __flex_free(__FILE__, __LINE__, anc)
  52.  
  53. #define malloc(s)            __malloc(__FILE__, __LINE__, s)
  54. #define realloc(m, s)        __realloc(__FILE__, __LINE__, m, s)
  55. #define free(m)              __free(__FILE__, __LINE__, m)
  56.  
  57. #define misc_malloc(ptr, size) (misc_malloc)(__FILE__, __LINE__, ptr, size)
  58. #define misc_free(ptr)         (misc_free)(__FILE__, __LINE__, ptr)
  59.  
  60. os_error *(misc_malloc)(char *name, int line, void **ptr, int size);
  61. void (misc_free)(char *name, int line, void **ptr);
  62.  
  63. #else
  64.  
  65. os_error *misc_malloc(void **ptr, int size);
  66. void misc_free(void **ptr);
  67.  
  68. #endif
  69. os_error *misc_falloc(void **ptr, int size);
  70. os_error *misc_fextend(void **ptr, int by);
  71. os_error *misc_fmidextend(void **ptr, int at, int by);
  72.  
  73. int misc_fsize(void **ptr);
  74. void misc_ffree(void **ptr);
  75.  
  76. os_error *misc_force(wimp_w w);
  77. os_error *misc_chtitle(wimp_w w);
  78. void misc_growbox(wimp_box *box, int dx, int dy);
  79. int misc_init(char *taskname);
  80. int misc_wimpver(void);
  81. void misc_report(char *tag, ...);
  82. void __memreport(void);
  83. char *misc_leaf(char *fname);
  84. os_error *misc_strdup(char **dest, const char *source);
  85. int misc_strcicmp(const char *s1, const char *s2);
  86. os_error *misc_counticons(wimp_w w, int *countp);
  87. os_error *misc_icontextlen(wimp_w w, wimp_i i, int *lenp);
  88. os_error *misc_nextwriteable(wimp_w w, BOOL *wrap);
  89. os_error *misc_prevwriteable(wimp_w w, BOOL *wrap);
  90. os_error *misc_fillrect(wimp_box *box);
  91. os_error *misc_setfontrgb(int fh, int bcol, int fcol);
  92. os_error *misc_setfontcolours(int fh, int bcol, int fcol);
  93. os_error *misc_settitle(wimp_w w, char *title);
  94.  
  95. #ifdef DEVELOPER
  96. os_error *misc__fix(char *file, int line, os_error *err);
  97. #define misc_fix(e) \
  98.    misc__fix(__FILE__, __LINE__, e)
  99. #include "werr.h"
  100. #define misc_assert(e) \
  101.    do { if (!(e)) werr(TRUE, "%s, line %d: Assertion %s was false", \
  102.                      __FILE__, __LINE__, #e); } while (0)
  103. #else
  104. #define misc_fix(e) e
  105. #define misc_assert(e) ((void) 0)
  106. #endif
  107.  
  108. #endif
  109.