amxmodx/plugins/include/nvault.inc

62 lines
1.6 KiB
PHP
Raw Normal View History

2005-08-01 20:22:01 +00:00
/* nVault functions
*
* by the AMX Mod X Development Team
*
* This file is provided as is (no warranties).
*/
#if defined _nvault_included
#endinput
#endif
#define _nvault_included
2006-05-10 10:42:49 +00:00
#if AMXX_VERSION_NUM >= 175
#pragma reqlib nvault
#if !defined AMXMODX_NOAUTOLOAD
#pragma loadlib nvault
#endif
#else
#pragma library nvault
#endif
2005-08-02 11:12:42 +00:00
2006-08-20 21:23:38 +00:00
/* All timestamps are in UNIX epoch form. */
/* Opens a vault by name (such as "myvault")
* Returns a vault id, INVALID_HANDLE otherwise (-1)
*/
2005-08-01 20:22:01 +00:00
native nvault_open(const name[]);
2006-08-20 21:23:38 +00:00
/* Gets a vault value by returning an int
* setting a byref float or setting a string + maxlength
*/
2005-08-01 20:22:01 +00:00
native nvault_get(vault, const key[], ...);
2006-08-20 21:23:38 +00:00
/* Looks up a vault value for full information
* Returns 0 if the entry is not found
*/
2005-08-01 20:22:01 +00:00
native nvault_lookup(vault, const key[], value[], maxlen, &timestamp)
2006-08-20 21:23:38 +00:00
/* Sets a vault value (with current timestamp) */
2005-08-01 20:22:01 +00:00
native nvault_set(vault, const key[], const value[]);
2006-08-20 21:23:38 +00:00
/* Sets a permanent vault value (no timestamp) */
2005-08-01 20:22:01 +00:00
native nvault_pset(vault, const key[], const value[]);
2006-08-20 21:23:38 +00:00
/* Prunes the vault for entries that are within the given timestamps.
* This will not erase values set with pset
*/
2005-08-01 20:22:01 +00:00
native nvault_prune(vault, start, end);
2006-08-20 21:23:38 +00:00
/* Closes a vault */
2005-08-01 20:22:01 +00:00
native nvault_close(vault);
2006-04-26 05:21:29 +00:00
2006-08-20 21:23:38 +00:00
/* Removes a key from the vault */
2006-04-26 05:21:29 +00:00
native nvault_remove(vault, const key[]);
2006-08-20 21:23:38 +00:00
/* "Touches" a key to update its timestamp value.
* If stamp is -1 (default), it will use the current time.
* Like the unix command "touch," it will create an empty key
* if the value does not exist.
*/
native nvault_touch(vault, const key[], timestamp=-1);