Mac OS 9
CGDataConsumer.h
Go to the documentation of this file.
1 
19 #ifndef __CGDATACONSUMER__
20 #define __CGDATACONSUMER__
21 
22 #ifndef __CGBASE__
23 #include <CGBase.h>
24 #endif
25 
26 #ifndef __CFURL__
27 #include <CFURL.h>
28 #endif
29 
30 #if PRAGMA_ONCE
31 #pragma once
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #if PRAGMA_IMPORT
40 #pragma import on
41 #endif
42 
43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = mac68k
45 #elif PRAGMA_STRUCT_PACKPUSH
46 #pragma pack(push, 2)
47 #elif PRAGMA_STRUCT_PACK
48 #pragma pack(2)
49 #endif
50 
51  typedef struct CGDataConsumer *CGDataConsumerRef;
52  typedef CALLBACK_API_C(size_t, CGPutBytesProcPtr)(void *info,
53  const void *buffer,
54  size_t count);
55  typedef CALLBACK_API_C(void, CGReleaseConsumerProcPtr)(void *info);
56  /* Callbacks for accessing data.
57  * `putBytes' copies `count' bytes from `buffer' to the consumer, and
58  * returns the number of bytes copied. It should return 0 if no more data
59  * can be written to the consumer.
60  * `releaseConsumer', if non-NULL, is called when the consumer is freed. */
62  {
63  CGPutBytesProcPtr putBytes;
64  CGReleaseConsumerProcPtr releaseConsumer;
65  };
67  /* Create a data consumer using `callbacks' to handle the data. `info' is
68  * passed to each of the callback functions. */
77  CGDataConsumerRef
78  CGDataConsumerCreate(void *info, const CGDataConsumerCallbacks *callbacks);
79 
80  /* Create a data consumer which writes data to `url'. */
89  CGDataConsumerRef
91 
92  /* Increment the retain count of `consumer' and return it. All data
93  * consumers are created with an initial retain count of 1. */
102  CGDataConsumerRef
103  CGDataConsumerRetain(CGDataConsumerRef consumer);
104 
105  /* Decrement the retain count of `consumer'. If the retain count reaches
106  * 0, then release it and any associated resources. */
115  void
116  CGDataConsumerRelease(CGDataConsumerRef consumer);
117 
118 #if PRAGMA_STRUCT_ALIGN
119 #pragma options align = reset
120 #elif PRAGMA_STRUCT_PACKPUSH
121 #pragma pack(pop)
122 #elif PRAGMA_STRUCT_PACK
123 #pragma pack()
124 #endif
125 
126 #ifdef PRAGMA_IMPORT_OFF
127 #pragma import off
128 #elif PRAGMA_IMPORT
129 #pragma import reset
130 #endif
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 #endif /* __CGDATACONSUMER__ */
xxx put contents here xxx
CGDataConsumerRef CGDataConsumerRetain(CGDataConsumerRef consumer)
void CGDataConsumerRelease(CGDataConsumerRef consumer)
CGDataConsumerRef CGDataConsumerCreate(void *info, const CGDataConsumerCallbacks *callbacks)
CGDataConsumerRef CGDataConsumerCreateWithURL(CFURLRef url)
Definition: CGDataConsumer.h:62