Dillo v3.1.1-119-g140d9ebd
Loading...
Searching...
No Matches
dpid_common.h File Reference
#include <dirent.h>
#include <stddef.h>
#include <sys/types.h>
#include "../dlib/dlib.h"
Include dependency graph for dpid_common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _MSG(...)
 
#define MSG(...)   printf("[dpid]: " __VA_ARGS__)
 
#define MSG_ERR(...)   fprintf(stderr, "[dpid]: " __VA_ARGS__)
 
#define dotDILLO_DPI   ".dillo/dpi"
 
#define dotDILLO_DPIDRC   ".dillo/dpidrc"
 
#define dotDILLO_DPID_COMM_KEYS   ".dillo/dpid_comm_keys"
 
#define ERRMSG(CALLER, CALLED, ERR)    errmsg(CALLER, CALLED, ERR, __FILE__, __LINE__)
 
#define _ERRMSG(CALLER, CALLED, ERR)
 
#define CKD_WRITE(fd, msg)   ckd_write(fd, msg, __FILE__, __LINE__)
 
#define CKD_CLOSE(fd)   ckd_close(fd, __FILE__, __LINE__)
 

Enumerations

enum  file_type { DPI_FILE , UNKNOWN_FILE }
 

Functions

void errmsg (char *caller, char *called, int errornum, char *file, int line)
 
ssize_t ckd_write (int fd, char *msg, char *file, int line)
 
ssize_t ckd_close (int fd, char *file, int line)
 

Detailed Description

Declares common functions, global variables, and types.

Todo:
The dpid error codes will be used in the next patch

Definition in file dpid_common.h.

Macro Definition Documentation

◆ _ERRMSG

#define _ERRMSG (   CALLER,
  CALLED,
  ERR 
)

Definition at line 31 of file dpid_common.h.

◆ _MSG

#define _MSG (   ...)

Definition at line 21 of file dpid_common.h.

◆ CKD_CLOSE

#define CKD_CLOSE (   fd)    ckd_close(fd, __FILE__, __LINE__)

Definition at line 38 of file dpid_common.h.

◆ CKD_WRITE

#define CKD_WRITE (   fd,
  msg 
)    ckd_write(fd, msg, __FILE__, __LINE__)

Macros for calling ckd_write and ckd_close functions

Definition at line 37 of file dpid_common.h.

◆ dotDILLO_DPI

#define dotDILLO_DPI   ".dillo/dpi"

Definition at line 25 of file dpid_common.h.

◆ dotDILLO_DPID_COMM_KEYS

#define dotDILLO_DPID_COMM_KEYS   ".dillo/dpid_comm_keys"

Definition at line 27 of file dpid_common.h.

◆ dotDILLO_DPIDRC

#define dotDILLO_DPIDRC   ".dillo/dpidrc"

Definition at line 26 of file dpid_common.h.

◆ ERRMSG

#define ERRMSG (   CALLER,
  CALLED,
  ERR 
)     errmsg(CALLER, CALLED, ERR, __FILE__, __LINE__)

Definition at line 29 of file dpid_common.h.

◆ MSG

#define MSG (   ...)    printf("[dpid]: " __VA_ARGS__)

Definition at line 22 of file dpid_common.h.

◆ MSG_ERR

#define MSG_ERR (   ...)    fprintf(stderr, "[dpid]: " __VA_ARGS__)

Definition at line 23 of file dpid_common.h.

Enumeration Type Documentation

◆ file_type

enum file_type

Intended for identifying dillo plugins and related files

Enumerator
DPI_FILE 
UNKNOWN_FILE 

Any file name containing .dpi

Definition at line 43 of file dpid_common.h.

Function Documentation

◆ ckd_close()

ssize_t ckd_close ( int  fd,
char *  file,
int  line 
)

Provides an error checked close() call. Call this via the CKD_CLOSE macro

Returns
close return value

Definition at line 50 of file dpid_common.c.

References dClose(), dStrerror, and MSG_ERR.

◆ ckd_write()

ssize_t ckd_write ( int  fd,
char *  msg,
char *  file,
int  line 
)

Provides an error checked write command. Call this via the CKD_WRITE macro

Returns
write return value

Definition at line 32 of file dpid_common.c.

References dStrerror, and MSG_ERR.

◆ errmsg()

void errmsg ( char *  caller,
char *  called,
int  errornum,
char *  file,
int  line 
)

Definition at line 20 of file dpid_common.c.

References dStrerror, and MSG_ERR.

Referenced by Tls_fatal_error_msg().