home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilsd / explain / !Explain / h / misc < prev   
Encoding:
Text File  |  1994-04-29  |  3.4 KB  |  108 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_settype(char *name, int ftype);
  29. os_error *misc_windowbox(wimp_box *box, BOOL shrink);
  30. os_error *misc_opendir(char *dirname);
  31.  
  32. int misc_min(int a, int b);
  33. int misc_max(int a, int b);
  34.  
  35. #ifdef MEMTRACE
  36.  
  37. #include "flex.h"
  38. #include <stdlib.h>
  39.  
  40. int __flex_alloc(char *name, int line, flex_ptr anchor, int n);
  41. int __flex_extend(char *name, int line, flex_ptr anchor, int n);
  42. void __flex_free(char *name, int line, flex_ptr anchor);
  43.  
  44. void *__malloc(char *name, int line, size_t size);
  45. void *__realloc(char *name, int line, void *m, size_t size);
  46. void __free(char *name, int line, void *m);
  47.  
  48. #define flex_alloc(anc, n)   __flex_alloc(__FILE__, __LINE__, anc, n)
  49. #define flex_extend(anc, n)  __flex_extend(__FILE__, __LINE__, anc, n)
  50. #define flex_free(anc)       __flex_free(__FILE__, __LINE__, anc)
  51.  
  52. #define malloc(s)            __malloc(__FILE__, __LINE__, s)
  53. #define realloc(m, s)        __realloc(__FILE__, __LINE__, m, s)
  54. #define free(m)              __free(__FILE__, __LINE__, m)
  55.  
  56. #define misc_malloc(ptr, size) (misc_malloc)(__FILE__, __LINE__, ptr, size)
  57. #define misc_free(ptr)         (misc_free)(__FILE__, __LINE__, ptr)
  58.  
  59. os_error *(misc_malloc)(char *name, int line, void **ptr, int size);
  60. void (misc_free)(char *name, int line, void **ptr);
  61.  
  62. #else
  63.  
  64. os_error *misc_malloc(void **ptr, int size);
  65. void misc_free(void **ptr);
  66.  
  67. #endif
  68. os_error *misc_falloc(void **ptr, int size);
  69. os_error *misc_fextend(void **ptr, int by);
  70. os_error *misc_fmidextend(void **ptr, int at, int by);
  71.  
  72. int misc_fsize(void **ptr);
  73. void misc_ffree(void **ptr);
  74.  
  75. os_error *misc_force(wimp_w w);
  76. os_error *misc_chtitle(wimp_w w);
  77. void misc_growbox(wimp_box *box, int dx, int dy);
  78. int misc_init(char *taskname);
  79. int misc_wimpver(void);
  80. void misc_report(char *tag, ...);
  81. void __memreport(void);
  82. char *misc_leaf(char *fname);
  83. os_error *misc_strdup(char **dest, const char *source);
  84. int misc_strcicmp(const char *s1, const char *s2);
  85. os_error *misc_counticons(wimp_w w, int *countp);
  86. os_error *misc_icontextlen(wimp_w w, wimp_i i, int *lenp);
  87. os_error *misc_nextwriteable(wimp_w w, BOOL *wrap);
  88. os_error *misc_prevwriteable(wimp_w w, BOOL *wrap);
  89. os_error *misc_fillrect(wimp_box *box);
  90. os_error *misc_setfontrgb(int fh, int bcol, int fcol);
  91. os_error *misc_setfontcolours(int fh, int bcol, int fcol);
  92. os_error *misc_settitle(wimp_w w, char *title);
  93.  
  94. #ifdef DEVELOPER
  95. os_error *misc__fix(char *file, int line, os_error *err);
  96. #define misc_fix(e) \
  97.    misc__fix(__FILE__, __LINE__, e)
  98. #include "werr.h"
  99. #define misc_assert(e) \
  100.    do { if (!(e)) werr(TRUE, "%s, line %d: Assertion %s was false", \
  101.                      __FILE__, __LINE__, #e); } while (0)
  102. #else
  103. #define misc_fix(e) e
  104. #define misc_assert(e) ((void) 0)
  105. #endif
  106.  
  107. #endif
  108.