Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOTCPStreamDecoderAbstractionLayer.h File Reference
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
+ Include dependency graph for OOTCPStreamDecoderAbstractionLayer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define OOTCPSTREAM_USE_COREFOUNDATION   0
 
#define OOALSTR(string)
 
#define OOALDestroyAutoreleasePool(pool)
 

Typedefs

typedef const void * OOALObjectRef
 
typedef const struct NSString * OOALStringRef
 
typedef const struct NSData * OOALDataRef
 
typedef struct NSData * OOALMutableDataRef
 
typedef const struct NSDictionary * OOALDictionaryRef
 
typedef const struct NSAutoreleasePool * OOALAutoreleasePoolRef
 

Functions

OOALStringRef OOALGetConstantString (const char *string)
 
void OOALRelease (OOALObjectRef object)
 
OOALStringRef OOTypeDescription (OOALObjectRef object)
 
bool OOALIsString (OOALObjectRef object)
 
OOALStringRef OOALStringCreateWithFormatAndArguments (OOALStringRef format, va_list args)
 
bool OOALIsDictionary (OOALObjectRef object)
 
OOALObjectRef OOALDictionaryGetValue (OOALDictionaryRef dictionary, OOALObjectRef key)
 
bool OOALIsData (OOALObjectRef object)
 
OOALMutableDataRef OOALDataCreateMutable (size_t capacity)
 
void OOALMutableDataAppendBytes (OOALMutableDataRef data, const void *bytes, size_t length)
 
const void * OOALDataGetBytePtr (OOALDataRef data)
 
size_t OOALDataGetLength (OOALDataRef data)
 
OOALAutoreleasePoolRef OOALCreateAutoreleasePool (void)
 
OOALObjectRef OOALPropertyListFromData (OOALMutableDataRef data, OOALStringRef *errStr)
 

Macro Definition Documentation

◆ OOALDestroyAutoreleasePool

#define OOALDestroyAutoreleasePool ( pool)
Value:
void OOALRelease(OOALObjectRef object)

Definition at line 117 of file OOTCPStreamDecoderAbstractionLayer.h.

Referenced by OOTCPStreamDecoderReceiveBytes().

◆ OOALSTR

#define OOALSTR ( string)
Value:
OOALGetConstantString("" string "")
OOALStringRef OOALGetConstantString(const char *string)

Definition at line 96 of file OOTCPStreamDecoderAbstractionLayer.h.

◆ OOTCPSTREAM_USE_COREFOUNDATION

#define OOTCPSTREAM_USE_COREFOUNDATION   0

Definition at line 11 of file OOTCPStreamDecoderAbstractionLayer.h.

Typedef Documentation

◆ OOALAutoreleasePoolRef

typedef const struct NSAutoreleasePool* OOALAutoreleasePoolRef

Definition at line 93 of file OOTCPStreamDecoderAbstractionLayer.h.

◆ OOALDataRef

typedef const struct NSData* OOALDataRef

Definition at line 90 of file OOTCPStreamDecoderAbstractionLayer.h.

◆ OOALDictionaryRef

typedef const struct NSDictionary* OOALDictionaryRef

Definition at line 92 of file OOTCPStreamDecoderAbstractionLayer.h.

◆ OOALMutableDataRef

typedef struct NSData* OOALMutableDataRef

Definition at line 91 of file OOTCPStreamDecoderAbstractionLayer.h.

◆ OOALObjectRef

typedef const void* OOALObjectRef

Definition at line 87 of file OOTCPStreamDecoderAbstractionLayer.h.

◆ OOALStringRef

typedef const struct NSString* OOALStringRef

Definition at line 89 of file OOTCPStreamDecoderAbstractionLayer.h.

Function Documentation

◆ OOALCreateAutoreleasePool()

OOALAutoreleasePoolRef OOALCreateAutoreleasePool ( void )

Definition at line 106 of file OOTCPStreamDecoderAbstractionLayer.m.

107{
108 return [[NSAutoreleasePool alloc] init];
109}

Referenced by OOTCPStreamDecoderReceiveBytes().

+ Here is the caller graph for this function:

◆ OOALDataCreateMutable()

OOALMutableDataRef OOALDataCreateMutable ( size_t capacity)

Definition at line 82 of file OOTCPStreamDecoderAbstractionLayer.m.

83{
84 return [[NSMutableData alloc] initWithCapacity:capacity];
85}

Referenced by OOTCPStreamDecoderReceiveBytes().

+ Here is the caller graph for this function:

◆ OOALDataGetBytePtr()

const void * OOALDataGetBytePtr ( OOALDataRef data)

Definition at line 94 of file OOTCPStreamDecoderAbstractionLayer.m.

