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()
168 static int hasInlineDataPointers(const ApiEntry * api) { in hasInlineDataPointers() argument
171 if (api->sync || api->ret.typeName[0]) { in hasInlineDataPointers()
174 for (ct=0; ct < api->paramCount; ct++) { in hasInlineDataPointers()
175 const VarType *vt = &api->params[ct]; in hasInlineDataPointers()
214 const ApiEntry * api = &apis[ct]; in printApiCpp() local
217 printFuncDecl(f, api, LOCAL_FIFO_PREFIX, 0, 0); in printApiCpp()
219 if (api->direct) { in printApiCpp()
221 if (api->ret.typeName[0]) { in printApiCpp()
224 fprintf(f, RS_INTERNAL_PREFIX "%s(", api->name); in printApiCpp()
225 if (!api->nocontext) { in printApiCpp()
228 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
229 const VarType *vt = &api->params[ct2]; in printApiCpp()
230 if (ct2 > 0 || !api->nocontext) { in printApiCpp()
236 } else if (api->handcodeApi) { in printApiCpp()
238 fprintf(f, " " LOCAL_FIFO_PREFIX "%s_handcode(", api->name); in printApiCpp()
239 if (!api->nocontext) { in printApiCpp()
242 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
243 const VarType *vt = &api->params[ct2]; in printApiCpp()
244 if (ct2 > 0 || !api->nocontext) { in printApiCpp()
255 if (api->ret.typeName[0]) { in printApiCpp()
258 fprintf(f, RS_INTERNAL_PREFIX "%s(", api->name); in printApiCpp()
259 if (!api->nocontext) { in printApiCpp()
262 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
263 const VarType *vt = &api->params[ct2]; in printApiCpp()
264 if (ct2 > 0 || !api->nocontext) { in printApiCpp()
270 if (!api->ret.typeName[0]) { in printApiCpp()
276 fprintf(f, " const size_t size = sizeof(RS_CMD_%s);\n", api->name); in printApiCpp()
277 if (hasInlineDataPointers(api)) { in printApiCpp()
279 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
280 const VarType *vt = &api->params[ct2]; in printApiCpp()
288 if (hasInlineDataPointers(api)) { in printApiCpp()
289 fprintf(f, " RS_CMD_%s *cmd = NULL;\n", api->name); in printApiCpp()
291 …static_cast<RS_CMD_%s *>(io->coreHeader(RS_CMD_ID_%s, dataSize + size));\n", api->name, api->name); in printApiCpp()
293 … cmd = static_cast<RS_CMD_%s *>(io->coreHeader(RS_CMD_ID_%s, size));\n", api->name, api->name); in printApiCpp()
297 …static_cast<RS_CMD_%s *>(io->coreHeader(RS_CMD_ID_%s, size));\n", api->name, api->name, api->name); in printApiCpp()
300 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
301 const VarType *vt = &api->params[ct2]; in printApiCpp()
303 if (vt->ptrLevel && hasInlineDataPointers(api)) { in printApiCpp()
320 if (api->ret.typeName[0] || api->sync) { in printApiCpp()
325 if (hasInlineDataPointers(api)) { in printApiCpp()
329 } else if (api->ret.typeName[0]) { in printApiCpp()
331 printVarType(f, &api->ret); in printApiCpp()
345 const ApiEntry * api = &apis[ct]; in printApiCpp() local
349 printFuncDecl(f, api, "rs", 0, 0); in printApiCpp()
352 if (api->ret.typeName[0]) { in printApiCpp()
355 fprintf(f, LOCAL_FIFO_PREFIX "%s(", api->name); in printApiCpp()
357 if (!api->nocontext) { in printApiCpp()
361 for (ct2=0; ct2 < api->paramCount; ct2++) { in printApiCpp()
362 const VarType *vt = &api->params[ct2]; in printApiCpp()
363 if (ct2 > 0 || !api->nocontext) { in printApiCpp()
392 const ApiEntry * api = &apis[ct]; in printPlaybackCpp() local
395 if (api->direct) { in printPlaybackCpp()
399 …"void " RS_PLAYBACK_PREFIX "%s(Context *con, const void *vp, size_t cmdSizeBytes) {\n", api->name); in printPlaybackCpp()
400 …rintf(f, " const RS_CMD_%s *cmd = static_cast<const RS_CMD_%s *>(vp);\n", api->name, api->name); in printPlaybackCpp()
402 if (hasInlineDataPointers(api)) { in printPlaybackCpp()
404 fprintf(f, " if (cmdSizeBytes != sizeof(RS_CMD_%s)) {\n", api->name); in printPlaybackCpp()
410 if (api->ret.typeName[0]) { in printPlaybackCpp()
412 printVarType(f, &api->ret); in printPlaybackCpp()
415 fprintf(f, RS_INTERNAL_PREFIX "%s(con", api->name); in printPlaybackCpp()
416 for (ct2=0; ct2 < api->paramCount; ct2++) { in printPlaybackCpp()
417 const VarType *vt = &api->params[ct2]; in printPlaybackCpp()
420 if (hasInlineDataPointers(api) && vt->ptrLevel) { in printPlaybackCpp()
429 if (hasInlineDataPointers(api)) { in printPlaybackCpp()
431 for (ct2=0; ct2 < api->paramCount; ct2++) { in printPlaybackCpp()
432 if (api->params[ct2].ptrLevel) { in printPlaybackCpp()
433 fprintf(f, " totalSize += cmd->%s_length;\n", api->params[ct2].name); in printPlaybackCpp()
437 … fprintf(f, " if ((totalSize != 0) && (cmdSizeBytes == sizeof(RS_CMD_%s))) {\n", api->name); in printPlaybackCpp()
440 } else if (api->ret.typeName[0]) { in printPlaybackCpp()
442 } else if (api->sync || needFlush) { in printPlaybackCpp()