From 4cf3bcbde172872fb4213f43bff0fb7e59982db7 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 19 May 2014 06:44:57 +0200 Subject: begin on base for servers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-base.h | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/mds-base.h (limited to 'src/mds-base.h') diff --git a/src/mds-base.h b/src/mds-base.h new file mode 100644 index 0000000..26b9c17 --- /dev/null +++ b/src/mds-base.h @@ -0,0 +1,77 @@ +/** + * mds — A micro-display server + * Copyright © 2014 Mattias Andrée (maandree@member.fsf.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef MDS_MDS_BASE_H +#define MDS_MDS_BASE_H + + +/** + * Characteristics of the server + */ +typedef struct server_characteristics +{ + /** + * Setting this to zero will cause the server to drop privileges as a security precaution + */ + int require_privileges; + +} server_characteristics_t; + + +/** + * This variable should declared by the actual server implementation. + * It must be configured before `main` is invoked. + * + * This tells the server-base how to behave. + */ +extern server_characteristics_t server_characteristics; + + +/** + * Number of elements in `argv` + */ +extern int argc; + +/** + * Command line arguments + */ +extern char** argv; + +/** + * Whether the server has been respawn + * rather than this being the initial spawn. + * This will be at least as true as `is_reexec`. + */ +extern int is_respawn; + +/** + * Whether the server is continuing + * from a self-reexecution + */ +extern int is_reexec; + + +/** + * The file descriptor of the socket + * that is connected to the server + */ +extern int socket_fd; + + + +#endif + -- cgit v1.2.3-70-g09d2