annotate dpid/dpi.h @ 1223:a09dbf132be6

Remove system includes for dpid
author Jorge Arellano Cid <jcid@dillo.org>
date Mon, 13 Jul 2009 15:24:42 -0400
parents 6ee11bf9e3ea
children 511017b74e8e
rev   line source
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
1 /*! \file
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
2 * Access functions for ~/.dillo/dpi_socket_dir.
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
3 * The most useful function for dillo is a_Dpi_srs, it returns
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
4 * the full path to the dpid service request socket.
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
5 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
6
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
7 #ifndef DPI_H
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
8 #define DPI_H
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
9
1223
a09dbf132be6 Remove system includes for dpid
Jorge Arellano Cid <jcid@dillo.org>
parents: 0
diff changeset
10 #include <unistd.h> /* for socklen_t */
a09dbf132be6 Remove system includes for dpid
Jorge Arellano Cid <jcid@dillo.org>
parents: 0
diff changeset
11 #include <sys/socket.h> /* for socklen_t and AF_LOCAL */
0
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
12
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
13 /* Check the Unix98 goodie */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
14 #ifndef socklen_t
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
15 #define socklen_t uint32_t
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
16 #endif
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
17
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
18 /* Some systems may not have this one... */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
19 #ifndef AF_LOCAL
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
20 #define AF_LOCAL AF_UNIX
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
21 #endif
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
22
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
23 /* This one is tricky, some sources state it should include the byte
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
24 * for the terminating NULL, and others say it shouldn't.
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
25 * The other way is to only use this one when a native SUN_LEN is not present,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
26 * but as dillo has used this for a long time successfully, here it goes.
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
27 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
28 # define D_SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
29 + strlen ((ptr)->sun_path))
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
30
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
31 /*!
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
32 * dpi commands
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
33 */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
34 enum {
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
35 UNKNOWN_CMD,
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
36 BYE_CMD, /* "DpiBye" */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
37 CHECK_SERVER_CMD, /* "check_server" */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
38 REGISTER_ALL_CMD, /* "register_all" */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
39 REGISTER_SERVICE_CMD /* "register_service" */
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
40 };
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
41
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
42
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
43 char *a_Dpi_sockdir_file(void);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
44
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
45 char *a_Dpi_rd_dpi_socket_dir(char *dirname);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
46
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
47 char *a_Dpi_srs(void);
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
48
6ee11bf9e3ea Initial revision
jcid
parents:
diff changeset
49 #endif