Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • 1bc1b688ba7744df45012e3a610fac8d4880a1f2
  • master par défaut protégée
  • rust-playlist-sync
  • rust
  • fix-qt-deprecated-qvariant-type
  • fix-mpris-qtwindow-race-condition
  • rust-appimage-wayland
  • windows-build-rebased
  • v2.5 protégée
  • v2.4 protégée
  • v2.3-1 protégée
  • v2.3 protégée
  • v2.2 protégée
  • v2.1 protégée
  • v2.0 protégée
  • v1.8-3 protégée
  • v1.8-2 protégée
  • v1.8-1 protégée
  • v1.8 protégée
  • v1.7 protégée
  • v1.6 protégée
  • v1.5 protégée
  • v1.4 protégée
  • v1.3 protégée
  • v1.2 protégée
  • v1.1 protégée
  • v1.0 protégée
27 résultats

server.c

Blame
  • 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();