Lines Matching refs:vt

24 void printVarType(FILE *f, const VarType *vt) {  in printVarType()  argument
26 if (vt->isConst) { in printVarType()
30 switch (vt->type) { in printVarType()
35 fprintf(f, "int%i_t", vt->bits); in printVarType()
38 fprintf(f, "uint%i_t", vt->bits); in printVarType()
41 if (vt->bits == 32) in printVarType()
47 fprintf(f, "%s", vt->typeName); in printVarType()
51 if (vt->ptrLevel) { in printVarType()
53 for (ct=0; ct < vt->ptrLevel; ct++) { in printVarType()
59 void printVarTypeAndName(FILE *f, const VarType *vt) { in printVarTypeAndName() argument
60 printVarType(f, vt); in printVarTypeAndName()
62 if (vt->name[0]) { in printVarTypeAndName()
63 fprintf(f, " %s", vt->name); in printVarTypeAndName()
168 const VarType *vt = &api->params[ct]; in hasInlineDataPointers() local
170 if (!vt->isConst && vt->ptrLevel) { in hasInlineDataPointers()
174 if (vt->ptrLevel > 1) { in hasInlineDataPointers()
179 if (vt->isConst && vt->ptrLevel) { in hasInlineDataPointers()
222 const VarType *vt = &api->params[ct2]; in printApiCpp() local
226 fprintf(f, "%s", vt->name); in printApiCpp()
236 const VarType *vt = &api->params[ct2]; in printApiCpp() local
240 fprintf(f, "%s", vt->name); in printApiCpp()
256 const VarType *vt = &api->params[ct2]; in printApiCpp() local
260 fprintf(f, "%s", vt->name); in printApiCpp()
273 const VarType *vt = &api->params[ct2]; in printApiCpp() local
274 if (vt->isConst && vt->ptrLevel) { in printApiCpp()
275 fprintf(f, " dataSize += %s_length;\n", vt->name); in printApiCpp()
294 const VarType *vt = &api->params[ct2]; in printApiCpp() local
295 needFlush += vt->ptrLevel; in printApiCpp()
296 if (vt->ptrLevel && hasInlineDataPointers(api)) { in printApiCpp()
297 fprintf(f, " if (%s_length == 0) {\n", vt->name); in printApiCpp()
298 fprintf(f, " cmd->%s = NULL;\n", vt->name); in printApiCpp()
300 fprintf(f, " memcpy(payload, %s, %s_length);\n", vt->name, vt->name); in printApiCpp()
301 fprintf(f, " cmd->%s = (", vt->name); in printApiCpp()
302 printVarType(f, vt); in printApiCpp()
304 fprintf(f, " payload += %s_length;\n", vt->name); in printApiCpp()
306 fprintf(f, " cmd->%s = %s;\n", vt->name, vt->name); in printApiCpp()
310 fprintf(f, " cmd->%s = %s;\n", vt->name, vt->name); in printApiCpp()
349 const VarType *vt = &api->params[ct2]; in printApiCpp() local
350 if (vt->ptrLevel == 0) { in printApiCpp()
351 fprintf(f, " io->%sWrite(& %s, sizeof(%s));\n", str, vt->name, vt->name); in printApiCpp()
357 const VarType *vt = &api->params[ct2]; in printApiCpp() local
358 if ((vt->ptrLevel == 1) && (vt->isConst)) { in printApiCpp()
359 fprintf(f, " io->%sWrite(%s, %s_length);\n", str, vt->name, vt->name); in printApiCpp()
365 const VarType *vt = &api->params[ct2]; in printApiCpp() local
366 if ((vt->ptrLevel == 2) && (vt->isConst)) { in printApiCpp()
367 … for (size_t ct = 0; ct < (%s_length_length / sizeof(%s_length)); ct++) {\n", vt->name, vt->name); in printApiCpp()
368 … fprintf(f, " io->%sWrite(%s[ct], %s_length[ct]);\n", str, vt->name, vt->name); in printApiCpp()
375 const VarType *vt = &api->params[ct2]; in printApiCpp() local
376 if ((vt->ptrLevel == 1) && (!vt->isConst)) { in printApiCpp()
377 fprintf(f, " io->%sGetReturn(%s, %s_length);\n", str, vt->name, vt->name); in printApiCpp()
383 const VarType *vt = &api->params[ct2]; in printApiCpp() local
384 if ((vt->ptrLevel == 2) && (!vt->isConst)) { in printApiCpp()
385 … for (size_t ct = 0; ct < (%s_length_length / sizeof(%s_length)); ct++) {\n", vt->name, vt->name); in printApiCpp()
386 … fprintf(f, " io->%sGetReturn(%s[ct], %s_length[ct]);\n", str, vt->name, vt->name); in printApiCpp()
438 const VarType *vt = &api->params[ct2]; in printApiCpp() local
442 fprintf(f, "%s", vt->name); in printApiCpp()
490 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
491 needFlush += vt->ptrLevel; in printPlaybackCpp()
493 if (hasInlineDataPointers(api) && vt->ptrLevel) { in printPlaybackCpp()
495 vt->name, vt->typeName, vt->name); in printPlaybackCpp()
497 fprintf(f, ",\n cmd->%s", vt->name); in printPlaybackCpp()
530 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
531 if (vt->ptrLevel == 0) { in printPlaybackCpp()
532 fprintf(f, " io->coreRead(&cmd.%s, sizeof(cmd.%s));\n", vt->name, vt->name); in printPlaybackCpp()
538 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
539 if (vt->ptrLevel == 1) { in printPlaybackCpp()
540 fprintf(f, " cmd.%s = (", vt->name); in printPlaybackCpp()
541 printVarType(f, vt); in printPlaybackCpp()
542 fprintf(f, ")malloc(cmd.%s_length);\n", vt->name); in printPlaybackCpp()
544 if (vt->isConst) { in printPlaybackCpp()
545 … if (cmd.%s_length) io->coreRead((void *)cmd.%s, cmd.%s_length);\n", vt->name, vt->name, vt->name); in printPlaybackCpp()
552 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
553 if (vt->ptrLevel == 2) { in printPlaybackCpp()
554 …ize_t ct = 0; ct < (cmd.%s_length_length / sizeof(cmd.%s_length)); ct++) {\n", vt->name, vt->name); in printPlaybackCpp()
555 fprintf(f, " cmd.%s = (", vt->name); in printPlaybackCpp()
556 printVarType(f, vt); in printPlaybackCpp()
557 fprintf(f, ")malloc(cmd.%s_length[ct]);\n", vt->name); in printPlaybackCpp()
558 … fprintf(f, " io->coreRead(& cmd.%s, cmd.%s_length[ct]);\n", vt->name, vt->name); in printPlaybackCpp()
575 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
579 fprintf(f, " cmd.%s", vt->name); in printPlaybackCpp()
584 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
585 if ((vt->ptrLevel == 1) && (!vt->isConst)) { in printPlaybackCpp()
586 … fprintf(f, " io->coreSetReturn((void *)cmd.%s, cmd.%s_length);\n", vt->name, vt->name); in printPlaybackCpp()
591 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
592 if ((vt->ptrLevel == 2) && (!vt->isConst)) { in printPlaybackCpp()
593 …ize_t ct = 0; ct < (cmd.%s_length_length / sizeof(cmd.%s_length)); ct++) {\n", vt->name, vt->name); in printPlaybackCpp()
594 …intf(f, " io->coreSetReturn((void *)cmd.%s[ct], cmd.%s_length[ct]);\n", vt->name, vt->name); in printPlaybackCpp()
607 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
608 if (vt->ptrLevel == 1) { in printPlaybackCpp()
609 fprintf(f, " free((void *)cmd.%s);\n", vt->name); in printPlaybackCpp()
613 const VarType *vt = &api->params[ct2]; in printPlaybackCpp() local
614 if (vt->ptrLevel == 2) { in printPlaybackCpp()
615 …ize_t ct = 0; ct < (cmd.%s_length_length / sizeof(cmd.%s_length)); ct++) {\n", vt->name, vt->name); in printPlaybackCpp()
616 fprintf(f, " free((void *)cmd.%s);\n", vt->name); in printPlaybackCpp()