/*! \file
 * 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.
 */

#ifndef DPI_H
#define DPI_H

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>

/*!
 * dpi commands
 */
enum {
   UNKNOWN_CMD,
   BYE_CMD, /* "DpiBye" */
   CHECK_SERVER_CMD, /* "check_server" */
   REGISTER_ALL_CMD, /* "register_all" */
   REGISTER_SERVICE_CMD /* "register_service" */
};

/*!
 * Dpi error message tags
 */
#define tag_prserr "<dpi cmd='DpiError' msg='Failed to parse request'>"
#define tag_cmderr "<dpi cmd='DpiError' msg='Unknown command'>"
#define tag_dpi_unavailerr\
 "<dpi cmd='DpiError' msg='Plugin currently unavailable'>"

char *a_Dpi_sockdir_file(void);

char *a_Dpi_rd_dpi_socket_dir(char *dirname);

char *a_Dpi_srs(void);

#endif
