dln.c File Reference
`#include "dln.h"`
`#include <strings.h>`
`#include <stdio.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`

Go to the source code of this file.

## Macros

#define | dln_notimplement --->>> dln not implemented <<<---
#define | dln_memerror abort
#define | dln_exit exit
#define | free(x) xfree(x)
#define | S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#define | MAXPATHLEN 1024
#define | FUNCNAME_PREFIX "Init_"
#define | isdirsep(x) ((x) == '/')
#define | init_funcname(buf, file)
#define | translit_separator(str) (void)(str)
#define | DLN_ERROR() (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))

## Functions

static void | dln_loaderror (const char *format,...)
void * | xmalloc ()
void * | xcalloc ()
void * | xrealloc ()
char * | getenv ()
static size_t | init_funcname_len (const char **file)
static const char * | dln_strerror (void)
void * | dln_load (const char *file)

## Variables

static const char | funcname_prefix [sizeof(FUNCNAME_PREFIX)-1] = FUNCNAME_PREFIX

## Macro Definition Documentation

#define DLN_ERROR | ( |  | ) | (error = dln_strerror(), strcpy(ALLOCA_N(char, strlen(error) + 1), error))

Referenced by dln_load().

#define dln_exit exit

Definition at line 21 of file dln.c.

#define dln_memerror abort

Definition at line 20 of file dln.c.

#define dln_notimplement --->>> dln not implemented <<<---

Definition at line 19 of file dln.c.

Referenced by dln_load().

#define free | ( |  | x | ) | xfree(x)

Definition at line 50 of file dln.c.

Referenced by argf_inplace_mode_set(), clear_readconv(), dln_find_exe_r(), pipe_del_fptr(), rb_io_fptr_finalize(), and ruby_set_inplace_mode().

#define FUNCNAME_PREFIX "Init_"

Definition at line 112 of file dln.c.

#define init_funcname | ( |  | buf,
|  |  | file
| ) |  |

Value:
do {\
const char *base = (file);\
const size_t flen = init_funcname_len(&base);\
const size_t plen = sizeof(funcname_prefix);\
char *const tmp = ALLOCA_N(char, plen+flen+1);\
if (!tmp) {\
dln_memerror();\
}\
memcpy(tmp, funcname_prefix, plen);\
memcpy(tmp+plen, base, flen);\
tmp[plen+flen] = '\0';\
*(buf) = tmp;\
} while (0)

Definition at line 139 of file dln.c.

Referenced by dln_load().

#define isdirsep | ( |  | x | ) | ((x) == '/')

Definition at line 119 of file dln.c.

Referenced by init_funcname_len().

#define MAXPATHLEN 1024

Definition at line 67 of file dln.c.

Referenced by dln_load().

#define S_ISDIR | ( |  | m | ) | (((m) & S_IFMT) == S_IFDIR)

Definition at line 60 of file dln.c.

#define translit_separator | ( |  | str | ) | (void)(str)

Definition at line 1245 of file dln.c.

Referenced by dln_load().

## Function Documentation

void* dln_load | ( | const char * | file | ) |

Definition at line 1249 of file dln.c.

Referenced by dln_load(), and load_ext().

static void dln_loaderror | ( | const char * | format,
|  |  | ...
| ) |  |

static

Definition at line 93 of file dln.c.

Referenced by dln_load().

static const char* dln_strerror | ( | void |  | ) |

static

Definition at line 1148 of file dln.c.

References strerror().

Referenced by dln_load().

char* getenv | ( |  | ) |

static size_t init_funcname_len | ( | const char ** | file | ) |

static

Definition at line 123 of file dln.c.

References isdirsep, NULL, and p.

void* xcalloc | ( |  | ) |

void* xmalloc | ( |  | ) |

void* xrealloc | ( |  | ) |

## Variable Documentation

const char funcname_prefix[sizeof(FUNCNAME_PREFIX)-1] = FUNCNAME_PREFIX

static

Definition at line 137 of file dln.c.