Lines Matching refs:api

85 void printArgList(FILE *f, const ApiEntry * api, int assumePrevious) {  in printArgList()  argument
87 for (ct=0; ct < api->paramCount; ct++) { in printArgList()
91 printVarTypeAndName(f, &api->params[ct]); in printArgList()
105 const ApiEntry * api = &apis[ct]; in printStructures() local
106 fprintf(f, "#define RS_CMD_ID_%s %i\n", api->name, ct+1); in printStructures()
107 fprintf(f, "struct __attribute__((packed)) RS_CMD_%s_rec {\n", api->name); in printStructures()
110 for (ct2=0; ct2 < api->paramCount; ct2++) { in printStructures()
112 printVarTypeAndName(f, &api->params[ct2]); in printStructures()
119 void printFuncDecl(FILE *f, const ApiEntry *api, const char *prefix, int addContext, int isFnPtr) { in printFuncDecl() argument
120 printVarTypeAndName(f, &api->ret); in printFuncDecl()
123 strncpy(t, api->name, sizeof(t)-1); in printFuncDecl()
130 fprintf(f, " (* %s%s) (", prefix, api->name); in printFuncDecl()
132 fprintf(f, " %s%s (", prefix, api->name); in printFuncDecl()
134 if (!api->nocontext) { in printFuncDecl()
141 printArgList(f, api, !api->nocontext); in printFuncDecl()
171 static int hasInlineDataPointers(const ApiEntry * api) { in hasInlineDataPointers() argument
174 if (api->sync || api->ret.typeName[0]) { in hasInlineDataPointers()
177 for (ct=0; ct < api->paramCount; ct++) { in hasInlineDataPointers()
178 const VarType *vt = &api->params[ct]; in hasInlineDataPointers()
217 const ApiEntry * api = &apis[ct]; in printApiCpp() local
220 printFuncDecl(f, api, LOCAL_FIFO_PREFIX, 0, 0); in printApiCpp()
222 if (api->direct) { in printApiCpp()
224 if (api->ret.typeName[0]) { in printApiCpp()
227 fprintf(f, RS_INTERNAL_PREFIX "%s(", api->name); in printApiCpp()
228 if (!api->nocontext) { in printApiCpp()
231 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
232 const VarType *vt = &api->params[ct2]; in printApiCpp()
233 if (ct2 > 0 || !api->nocontext) { in printApiCpp()
239 } else if (api->handcodeApi) { in printApiCpp()
241 fprintf(f, " " LOCAL_FIFO_PREFIX "%s_handcode(", api->name); in printApiCpp()
242 if (!api->nocontext) { in printApiCpp()
245 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
246 const VarType *vt = &api->params[ct2]; in printApiCpp()
247 if (ct2 > 0 || !api->nocontext) { in printApiCpp()
258 if (api->ret.typeName[0]) { in printApiCpp()
261 fprintf(f, RS_INTERNAL_PREFIX "%s(", api->name); in printApiCpp()
262 if (!api->nocontext) { in printApiCpp()
265 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
266 const VarType *vt = &api->params[ct2]; in printApiCpp()
267 if (ct2 > 0 || !api->nocontext) { in printApiCpp()
273 if (!api->ret.typeName[0]) { in printApiCpp()
279 fprintf(f, " const size_t size = sizeof(RS_CMD_%s);\n", api->name); in printApiCpp()
280 if (hasInlineDataPointers(api)) { in printApiCpp()
282 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
283 const VarType *vt = &api->params[ct2]; in printApiCpp()
291 if (hasInlineDataPointers(api)) { in printApiCpp()
292 fprintf(f, " RS_CMD_%s *cmd = NULL;\n", api->name); in printApiCpp()
294 …static_cast<RS_CMD_%s *>(io->coreHeader(RS_CMD_ID_%s, dataSize + size));\n", api->name, api->name); in printApiCpp()
296 … cmd = static_cast<RS_CMD_%s *>(io->coreHeader(RS_CMD_ID_%s, size));\n", api->name, api->name); in printApiCpp()
300 …static_cast<RS_CMD_%s *>(io->coreHeader(RS_CMD_ID_%s, size));\n", api->name, api->name, api->name); in printApiCpp()
303 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
304 const VarType *vt = &api->params[ct2]; in printApiCpp()
306 if (vt->ptrLevel && hasInlineDataPointers(api)) { in printApiCpp()
323 if (api->ret.typeName[0] || api->sync) { in printApiCpp()
328 if (hasInlineDataPointers(api)) { in printApiCpp()
332 } else if (api->ret.typeName[0]) { in printApiCpp()
334 printVarType(f, &api->ret); in printApiCpp()
348 const ApiEntry * api = &apis[ct]; in printApiCpp() local
352 printFuncDecl(f, api, "rs", 0, 0); in printApiCpp()
355 if (api->ret.typeName[0]) { in printApiCpp()
358 fprintf(f, LOCAL_FIFO_PREFIX "%s(", api->name); in printApiCpp()
360 if (!api->nocontext) { in printApiCpp()
364 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
365 const VarType *vt = &api->params[ct2]; in printApiCpp()
366 if (ct2 > 0 || !api->nocontext) { in printApiCpp()
395 const ApiEntry * api = &apis[ct]; in printPlaybackCpp() local
398 if (api->direct) { in printPlaybackCpp()
402 …"void " RS_PLAYBACK_PREFIX "%s(Context *con, const void *vp, size_t cmdSizeBytes) {\n", api->name); in printPlaybackCpp()
403 …rintf(f, " const RS_CMD_%s *cmd = static_cast<const RS_CMD_%s *>(vp);\n", api->name, api->name); in printPlaybackCpp()
405 if (hasInlineDataPointers(api)) { in printPlaybackCpp()
407 fprintf(f, " if (cmdSizeBytes != sizeof(RS_CMD_%s)) {\n", api->name); in printPlaybackCpp()
413 if (api->ret.typeName[0]) { in printPlaybackCpp()
415 printVarType(f, &api->ret); in printPlaybackCpp()
418 fprintf(f, RS_INTERNAL_PREFIX "%s(con", api->name); in printPlaybackCpp()
419 for (ct2=0; ct2 < api->paramCount; ct2++) { in printPlaybackCpp()
420 const VarType *vt = &api->params[ct2]; in printPlaybackCpp()
423 if (hasInlineDataPointers(api) && vt->ptrLevel) { in printPlaybackCpp()
432 if (hasInlineDataPointers(api)) { in printPlaybackCpp()
434 for (ct2=0; ct2 < api->paramCount; ct2++) { in printPlaybackCpp()
435 if (api->params[ct2].ptrLevel) { in printPlaybackCpp()
436 fprintf(f, " totalSize += cmd->%s_length;\n", api->params[ct2].name); in printPlaybackCpp()
440 … fprintf(f, " if ((totalSize != 0) && (cmdSizeBytes == sizeof(RS_CMD_%s))) {\n", api->name); in printPlaybackCpp()
443 } else if (api->ret.typeName[0]) { in printPlaybackCpp()
445 } else if (api->sync || needFlush) { in printPlaybackCpp()