~ubuntu-branches/ubuntu/utopic/tinymux/utopic

« back to all changes in this revision

Viewing changes to src/externs.h

  • Committer: Bazaar Package Importer
  • Author(s): Ervin Hearn III
  • Date: 2008-04-11 23:18:25 UTC
  • mfrom: (1.1.5 upstream) (6.1.1 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080411231825-1pq4trckagyk8roo
Tags: 2.6.5.27-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// externs.h -- Prototypes for externs not defined elsewhere.
2
2
//
3
 
// $Id: externs.h,v 1.65 2006/01/31 00:17:26 sdennis Exp $
 
3
// $Id: externs.h 3049 2007-12-30 06:35:41Z brazilofmux $
4
4
//
5
5
 
6
6
#ifndef EXTERNS_H
14
14
// From bsd.cpp.
15
15
//
16
16
void boot_slave(dbref executor, dbref caller, dbref enactor, int key);
17
 
void close_sockets(bool emergency, char *message);
 
17
void close_sockets(bool emergency, const char *message);
18
18
void CleanUpSlaveSocket(void);
19
19
void CleanUpSlaveProcess(void);
20
20
#ifdef QUERY_SLAVE
34
34
 
35
35
// From conf.cpp
36
36
//
37
 
void cf_log_notfound(dbref, char *, const char *, char *);
 
37
void cf_log_notfound(dbref, const char *, const char *, const char *);
38
38
int  cf_modify_bits(int *, char *, void *, UINT32, dbref, char *);
39
39
void DCL_CDECL cf_log_syntax(dbref player, char *cmd, const char *fmt, ...);
40
40
void ValidateConfigurationDbrefs(void);
68
68
void local_data_create(dbref);
69
69
void local_data_clone(dbref, dbref);
70
70
void local_data_free(dbref);
 
71
const char **local_get_info_table(void);
71
72
 
72
73
// From mail.cpp.
73
74
//
74
75
void load_mail(FILE *);
75
76
int  dump_mail(FILE *);
76
77
struct mail *mail_fetch(dbref, int);
 
78
char *MakeCanonicalMailAlias
 
79
(
 
80
    char   *pMailAlias,
 
81
    size_t *pnValidMailAlias,
 
82
    bool   *pbValidMailAlias
 
83
);
 
84
 
 
85
char *MakeCanonicalMailAliasDesc
 
86
(
 
87
    char   *pMailAliasDesc,
 
88
    size_t *pnValidMailAliasDesc,
 
89
    bool   *pbValidMailAliasDesc,
 
90
    size_t *pnVisualWidth
 
91
);
 
92
 
 
93
#if defined(FIRANMUX)
 
94
const char *MessageFetch(int number);
 
95
size_t MessageFetchSize(int number);
 
96
#endif // FIRANMUX
77
97
 
78
98
// From netcommon.cpp.
79
99
//
80
 
void DCL_CDECL raw_broadcast(int, char *, ...);
 
100
void DCL_CDECL raw_broadcast(int, const char *, ...);
81
101
void list_siteinfo(dbref);
82
102
void logged_out0(dbref executor, dbref caller, dbref enactor, int key);
83
 
void logged_out1(dbref executor, dbref caller, dbref enactor, int key, char *arg);
 
103
void logged_out1(dbref executor, dbref caller, dbref enactor, int eval, int key, char *arg);
84
104
void init_logout_cmdtab(void);
85
105
void desc_reload(dbref);
86
106
void make_portlist(dbref, dbref, char *, char **);
 
107
char *MakeCanonicalDoing(char *pDoing, size_t *pnValidDoing, bool *pbValidDoing);
87
108
 
88
109
/* From cque.cpp */
89
110
int  nfy_que(dbref, int, int, int);
90
111
int  halt_que(dbref, dbref);
91
 
void wait_que(dbref executor, dbref caller, dbref enactor, bool,
92
 
    CLinearTimeAbsolute&, dbref, int, char *, char *[],int, char *[]);
 
112
void wait_que(dbref executor, dbref caller, dbref enactor, int, bool,
 
113
    CLinearTimeAbsolute&, dbref, int, char *, int, char *[], reg_ref *[]);
93
114
 
94
 
#ifdef WIN32
95
 
#include "crypt/crypt.h"
96
 
#else // WIN32
 
115
#ifndef WIN32
97
116
extern "C" char *crypt(const char *inptr, const char *inkey);
98
117
#endif // WIN32
99
118
extern bool break_called;
107
126
void mux_exec(char *buff, char **bufc, dbref executor, dbref caller,
108
127
              dbref enactor, int eval, char **dstr, char *cargs[],
109
128
              int ncargs);
110
 
void save_global_regs(const char *, char *[], int []);
111
 
void save_and_clear_global_regs(const char *, char *[], int[]);
112
 
void restore_global_regs(const char *, char *[], int []);
 
129
 
 
130
DCL_INLINE void BufAddRef(lbuf_ref *lbufref)
 
131
{
 
132
    if (NULL != lbufref)
 
133
    {
 
134
        lbufref->refcount++;
 
135
    }
 
136
}
 
137
 
 
138
DCL_INLINE void BufRelease(lbuf_ref *lbufref)
 
139
{
 
140
    if (NULL != lbufref)
 
141
    {
 
142
        lbufref->refcount--;
 
143
        if (0 == lbufref->refcount)
 
144
        {
 
145
            free_lbuf(lbufref->lbuf_ptr);
 
146
            lbufref->lbuf_ptr = NULL;
 
147
            free_lbufref(lbufref);
 
148
        }
 
149
    }
 
150
}
 
151
 
 
152
DCL_INLINE void RegAddRef(reg_ref *regref)
 
153
{
 
154
    if (NULL != regref)
 
155
    {
 
156
        regref->refcount++;
 
157
    }
 
158
}
 
159
 
 
160
DCL_INLINE void RegRelease(reg_ref *regref)
 
161
{
 
162
    if (NULL != regref)
 
163
    {
 
164
        regref->refcount--;
 
165
        if (0 == regref->refcount)
 
166
        {
 
167
            BufRelease(regref->lbuf);
 
168
            regref->lbuf    = NULL;
 
169
            regref->reg_ptr = NULL;
 
170
            regref->reg_len = 0;
 
171
            free_regref(regref);
 
172
        }
 
173
    }
 
174
}
 
175
void RegAssign(reg_ref **regref, size_t nLength, const char *ptr);
 
176
 
 
177
void save_global_regs(reg_ref *preserve[]);
 
178
void save_and_clear_global_regs(reg_ref *preserve[]);
 
179
void restore_global_regs(reg_ref *preserve[]);
 
180
 
113
181
char **PushPointers(int nNeeded);
114
182
void PopPointers(char **p, int nNeeded);
115
 
int *PushIntegers(int nNeeded);
116
 
void PopIntegers(int *pi, int nNeeded);
 
183
reg_ref **PushRegisters(int nNeeded);
 
184
void PopRegisters(reg_ref **p, int nNeeded);
 
185
 
117
186
extern const signed char mux_RegisterSet[256];
118
187
extern const char *ColorTable[256];
119
188
 
 
189
#if defined(FIRANMUX)
 
190
char *linewrap_desc(char *);
 
191
char *linewrap_general(char *, int, const char *, const char *);
 
192
#endif // FIRANMUX
 
193
 
120
194
/* From game.cpp */
121
195
#define notify(p,m)                         notify_check(p,p,m, MSG_PUP_ALWAYS|MSG_ME_ALL|MSG_F_DOWN)
122
196
#define notify_saypose(p,m)                 notify_check(p,p,m, MSG_PUP_ALWAYS|MSG_ME_ALL|MSG_F_DOWN|MSG_SAYPOSE)
181
255
void dump_database_internal(int);
182
256
void fork_and_dump(int key);
183
257
 
 
258
#define MUX_OPEN_INVALID_HANDLE_VALUE (-1)
 
259
bool mux_fopen(FILE **pFile, const char *filename, const char *mode);
 
260
bool mux_open(int *pfh, const char *filename, int oflag);
 
261
const char *mux_strerror(int errnum);
 
262
 
184
263
/* From help.cpp */
185
264
void helpindex_clean(int);
186
265
void helpindex_load(dbref);
210
289
/* From look.cpp */
211
290
void look_in(dbref,dbref, int);
212
291
void show_vrml_url(dbref, dbref);
213
 
size_t decode_attr_flags(int aflags, char *buff);
 
292
#define NUM_ATTRIBUTE_CODES 12
 
293
size_t decode_attr_flags(int aflags, char buff[NUM_ATTRIBUTE_CODES+1]);
 
294
void   decode_attr_flag_names(int aflags, char *buf, char **bufc);
214
295
 
215
296
/* From move.cpp */
216
297
void move_object(dbref, dbref);
231
312
void  empty_obj(dbref);
232
313
 
233
314
/* From player.cpp */
234
 
dbref create_player(char *name, char *pass, dbref executor, bool isrobot, const char **pmsg);
 
315
dbref create_player(const char *name, const char *pass, dbref executor, bool isrobot, const char **pmsg);
235
316
void AddToPublicChannel(dbref player);
236
317
bool add_player_name(dbref, const char *);
237
318
bool delete_player_name(dbref, const char *);
261
342
bool canpayfees(dbref, dbref, int, int);
262
343
void giveto(dbref,int);
263
344
bool payfor(dbref,int);
264
 
char *MakeCanonicalObjectName(const char *pName, int *pnName, bool *pbValid);
265
 
char *MakeCanonicalExitName(const char *pName, int *pnName, bool *pbValid);
 
345
char *MakeCanonicalObjectName(const char *pName, size_t *pnName, bool *pbValid);
 
346
char *MakeCanonicalExitName(const char *pName, size_t *pnName, bool *pbValid);
266
347
bool ValidatePlayerName(const char *pName);
267
348
bool ok_password(const char *szPassword, const char **pmsg);
268
349
void handle_ears(dbref, bool, bool);
276
357
bool nearby(dbref, dbref);
277
358
bool exit_visible(dbref, dbref, int);
278
359
bool exit_displayable(dbref, dbref, int);
279
 
void did_it(dbref, dbref, int, const char *, int, const char *, int, char *[], int);
 
360
void did_it(dbref player, dbref thing, int what, const char *def, int owhat,
 
361
            const char *odef, int awhat, int ctrl_flags,
 
362
            char *args[], int nargs);
280
363
bool bCanReadAttr(dbref executor, dbref target, ATTR *tattr, bool bParentCheck);
281
364
bool bCanSetAttr(dbref executor, dbref target, ATTR *tattr);
282
365
bool bCanLockAttr(dbref executor, dbref target, ATTR *tattr);
289
372
#define match_controlled(player,name)       match_controlled_handler(player, name, false)
290
373
#define match_controlled_quiet(player,name) match_controlled_handler(player, name, true)
291
374
void set_modified(dbref thing);
 
375
void TranslateFlags_Clone
 
376
(
 
377
    FLAG     aClearFlags[3],
 
378
    dbref    executor,
 
379
    int      key
 
380
);
 
381
void TranslateFlags_Chown
 
382
(
 
383
    FLAG     aClearFlags[3],
 
384
    FLAG     aSetFlags[3],
 
385
    bool    *bClearPowers,
 
386
    dbref    executor,
 
387
    int      key
 
388
);
 
389
void SetClearFlags(dbref thing, FLAG aClearFlags[3], FLAG aSetFlags[3]);
292
390
 
293
391
/* From boolexp.cpp */
294
392
bool eval_boolexp(dbref, dbref, dbref, BOOLEXP *);
327
425
/* From command.cpp */
328
426
bool check_access(dbref player, int mask);
329
427
void set_prefix_cmds(void);
330
 
char *process_command(dbref executor, dbref caller, dbref enactor, bool,
 
428
char *process_command(dbref executor, dbref caller, dbref enactor, int, bool,
331
429
    char *, char *[], int);
 
430
size_t LeftJustifyString(char *field, size_t nWidth, const char *value);
 
431
size_t RightJustifyNumber(char *field, size_t nWidth, INT64 value, char chFill);
332
432
 
333
433
#define Protect(f) (cmdp->perms & f)
334
434
 
345
445
const char *Name(dbref thing);
346
446
const char *PureName(dbref thing);
347
447
const char *Moniker(dbref thing);
348
 
int  fwdlist_load(FWDLIST *, dbref, char *);
 
448
FWDLIST *fwdlist_load(dbref player, char *atext);
349
449
void fwdlist_set(dbref, FWDLIST *);
350
450
void fwdlist_clr(dbref);
351
451
int  fwdlist_rewrite(FWDLIST *, char *);
358
458
void atr_cpy(dbref dest, dbref source, bool bInternal);
359
459
void atr_chown(dbref);
360
460
void atr_clr(dbref, int);
361
 
void atr_add_raw_LEN(dbref, int, const char *, int);
 
461
void atr_add_raw_LEN(dbref, int, const char *, size_t n);
362
462
void atr_add_raw(dbref, int, const char *);
363
463
void atr_add(dbref, int, char *, dbref, int);
364
464
void atr_set_flags(dbref, int, int);
395
495
#define CEMIT_NOHEADER  1   /* Channel emit without header */
396
496
#define CHOWN_ONE       1   /* item = new_owner */
397
497
#define CHOWN_ALL       2   /* old_owner = new_owner */
398
 
//#define CHOWN_NOSTRIP   4   /* Don't strip (most) flags from object */
 
498
#define CHOWN_NOSTRIP   4   /* Don't strip (most) flags from object */
399
499
#define CHOWN_NOZONE    8   /* Strip zones from objects */
400
500
#define CLIST_FULL      1   /* Full listing of channels */
401
501
#define CLIST_HEADERS   2   /* Lists channel headers, like "[Public]" */
407
507
#define CLONE_SET_LOC   16  /* ARG2 is location of cloned object */
408
508
#define CLONE_SET_NAME  32  /* ARG2 is alternate name of cloned object */
409
509
#define CLONE_FROM_PARENT 64 /* Set parent on obj instd of cloning attrs */
 
510
#define CLONE_NOSTRIP   128 // Don't strip (most) flags from object.
410
511
#define CBOOT_QUIET     1   // Cboot without a message
411
512
#define COMTITLE_ON     1   // Turn Comtitles on.
412
513
#define COMTITLE_OFF    2   // Turn Comtitles off.
614
715
#define SWITCH_DEFAULT  0   /* Use the configured default for switch */
615
716
#define SWITCH_ANY      1   /* Execute all cases that match */
616
717
#define SWITCH_ONE      2   /* Execute only first case that matches */
 
718
#define SWITCH_MASK     3   /* Includes lower 2 bits */
 
719
#define SWITCH_NOTIFY   4   /* Send a @notify after the @switch is completed */
617
720
#define SWEEP_ME        1   /* Check my inventory */
618
721
#define SWEEP_HERE      2   /* Check my location */
619
722
#define SWEEP_COMMANDS  4   /* Check for $-commands */
631
734
#define TIMECHK_LOG     4   /* Write info to log */
632
735
#define TOAD_NO_CHOWN   1   /* Don't change ownership */
633
736
#define TRIG_QUIET      1   /* Don't display 'Triggered.' message. */
 
737
#define TRIG_NOTIFY     2   /* Send a @notify after the @trigger is completed. */
634
738
#define TWARP_QUEUE     1   /* Warp the wait and sem queues */
635
739
#define TWARP_DUMP      2   /* Warp the dump interval */
636
740
#define TWARP_CLEAN     4   /* Warp the cleaning interval */
637
741
#define TWARP_IDLE      8   /* Warp the idle check interval */
638
742
/* empty       16 */
639
743
#define TWARP_EVENTS    32  /* Warp the events checking interval */
 
744
#define VERB_NONAME     1   // Do not preprend name to odefault.
640
745
#define WAIT_UNTIL      1   // Absolute UTC seconds instead of delta.
641
746
 
642
747
/* Hush codes for movement messages */
661
766
#define EV_NO_COMPRESS  0x00040000  /* Don't compress spaces. */
662
767
#define EV_NO_LOCATION  0x00080000  /* Supresses %l */
663
768
#define EV_NOFCHECK     0x00100000  /* Do not evaluate functions! */
 
769
#define EV_TRACE        0x00200000  /* Request a trace of this call to eval */
664
770
 
665
771
/* Message forwarding directives */
666
772
 
765
871
    int chPoseType,
766
872
    char *message
767
873
);
768
 
void do_say(dbref executor, dbref caller, dbref enactor, int key,
 
874
void do_say(dbref executor, dbref caller, dbref enactor, int eval, int key,
769
875
                   char *message);
770
876
 
771
877
int  boot_off(dbref player, const char *message);
813
919
extern int      nMainGamePorts;
814
920
 
815
921
#ifdef WIN32
816
 
extern DWORD platform;
 
922
extern bool bUseCompletionPorts;;
817
923
#else // WIN32
818
924
extern int maxd;
819
925
#endif // WIN32
862
968
//    heap.
863
969
//
864
970
// If you ever re-implement this object using another data structure,
865
 
// please remember to maintain the properties properties.
 
971
// please remember to maintain this property.
866
972
//
867
973
typedef void FTASK(void *, int);
868
974
 
912
1018
    CTaskHeap();
913
1019
    ~CTaskHeap();
914
1020
 
915
 
    void Insert(PTASK_RECORD, SCHCMP *);
 
1021
    void Shrink(void);
 
1022
    bool Insert(PTASK_RECORD, SCHCMP *);
916
1023
    PTASK_RECORD PeekAtTopmost(void);
917
1024
    PTASK_RECORD RemoveTopmost(SCHCMP *);
918
1025
    void CancelTask(FTASK *fpTask, void *arg_voidptr, int arg_Integer);
945
1052
    int  RunTasks(const CLinearTimeAbsolute& tNow);
946
1053
    void ReadyTasks(const CLinearTimeAbsolute& tNow);
947
1054
    void CancelTask(FTASK *fpTask, void *arg_voidptr, int arg_Integer);
 
1055
    void Shrink(void);
948
1056
 
949
1057
    void SetMinPriority(int arg_minPriority);
950
1058
    int  GetMinPriority(void) { return m_minPriority; }
1011
1119
//
1012
1120
void cache_redirect(void);
1013
1121
void cache_pass2(void);
 
1122
void cache_cleanup(void);
1014
1123
extern CLinearTimeAbsolute cs_ltime;
1015
1124
 
1016
1125
// From speech.cpp
1019
1128
 
1020
1129
// From funceval.cpp
1021
1130
//
 
1131
#ifdef DEPRECATED
1022
1132
void stack_clr(dbref obj);
1023
 
bool parse_and_get_attrib(dbref, char *[], char **, dbref *, char *, char **);
 
1133
#endif // DEPRECATED
 
1134
bool parse_and_get_attrib(dbref, char *[], char **, dbref *, dbref *, int *, char *, char **);
 
1135
void SimplifyColorLetters(char Out[8], char *pIn);
1024
1136
 
1025
1137
#endif // EXTERNS_H