Lines Matching refs:fcode
78 static struct fcode *dictionary = NULL;
308 static int fadd(struct fcode *, struct fcode *);
309 static struct fcode *flookup(struct fcode *, const char *);
323 * Standard FCode names and numbers. Includes standard
326 static struct fcode fcodes[] = {
447 { "fcode-revision", 0x0087, 0, NULL, NULL },
634 { "fcode-version", 0x0212, 0, NULL, NULL },
637 { "suspend-fcode", 0x0215, 0, NULL, NULL },
674 /* 64-bit FCode extensions */
810 * Insert fcode into dictionary.
813 fadd(struct fcode *dict, struct fcode *new)
817 new->type = FCODE;
818 ASSERT(dict->type == FCODE);
821 * Duplicate entry. Give the old name the new FCode
832 printf("fadd: new FCode `%s' is %lx\n",
842 printf("fadd: new FCode `%s' is %lx\n",
854 static struct fcode *
855 flookup(struct fcode *dict, const char *str)
861 ASSERT(dict->type == FCODE);
939 struct fcode *code = fcodes;
945 code->type = FCODE;
1084 struct fcode *fcode;
1218 /* The next pass should tokenize the FCODE number */
1237 fcode = emalloc(sizeof(*fcode));
1238 fcode->num = nextfcode++;
1239 fcode->name = estrdup(token->text);
1240 if (!fadd(dictionary, fcode)) {
1243 printf("%s: duplicate FCode\n",
1245 free(__UNCONST(fcode->name));
1246 free(fcode);
1260 spit(fcode->num);
1262 last_token = fcode->name;
1324 if ((fcode = flookup(dictionary, token->text)) == NULL)
1327 spit(fcode->num);
1355 fcode = emalloc(sizeof(*fcode));
1356 fcode->num = nextfcode++;
1357 fcode->name = estrdup(token->text);
1358 fadd(dictionary, fcode);
1370 spit(fcode->num);
1388 fcode = emalloc(sizeof(*fcode));
1389 fcode->num = nextfcode++;
1390 fcode->name = estrdup(token->text);
1391 fadd(dictionary, fcode);
1403 spit(fcode->num);
1427 fcode = emalloc(sizeof(*fcode));
1428 fcode->num = nextfcode++;
1429 fcode->name = estrdup(token->text);
1430 fadd(dictionary, fcode);
1442 spit(fcode->num);
1508 fcode = emalloc(sizeof(*fcode));
1509 fcode->num = nextfcode++;
1510 fcode->name = estrdup(token->text);
1511 fadd(dictionary, fcode);
1523 spit(fcode->num);
1542 * it generates the FCode and returns, with outpos at b2. We then
1651 * the FCode header. But that's all done in main().
1665 fcode = emalloc(sizeof(*fcode));
1666 fcode->num = nextfcode++;
1667 fcode->name = estrdup(token->text);
1668 fadd(dictionary, fcode);
1680 spit(fcode->num);
1876 /* The next pass should tokenize the FCODE number */
1896 fcode = emalloc(sizeof(*fcode));
1897 fcode->num = nextfcode++;
1898 fcode->name = estrdup(token->text);
1899 fadd(dictionary, fcode);
1911 spit(fcode->num);
1924 fcode = emalloc(sizeof(*fcode));
1925 fcode->num = nextfcode++;
1926 fcode->name = estrdup(token->text);
1927 fadd(dictionary, fcode);
1939 spit(fcode->num);
2078 * Lookup fcode string in dictionary and spit it out.
2080 * Fcode must be in dictionary. No alias conversion done.
2085 struct fcode *code;
2120 * Spit out an FCode string.