Parent Directory | Revision Log
Revision 17 - (view) (download)
1 : | ian | 1 | /* nVault functions |
2 : | * | ||
3 : | * by the AMX Mod X Development Team | ||
4 : | * | ||
5 : | * This file is provided as is (no warranties). | ||
6 : | */ | ||
7 : | |||
8 : | #if defined _nvault_included | ||
9 : | #endinput | ||
10 : | #endif | ||
11 : | #define _nvault_included | ||
12 : | |||
13 : | #if AMXX_VERSION_NUM >= 175 | ||
14 : | #pragma reqlib nvault | ||
15 : | #if !defined AMXMODX_NOAUTOLOAD | ||
16 : | #pragma loadlib nvault | ||
17 : | #endif | ||
18 : | #else | ||
19 : | #pragma library nvault | ||
20 : | #endif | ||
21 : | |||
22 : | /* All timestamps are in UNIX epoch form. */ | ||
23 : | |||
24 : | /* Opens a vault by name (such as "myvault") | ||
25 : | * Returns a vault id, INVALID_HANDLE otherwise (-1) | ||
26 : | */ | ||
27 : | native nvault_open(const name[]); | ||
28 : | |||
29 : | /* Gets a vault value by returning an int | ||
30 : | * setting a byref float or setting a string + maxlength | ||
31 : | */ | ||
32 : | ian | 17 | native nvault_get(vault, const key[], {Float,_}:...); |
33 : | ian | 1 | |
34 : | /* Looks up a vault value for full information | ||
35 : | * Returns 0 if the entry is not found | ||
36 : | */ | ||
37 : | native nvault_lookup(vault, const key[], value[], maxlen, ×tamp); | ||
38 : | |||
39 : | /* Sets a vault value (with current timestamp) */ | ||
40 : | native nvault_set(vault, const key[], const value[]); | ||
41 : | |||
42 : | /* Sets a permanent vault value (no timestamp) */ | ||
43 : | native nvault_pset(vault, const key[], const value[]); | ||
44 : | |||
45 : | /* Prunes the vault for entries that are within the given timestamps. | ||
46 : | * This will not erase values set with pset | ||
47 : | */ | ||
48 : | native nvault_prune(vault, start, end); | ||
49 : | |||
50 : | /* Closes a vault */ | ||
51 : | native nvault_close(vault); | ||
52 : | |||
53 : | /* Removes a key from the vault */ | ||
54 : | native nvault_remove(vault, const key[]); | ||
55 : | |||
56 : | /* "Touches" a key to update its timestamp value. | ||
57 : | * If stamp is -1 (default), it will use the current time. | ||
58 : | * Like the unix command "touch," it will create an empty key | ||
59 : | * if the value does not exist. | ||
60 : | */ | ||
61 : | native nvault_touch(vault, const key[], timestamp=-1); |
Contact | ViewVC Help |
Powered by ViewVC 1.0.4 |