Defines | Typedefs | Functions | Variables
web_server.c File Reference
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <stddef.h>
#include <stdarg.h>
#include <ctype.h>
#include <time.h>
#include "mongoose.h"
#include <sys/wait.h>
#include <unistd.h>
Include dependency graph for web_server.c:

Go to the source code of this file.

Defines

#define __cdecl
#define _CRT_SECURE_NO_WARNINGS
#define _MBCS
#define _WIN32_WINNT   0x500
#define _XOPEN_SOURCE   600
#define abs_path(rel, abs, abs_size)   realpath((rel), (abs))
#define CONFIG_FILE   "mongoose.conf"
#define DIRSEP   '/'
#define EV_HANDLER   NULL
#define MAX_CONF_FILE_LINE_SIZE   (8 * 1024)
#define MAX_OPTIONS   100
#define MVER   MONGOOSE_VERSION

Typedefs

typedef struct stat file_stat_t

Functions

static void die (const char *fmt,...)
static char * get_option (char **options, const char *option_name)
static void init_server_name (void)
static int is_path_absolute (const char *path)
int main (int argc, char *argv[])
int modify_passwords_file (const char *fname, const char *domain, const char *user, const char *pass)
static void notify (const char *fmt,...)
static int path_exists (const char *path, int is_dir)
static void process_command_line_arguments (char *argv[], char **options)
static char * sdup (const char *str)
static void * serving_thread_func (void *param)
static void set_absolute_path (char *options[], const char *option_name)
static void set_option (char **options, const char *name, const char *value)
static void set_options (char *argv[])
static void show_usage_and_exit (void)
static void __cdecl signal_handler (int sig_num)
static void start_mongoose (int argc, char *argv[])
static void verify_existence (char **options, const char *name, int is_dir)
static void vnotify (const char *fmt, va_list ap, int must_exit)

Variables

static int exit_flag
static char ** s_argv = { NULL }
static char s_config_file [PATH_MAX]
static const char * s_default_document_root = "."
static const char * s_default_listening_port = "8080"
static struct mg_serverserver
static char server_name [50]

Define Documentation

#define __cdecl

Definition at line 58 of file web_server.c.

Definition at line 8 of file web_server.c.

#define _MBCS

Definition at line 6 of file web_server.c.

#define _WIN32_WINNT   0x500

Definition at line 7 of file web_server.c.

#define _XOPEN_SOURCE   600

Definition at line 9 of file web_server.c.

#define abs_path (   rel,
  abs,
  abs_size 
)    realpath((rel), (abs))

Definition at line 59 of file web_server.c.

#define CONFIG_FILE   "mongoose.conf"

Definition at line 80 of file web_server.c.

#define DIRSEP   '/'

Definition at line 57 of file web_server.c.

#define EV_HANDLER   NULL

Definition at line 142 of file web_server.c.

#define MAX_CONF_FILE_LINE_SIZE   (8 * 1024)

Definition at line 63 of file web_server.c.

#define MAX_OPTIONS   100

Definition at line 62 of file web_server.c.

#define MVER   MONGOOSE_VERSION

Definition at line 66 of file web_server.c.


Typedef Documentation

typedef struct stat file_stat_t

Definition at line 49 of file web_server.c.


Function Documentation

static void die ( const char *  fmt,
  ... 
) [static]

Definition at line 113 of file web_server.c.

static char* get_option ( char **  options,
const char *  option_name 
) [static]

Definition at line 255 of file web_server.c.

static void init_server_name ( void  ) [static]

Definition at line 239 of file web_server.c.

static int is_path_absolute ( const char *  path) [static]

Definition at line 245 of file web_server.c.

int main ( int  argc,
char *  argv[] 
)

Definition at line 474 of file web_server.c.

int modify_passwords_file ( const char *  fname,
const char *  domain,
const char *  user,
const char *  pass 
)

Definition at line 318 of file web_server.c.

static void notify ( const char *  fmt,
  ... 
) [static]

Definition at line 106 of file web_server.c.

static int path_exists ( const char *  path,
int  is_dir 
) [static]

Definition at line 273 of file web_server.c.

static void process_command_line_arguments ( char *  argv[],
char **  options 
) [static]

Definition at line 173 of file web_server.c.

static char* sdup ( const char *  str) [static]

Definition at line 144 of file web_server.c.

static void* serving_thread_func ( void *  param) [static]

Definition at line 265 of file web_server.c.

static void set_absolute_path ( char *  options[],
const char *  option_name 
) [static]

Definition at line 288 of file web_server.c.

static void set_option ( char **  options,
const char *  name,
const char *  value 
) [static]

Definition at line 152 of file web_server.c.

static void set_options ( char *  argv[]) [static]

Definition at line 406 of file web_server.c.

static void show_usage_and_exit ( void  ) [static]

Definition at line 120 of file web_server.c.

static void __cdecl signal_handler ( int  sig_num) [static]

Definition at line 83 of file web_server.c.

static void start_mongoose ( int  argc,
char *  argv[] 
) [static]

Definition at line 382 of file web_server.c.

static void verify_existence ( char **  options,
const char *  name,
int  is_dir 
) [static]

Definition at line 279 of file web_server.c.

static void vnotify ( const char *  fmt,
va_list  ap,
int  must_exit 
) [static]

Definition at line 98 of file web_server.c.


Variable Documentation

int exit_flag [static]

Definition at line 69 of file web_server.c.

char** s_argv = { NULL } [static]

Definition at line 75 of file web_server.c.

char s_config_file[PATH_MAX] [static]

Definition at line 71 of file web_server.c.

const char* s_default_document_root = "." [static]

Definition at line 73 of file web_server.c.

const char* s_default_listening_port = "8080" [static]

Definition at line 74 of file web_server.c.

struct mg_server* server [static]

Definition at line 72 of file web_server.c.

char server_name[50] [static]

Definition at line 70 of file web_server.c.



rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:09