summaryrefslogtreecommitdiff
path: root/support/dktools/test-dk4mai8dsz.ctr
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/dktools/test-dk4mai8dsz.ctr
Initial commit
Diffstat (limited to 'support/dktools/test-dk4mai8dsz.ctr')
-rw-r--r--support/dktools/test-dk4mai8dsz.ctr40
1 files changed, 40 insertions, 0 deletions
diff --git a/support/dktools/test-dk4mai8dsz.ctr b/support/dktools/test-dk4mai8dsz.ctr
new file mode 100644
index 0000000000..4cee4ab620
--- /dev/null
+++ b/support/dktools/test-dk4mai8dsz.ctr
@@ -0,0 +1,40 @@
+
+
+#include "dk4conf.h"
+
+#include <stdio.h>
+
+#include "dk4str8.h"
+#include "dk4mao8d.h"
+#include "dk4mai8dsz.h"
+
+
+
+int main(void)
+{
+ char buf[128];
+ char oub[128];
+ dk4_er_t er;
+ const char *endptr = NULL;
+ size_t um;
+ int res;
+ while(fgets(buf, sizeof(buf), stdin)) {
+ dk4str8_normalize(buf, NULL);
+ dk4error_init(&er);
+ res = dk4ma_input_c8_dec_size_t(&um, buf, &endptr, 1, &er);
+ if (0 != res) {
+ if (dk4ma_write_c8_decimal_unsigned(oub,sizeof(oub),(dk4_um_t)um,0,&er)) {
+ printf("Zahl gelesen: ");
+ fputs(oub, stdout);
+ printf("\n");
+ } else {
+ printf("Fehler beim String-Erzeugen!\n");
+ }
+ } else {
+ printf("Fehler beim Einlesen: %d\n", er.ec);
+ printf("Fehlerstelle: \"%s\"\n", (endptr ? endptr : "(NULL)"));
+ }
+ }
+ return 0;
+}
+