diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-11-21 09:56:28 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-11-21 09:56:28 +0100 |
commit | 45e1231149779c363c9abb78cc09e21d047c463f (patch) | |
tree | 111b91a23e747bb2c9df60b0170914cbbd74dec3 /assorted/unit2any.c | |
parent | d391e80c7378e6604c8f84538f27df8b915ebd2a (diff) | |
parent | 987942a206ef0f2342bf81d5de6432c6af42b7e7 (diff) |
Update upstream source from tag 'upstream/4.17'
Update to upstream version '4.17'
with Debian dir da192eda54f0b421cbc1b9ba383659593db8d3db
Diffstat (limited to 'assorted/unit2any.c')
-rw-r--r-- | assorted/unit2any.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/assorted/unit2any.c b/assorted/unit2any.c deleted file mode 100644 index 74e87d3..0000000 --- a/assorted/unit2any.c +++ /dev/null @@ -1,49 +0,0 @@ -#include <stdbool.h> -#include <stdlib.h> -#include <libHX/option.h> - -static double dpi = 96; - -static void px2any(const struct HXoptcb *cbi) -{ - double px = cbi->data_dbl; - - printf("%f px are (at %f DPI) equal to:\n", px, dpi); - printf("\t%f inch\n", px / dpi); - printf("\t%f pt\n", px * 72 / dpi); - printf("\t%f cm\n", px * 2.54 / dpi); -} - -static void pt2any(const struct HXoptcb *cbi) -{ - double pt = cbi->data_dbl; - - printf("%f pt are equal to:\n", pt); - printf("\t%f inch\n", pt / 72); - printf("\t%f px (at %f DPI)\n", dpi * pt / 72, dpi); - printf("\t%f cm\n", pt * 2.54 / 72); -} - -static const struct HXoption option_table[] = { - {.sh = 'D', .ln = "dpi", .type = HXTYPE_DOUBLE, .ptr = &dpi, - .help = "Resolution (default: 96 dpi)"}, - {.sh = 'P', .ln = "px", .type = HXTYPE_DOUBLE, .cb = px2any}, - {.sh = 'p', .ln = "pt", .type = HXTYPE_DOUBLE, .cb = pt2any}, - HXOPT_AUTOHELP, - HXOPT_TABLEEND, -}; - -static bool get_options(int *argc, const char ***argv) -{ -} - -int main(int argc, const char **argv) -{ - int ret; - - ret = HX_getopt(option_table, &argc, &argv, HXOPT_USAGEONERR); - if (ret != HXOPT_ERR_SUCCESS) - return EXIT_FAILURE; - - -} |