![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Common function. More...
#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_str.h"#include <limits.h>#include <stdio.h>#include <stdlib.h>#include <libgen.h>#include "nilorea/n_windows.h"#include <errno.h>#include <strings.h>#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/wait.h>#include <time.h>Go to the source code of this file.
Functions | |
| int | file_exist (const char *filename) |
| test if file exist and if it's readable | |
| int | get_computer_name (char *computer_name, size_t len) |
| get the computer name | |
| char * | get_prog_dir (void) |
| get current program running directory | |
| char * | get_prog_name (void) |
| get current program name | |
| void | log_environment (int loglevel) |
| log environment variables in syslog | |
| void | n_abort (char const *format,...) |
| abort program with a text | |
| int | n_daemonize (void) |
| Daemonize program. | |
| int | n_daemonize_ex (int mode) |
| Daemonize program. | |
| char * | n_get_file_extension (char path[]) |
| get extension of path+filename | |
| void | N_HIDE_STR (char *buf,...) |
| store a hidden version of a string | |
| int | n_open_with_default (const char *path) |
| Open a file or a URL with whatever the desktop opens it with. | |
| int | n_popen (char *cmd, size_t read_buf_size, void **nstr_output, int *ret) |
| launch a command and return output and status | |
| int | n_spawn_detached (const char *program, const char *const *args) |
| Start a program and do not wait for it. | |
| int | n_spawn_wait (const char *program, const char *const *args, int *exit_code) |
| Run a program with arguments and wait for it to finish. | |
| int | n_spawn_wait_cancel (const char *program, const char *const *args, int *exit_code, const volatile int *cancel) |
| Run a program and wait for it, ending it early when asked. | |
| void | sigchld_handler (int sig) |
| Handles SIGCHLD issues when forking. | |
| int | sigchld_handler_installer (void) |
| install signal SIGCHLD handler to reap zombie processes | |
| pid_t | system_nb (const char *command, int *infp, int *outfp) |
| Non blocking system call. | |