Mac OS 9
Debugging.h
Go to the documentation of this file.
1 
19 #ifndef __DEBUGGING__
20 #define __DEBUGGING__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __FILES__
27 #include <Files.h>
28 #endif
29 
113 #ifndef kComponentSignatureString
114 #define kComponentSignatureString "Third Party Client"
115 #endif
116 
117 #define DEBUG_LEVEL_PRODUCTION 0
118 #define DEBUG_LEVEL_BREAK_ONLY 1
119 #define DEBUG_LEVEL_EXTERNAL 3
120 #define DEBUG_LEVEL_INTERNAL 4
121 #define DEBUGFULL DEBUG_LEVEL_INTERNAL
122 #define DEBUG_NO_OPTIONS 0
123 
124 #ifdef DEBUGLEVEL
125 #undef DEBUGLEVEL
126 #endif
127 
128 #if DEBUG
129 #if PRODUCTION
130 #define DEBUGLEVEL DEBUG_LEVEL_PRODUCTION
131 #elif DEBUG_EXTERNAL
132 #define DEBUGLEVEL DEBUG_LEVEL_EXTERNAL
133 #elif DEBUG_INTERNAL
134 #define DEBUGLEVEL DEBUG_LEVEL_INTERNAL
135 #elif PERFORMANCE
136 #define DEBUGLEVEL DEBUG_LEVEL_PRODUCTION
137 #elif DEBUG_BREAK_ONLY
138 #define DEBUGLEVEL DEBUG_LEVEL_BREAK_ONLY
139 #else
140 #define DEBUGLEVEL DEBUG_LEVEL_INTERNAL
141 #endif
142 #endif
143 
144 #ifndef DEBUGLEVEL
145 #define DEBUGLEVEL DEBUG_LEVEL_PRODUCTION
146 #endif
147 
148 #ifndef COMPONENT_SIGNATURE
149 #define COMPONENT_SIGNATURE '?*?*'
150 #endif
151 
152 #define QuoteExceptionString(x) #x
153 
164 #if PRAGMA_ONCE
165 #pragma once
166 #endif
167 
168 #ifdef __cplusplus
169 extern "C"
170 {
171 #endif
172 
173 #if PRAGMA_IMPORT
174 #pragma import on
175 #endif
176 
177 #if PRAGMA_STRUCT_ALIGN
178 #pragma options align = mac68k
179 #elif PRAGMA_STRUCT_PACKPUSH
180 #pragma pack(push, 2)
181 #elif PRAGMA_STRUCT_PACK
182 #pragma pack(2)
183 #endif
184 
193  void
194  DebugAssert(OSType componentSignature, UInt32 options,
195  const char *assertionString, const char *exceptionString,
196  const char *errorString, const char *fileName, long lineNumber,
197  void *value);
198 
199 #ifndef DEBUGASSERTMSG
200 #if DEBUGLEVEL == DEBUG_LEVEL_BREAK_ONLY
201 #define DEBUGASSERTMSG(componentSignature, options, assertionString, \
202  exceptionString, errorString, fileName, lineNumber, \
203  value) \
204  Debugger()
205 #elif DEBUGLEVEL == DEBUG_LEVEL_EXTERNAL
207 #if (applec && (!__powerc))
208 #define DEBUGASSERTMSG(componentSignature, options, assertionString, \
209  exceptionString, errorString, fileName, lineNumber, \
210  value) \
211  DebugAssert(componentSignature, options, kComponentSignatureString, \
212  assertionString, NULL, NULL, 0, value)
213 #else
214 #define DEBUGASSERTMSG(componentSignature, options, assertionString, \
215  exceptionString, errorString, fileName, lineNumber, \
216  value) \
217  DebugAssert(componentSignature, options, \
218  kComponentSignatureString ": " assertionString, NULL, NULL, \
219  NULL, 0, value)
220 #endif
221 #elif DEBUGLEVEL == DEBUG_LEVEL_INTERNAL
223 #if (applec && (!__powerc))
224 #define DEBUGASSERTMSG(componentSignature, options, assertionString, \
225  exceptionString, errorString, fileName, lineNumber, \
226  value) \
227  DebugAssert(componentSignature, options, kComponentSignatureString, \
228  assertionString, NULL, fileName, lineNumber, value)
229 #else
230 #define DEBUGASSERTMSG(componentSignature, options, assertionString, \
231  exceptionString, errorString, fileName, lineNumber, \
232  value) \
233  DebugAssert(componentSignature, options, \
234  kComponentSignatureString ": " assertionString, exceptionString, \
235  errorString, fileName, lineNumber, value)
236 #endif
237 #else
239 #define DEBUGASSERTMSG(componentSignature, options, assertionString, \
240  exceptionString, errorString, fileName, lineNumber, \
241  value)
242 #endif
243 #endif
244 
252  enum
253  {
254  kBlessedBusErrorBait = 0x68F168F1
255  };
256 
258  enum
259  {
260  k68kInterruptLevelMask = 0x00000007,
261  kInVBLTaskMask = 0x00000010,
262  kInDeferredTaskMask = 0x00000020,
263  kInSecondaryIntHandlerMask = 0x00000040,
264  kInNestedInterruptMask = 0x00000080
265  };
266 
267  enum
268  {
269  kComponentDebugOption =
270  0
271  };
272 
273  enum
274  {
275  kGetDebugOption = 1,
276  kSetDebugOption = 2
277  };
278 
289  typedef CALLBACK_API(void,
290  DebugComponentCallbackProcPtr)(SInt32 optionSelectorNum,
291  UInt32 command,
292  Boolean *optionSetting);
293  typedef STACK_UPP_TYPE(DebugComponentCallbackProcPtr) DebugComponentCallbackUPP;
312  UInt32
313  TaskLevel(void);
314 
315 #define ATTASKLEVEL0() (TaskLevel() == 0)
316 
337  OSStatus
338  NewDebugComponent(OSType componentSignature, ConstStr255Param componentName,
339  DebugComponentCallbackUPP componentCallback);
340 
365  OSStatus
366  NewDebugOption(OSType componentSignature, SInt32 optionSelectorNum,
367  ConstStr255Param optionName);
368 
385  OSStatus
386  DisposeDebugComponent(OSType componentSignature);
387 
408  OSStatus
409  GetDebugComponentInfo(UInt32 index, OSType *componentSignature,
410  Str255 componentName);
411 
433  OSStatus
434  GetDebugOptionInfo(UInt32 index, OSType componentSignature,
435  SInt32 *optionSelectorNum, Str255 optionName,
436  Boolean *optionSetting);
437 
458  OSStatus
459  SetDebugOptionValue(OSType componentSignature, SInt32 optionSelectorNum,
460  Boolean newOptionSetting);
461 
470  typedef CALLBACK_API(void, DebugAssertOutputHandlerProcPtr)(
471  OSType componentSignature, UInt32 options, const char *assertionString,
472  const char *exceptionString, const char *errorString, const char *fileName,
473  long lineNumber, void *value, ConstStr255Param outputMsg);
474  typedef STACK_UPP_TYPE(DebugAssertOutputHandlerProcPtr)
475  DebugAssertOutputHandlerUPP;
491  void
492  InstallDebugAssertOutputHandler(DebugAssertOutputHandlerUPP handler);
493 
498 #if CALL_NOT_IN_CARBON
507  void
508  dprintf(const char *format, ...);
509 
520  void
521  vdprintf(const char *format, char *va_args_list);
522 
523 #endif
525 #if DEBUG
536 #define DPRINTF(x) dprintf x
537 #else
538 #define DPRINTF(x) \
539  { \
540  }
541 #endif
542 
551  DebugComponentCallbackUPP
552  NewDebugComponentCallbackUPP(DebugComponentCallbackProcPtr userRoutine);
553 #if !OPAQUE_UPP_TYPES
554  enum
555  {
556  uppDebugComponentCallbackProcInfo = 0x00000FC0
557  };
558 #ifdef __cplusplus
559  inline DebugComponentCallbackUPP
560  NewDebugComponentCallbackUPP(DebugComponentCallbackProcPtr userRoutine)
561  {
562  return (DebugComponentCallbackUPP)NewRoutineDescriptor(
563  (ProcPtr)(userRoutine), uppDebugComponentCallbackProcInfo,
564  GetCurrentArchitecture());
565  }
566 #else
567 #define NewDebugComponentCallbackUPP(userRoutine) \
568  (DebugComponentCallbackUPP) NewRoutineDescriptor( \
569  (ProcPtr)(userRoutine), uppDebugComponentCallbackProcInfo, \
570  GetCurrentArchitecture())
571 #endif
572 #endif
573 
582  DebugAssertOutputHandlerUPP
583  NewDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerProcPtr userRoutine);
584 #if !OPAQUE_UPP_TYPES
585  enum
586  {
587  uppDebugAssertOutputHandlerProcInfo = 0x00FFFFC0
588  };
590 #ifdef __cplusplus
591  inline DebugAssertOutputHandlerUPP
592  NewDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerProcPtr userRoutine)
593  {
594  return (DebugAssertOutputHandlerUPP)NewRoutineDescriptor(
595  (ProcPtr)(userRoutine), uppDebugAssertOutputHandlerProcInfo,
596  GetCurrentArchitecture());
597  }
598 #else
599 #define NewDebugAssertOutputHandlerUPP(userRoutine) \
600  (DebugAssertOutputHandlerUPP) NewRoutineDescriptor( \
601  (ProcPtr)(userRoutine), uppDebugAssertOutputHandlerProcInfo, \
602  GetCurrentArchitecture())
603 #endif
604 #endif
605 
614  void
615  DisposeDebugComponentCallbackUPP(DebugComponentCallbackUPP userUPP);
616 #if !OPAQUE_UPP_TYPES
617 #ifdef __cplusplus
618  inline void
619  DisposeDebugComponentCallbackUPP(DebugComponentCallbackUPP userUPP)
620  {
621  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
622  }
623 #else
624 #define DisposeDebugComponentCallbackUPP(userUPP) \
625  DisposeRoutineDescriptor(userUPP)
626 #endif
627 #endif
628 
637  void
638  DisposeDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerUPP userUPP);
639 #if !OPAQUE_UPP_TYPES
640 #ifdef __cplusplus
641  inline void
642  DisposeDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerUPP userUPP)
643  {
644  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
645  }
646 #else
647 #define DisposeDebugAssertOutputHandlerUPP(userUPP) \
648  DisposeRoutineDescriptor(userUPP)
649 #endif
650 #endif
651 
660  void
661  InvokeDebugComponentCallbackUPP(SInt32 optionSelectorNum, UInt32 command,
662  Boolean *optionSetting,
663  DebugComponentCallbackUPP userUPP);
664 #if !OPAQUE_UPP_TYPES
665 #ifdef __cplusplus
666  inline void InvokeDebugComponentCallbackUPP(SInt32 optionSelectorNum,
667  UInt32 command,
668  Boolean *optionSetting,
669  DebugComponentCallbackUPP userUPP)
670  {
671  CALL_THREE_PARAMETER_UPP(userUPP, uppDebugComponentCallbackProcInfo,
672  optionSelectorNum, command, optionSetting);
673  }
674 #else
675 #define InvokeDebugComponentCallbackUPP(optionSelectorNum, command, \
676  optionSetting, userUPP) \
677  CALL_THREE_PARAMETER_UPP((userUPP), uppDebugComponentCallbackProcInfo, \
678  (optionSelectorNum), (command), (optionSetting))
679 #endif
680 #endif
681 
690  void
691  InvokeDebugAssertOutputHandlerUPP(OSType componentSignature, UInt32 options,
692  const char *assertionString,
693  const char *exceptionString,
694  const char *errorString, const char *fileName,
695  long lineNumber, void *value,
696  ConstStr255Param outputMsg,
697  DebugAssertOutputHandlerUPP userUPP);
698 #if !OPAQUE_UPP_TYPES
699 #ifdef __cplusplus
701  OSType componentSignature, UInt32 options, const char *assertionString,
702  const char *exceptionString, const char *errorString, const char *fileName,
703  long lineNumber, void *value, ConstStr255Param outputMsg,
704  DebugAssertOutputHandlerUPP userUPP)
705  {
706  CALL_NINE_PARAMETER_UPP(userUPP, uppDebugAssertOutputHandlerProcInfo,
707  componentSignature, options, assertionString,
708  exceptionString, errorString, fileName, lineNumber,
709  value, outputMsg);
710  }
711 #else
712 #define InvokeDebugAssertOutputHandlerUPP( \
713  componentSignature, options, assertionString, exceptionString, \
714  errorString, fileName, lineNumber, value, outputMsg, userUPP) \
715  CALL_NINE_PARAMETER_UPP((userUPP), uppDebugAssertOutputHandlerProcInfo, \
716  (componentSignature), (options), (assertionString), \
717  (exceptionString), (errorString), (fileName), \
718  (lineNumber), (value), (outputMsg))
719 #endif
720 #endif
721 
722 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
724 #define NewDebugComponentCallbackProc(userRoutine) \
725  NewDebugComponentCallbackUPP(userRoutine)
726 #define NewDebugAssertOutputHandlerProc(userRoutine) \
727  NewDebugAssertOutputHandlerUPP(userRoutine)
728 #define CallDebugComponentCallbackProc(userRoutine, optionSelectorNum, \
729  command, optionSetting) \
730  InvokeDebugComponentCallbackUPP(optionSelectorNum, command, optionSetting, \
731  userRoutine)
732 #define CallDebugAssertOutputHandlerProc( \
733  userRoutine, componentSignature, options, assertionString, \
734  exceptionString, errorString, fileName, lineNumber, value, outputMsg) \
735  InvokeDebugAssertOutputHandlerUPP( \
736  componentSignature, options, assertionString, exceptionString, \
737  errorString, fileName, lineNumber, value, outputMsg, userRoutine)
738 #endif
756 #if CALL_NOT_IN_CARBON
757 
758 #define LocalLMGetMacJmp() (*((unsigned long *)0x0120))
759 #define LocalLMGetMacJmpFlag() (*((UInt8 *)0x0BFF))
760 #define LocalLMKeyMap ((UInt16 *)(0x0174))
761 
762 #define ISCAPSLOCKKEYDOWN() ((LocalLMKeyMap[3] & 0x0002) == 0x0002)
763 
764 #define ISLOWLEVELDEBUGGERCALLABLE() \
765  ((LocalLMGetMacJmpFlag() != (UInt8)0xff) && \
766  ((LocalLMGetMacJmpFlag() & (UInt8)0xe0) == (UInt8)0x60) && \
767  (LocalLMGetMacJmp() != 0) && \
768  (LocalLMGetMacJmp() != (unsigned long)0xffffffff))
769 
773 #define SafeDebugger() \
774  do \
775  { \
776  if (ISLOWLEVELDEBUGGERCALLABLE()) \
777  Debugger(); \
778  } while (false)
779 
780 #define SafeDebugStr(str) \
781  do \
782  { \
783  if (ISLOWLEVELDEBUGGERCALLABLE()) \
784  DebugStr(str); \
785  } while (false)
786 
787 #define CapsLockDebugger() \
788  do \
789  { \
790  if (ISLOWLEVELDEBUGGERCALLABLE() && ISCAPSLOCKKEYDOWN()) \
791  Debugger(); \
792  } while (false)
793 
794 #define CapsLockDebugStr(str) \
795  do \
796  { \
797  if (ISLOWLEVELDEBUGGERCALLABLE() && ISCAPSLOCKKEYDOWN()) \
798  DebugStr(str); \
799  } while (false)
800 
804 #if DEBUG
805 #define DEBUGGER() SafeDebugger()
806 
807 #define DEBUGSTR(str) SafeDebugStr(str)
808 #else
809 #define DEBUGGER()
810 
811 #define DEBUGSTR(str)
812 #endif
813 
814 #endif
818 #if DEBUGLEVEL == DEBUG_LEVEL_PRODUCTION
819 #define check(assertion)
820 #define check_string(assertion, cstring)
821 #define check_noerr(err)
822 #define check_noerr_string(error, cstring)
823 #define debug_string(cstring)
824 #define require(assertion, label) \
825  do \
826  { \
827  if (!(assertion)) \
828  goto label; \
829  } while (false)
830 #define require_string(assertion, label, string) require(assertion, label)
831 #define require_quiet(assertion, label) require(assertion, label)
832 #define require_noerr(error, label) \
833  do \
834  { \
835  if ((error) != noErr) \
836  goto label; \
837  } while (false)
838 #define require_noerr_quiet(assertion, label) require_noerr(assertion, label)
839 #define require_noerr_action(error, label, action) \
840  do \
841  { \
842  if ((error) != noErr) \
843  { \
844  { \
845  action; \
846  }; \
847  goto label; \
848  } \
849  } while (false)
850 #define require_noerr_action_quiet(assertion, label, action) \
851  require_noerr_action(assertion, label, action)
852 #define require_action(assertion, label, action) \
853  do \
854  { \
855  if (!(assertion)) \
856  { \
857  { \
858  action; \
859  }; \
860  goto label; \
861  } \
862  } while (false)
863 #define require_action_quiet(assertion, label, action) \
864  require_action(assertion, label, action)
865 #define require_action_string(assertion, label, action, cstring) \
866  do \
867  { \
868  if (!(assertion)) \
869  { \
870  { \
871  action; \
872  }; \
873  goto label; \
874  } \
875  } while (false)
876 
877 #else
878 
881 #define debug_string(string) \
882  do \
883  { \
884  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
885  QuoteExceptionString(string), NULL, NULL, __FILE__, \
886  __LINE__, 0); \
887  } while (false)
888 
891 #define check(assertion) \
892  do \
893  { \
894  if (!(assertion)) \
895  { \
896  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
897  QuoteExceptionString(assertion), NULL, NULL, __FILE__, \
898  __LINE__, 0); \
899  } \
900  } while (false)
901 
904 #define check_string(assertion, cstring) \
905  do \
906  { \
907  if (!(assertion)) \
908  { \
909  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
910  QuoteExceptionString(assertion), cstring, NULL, __FILE__, \
911  __LINE__, 0); \
912  } \
913  } while (false)
914 
917 #define check_noerr(error) \
918  do \
919  { \
920  OSStatus localError = error; \
921  if (localError != noErr) \
922  { \
923  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
924  QuoteExceptionString(error) "== noErr", NULL, NULL, \
925  __FILE__, __LINE__, (void *)localError); \
926  } \
927  } while (false)
928 
931 #define check_noerr_string(error, cstring) \
932  do \
933  { \
934  OSStatus localError = error; \
935  if (localError != noErr) \
936  { \
937  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
938  QuoteExceptionString(error) "== noErr\n", cstring, NULL, \
939  __FILE__, __LINE__, (void *)localError); \
940  } \
941  } while (false)
942 
945 #define require(assertion, exception) \
946  do \
947  { \
948  if (!(assertion)) \
949  { \
950  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
951  QuoteExceptionString(assertion), \
952  QuoteExceptionString(exception), NULL, __FILE__, \
953  __LINE__, 0); \
954  goto exception; \
955  } \
956  } while (false)
957 
960 #define require_noerr(error, exception) \
961  do \
962  { \
963  OSStatus localError = error; \
964  if (localError != noErr) \
965  { \
966  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
967  QuoteExceptionString(error) "== noErr", \
968  QuoteExceptionString(exception), NULL, __FILE__, \
969  __LINE__, (void *)localError); \
970  goto exception; \
971  } \
972  } while (false)
973 
976 #define require_string(assertion, exception, string) \
977  do \
978  { \
979  if (!(assertion)) \
980  { \
981  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, string, \
982  QuoteExceptionString(assertion), \
983  QuoteExceptionString(exception), __FILE__, __LINE__, 0); \
984  goto exception; \
985  } \
986  } while (false)
987 
990 #define require_noerr_action(error, exception, action) \
991  do \
992  { \
993  OSStatus localError = error; \
994  if (localError != noErr) \
995  { \
996  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
997  QuoteExceptionString(error) "== noErr", \
998  QuoteExceptionString(exception), NULL, __FILE__, \
999  __LINE__, (void *)localError); \
1000  { \
1001  action; \
1002  } \
1003  goto exception; \
1004  } \
1005  } while (false)
1006 
1009 #define require_noerr_quiet(error, exception) \
1010  do \
1011  { \
1012  if (error != noErr) \
1013  { \
1014  goto exception; \
1015  } \
1016  } while (false)
1017 
1020 #define require_noerr_action_quiet(error, exception, action) \
1021  do \
1022  { \
1023  if (error != noErr) \
1024  { \
1025  { \
1026  action; \
1027  } \
1028  goto exception; \
1029  } \
1030  } while (false)
1031 
1034 #define require_action(assertion, exception, action) \
1035  do \
1036  { \
1037  if (!(assertion)) \
1038  { \
1039  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
1040  QuoteExceptionString(assertion), \
1041  QuoteExceptionString(exception), NULL, __FILE__, \
1042  __LINE__, 0); \
1043  { \
1044  action; \
1045  } \
1046  goto exception; \
1047  } \
1048  } while (false)
1049 
1052 #define require_action_string(assertion, exception, action, cstring) \
1053  do \
1054  { \
1055  if (!(assertion)) \
1056  { \
1057  DEBUGASSERTMSG(COMPONENT_SIGNATURE, DEBUG_NO_OPTIONS, \
1058  cstring ": " QuoteExceptionString(assertion), \
1059  QuoteExceptionString(exception), NULL, __FILE__, \
1060  __LINE__, 0); \
1061  { \
1062  action; \
1063  } \
1064  goto exception; \
1065  } \
1066  } while (false)
1067 
1070 #define require_quiet(assertion, exception) \
1071  do \
1072  { \
1073  if (!(assertion)) \
1074  { \
1075  goto exception; \
1076  } \
1077  } while (false)
1078 
1081 #define require_action_quiet(assertion, exception, action) \
1082  do \
1083  { \
1084  if (!(assertion)) \
1085  { \
1086  { \
1087  action; \
1088  } \
1089  goto exception; \
1090  } \
1091  } while (false)
1092 
1093 #endif
1099 #define check_tasklevel0() check(ATTASKLEVEL0())
1100 #define check_tasklevel0_string(string) check_string(ATTASKLEVEL0(), string)
1101 
1102 #define require_tasklevel0(label) require(ATTASKLEVEL0(), label)
1103 #define require_tasklevel0_string(label, string) \
1104  require_string(ATTASKLEVEL0(), label, string)
1105 #define require_tasklevel0_action(label, string, action) \
1106  require_action(ATTASKLEVEL0(), label, action)
1107 #define require_tasklevel0_action_string(label, string, action) \
1108  require_action_string(ATTASKLEVEL0(), label, action, string)
1109 
1112 #if DEBUGLEVEL > DEBUG_LEVEL_PRODUCTION
1113 #define verify(assertion) check(assertion)
1114 #define verify_noerr(assertion) check_noerr((assertion))
1115 #else
1116 #define verify(assertion) \
1117  do \
1118  { \
1119  (void)(assertion); \
1120  } while (0)
1121 #define verify_noerr(assertion) verify(assertion)
1122 #endif
1123 
1126 #define ncheck(assertion) check(!(assertion))
1127 #define ncheck_string(assertion, cstring) check_string(!(assertion), cstring)
1128 #define nrequire(assertion, exception) require(!(assertion), exception)
1129 #define nrequire_action(assertion, exception, action) \
1130  require_action(!(assertion), exception, action)
1131 #define nrequire_quiet(assertion, exception) \
1132  require_quiet(!(assertion), exception)
1133 #define nrequire_action_quiet(assertion, exception, action) \
1134  require_action_quiet(!(assertion), exception, action)
1135 #define nrequire_string(assertion, exception, string) \
1136  require_string(!(assertion), exception, string)
1137 
1138 #if PRAGMA_STRUCT_ALIGN
1139 #pragma options align = reset
1140 #elif PRAGMA_STRUCT_PACKPUSH
1141 #pragma pack(pop)
1142 #elif PRAGMA_STRUCT_PACK
1143 #pragma pack()
1144 #endif
1145 
1146 #ifdef PRAGMA_IMPORT_OFF
1147 #pragma import off
1148 #elif PRAGMA_IMPORT
1149 #pragma import reset
1150 #endif
1151 
1152 #ifdef __cplusplus
1153 }
1154 #endif
1155 
1156 #endif
OSStatus NewDebugOption(OSType componentSignature, SInt32 optionSelectorNum, ConstStr255Param optionName)
#define NewDebugAssertOutputHandlerUPP(userRoutine)
Definition: Debugging.h:599
UInt32 TaskLevel(void)
OSStatus SetDebugOptionValue(OSType componentSignature, SInt32 optionSelectorNum, Boolean newOptionSetting)
OSStatus GetDebugOptionInfo(UInt32 index, OSType componentSignature, SInt32 *optionSelectorNum, Str255 optionName, Boolean *optionSetting)
void InvokeDebugAssertOutputHandlerUPP(OSType componentSignature, UInt32 options, const char *assertionString, const char *exceptionString, const char *errorString, const char *fileName, long lineNumber, void *value, ConstStr255Param outputMsg, DebugAssertOutputHandlerUPP userUPP)
void DebugAssert(OSType componentSignature, UInt32 options, const char *assertionString, const char *exceptionString, const char *errorString, const char *fileName, long lineNumber, void *value)
OSStatus GetDebugComponentInfo(UInt32 index, OSType *componentSignature, Str255 componentName)
void DisposeDebugComponentCallbackUPP(DebugComponentCallbackUPP userUPP)
void vdprintf(const char *format, char *va_args_list)
#define NewDebugComponentCallbackUPP(userRoutine)
Definition: Debugging.h:567
@ kSetDebugOption
Definition: Debugging.h:276
OSStatus NewDebugComponent(OSType componentSignature, ConstStr255Param componentName, DebugComponentCallbackUPP componentCallback)
void DisposeDebugAssertOutputHandlerUPP(DebugAssertOutputHandlerUPP userUPP)
typedef CALLBACK_API(void, DebugComponentCallbackProcPtr)(SInt32 optionSelectorNum
OSStatus DisposeDebugComponent(OSType componentSignature)
void InstallDebugAssertOutputHandler(DebugAssertOutputHandlerUPP handler)
void InvokeDebugComponentCallbackUPP(SInt32 optionSelectorNum, UInt32 command, Boolean *optionSetting, DebugComponentCallbackUPP userUPP)
void dprintf(const char *format,...)
File Manager (MFS, HFS, and HFS+) Interfaces.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)