Quantum Fog  0.9.3
GLOBAL_FUN.h
1 //global functions(their prototypes):
2 #pragma once
3 
4 #if _do_debug
5  extern LONG req_stack_space;
6 #endif
7 
8 DOUBLE my_factorial(USHORT n);
9 VOID limited_degrees(SHORT & ang);
10 VOID limited_degrees(DOUBLE & ang);
11 
12 #ifdef _mac_gui_app //''''''''''''''''''''''''''''''''''''''''''''\\.
13 
14 
15 #define ReleaseResource_(handle) \
16  do { \
17  if(handle != nil){ \
18  ::ReleaseResource(handle); \
19  handle = nil; \
20  } \
21  } while (false)
22 #define DisposeHandle_(handle) \
23  do { \
24  if(handle != nil){ \
25  ::DisposeHandle(handle); \
26  handle = nil; \
27  } \
28  } while (false)
29 
30  SInt16 nearest_int16(DOUBLE x);
31  VOID toggle(BOOLEAN & x);
32  VOID draw_cell_frame(const Rect & rect);
33 // VOID my_set_cursor(SHORT id);
34  VOID trunc_pstr_so_it_fits(Str255 pstr, USHORT box_width, USHORT pixs_for_margins);
35  BOOLEAN get_TEXT_scrap(Handle content_h);
36 #endif //_mac_gui_app \\............................................//
37 
38 
39 
40 
41 #ifdef _mac_gui_app //''''''''''''''''''''''''''''''''''''''''''''\\.
42 
43  #if _do_debug
44  #define refresh_req_stack_space_() if(req_stack_space>::StackSpace()) req_stack_space = ::StackSpace();
45  #else
46  #define refresh_req_stack_space_()
47  #endif
48 #else
49  #define refresh_req_stack_space_()
50 #endif //_mac_gui_app \\............................................//
51 
52 
53 
54 //******************************************
55 inline
56 VOID toggle(
57 BOOLEAN & x) //i-o
58 {
59  x=(!x);
60 }
61