annotate dpid/dpid_common.h @ 2104:3e7e5395f0bc

non-ASCII keybindings Alexander Voigt has kindly done some testing, and it seems that this makes bindings to most keys on a German keyboard possible -- except those that need AltGr don't work yet.
author corvid <corvid@lavabit.com>
date Thu, 23 Jun 2011 19:24:11 +0000
parents c1c822f70582
children
rev   line source
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
1 #ifndef DPID_COMMON_H
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
2 #define DPID_COMMON_H
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
3
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
4 /*! \file
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
5 * Declares common functions, global variables, and types.
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
6 *
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
7 * \todo
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
8 * The dpid error codes will be used in
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
9 * the next patch
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
10 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
11
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
12 #include <dirent.h>
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
13
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
14 #include "../dlib/dlib.h"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
15
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
16 /*
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
17 * Debugging macros
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
18 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
19 #define _MSG(...)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
20 #define MSG(...) printf("[dpid]: " __VA_ARGS__)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
21 #define _MSG_ERR(...)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
22 #define MSG_ERR(...) fprintf(stderr, "[dpid]: " __VA_ARGS__)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
23
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
24 #define dotDILLO_DPI ".dillo/dpi"
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
25 #define dotDILLO_DPIDRC ".dillo/dpidrc"
1382
7faa2c7a544f Switch the DPI framework from Unix sockets to Internet sockets
Jorge Arellano Cid <jcid@dillo.org>
parents: 1223
diff changeset
26 #define dotDILLO_DPID_COMM_KEYS ".dillo/dpid_comm_keys"
7faa2c7a544f Switch the DPI framework from Unix sockets to Internet sockets
Jorge Arellano Cid <jcid@dillo.org>
parents: 1223
diff changeset
27
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
28 #define ERRMSG(CALLER, CALLED, ERR)\
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
29 errmsg(CALLER, CALLED, ERR, __FILE__, __LINE__)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
30 #define _ERRMSG(CALLER, CALLED, ERR)
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
31
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
32
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
33 /*!
1389
c1c822f70582 Removed the write/fwrite mix in dpip. Introduced a_Dpip_dsh_trywrite()
Jorge Arellano Cid <jcid@dillo.org>
parents: 1382
diff changeset
34 * Macros for calling ckd_write and ckd_close functions
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
35 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
36 #define CKD_WRITE(fd, msg) ckd_write(fd, msg, __FILE__, __LINE__)
1389
c1c822f70582 Removed the write/fwrite mix in dpip. Introduced a_Dpip_dsh_trywrite()
Jorge Arellano Cid <jcid@dillo.org>
parents: 1382
diff changeset
37 #define CKD_CLOSE(fd) ckd_close(fd, __FILE__, __LINE__)
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
38
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
39
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
40 /*! Error codes for dpid */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
41 enum {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
42 no_errors,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
43 dpid_srs_addrinuse /* dpid service request socket address already in use */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
44 } dpi_errno;
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
45
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
46 /*! Intended for identifying dillo plugins
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
47 * and related files
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
48 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
49 enum file_type {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
50 DPI_FILE, /*! Any file name containing .dpi */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
51 UNKNOWN_FILE
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
52 };
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
53
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
54
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
55 void errmsg(char *caller, char *called, int errornum, char *file, int line);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
56
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
57 int no_dotfiles(const struct dirent *filedat);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
58
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
59 ssize_t ckd_write(int fd, char *msg, char *file, int line);
1389
c1c822f70582 Removed the write/fwrite mix in dpip. Introduced a_Dpip_dsh_trywrite()
Jorge Arellano Cid <jcid@dillo.org>
parents: 1382
diff changeset
60 ssize_t ckd_close(int fd, char *file, int line);
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
61
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
62 #endif