ekg2
GIT master
|
#include "ekg2.h"
#include <glib/gprintf.h>
#include <glib/gstdio.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/resource.h>
#include <sys/select.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <locale.h>
#include <pwd.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "emoticons.h"
#include "internal.h"
#include "scripts.h"
Struktury danych | |
struct | option_callback_args |
Funkcje | |
static gint | ekg_autoaway_timer (gint type, gpointer data) |
void | ekg_loop () |
static void | handle_sigusr1 () |
static void | handle_sigusr2 () |
static void | handle_sighup () |
static void | handle_fatal_signal (char *message) |
static void | handle_sigabrt () |
static void | handle_sigsegv () |
static char * | prepare_batch_line (char *argv[], int n) |
static int | handle_stderr (int type, int fd, const char *watch, void *data) |
void | ekg_debug_handler (int level, const char *format, va_list ap) |
static void | glib_debug_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer user_data) |
static void | glib_print_handler (const gchar *string) |
static void | glib_printerr_handler (const gchar *string) |
gboolean | set_status_callback (const gchar *optname, const gchar *optval, gpointer data, GError **error) |
int | main (int argc, char **argv) |
void | ekg_exit () |
Zmienne | |
char * | config_dir |
char * | old_config_dir |
int | mesg_startup |
static char | argv0 [4096] |
static gchar | last_err_message [128] = {0} |
pid_t | speech_pid = 0 |
static int | stderr_backup = -1 |
int | no_mouse = 0 |
static GOptionEntry | ekg_options [] |
|
static |
less important things which don't need to be checked every main loop iteration e.g. autoaways
executed each second.
void ekg_debug_handler | ( | int | level, |
const char * | format, | ||
va_list | ap | ||
) |
debug message [if config_debug set] coming direct from libgadu (by libgadu_debug_handler()) or by debug() or by debug_ext()
XXX, doc more. But function now is ok.
level | |
format | |
ap |
void ekg_exit | ( | ) |
void ekg_loop | ( | ) |
|
static |
|
static |
|
static |
|
static |
Notifies plugins, writes the message to stderr, with last_err_message.
We are only allowed to call POSIX-defined "async-signal-safe functions" here (see signal(7)), because anything else can result in a "bad thing" such as a deadlock (e.g. if the signal was a result of a malloc()/free()) or a segfault. There were cases of this happening to ekg2.
In order to avoid touching the (possibly corrupt) heap, we invoke statically stored set of abort handlers. This is the mechanism we use to notify UI and logs plugins to reset the terminal and sync their output as necessary.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
int main | ( | int | argc, |
char ** | argv | ||
) |
|
static |
gboolean set_status_callback | ( | const gchar * | optname, |
const gchar * | optval, | ||
gpointer | data, | ||
GError ** | error | ||
) |
|
static |
char* config_dir |
|
static |
|
static |
int mesg_startup |
int no_mouse = 0 |
char* old_config_dir |
pid_t speech_pid = 0 |
|
static |