Ruby: dln.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
dln.c File Reference
`#include "dln.h"`
`#include "internal.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 | EXTERNAL_PREFIX ""
#define | FUNCNAME_PREFIX EXTERNAL_PREFIX"Init_"
#define | isdirsep(x) ((x) == '/')
#define | init_funcname(buf, file)
#define | translit_separator(str) (void)(str)

## Functions
char * | getenv ()
void * | dln_load (const char *file)

## Macro Definition Documentation

## ◆ dln_exit

#define dln_exit exit

Definition at line 21 of file dln.c.

## ◆ dln_memerror

#define dln_memerror abort

Definition at line 20 of file dln.c.

## ◆ dln_notimplement

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

Definition at line 19 of file dln.c.

## ◆ EXTERNAL_PREFIX

#define EXTERNAL_PREFIX ""

Definition at line 109 of file dln.c.

## ◆ free

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

Definition at line 52 of file dln.c.

## ◆ FUNCNAME_PREFIX

#define FUNCNAME_PREFIX EXTERNAL_PREFIX"Init_"

Definition at line 111 of file dln.c.

## ◆ init_funcname

#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)
buf
voidpf void * buf
Definition: ioapi.h:138
ALLOCA_N
#define ALLOCA_N(type, n)
Definition: memory.h:112
file
Definition: gzappend.c:170

Definition at line 136 of file dln.c.

## ◆ isdirsep

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

Definition at line 116 of file dln.c.

## ◆ MAXPATHLEN

#define MAXPATHLEN 1024

Definition at line 69 of file dln.c.

## ◆ S_ISDIR

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

Definition at line 62 of file dln.c.

## ◆ translit_separator

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

Definition at line 1243 of file dln.c.

## Function Documentation

## ◆ dln_load()

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

Definition at line 1264 of file dln.c.

References ALLOCA_N, dln_load(), dln_memerror, dln_notimplement, error(), free, init_funcname, load(), memcpy, NULL, rb_fatal(), rb_w32_mbstr_to_wstr(), strerror(), strlen(), and translit_separator.

Referenced by dln_load().

## ◆ getenv()

char * getenv | ( |  | ) |