summaryrefslogtreecommitdiff
path: root/libmailutils/string/str_to_c.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmailutils/string/str_to_c.c')
-rw-r--r--libmailutils/string/str_to_c.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/libmailutils/string/str_to_c.c b/libmailutils/string/str_to_c.c
index 478dc0c81..94d885f7e 100644
--- a/libmailutils/string/str_to_c.c
+++ b/libmailutils/string/str_to_c.c
@@ -1,5 +1,5 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
- Copyright (C) 2016-2019 Free Software Foundation, Inc.
+ Copyright (C) 2016-2024 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -31,6 +31,7 @@
#include <mailutils/cctype.h>
#include <mailutils/io.h>
#include <mailutils/nls.h>
+#include <mailutils/cstr.h>
typedef int (*str_to_c_t) (void *tgt, char const *string, char **errmsg);
@@ -245,6 +246,12 @@ to_incr (void *tgt, char const *string, char **errmsg)
return 0;
}
+static int
+to_hsize (void *tgt, char const *string, char **errmsg)
+{
+ return mu_strtosize (string, NULL, tgt);
+}
+
static str_to_c_t str_to_c[] = {
[mu_c_string] = to_string,
[mu_c_short] = to_short,
@@ -254,13 +261,14 @@ static str_to_c_t str_to_c[] = {
[mu_c_long] = to_long,
[mu_c_ulong] = to_ulong,
[mu_c_size] = to_size_t,
+ [mu_c_hsize] = to_hsize,
/* FIXME [mu_c_off] = { to_off, generic_dealloc }, */
[mu_c_time] = to_time_t,
[mu_c_bool] = to_bool,
/* FIXME [mu_c_ipv4] = to_ipv4, */
[mu_c_cidr] = to_cidr,
/* FIXME [mu_c_host] = { to_host, generic_dealloc } */
- [mu_c_incr] = to_incr
+ [mu_c_incr] = to_incr,
};
char const *mu_c_type_str[] = {
@@ -272,6 +280,7 @@ char const *mu_c_type_str[] = {
[mu_c_long] = "mu_c_long",
[mu_c_ulong] = "mu_c_ulong",
[mu_c_size] = "mu_c_size",
+ [mu_c_hsize] = "mu_c_hsize",
[mu_c_off] = "mu_c_off",
[mu_c_time] = "mu_c_time",
[mu_c_bool] = "mu_c_bool",
@@ -279,7 +288,7 @@ char const *mu_c_type_str[] = {
[mu_c_cidr] = "mu_c_cidr",
[mu_c_host] = "mu_c_host",
[mu_c_incr] = "mu_c_incr",
- [mu_c_void] = "mu_c_void"
+ [mu_c_void] = "mu_c_void",
};
int

Return to:

Send suggestions and report system problems to the System administrator.