aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils.h
blob: f5b8704212941000a8b0615ac71073ab03ff86ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* public declarations from utils.c */

#ifndef _UTILS_H_
#define _UTILS_H_

char *my_strdup(char *s);
char *my_strncpy(char *dst, char *src, int len);
int  printstrlen(char *s);

void ptrunescape(ptr p);
int  memunescape(char *p, int lenp);

ptr  ptrescape(ptr dst, ptr src, int append);
ptr  ptrmescape(ptr dst, char *src, int srclen, int append);

ptr  ptraddmarks(ptr dst, ptr line);
ptr  ptrmaddmarks(ptr dst, char *line, int len);

void put_marks(char *dst, char *line);
void smart_print(char *line, char newline);
char *split_first_word(char *dst, int dstlen, char *src);
char *first_valid(char *p, char ch);
char *first_regular(char *p, char c);
void unescape(char *s);
void escape_specials(char *str, char *p);
char *skipspace(char *p);
void exit_powwow(void);
void suspend_powwow(int signum);
function_signal sig_permanent(int signum, function_signal sighandler);

#ifdef SA_ONESHOT
   function_signal sig_oneshot(int signum, function_signal sighandler);
#else
#  define sig_oneshot signal
#endif

void signal_start(void);
void sig_bottomhalf(void);
void errmsg(char *msg);
void syserr(char *msg);
int  read_settings(void);
int  save_settings(void);
void movie_write(char *str, int newline);

void update_now(void);

#endif /* _UTILS_H_ */