mirror of https://github.com/dnomd343/ClearDNS
dnomd343
2 years ago
6 changed files with 59 additions and 42 deletions
@ -1,3 +1,3 @@ |
|||
cmake_minimum_required(VERSION 2.8.12) |
|||
|
|||
add_library(utils logger.c structure.c cJSON.c) |
|||
add_library(utils cJSON.c logger.c process.c structure.c) |
|||
|
@ -0,0 +1,16 @@ |
|||
#include "common.h" |
|||
#include "process.h" |
|||
#include "structure.h" |
|||
|
|||
process* process_init(const char *caption, const char *bin) { // init process struct
|
|||
process *proc = (process *)malloc(sizeof(process)); |
|||
proc->name = string_init(caption); // process caption
|
|||
proc->cmd = string_list_append(string_list_init(), bin); // argv[0] normally be process file name
|
|||
proc->env = string_list_init(); // empty environment variable
|
|||
proc->cwd = WORK_DIR; // current working directory
|
|||
return proc; |
|||
} |
|||
|
|||
void process_add_arg(process *proc, const char *arg) { // add argument for process
|
|||
proc->cmd = string_list_append(proc->cmd, arg); |
|||
} |
Loading…
Reference in new issue