Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

revived after deconstruction

started to update test app
  • Loading branch information...
commit cfbde74f0e3a0657b0d691324953cfb5617fadb9 1 parent 8dee1ee
bkrpub authored
7 EngineRoom.xcodeproj/project.pbxproj
View
@@ -74,7 +74,14 @@
isa = PBXProject;
buildConfigurationList = 0422136811FF5B5F0011C415 /* Build configuration list for PBXProject "EngineRoom" */;
compatibilityVersion = "Xcode 2.4";
+ developmentRegion = English;
hasScannedForEncodings = 0;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 0422136311FF5B5F0011C415;
projectDirPath = "";
projectReferences = (
169 EngineRoom/logpoints_api.h
View
@@ -27,10 +27,10 @@
#include "logpoints_private.h"
#include "logpoints_kinds.h"
-#define LOGPOINTS_EXPORT __attribute__((visibility("default")))
-#define LOGPOINTS_HIDDEN __attribute__((visibility("hidden")))
-#define LOGPOINTS_WEAK __attribute__((visibility("weak_import")))
-#define LOGPOINTS_USED __attribute__((visibility("used")))
+#define LOGPOINTS_EXPORT /* __attribute__((visibility("default"))) */
+#define LOGPOINTS_HIDDEN /* __attribute__((visibility("hidden"))) */
+#define LOGPOINTS_WEAK /* __attribute__((visibility("weak_import"))) */
+#define LOGPOINTS_USED /* __attribute__((visibility("used"))) */
#ifdef __cplusplus
@@ -110,11 +110,92 @@ LOGPOINTS_EXPORT int logPointPriorityNumberFromName(const char *name);
*
*/
-#warning local client test
-
-LOGPOINTS_HIDDEN LOGPOINTS_USED LOGPOINT_INVOKER_DECLARATION(local_logPointInvokerDefault)
+/*
+ * all code that uses or declares these types must be compiled in the same language
+ */
+#ifdef __OBJC__
+typedef CFStringRef LOGPOINT_MESSAGE_TYPE;
+#define LOGPOINT_MESSAGE_FORMAT "%@"
+#define LOGPOINT_MESSAGE_EMPTY CFSTR("")
+#else
+typedef char *LOGPOINT_MESSAGE_TYPE;
+#define LOGPOINT_MESSAGE_FORMAT "%s"
+#define LOGPOINT_MESSAGE_EMPTY ""
+#endif
+
+/*
+ * this is the first function invoked by a logpoint, full control, all responsibilities yours
+ * if you don't care about ObjC, you can assume that "fmt" is const char *, otherwise it is
+ * LOGPOINT_FLAG(*lpp, LOGPOINT_NSSTRING) ? CFStringRef : const char *
+ */
+typedef lp_return_t (*LOGPOINT_INVOKER)(LOGPOINT *lpp, const void *langspec1, const void *langspec2, const void *fmt, ...);
+#define LOGPOINT_INVOKER_DECLARATION(name) lp_return_t name(LOGPOINT *lpp, const void *langspec1, const void *langspec2, const void *fmt, ...)
+
+LOGPOINTS_EXPORT LOGPOINT_INVOKER_DECLARATION(logPointInvokerDefault);
+LOGPOINTS_EXPORT LOGPOINTS_WEAK LOGPOINT_INVOKER logPointGetInvoker(void);
+LOGPOINTS_EXPORT LOGPOINT_INVOKER logPointSetInvoker(LOGPOINT_INVOKER newInvoker);
+
+
+/*
+ * payload is the result of the users "fmt", ... arguments
+ * if the ObjC version (logpoints.m) is used, payload is a CFStringRef, otherwise a const char *
+ */
+typedef lp_return_t (*LOGPOINT_COMPOSER)(LOGPOINT *lpp, const void *langspec1, const void *langspec2, LOGPOINT_MESSAGE_TYPE payload);
+
+#define LOGPOINT_COMPOSER_DECLARATION(name) lp_return_t name(LOGPOINT *lpp, const void *langspec1, const void *langspec2, LOGPOINT_MESSAGE_TYPE payload)
+
+LOGPOINTS_EXPORT LOGPOINT_COMPOSER_DECLARATION(logPointComposerDefault);
+LOGPOINTS_EXPORT LOGPOINT_COMPOSER logPointGetComposer(void);
+LOGPOINTS_EXPORT LOGPOINT_COMPOSER logPointSetComposer(LOGPOINT_COMPOSER newComposer);
+
+/*
+ * the composer will call the emitter with a format string and arguments decorating
+ * the message produced by the invoker with metadata like location in source etc.
+ */
+typedef lp_return_t (*LOGPOINT_EMITTER)(LOGPOINT *lpp, const void *langspec1, const void *langspec2, const char *fmt, ...);
+
+#define LOGPOINT_EMITTER_DECLARATION(name) lp_return_t name(LOGPOINT *lpp, const void *langspec1, const void *langspec2, const char *fmt, ...)
+
+LOGPOINTS_EXPORT LOGPOINT_EMITTER_DECLARATION(logPointEmitterDefault);
+LOGPOINTS_EXPORT LOGPOINT_EMITTER logPointGetEmitter(void);
+LOGPOINTS_EXPORT LOGPOINT_EMITTER logPointSetEmitter(LOGPOINT_EMITTER newEmitter);
+
+
+
+
+#if __OBJC__
+
+/* TESTING NSValue *__cmnsv = [[NSValue alloc] initWithBytes: &__cmv objCType: type]; */ /* NSValue secretly supports 'D'... */
+
+#ifdef LOCAL_CLIENT
+#define LOGPOINT_FORMAT_VALUE(v, label) ({ \
+ __typeof__ (v) __valueToFormat = (v) ; \
+ char *type = __builtin_types_compatible_p( __typeof__(__valueToFormat), long double) ? "D" : @encode( __typeof__ (__valueToFormat) ); \
+ (logPointFormatObjCType ? logPointFormatObjCType : local_logPointFormatObjCType)(type, (void*)&__valueToFormat, (label)); /* returns autoreleased string */ \
+})
+#else
+#define LOGPOINT_FORMAT_VALUE(v, label) ({ \
+ __typeof__ (v) __valueToFormat = (v) ; \
+ char *type = __builtin_types_compatible_p( __typeof__(__valueToFormat), long double) ? "D" : @encode( __typeof__ (__valueToFormat) ); \
+ (logPointFormatObjCType)(type, (void*)&__valueToFormat, (label)); /* returns autoreleased string */ \
+})
+#endif
+
+/*
+ * internal helper function in logpoints.m, returns autoreleased string describing the @encode type at *data
+ */
+LOGPOINTS_EXPORT LOGPOINTS_WEAK id logPointFormatObjCType(const char *type, void *data, const char *label);
+
+#endif
+
+#if LOCAL_CLIENT
+static LOGPOINTS_HIDDEN LOGPOINTS_USED LOGPOINT_INVOKER_DECLARATION(local_logPointInvokerDefault)
{
+#ifdef MAINTAINER_WARNINGS
+#warning local client test
#warning no non-objc support
+#endif
+
va_list args;
va_start(args, fmt);
@@ -134,13 +215,13 @@ LOGPOINTS_HIDDEN LOGPOINTS_USED LOGPOINT_INVOKER_DECLARATION(local_logPointInvok
[msg release];
va_end(args);
- return ;
+ return LOGPOINT_YES;
}
/* ObjC ! */
#import "CrossPlatform_NSString_CGGeometry.h"
-LOGPOINTS_HIDDEN LOGPOINTS_USED local_logPointFormatObjCType(const char *type, void *data, const char *label)
+static LOGPOINTS_HIDDEN LOGPOINTS_USED id local_logPointFormatObjCType(const char *type, void *data, const char *label)
{
if( NULL == type )
return @"NILTYPE";
@@ -266,79 +347,11 @@ LOGPOINTS_HIDDEN LOGPOINTS_USED local_logPointFormatObjCType(const char *type, v
}
-
-
-
-/*
- * all code that uses or declares these types must be compiled in the same language
- */
-#ifdef __OBJC__
-typedef CFStringRef LOGPOINT_MESSAGE_TYPE;
-#define LOGPOINT_MESSAGE_FORMAT "%@"
-#define LOGPOINT_MESSAGE_EMPTY CFSTR("")
-#else
-typedef char *LOGPOINT_MESSAGE_TYPE;
-#define LOGPOINT_MESSAGE_FORMAT "%s"
-#define LOGPOINT_MESSAGE_EMPTY ""
#endif
-
-/*
- * this is the first function invoked by a logpoint, full control, all responsibilities yours
- * if you don't care about ObjC, you can assume that "fmt" is const char *, otherwise it is
- * LOGPOINT_FLAG(*lpp, LOGPOINT_NSSTRING) ? CFStringRef : const char *
- */
-typedef lp_return_t (*LOGPOINT_INVOKER)(LOGPOINT *lpp, const void *langspec1, const void *langspec2, const void *fmt, ...);
-#define LOGPOINT_INVOKER_DECLARATION(name) lp_return_t name(LOGPOINT *lpp, const void *langspec1, const void *langspec2, const void *fmt, ...)
-
-LOGPOINTS_EXPORT LOGPOINT_INVOKER_DECLARATION(logPointInvokerDefault);
-LOGPOINTS_EXPORT LOGPOINTS_WEAK LOGPOINT_INVOKER logPointGetInvoker(void);
-LOGPOINTS_EXPORT LOGPOINT_INVOKER logPointSetInvoker(LOGPOINT_INVOKER newInvoker);
-
-
-/*
- * payload is the result of the users "fmt", ... arguments
- * if the ObjC version (logpoints.m) is used, payload is a CFStringRef, otherwise a const char *
- */
-typedef lp_return_t (*LOGPOINT_COMPOSER)(LOGPOINT *lpp, const void *langspec1, const void *langspec2, LOGPOINT_MESSAGE_TYPE payload);
-
-#define LOGPOINT_COMPOSER_DECLARATION(name) lp_return_t name(LOGPOINT *lpp, const void *langspec1, const void *langspec2, LOGPOINT_MESSAGE_TYPE payload)
-
-LOGPOINTS_EXPORT LOGPOINT_COMPOSER_DECLARATION(logPointComposerDefault);
-LOGPOINTS_EXPORT LOGPOINT_COMPOSER logPointGetComposer(void);
-LOGPOINTS_EXPORT LOGPOINT_COMPOSER logPointSetComposer(LOGPOINT_COMPOSER newComposer);
-
-/*
- * the composer will call the emitter with a format string and arguments decorating
- * the message produced by the invoker with metadata like location in source etc.
- */
-typedef lp_return_t (*LOGPOINT_EMITTER)(LOGPOINT *lpp, const void *langspec1, const void *langspec2, const char *fmt, ...);
-
-#define LOGPOINT_EMITTER_DECLARATION(name) lp_return_t name(LOGPOINT *lpp, const void *langspec1, const void *langspec2, const char *fmt, ...)
-
-LOGPOINTS_EXPORT LOGPOINT_EMITTER_DECLARATION(logPointEmitterDefault);
-LOGPOINTS_EXPORT LOGPOINT_EMITTER logPointGetEmitter(void);
-LOGPOINTS_EXPORT LOGPOINT_EMITTER logPointSetEmitter(LOGPOINT_EMITTER newEmitter);
+/* LOCAL_CLIENT */
-
-#if __OBJC__
-
-/* TESTING NSValue *__cmnsv = [[NSValue alloc] initWithBytes: &__cmv objCType: type]; */ /* NSValue secretly supports 'D'... */
-
-#define LOGPOINT_FORMAT_VALUE(v, label) ({ \
- __typeof__ (v) __valueToFormat = (v) ; \
- char *type = __builtin_types_compatible_p( __typeof__(__valueToFormat), long double) ? "D" : @encode( __typeof__ (__valueToFormat) ); \
- (logPointFormatObjCType ? logPointFormatObjCType : local_logPointFormatObjCType)(type, (void*)&__valueToFormat, (label)); /* returns autoreleased string */ \
-})
-
-/*
- * internal helper function in logpoints.m, returns autoreleased string describing the @encode type at *data
- */
-LOGPOINTS_EXPORT LOGPOINTS_WEAK id logPointFormatObjCType(const char *type, void *data, const char *label);
-
-#endif
-
#ifdef __cplusplus
}
#endif
6 EngineRoom/logpoints_private.h
View
@@ -41,7 +41,7 @@
#endif
#ifndef LOGPOINT_ZERO
-#define LOGPOINT_ZERO ({ 0; }) /* logpoints return whether they were triggered */
+#define LOGPOINT_ZERO logPointReturnFromMacro(NULL) /* logpoints return whether they were triggered */
#endif
#ifdef __linux__
@@ -82,7 +82,11 @@
#endif
#ifndef LOGPOINT_INVOKE
+#if LOCAL_CLIENT
#define LOGPOINT_INVOKE(lpp, langspec1, langspec2, fmt, ...) ( logPointGetInvoker ? logPointGetInvoker() : local_logPointInvokerDefault)((lpp), (langspec1), (langspec2), (fmt), ## __VA_ARGS__ )
+#else
+#define LOGPOINT_INVOKE(lpp, langspec1, langspec2, fmt, ...) ( logPointGetInvoker() )((lpp), (langspec1), (langspec2), (fmt), ## __VA_ARGS__ )
+#endif
#endif
7 Test-OSX/EngineRoomTest.xcodeproj/project.pbxproj
View
@@ -196,7 +196,14 @@
isa = PBXProject;
buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "EngineRoomTest" */;
compatibilityVersion = "Xcode 3.0";
+ developmentRegion = English;
hasScannedForEncodings = 1;
+ knownRegions = (
+ English,
+ Japanese,
+ French,
+ German,
+ );
mainGroup = 2A37F4AAFDCFA73011CA2CEA /* EngineRoomTest */;
projectDirPath = "";
projectReferences = (
13 Test-OSX/MyDocument.m
View
@@ -22,25 +22,28 @@
#import "MyDocument.h"
#import <EngineRoom/EngineRoom.h>
-#import <EngineRoom/logpoints_bk.h>
+#import <EngineRoom/tracer.h>
+#import <EngineRoom/logpoints_default.h>
+#define dbug lpdebug
+#define dbug_return return_lpdebug
@implementation MyDocument
- (IBAction) generateWarning: (id) sender
{
- lpwarning("interface", "please do not press this (%@) again\n%@", sender, tracerBacktraceAsString(0));
+ lpkwarningf("interface", "please do not press this (%@) again\n%@", sender, tracerBacktraceAsString(0));
}
- (IBAction) takeTestValueFrom: (id) sender
{
- lpdebug("action", "sender: %@", sender);
+ lpkdebugf("action", "sender: %@", sender);
/*dbug([sender frame]);*/
NSString *string = [sender stringValue];
- if( lpdebugswitch("action,expandInput", "trying to expand %@", string) ) {
+ if( lpkswitchf("action,expandInput", "trying to expand %@", string) ) {
if( [string isEqualToString: @"*"] ) {
[sender setStringValue: @"42"];
}
@@ -53,7 +56,7 @@ - (IBAction) takeTestValueFrom: (id) sender
dbug([sender doubleValue]);
dbug( NSMakeSize(length, length) );
} else {
- lperror("interface,entry", "empty value from %@", sender);
+ lpkerrorf("interface,entry", "empty value from %@", sender);
}
Please sign in to comment.
Something went wrong with that request. Please try again.