From: Martin Mares Date: Fri, 25 Jul 2014 11:11:16 +0000 (+0200) Subject: Extended types: Moved unit tables to a more logical place in the header X-Git-Tag: v6.1~3^2~43^2~3 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=49bf71eff0a0b6342a2cedb2ae4108fa26ee52ad;p=libucw.git Extended types: Moved unit tables to a more logical place in the header --- diff --git a/ucw/xtypes.h b/ucw/xtypes.h index 3bf96568..f0e89277 100644 --- a/ucw/xtypes.h +++ b/ucw/xtypes.h @@ -74,23 +74,6 @@ typedef const char * (*xtype_fmt_parser)(const char *str, u32 *dest, struct memp **/ typedef const char * (*xtype_fmt_formatter)(u32 fmt, struct mempool *pool); -/** - * Definition of the units that are appended to an xtype value. The value with units is represented - * by the following string: "". The final value of the of the string is computed using - * the following formula: * /. - **/ -struct unit_definition { - const char *unit; // string representation of unit - u64 num; - u64 denom; -}; - -/** - * Parse a name of a unit and return its index in the @units array or -1 - * if is not present there. - **/ -int xtype_unit_parser(const char *str, struct unit_definition *units); - /** * This structure describes an xtype. Among other things, it points to callback * functions handling this xtype. @@ -134,4 +117,23 @@ extern const struct xtype xt_double; #define XTYPE_FMT_DBL_FIXED_PREC(_prec) (_prec | XTYPE_FMT_DBL_PREC) #define XTYPE_FMT_DBL_PREC XTYPE_FMT_CUSTOM +/* Tables of units, provided as convenience for the implementations of xtypes */ + +/** + * Definition of the units that are appended to an xtype value. The value with units is represented + * by the following string: "". The final value of the of the string is computed using + * the following formula: * /. + **/ +struct unit_definition { + const char *unit; // string representation of unit + u64 num; + u64 denom; +}; + +/** + * Parse a name of a unit and return its index in the @units array or -1 + * if is not present there. + **/ +int xtype_unit_parser(const char *str, struct unit_definition *units); + #endif