From 00e6c3c3ed06a258a02943fc49fa7c528025d747 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 31 Dec 2015 13:59:18 +0200 Subject: Command-line control interface. * configure.ac (DEFAULT_CONTROL_URL): New subst variable. * grecs: Upgrade. * ident/pam.c (overwrite_and_free): Free ptr. * lib/Makefile.am: Add new sources. * src/addrfmt.c: Move to lib/addrfmt.c * lib/grecsasrt.c: New file. * lib/grecsasrt.h: New file. * lib/mkfilename.c: New file. * lib/netrc.c: New file. * lib/pp.c: New file. * lib/split3.c: New file. * src/url.c: Move from lib/url.c (pies_url_free_user, pies_url_free_passwd): New finctions. * lib/libpies.h (strsplit3): New proto. (pies_url_create, pies_url_destroy) (pies_url_get_arg, pies_url_copy) (pies_url_free_user, pies_url_free_passwd) (netrc_scan) (pp_add_option, pp_command_line, mkfilename) (sockaddr_to_str, sockaddr_to_astr): New protos * src/Makefile.am (bin_PROGRAMS): New program: piesctl (pies_SOURCES): Remove addrfmt.c and url.c. (noinst_HEADERS, BUILT_SOURCES): Add piesctl-cl.h * src/cmdline.opt: Use pp_* function family to build preprocessor command line. * src/ctl.c (http_header_hash): Use case-insensitive hashing. (ctlio_finalize_reply): Don't close connection after sending 401 response. (input): Remove ws and wsflags. All uses changed. (input_append): Use strsplit3 to parse the request line. * src/pies.c: Use pp_* function family to build preprocessor command line. Move assert_, mkfilename and _cb+_url functions into libpies. * src/pies.h (pies_sockaddr_storage): Move to libpies.h * src/piesctl.c: New file. * src/piesctl-cl.opt: New file. --- src/pies.h | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'src/pies.h') diff --git a/src/pies.h b/src/pies.h index 56fb72d..afdac66 100644 --- a/src/pies.h +++ b/src/pies.h @@ -1,5 +1,5 @@ /* This file is part of GNU Pies. - Copyright (C) 2008, 2009, 2010, 2011, 2013 Sergey Poznyakoff + Copyright (C) 2008, 2009, 2010, 2011, 2013-2015 Sergey Poznyakoff GNU Pies is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -262,13 +262,6 @@ struct component }; #define is_sysvinit(cp) ((cp)->mode >= pies_mark_sysvinit || (cp)->runlevels) - -union pies_sockaddr_storage -{ - struct sockaddr s; - struct sockaddr_in s_in; - struct sockaddr_un s_un; -}; enum pies_action { ACTION_CONT, @@ -380,27 +373,6 @@ void component_finish (struct component *comp, grecs_locus_t *locus); struct grecs_keyword *find_component_keyword (const char *ident); -/* url.c */ -struct pies_url -{ - char *string; - char *scheme; - char *host; - char *port_s; - int port; - char *proto_s; - int proto; - char *path; - char *user; - char *passwd; - int argc; - char **argv; -}; - -int pies_url_create (struct pies_url **purl, const char *str); -void pies_url_destroy (struct pies_url **purl); -const char *pies_url_get_arg (struct pies_url *url, const char *argname); - void pies_pause (void); @@ -484,13 +456,6 @@ char *meta_expand_string (const char *string, struct metadef *def, void *data); void meta_free (struct metadef *def); -/* addrfmt.c */ -void sockaddr_to_str (const struct sockaddr *sa, int salen, - char *bufptr, size_t buflen, - size_t *plen); -char *sockaddr_to_astr (const struct sockaddr *sa, int salen); - - /* userprivs.c */ int switch_to_privs (uid_t uid, gid_t gid, struct grecs_list *retain_groups); -- cgit v1.2.1