Sélectionner une révision Git
server.c 4,12 Kio
#define _POSIX_C_SOURCE 200809L
#include <common/common.h>
#include <lektor/config.h>
#include <lektor/net.h>
#include <lektor/cmd.h>
#include <lektor/reg.h>
#include <lektor/database.h>
#include <mthread/mthread.h>
#include <lektor/commands.h>
#include <assert.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <strings.h>
#include <pwd.h>
#include <pthread.h>
#ifdef _STATIC_SDL2
#include <lektor/module/module_sdl2.h>
#endif
#ifdef _STATIC_X11
#include <lektor/module/module_x11.h>
#endif
REG_BEGIN(server_reg)
REG_ADD(load_repo_https)
#ifdef _STATIC_SDL2
REG_ADD(load_sdl2)
#endif
#ifdef _STATIC_X11
REG_ADD(load_x11)
#endif
REG_END()
int
main(int argc, char *argv[])
{
struct passwd *pw = getpwuid(getuid());
char exe[PATH_MAX];
int autoclear, check_exclusive = 1, opt;
char *conf_file = safe_zero_malloc(PATH_MAX * sizeof(char));
pthread_t th;
executable_name = "lektord";
if (argc <= 1)
goto normal_launch;
/* Check args */
while ((opt = getopt(argc, argv, "hFf:")) != -1) {
switch (opt) {
case 'F':
check_exclusive = 0;
break;
case 'f':
strncpy(conf_file, optarg, PATH_MAX);
break;
case 'h':
default:
help__();
exit(EXIT_SUCCESS);
}
}
normal_launch:
reg_export(server_reg);
mthread_init();