Lines Matching defs:vt

24 void printVarType(FILE *f, const VarType *vt) {
26 if (vt->isConst) {
30 switch (vt->type) {
35 fprintf(f, "int%i_t", vt->bits);
38 fprintf(f, "uint%i_t", vt->bits);
41 if (vt->bits == 32)
47 fprintf(f, "%s", vt->typeName);
51 if (vt->ptrLevel) {
53 for (ct=0; ct < vt->ptrLevel; ct++) {
59 void printVarTypeAndName(FILE *f, const VarType *vt) {
60 printVarType(f, vt);
62 if (vt->name[0]) {
63 fprintf(f, " %s", vt->name);
168 const VarType *vt = &api->params[ct];
170 if (!vt->isConst && vt->ptrLevel) {
174 if (vt->ptrLevel > 1) {
179 if (vt->isConst && vt->ptrLevel) {
222 const VarType *vt = &api->params[ct2];
226 fprintf(f, "%s", vt->name);
236 const VarType *vt = &api->params[ct2];
240 fprintf(f, "%s", vt->name);
256 const VarType *vt = &api->params[ct2];
260 fprintf(f, "%s", vt->name);
273 const VarType *vt = &api->params[ct2];
274 if (vt->isConst && vt->ptrLevel) {
275 fprintf(f, " dataSize += %s_length;\n", vt->name);
294 const VarType *vt = &api->params[ct2];
295 needFlush += vt->ptrLevel;
296 if (vt->ptrLevel && hasInlineDataPointers(api)) {
298 fprintf(f, " memcpy(payload, %s, %s_length);\n", vt->name, vt->name);
299 fprintf(f, " cmd->%s = (", vt->name);
300 printVarType(f, vt);
302 fprintf(f, " payload += %s_length;\n", vt->name);
304 fprintf(f, " cmd->%s = %s;\n", vt->name, vt->name);
308 fprintf(f, " cmd->%s = %s;\n", vt->name, vt->name);
347 const VarType *vt = &api->params[ct2];
348 if (vt->ptrLevel == 0) {
349 fprintf(f, " io->%sWrite(& %s, sizeof(%s));\n", str, vt->name, vt->name);
355 const VarType *vt = &api->params[ct2];
356 if ((vt->ptrLevel == 1) && (vt->isConst)) {
357 fprintf(f, " io->%sWrite(%s, %s_length);\n", str, vt->name, vt->name);
363 const VarType *vt = &api->params[ct2];
364 if ((vt->ptrLevel == 2) && (vt->isConst)) {
365 fprintf(f, " for (size_t ct = 0; ct < (%s_length_length / sizeof(%s_length)); ct++) {\n", vt->name, vt->name);
366 fprintf(f, " io->%sWrite(%s[ct], %s_length[ct]);\n", str, vt->name, vt->name);
373 const VarType *vt = &api->params[ct2];
374 if ((vt->ptrLevel == 1) && (!vt->isConst)) {
375 fprintf(f, " io->%sGetReturn(%s, %s_length);\n", str, vt->name, vt->name);
381 const VarType *vt = &api->params[ct2];
382 if ((vt->ptrLevel == 2) && (!vt->isConst)) {
383 fprintf(f, " for (size_t ct = 0; ct < (%s_length_length / sizeof(%s_length)); ct++) {\n", vt->name, vt->name);
384 fprintf(f, " io->%sGetReturn(%s[ct], %s_length[ct]);\n", str, vt->name, vt->name);
436 const VarType *vt = &api->params[ct2];
440 fprintf(f, "%s", vt->name);
488 const VarType *vt = &api->params[ct2];
489 needFlush += vt->ptrLevel;
491 if (hasInlineDataPointers(api) && vt->ptrLevel) {
492 fprintf(f, ",\n (const %s *)&baseData[(intptr_t)cmd->%s]", vt->typeName, vt->name);
494 fprintf(f, ",\n cmd->%s", vt->name);
527 const VarType *vt = &api->params[ct2];
528 if (vt->ptrLevel == 0) {
529 fprintf(f, " io->coreRead(&cmd.%s, sizeof(cmd.%s));\n", vt->name, vt->name);
535 const VarType *vt = &api->params[ct2];
536 if (vt->ptrLevel == 1) {
537 fprintf(f, " cmd.%s = (", vt->name);
538 printVarType(f, vt);
539 fprintf(f, ")malloc(cmd.%s_length);\n", vt->name);
541 if (vt->isConst) {
542 fprintf(f, " if (cmd.%s_length) io->coreRead((void *)cmd.%s, cmd.%s_length);\n", vt->name, vt->name, vt->name);
549 const VarType *vt = &api->params[ct2];
550 if (vt->ptrLevel == 2) {
551 fprintf(f, " for (size_t ct = 0; ct < (cmd.%s_length_length / sizeof(cmd.%s_length)); ct++) {\n", vt->name, vt->name);
552 fprintf(f, " cmd.%s = (", vt->name);
553 printVarType(f, vt);
554 fprintf(f, ")malloc(cmd.%s_length[ct]);\n", vt->name);
555 fprintf(f, " io->coreRead(& cmd.%s, cmd.%s_length[ct]);\n", vt->name, vt->name);
572 const VarType *vt = &api->params[ct2];
576 fprintf(f, " cmd.%s", vt->name);
581 const VarType *vt = &api->params[ct2];
582 if ((vt->ptrLevel == 1) && (!vt->isConst)) {
583 fprintf(f, " io->coreSetReturn((void *)cmd.%s, cmd.%s_length);\n", vt->name, vt->name);
588 const VarType *vt = &api->params[ct2];
589 if ((vt->ptrLevel == 2) && (!vt->isConst)) {
590 fprintf(f, " for (size_t ct = 0; ct < (cmd.%s_length_length / sizeof(cmd.%s_length)); ct++) {\n", vt->name, vt->name);
591 fprintf(f, " io->coreSetReturn((void *)cmd.%s[ct], cmd.%s_length[ct]);\n", vt->name, vt->name);
604 const VarType *vt = &api->params[ct2];
605 if (vt->ptrLevel == 1) {
606 fprintf(f, " free((void *)cmd.%s);\n", vt->name);
610 const VarType *vt = &api->params[ct2];
611 if (vt->ptrLevel == 2) {
612 fprintf(f, " for (size_t ct = 0; ct < (cmd.%s_length_length / sizeof(cmd.%s_length)); ct++) {\n", vt->name, vt->name);
613 fprintf(f, " free((void *)cmd.%s);\n", vt->name);