Subversion Repositories IRCServ

Rev

Rev 3 | Rev 7 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

/* $Id: main.c 5 2024-08-25 11:58:10Z nishi $ */

#include "is_version.h"
#include "is_util.h"
#include "is_log.h"

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include <string.h>

int main(int argc, char** argv) {
        bool daemon = true;
        printf("IRCServ version %s\n", is_get_version());
        int i;
        for(i = 1; i < argc; i++) {
                if(strcmp(argv[i], "-D") == 0) {
                        daemon = false;
                        break;
                }
        }
        pid_t pid = 0;
        if(daemon) {
                pid = fork();
        }
        if(pid == 0) {
                char* str;

                str = is_strcat("IRCServ version ", is_get_version());
                is_log(str);
                free(str);

                return 0;
        } else {
                return 0;
        }
}