Lines Matching defs:unit
87 char *lookupunit(const char *unit);
92 int completereduce(struct unittype * unit);
190 warnx("redefinition of unit '%s' on line %d ignored",
197 warnx("unexpected end of unit on line %d",
226 warnx("memory overflow in unit reduction");
287 warnx("unit reduces to zero");
291 Adds the specified string to the unit.
293 Quantity is 1 if this is a quantity to be converted rather than a pure unit.
454 Looks up the definition for the specified unit.
456 if the specified unit does not appear in the units table.
463 lookupunit(const char *unit)
469 if (!strcmp(unittable[i].uname, unit))
473 if (unit[strlen(unit) - 1] == '^') {
474 copy = dupstr(unit);
485 if (unit[strlen(unit) - 1] == 's') {
486 copy = dupstr(unit);
509 if (!strncmp(prefixtable[i].prefixname, unit, len)) {
510 if (!strlen(unit + len) || lookupunit(unit + len)) {
512 prefixtable[i].prefixval, unit + len);
528 bit 2 (4) set on if an unknown unit is discovered.
554 printf("unknown unit '%s'\n", *product);
573 Reduces numerator and denominator of the specified unit.
574 Returns 0 on success, or 1 on unknown unit error.
625 completereduce(struct unittype * unit)
627 if (reduceunit(unit))
629 sortunit(unit);
630 cancelunit(unit);
667 "usage: units [-f unitsfile] [-q] [-v] [from-unit to-unit]\n");