mirror of
https://github.com/rbenv/rbenv.git
synced 2025-01-01 06:37:11 +01:00
16c7eb4135
On systems that support both C compiling and dynamic loading, we can speed up `realpath()` (where most time in rbenv is spent) by replacing it with a dynamically loaded bash builtin. When `make -C src` is called in the project's root, `libexec/rbenv-realpath.dylib` will be created. If it exists, rbenv will attempt to load it as a builtin command. If it fails, execution will fall back to the old `realpath()` shell function.
31 lines
496 B
C
31 lines
496 B
C
#ifndef __BASH_H__
|
|
#define __BASH_H__
|
|
|
|
#define EXECUTION_SUCCESS 0
|
|
#define EXECUTION_FAILURE 1
|
|
#define EX_USAGE 258
|
|
|
|
#define BUILTIN_ENABLED 1
|
|
|
|
typedef struct word_desc {
|
|
char *word;
|
|
int flags;
|
|
} WORD_DESC;
|
|
|
|
typedef struct word_list {
|
|
struct word_list *next;
|
|
WORD_DESC *word;
|
|
} WORD_LIST;
|
|
|
|
typedef int sh_builtin_func_t(WORD_LIST *);
|
|
|
|
struct builtin {
|
|
char *name;
|
|
sh_builtin_func_t *function;
|
|
int flags;
|
|
char * const *long_doc;
|
|
const char *short_doc;
|
|
char *unused;
|
|
};
|
|
|
|
#endif
|