95{
96 return [data bytes];
97}

Referenced by OOTCPStreamDecoderReceiveData().

+ Here is the caller graph for this function:

◆ OOALDataGetLength()

size_t OOALDataGetLength ( OOALDataRef data)

Definition at line 100 of file OOTCPStreamDecoderAbstractionLayer.m.

101{
102 return [data length];
103}

Referenced by OOTCPStreamDecoderReceiveData().

+ Here is the caller graph for this function:

◆ OOALDictionaryGetValue()

OOALObjectRef OOALDictionaryGetValue ( OOALDictionaryRef dictionary,
OOALObjectRef key )

Definition at line 70 of file OOTCPStreamDecoderAbstractionLayer.m.

71{
72 return [dictionary objectForKey:key];
73}

Referenced by PacketReady().

+ Here is the caller graph for this function:

◆ OOALGetConstantString()

OOALStringRef OOALGetConstantString ( const char * string)

Definition at line 16 of file OOTCPStreamDecoderAbstractionLayer.m.

17{
18 static NSMutableDictionary *sStrings = nil;
19 NSValue *key = nil;
20 NSString *value = nil;
21
22 if (sStrings == nil)
23 {
24 sStrings = [[NSMutableDictionary alloc] init];
25 }
26
27 key = [NSValue valueWithPointer:string];
28 value = [sStrings objectForKey:key];
29 if (value == nil)
30 {
31 // Note: non-ASCII strings are not permitted, but we don't bother to detect them.
32 value = [NSString stringWithUTF8String:string];
33 if (value != nil) [sStrings setObject:value forKey:key];
34 }
35
36 return value;
37}
return nil

References nil.

◆ OOALIsData()

bool OOALIsData ( OOALObjectRef object)

Definition at line 76 of file OOTCPStreamDecoderAbstractionLayer.m.

77{
78 return [object isKindOfClass:[NSData class]];
79}

◆ OOALIsDictionary()

bool OOALIsDictionary ( OOALObjectRef object)

Definition at line 64 of file OOTCPStreamDecoderAbstractionLayer.m.

65{
66 return [object isKindOfClass:[NSDictionary class]];
67}

Referenced by PacketReady().

+ Here is the caller graph for this function:

◆ OOALIsString()

bool OOALIsString ( OOALObjectRef object)

Definition at line 52 of file OOTCPStreamDecoderAbstractionLayer.m.

53{
54 return [object isKindOfClass:[NSString class]];
55}

Referenced by PacketReady().

+ Here is the caller graph for this function:

◆ OOALMutableDataAppendBytes()

void OOALMutableDataAppendBytes ( OOALMutableDataRef data,
const void * bytes,
size_t length )

Definition at line 88 of file OOTCPStreamDecoderAbstractionLayer.m.

89{
90 [data appendBytes:bytes length:length];
91}

Referenced by OOTCPStreamDecoderReceiveBytes().

+ Here is the caller graph for this function:

◆ OOALPropertyListFromData()

OOALObjectRef OOALPropertyListFromData ( OOALMutableDataRef data,
OOALStringRef * errStr )

Definition at line 112 of file OOTCPStreamDecoderAbstractionLayer.m.

113{
114 id result = [NSPropertyListSerialization propertyListFromData:data
115 mutabilityOption:NSPropertyListImmutable
116 format:NULL
117 errorDescription:errStr];
118 [result retain];
119
120#if !OOLITE_RELEASE_PLIST_ERROR_STRINGS
121 [*errStr retain];
122#endif
123
124 return result;
125}

Referenced by PacketReady().

+ Here is the caller graph for this function:

◆ OOALRelease()

void OOALRelease ( OOALObjectRef object)

Definition at line 40 of file OOTCPStreamDecoderAbstractionLayer.m.

41{
42 [object release];
43}

Referenced by Error(), OOTCPStreamDecoderDestroy(), OOTCPStreamDecoderReceiveBytes(), and PacketReady().

+ Here is the caller graph for this function:

◆ OOALStringCreateWithFormatAndArguments()

OOALStringRef OOALStringCreateWithFormatAndArguments ( OOALStringRef format,
va_list args )

Definition at line 58 of file OOTCPStreamDecoderAbstractionLayer.m.

59{
60 return [[NSString alloc] initWithFormat:format arguments:args];
61}

Referenced by Error().

+ Here is the caller graph for this function:

◆ OOTypeDescription()

OOALStringRef OOTypeDescription ( OOALObjectRef object)

Definition at line 46 of file OOTCPStreamDecoderAbstractionLayer.m.

47{
48 return [[object class] description];
49}

Referenced by PacketReady().

+ Here is the caller graph for this function: