MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // MorgenGrauen MUDlib |
| 2 | // |
| 3 | // defines.h -- Nuetzliche und oft gebrauchte Definitionen |
| 4 | // |
| 5 | // $Id: defines.h 7265 2009-08-21 18:13:22Z Zesstra $ |
| 6 | |
| 7 | #ifndef _DEFINES_H_ |
| 8 | #define _DEFINES_H_ |
| 9 | |
| 10 | // defines.h darf leider keine Standard-Includeverzeichnisse benutzen, weils |
| 11 | // es vom Master selber benutzt wird. |
| 12 | #include "/sys/break_string.h" |
| 13 | |
| 14 | #ifndef ME |
| 15 | #define ME this_object() |
| 16 | #endif |
| 17 | |
| 18 | #ifndef PL |
| 19 | #define PL this_player() |
| 20 | #endif |
| 21 | |
| 22 | #ifndef RPL |
| 23 | #define RPL this_interactive() |
| 24 | #endif |
| 25 | |
| 26 | #ifndef CAP |
| 27 | #define CAP(str) capitalize(str) |
| 28 | #endif |
| 29 | |
| 30 | #ifndef QPP |
| 31 | #define QPP QueryPossPronoun |
| 32 | #endif |
| 33 | |
| 34 | #define REAL_UID(x) (explode(getuid(x), ".")[<1]) |
| 35 | #define REAL_EUID(x) (explode(geteuid(x), ".")[<1]) |
| 36 | |
| 37 | // obsolet, nur aus Kompatibilitaetsgruenden noch vorhanden |
| 38 | #ifndef IS_CLONE |
| 39 | #define IS_CLONE(ob) (clonep(ob)) |
| 40 | #endif |
| 41 | |
| 42 | // obsolet, nur aus Kompatibilitaetsgruenden noch vorhanden |
| 43 | #ifndef IS_BLUE |
| 44 | #define IS_BLUE(ob) (!clonep(ob)) |
| 45 | #endif |
| 46 | |
| 47 | #ifndef BLUE_NAME |
| 48 | #define BLUE_NAME(ob) load_name(ob) |
| 49 | //#define BLUE_NAME(ob) (explode(object_name(ob),"#")[0]) |
| 50 | #endif |
| 51 | |
| 52 | #ifndef IS_PARA |
| 53 | #define IS_PARA(ob) (sizeof(regexp(({to_string(ob)}),"\\^[1-9][0-9]*$"))) |
| 54 | |
| 55 | #endif |
| 56 | |
| 57 | // obsolet, nur aus Kompatibilitaetsgruenden noch vorhanden |
| 58 | #ifndef MAX |
| 59 | #define MAX(a,b) max(a,b) |
| 60 | #endif |
| 61 | |
| 62 | #endif /* _DEFINES_H_ */ |
| 63 | |