aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2013-08-08 16:30:56 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2013-08-08 17:48:18 +0300
commit13a46fd53e76974346ae8692e036fef1d1fe8fcd (patch)
tree3a81868036335dc2e15eb8ce81db55da48c6e2d7 /src/main.c
parentbaddd4eb91a95add6ef92ead7bdbdc7dcdb0c3ee (diff)
downloadmailfromd-13a46fd53e76974346ae8692e036fef1d1fe8fcd.tar.gz
mailfromd-13a46fd53e76974346ae8692e036fef1d1fe8fcd.tar.bz2
Get rid of gnulib.
* .gitmodules: Remove gnulib. * gnulib: Remove. * gnulib.modules: Remove. * Makefile.am: Remove gnulib. Use git2chg.awk to create ChangeLog. * bootstrap: Rewrite. * bootstrap.conf: Remove. * configure.ac: Update. * gacopyz/Makefile.am (AM_CPPFLAGS): Update. * git2chg.awk: New file. * lib/Makefile.am: Remove dependencies on gnulib. * mtasim/Makefile.am: Likewise. * pmult/Makefile.am: Likewise. * src/Makefile.am: Likewise. * src/builtin/Makefile.am: Likewise. * lib/gettext.h: New file. * lib/.gitignore: New file. * lib/obstack.c: New file. * lib/obstack.h_: New file. * lib/ftimestr.c (format_time_str): Rewrite using strftime and statically allocated buffer. * lib/libmf.h (transform_error_string): Change return type (const char *). * lib/proctitle.c: Rewrite using statically allocated buffer. * lib/transform.c: Use mu_ allocation and ctype functions. (transform_error_string): Use statically allocated buffer. Return a pointer to its content. * mtasim/mtasim.c Use mu_ allocation and ctype functions. (save_cwd, restore_cwd): New functions * lib/db.c: Use mu_ allocation and ctype functions. * lib/dbcfg.c: Likewise. * lib/dict.c: Likewise. * lib/dns.c: Likewise. * lib/namefixup.c: Likewise. * lib/optcache.c: Likewise. * lib/parsetime.c: Likewise. * lib/server.c: Likewise. * lib/srvman.c: Likewise. * lib/userprivs.c: Likewise. * lib/utils.c: Likewise. * pmult/pmult.c: Likewise. * src/bitmask.h: Likewise. * src/builtin/burst.bi: Likewise. * src/builtin/ctype.bi: Likewise. * src/builtin/db.bi: Likewise. * src/builtin/dns.bi: Likewise. * src/builtin/dspam.bi: Likewise. * src/builtin/getopt.bi: Likewise. * src/builtin/getpw.bi: Likewise. * src/builtin/mbox.bi: Likewise. * src/builtin/msg.bi: Likewise. * src/builtin/sprintf.bi: Likewise. * src/callout.h: Likewise. * src/calloutd.c: Likewise. * src/deprecation.c: Likewise. * src/engine.c: Likewise. * src/exclist.c: Likewise. * src/gram.y: Likewise. * src/lex.l: Likewise. * src/mailfromd.h: Likewise. * src/main.c: Likewise. * src/mfdbtool.c: Likewise. * src/pp.c: Likewise. * src/pragma.c: Likewise. * src/prog.c: Likewise. * src/srvcfg.c: Likewise. * src/stack.c: Likewise. * src/symbols.c: Likewise. * src/callout.c: Likewise. * po/.gitignore: Update. * po/Makevars: New file. * src/builtin/io.bi: Use mu_ allocation and ctype functions. (stderr_to_log): Use fgets instead of getline. * src/builtin/system.bi (strftime): Use statically allocated buffer and strftime. * src/savsrv.c: Use mu_ allocation and ctype functions. (trimcrlf): Return 0 if theCR(LF) has been removed and 1 otherwise. (callout_session_server): Use statically allocated buffer. Reject input lines that are longer than allowed by its capacity. * src/spf.c: Use mu_ allocation and ctype functions. (scanback): New function. (spf_reverse,spf_truncate): Use scanback instead of memrchr.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/main.c b/src/main.c
index b432627a..5fbc3682 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,7 +42,6 @@
#include "mailfromd.h"
#include "callout.h"
#include "srvman.h"
-#include "inttostr.h"
#include "srvcfg.h"
#include "filenames.h"
#include "builtin.h"
@@ -92,9 +91,9 @@ add_pp_option(const char *opt, const char *arg)
len = 1 + strlen(opt) + (arg ? strlen(arg) : 0);
if (ext_pp_options) {
len += strlen(ext_pp_options);
- ext_pp_options = xrealloc(ext_pp_options, len + 1);
+ ext_pp_options = mu_realloc(ext_pp_options, len + 1);
} else {
- ext_pp_options = xmalloc(len + 1);
+ ext_pp_options = mu_alloc(len + 1);
ext_pp_options[0] = 0;
}
strcat(ext_pp_options, " ");
@@ -202,12 +201,12 @@ read_domain_file(const char *name)
while (p = fgets(buf, sizeof buf, fp)) {
char *q;
- while (*p && c_isspace(*p))
+ while (*p && mu_isspace(*p))
p++;
if (*p == '#')
continue;
- for (q = p; *q && !c_isspace(*q); q++)
+ for (q = p; *q && !mu_isspace(*q); q++)
;
*q = 0;
@@ -679,7 +678,7 @@ parse_opt(int key, char *arg, struct argp_state *state)
mu_list_set_destroy_item(args->trace_modules,
destroy_trace_item);
}
- mu_list_append(args->trace_modules, xstrdup(arg ? arg : "all"));
+ mu_list_append(args->trace_modules, mu_strdup(arg ? arg : "all"));
break;
case ARGP_KEY_INIT:
@@ -955,7 +954,7 @@ _add_runtime_param_entry(struct mu_cfg_param *p)
if (runtime_param_cnt == runtime_param_max) {
if (runtime_param_max == 0)
runtime_param_max = 16;
- runtime_param = x2nrealloc(runtime_param,
+ runtime_param = mu_2nrealloc(runtime_param,
&runtime_param_max,
sizeof(runtime_param[0]));
}
@@ -1155,7 +1154,7 @@ mf_server_function(const char *key, struct mf_srvcfg *cfg)
if (cfg->defopt ||
mu_list_locate(cfg->options, "default", NULL) == 0)
callout_server_url =
- xstrdup(mu_url_to_string(cfg->url));
+ mu_strdup(mu_url_to_string(cfg->url));
} else
return 1;
return 0;
@@ -1192,8 +1191,15 @@ open_strecho (int daemon_mode)
}
}
+void
+mailfromd_alloc_die()
+{
+ parse_error("not enough memory");
+ abort();
+}
extern char **environ;
+extern char *program_invocation_short_name;//FIXME
int
main(int argc, char **argv)
@@ -1206,6 +1212,7 @@ main(int argc, char **argv)
mf_init_nls();
mf_proctitle_init(argc, argv, environ);
+ mu_alloc_die_hook = mailfromd_alloc_die;
MU_AUTH_REGISTER_ALL_MODULES();
mu_register_all_formats();
@@ -1297,8 +1304,6 @@ main(int argc, char **argv)
exit(EX_CONFIG);
}
- fixup_create_script();
-
if (script_dump_tree)
print_syntax_tree();
if (script_dump_code)
@@ -1390,9 +1395,3 @@ main(int argc, char **argv)
exit(EX_OK);
}
-void
-xalloc_die()
-{
- parse_error("not enough memory");
- abort();
-}

Return to:

Send suggestions and report system problems to the System administrator.