Lines Matching refs:fld
57 Field* fld = (Field*) calloc(1, sizeof(Field));
61 fld->next = cmd->fields;
62 cmd->fields = fld;
63 fld->name = name;
64 fld->visible = 1;
65 fld->offset = offset;
73 Field* fld = (Field*) calloc(1, sizeof(Field));
74 fld->next = cmd->fields;
75 cmd->fields = fld;
76 fld->name = NULL;
77 fld->visible = 0;
78 fld->size = size;
79 fld->offset = offset;
80 fld->value = value;
394 void OutputFields(Field* fld) {
398 if (fld != NULL) {
399 OutputFields(fld->next);
400 if (fld->visible) {
401 printf(" uint16_t %s;\n", fld->name);
408 int OutputBytes_(Command* cmd, Field* fld) {
414 if (fld != NULL) {
415 cursor = OutputBytes_(cmd, fld->next);
419 if (!fld->visible) {
423 assert(fld->offset >= cursor);
424 for (i = 0; i < fld->offset - cursor; i++) {
427 cursor = fld->offset;
428 switch (fld->size) {
430 printf("0x%x, ", fld->value);
434 printf("0x%x, 0x%x, ", fld->value >> 8, fld->value & 0xff);
438 printf("0x%x, 0x%x, 0x%x, 0x%x, ", fld->value >> 24,
439 (fld->value >> 16) & 0xff,
440 (fld->value >> 8) & 0xff,
441 fld->value & 0xff);
445 fprintf(stderr, "invalid field size %d\n", fld->size);
459 void OutputFieldPointers(Command* cmd, Field* fld) {
460 if (fld == NULL) {
463 OutputFieldPointers(cmd, fld->next);
464 if (fld->visible) {
465 printf("%d, ", fld->offset);
515 static void FreeFields(Field* fld) {
516 if (fld != NULL) {
517 Field* next_field = fld->next;
518 free(fld);