Dillo v3.1.1-46-g8a360e32
Loading...
Searching...
No Matches
dpi.h File Reference
#include <unistd.h>
#include <sys/socket.h>
Include dependency graph for dpi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define AF_LOCAL   AF_UNIX
 
#define D_SUN_LEN(ptr)
 

Enumerations

enum  {
  UNKNOWN_CMD , AUTH_CMD , BYE_CMD , CHECK_SERVER_CMD ,
  REGISTER_ALL_CMD , REGISTER_SERVICE_CMD
}
 

Functions

char * a_Dpi_sockdir_file (void)
 
char * a_Dpi_rd_dpi_socket_dir (char *dirname)
 
char * a_Dpi_srs (void)
 

Detailed Description

Access functions for ~/.dillo/dpi_socket_dir. The most useful function for dillo is a_Dpi_srs, it returns the full path to the dpid service request socket.

Definition in file dpi.h.

Macro Definition Documentation

◆ AF_LOCAL

#define AF_LOCAL   AF_UNIX

Definition at line 15 of file dpi.h.

◆ D_SUN_LEN

#define D_SUN_LEN (   ptr)
Value:
((size_t) (((struct sockaddr_un *) 0)->sun_path) \
+ strlen ((ptr)->sun_path))

Definition at line 23 of file dpi.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

dpi commands

Enumerator
UNKNOWN_CMD 
AUTH_CMD 
BYE_CMD 
CHECK_SERVER_CMD 
REGISTER_ALL_CMD 
REGISTER_SERVICE_CMD 

Definition at line 29 of file dpi.h.

Function Documentation

◆ a_Dpi_rd_dpi_socket_dir()

char * a_Dpi_rd_dpi_socket_dir ( char *  dirname)

Read socket directory path from ~/.dillo/dpi_socket_dir \Return socket directory path or NULL if the dpi_socket_dir file does not exist. \Note This function exits if ~/.dillo does not exist or if the dpi_socket_dir file cannot be opened for a reason other than it does not exist.

Definition at line 51 of file dpi.c.

References dFree(), dGethomedir(), dGetline(), dStrconcat(), ERRMSG, and MSG_ERR.

Referenced by a_Dpi_srs(), and init_sockdir().

◆ a_Dpi_sockdir_file()

char * a_Dpi_sockdir_file ( void  )

\Return Returns path to the dpi_socket_dir file Use dFree to free memory

Definition at line 34 of file dpi.c.

References dGethomedir(), and dStrconcat().

Referenced by a_Dpi_srs(), and main().

◆ a_Dpi_srs()

char * a_Dpi_srs ( void  )

\Modifies srs_name \Return The service request socket name with its complete path.

Definition at line 87 of file dpi.c.

References a_Dpi_rd_dpi_socket_dir(), a_Dpi_sockdir_file(), dFree(), dStrconcat(), dStrstrip(), and srs_name.