Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
BitchX
GitHub Repository: BitchX/BitchX1.3
Path: blob/master/include/alias.h
1069 views
1
/*
2
* alias.h: header for alias.c
3
*
4
* Written By Michael Sandrof
5
*
6
* Copyright(c) 1990
7
*
8
* See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT
9
*
10
* @(#)$Id: alias.h 3 2008-02-25 09:49:14Z keaston $
11
*/
12
13
#ifndef _ALIAS_H_
14
#define _ALIAS_H_
15
16
#include "irc_std.h"
17
18
#define DCC_STRUCT 0
19
#define USERLIST_STRUCT 1
20
#define NICK_STRUCT 2
21
#define SERVER_STRUCT 3
22
23
24
extern BuiltInDllFunctions *dll_functions;
25
26
/*
27
* XXXX - These need to go away
28
*/
29
#define COMMAND_ALIAS 0
30
#define VAR_ALIAS 1
31
#define VAR_ALIAS_LOCAL 2
32
33
/*
34
* These are the user commands. Dont call these directly.
35
*/
36
extern void aliascmd (char *, char *, char *, char *);
37
extern void assigncmd (char *, char *, char *, char *);
38
extern void localcmd (char *, char *, char *, char *);
39
extern void stubcmd (char *, char *, char *, char *);
40
extern void dumpcmd (char *, char *, char *, char *);
41
42
extern void add_var_alias (char *, char *);
43
extern void add_local_alias (char *, char *);
44
/*extern void add_cmd_alias (char *, char *);*/
45
extern void add_var_stub_alias (char *, char *);
46
extern void add_cmd_stub_alias (char *, char *);
47
48
extern char * get_variable (char *);
49
extern char ** glob_cmd_alias (char *, int *);
50
extern char * get_cmd_alias (char *, int *, char **, void **);
51
extern char ** get_subarray_elements (char *, int *, int);
52
53
54
/* These are in expr.c */
55
/*
56
* This function is a general purpose interface to alias expansion.
57
* The second argument is the text to be expanded.
58
* The third argument are the command line expandoes $0, $1, etc.
59
* The fourth argument is a flag whether $0, $1, etc are used
60
* The fifth argument, if set, controls whether only the first "command"
61
* will be expanded. If set, this argument will be set to the "rest"
62
* of the commands (after the first semicolon, or the null). If NULL,
63
* then the entire text will be expanded.
64
*/
65
extern char * BX_expand_alias (const char *, const char *, int *, char **);
66
67
/*
68
* This is the interface to the "expression parser"
69
* The first argument is the expression to be parsed
70
* The second argument is the command line expandoes ($0, $1, etc)
71
* The third argument will be set if the command line expandoes are used.
72
*/
73
extern char * BX_parse_inline (char *, const char *, int *);
74
75
/*
76
* This function is used to call a user-defined function.
77
* Noone should be calling this directly except for call_function.
78
*/
79
extern char * call_user_function (char *, char *);
80
extern void call_user_alias (char *, char *, char *, void *);
81
82
83
84
/*
85
* This function is sued to save all the current aliases to a global
86
* file. This is used by /SAVE and /ABORT.
87
*/
88
extern void save_aliases (FILE *, int);
89
extern void save_assigns (FILE *, int);
90
91
/*
92
* This function is in functions.c
93
* This function allows you to execute a primitive "BUILT IN" expando.
94
* These are the $A, $B, $C, etc expandoes.
95
* The argument is the character of the expando (eg, 'A', 'B', etc)
96
*
97
* This is in functions.c
98
*/
99
extern char * built_in_alias (char, int *);
100
101
102
103
/* BOGUS */
104
105
/*
106
* This function is used by parse_command to directly execute an alias.
107
* Noone should be calling this function directly. (call parse_line.)
108
*/
109
/*extern void execute_alias (char *, char *, char *);*/
110
void prepare_alias_call (void *, char **);
111
void destroy_alias_call (void *);
112
113
114
/*
115
* This is in functions.c
116
* This is only used by next_unit and expand_alias to call built in functions.
117
* Noone should call this function directly.
118
*/
119
extern char * call_function (char *, const char *, int *);
120
121
122
123
/*
124
* These are the two primitives for runtime stacks.
125
*/
126
extern void BX_make_local_stack (char *);
127
extern void BX_destroy_local_stack (void);
128
extern void set_current_command (char *);
129
extern void bless_local_stack (void);
130
extern void unset_current_command (void);
131
extern void dump_call_stack (void);
132
extern void panic_dump_call_stack (void);
133
extern void BX_lock_stack_frame (void);
134
extern void BX_unlock_stack_frame (void);
135
extern void destroy_aliases (int);
136
Alias *find_var_alias (char *);
137
void delete_var_alias (char *, int);
138
char *parse_line_with_return (char *, char *, char *, int, int);
139
/*
140
* This is the alias interface to the /STACK command.
141
*/
142
extern void do_stack_alias (int, char *, int);
143
char *BX_next_unit (char *, const char *, int *, int);
144
char *BX_alias_special_char(char **buffer, char *ptr, const char *args, char *quote_em, int *args_flag);
145
146
#endif /* _ALIAS_H_ */
147
148