Lines Matching refs:fp

33      ERROR_OUT_WRITEERROR(fp)
34 ERROR_OUT_READERROR(fp)
35 ERROR_OUT_BUFERROR(fp)
36 ERROR_OUT_NOSUCCESS(fp) */
82 #define WRITE(fp,ptr,size) \
85 if (tio_write(fp,ptr,(size_t)size)) \
88 ERROR_OUT_WRITEERROR(fp); \
91 #define WRITE_TYPE(fp,field,type) \
92 WRITE(fp,&(field),sizeof(type))
94 #define WRITE_INT32(fp,i) \
97 WRITE_TYPE(fp,tmpint32,int32_t)
99 #define WRITE_STRING(fp,str) \
103 WRITE_INT32(fp,0); \
107 WRITE_INT32(fp,strlen(str)); \
109 { WRITE(fp,(str),tmpint32); } \
112 #define WRITE_STRINGLIST(fp,arr) \
116 WRITE_INT32(fp,0); \
125 WRITE_TYPE(fp,tmp3int32,int32_t); \
129 WRITE_STRING(fp,(arr)[tmp2int32]); \
133 #define WRITE_STRINGLIST_EXCEPT(fp,arr,not) \
141 WRITE_TYPE(fp,tmp3int32,int32_t); \
147 WRITE_STRING(fp,(arr)[tmp2int32]); \
159 #define READ(fp,ptr,size) \
160 if (tio_read(fp,ptr,(size_t)size)) \
163 ERROR_OUT_READERROR(fp); \
168 #define READ_TYPE(fp,field,type) \
169 READ(fp,&(field),sizeof(type))
171 #define READ_INT32(fp,i) \
172 READ_TYPE(fp,tmpint32,int32_t); \
177 #define READ_STRING(fp,buffer) \
179 READ_TYPE(fp,tmpint32,int32_t); \
186 ERROR_OUT_BUFERROR(fp); \
190 { READ(fp,buffer,(size_t)tmpint32); } \
210 #define BUF_CHECK(fp,sz) \
215 ERROR_OUT_BUFERROR(fp); \
224 #define BUF_ALIGN(fp,type) \
228 BUF_CHECK(fp,tmp2int32); \
232 #define BUF_ALLOC(fp,ptr,type,num) \
234 BUF_ALIGN(fp,type); \
236 BUF_CHECK(fp,(size_t)(num)*sizeof(type)); \
243 #define READ_BUF(fp,ptr,sz) \
245 BUF_CHECK(fp,sz); \
246 READ(fp,BUF_CUR,(size_t)sz); \
253 #define READ_BUF_STRING(fp,field) \
255 READ_TYPE(fp,tmpint32,int32_t); \
258 BUF_CHECK(fp,tmpint32+1); \
261 { READ(fp,BUF_CUR,(size_t)tmpint32); } \
271 #define READ_BUF_STRINGLIST(fp,arr) \
273 READ_TYPE(fp,tmp3int32,int32_t); \
276 BUF_ALLOC(fp,arr,char *,tmp3int32+1); \
280 READ_BUF_STRING(fp,(arr)[tmp2int32]); \
289 #define SKIP(fp,sz) \
292 if (tio_skip(fp,sz)) \
295 ERROR_OUT_READERROR(fp); \
299 #define SKIP_STRING(fp) \
301 READ_TYPE(fp,tmpint32,int32_t); \
304 SKIP(fp,tmpint32);
307 #define SKIP_STRINGLIST(fp) \
309 READ_TYPE(fp,tmp3int32,int32_t); \
314 SKIP_STRING(fp); \
327 #define NSLCD_REQUEST(fp,action,writefn) \
329 if ((fp=nslcd_client_open())==NULL) \
332 WRITE_INT32(fp,(int32_t)NSLCD_VERSION) \
333 WRITE_INT32(fp,(int32_t)action) \
337 if (tio_flush(fp)<0) \
340 ERROR_OUT_WRITEERROR(fp); \
343 READ_TYPE(fp,tmpint32,int32_t); \
345 { ERROR_OUT_READERROR(fp) } \
347 READ_TYPE(fp,tmpint32,int32_t); \
349 { ERROR_OUT_READERROR(fp) }
353 #define READ_RESPONSE_CODE(fp) \
354 READ_TYPE(fp,tmpint32,int32_t); \
356 { ERROR_OUT_NOSUCCESS(fp) }