Guess I forgot to close this.
3 * ===============================================================
4 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
5 * ===============================================================
7 * This file is part of the SourceMod/SourcePawn SDK. This file may only be used
8 * or modified under the Terms and Conditions of its License Agreement, which is found
9 * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
10 * may change at any time. To view the latest information, see:
11 * http://www.sourcemod.net/license.php
16 #if defined _datapack_included
19 #define _datapack_included
23 * Creates a new data pack.
25 * @return A Handle to the data pack. Must be closed with CloseHandle().
27 native Handle:CreateDataPack();
30 * Packs a normal cell into a data pack.
32 * @param pack Handle to the data pack.
33 * @param cell Cell to add.
35 * @error Invalid handle.
37 native WritePackCell(Handle:pack, cell);
40 * Packs a float into a data pack.
42 * @param pack Handle to the data pack.
43 * @param val Float to add.
45 * @error Invalid handle.
47 native WritePackFloat(Handle:pack, Float:val);
50 * Packs a string into a data pack.
52 * @param pack Handle to the data pack.
53 * @param str String to add.
55 * @error Invalid handle.
57 native WritePackString(Handle:pack, String:str[]);
60 * Reads a cell from a data pack.
62 * @param pack Handle to the data pack.
64 * @error Invalid handle, or bounds error.
66 native ReadPackCell(Handle:pack);
69 * Reads a float from a data pack.
71 * @param pack Handle to the data pack.
72 * @return Float value.
73 * @error Invalid handle, or bounds error.
75 native Float:ReadPackFloat(Handle:pack);
78 * Reads a string from a data pack.
80 * @param pack Handle to the data pack.
81 * @param buffer Destination string buffer.
82 * @param maxlen Maximum length of output string buffer.
84 * @error Invalid handle, or bounds error.
86 native ReadPackString(Handle:pack, String:buffer[], maxlen);
89 * Resets the position in a data pack.
91 * @param pack Handle to the data pack.
92 * @param clear If true, clears the contained data.
94 * @error Invalid handle.
96 native ResetPack(Handle:pack, bool:clear=false);
99 * Returns the read or write position in a data pack.
101 * @param pack Handle to the data pack.
102 * @return Numerical position in the data pack.
103 * @error Invalid handle.
105 native GetPackPosition(Handle:pack);
108 * Sets the read/write position in a data pack.
110 * @param pack Handle to the data pack.
111 * @param position New position to set.
113 * @error Invalid handle, or position is beyond the pack bounds.
115 native SetPackPosition(Handle:pack, position);
118 * Returns whether or not a specified number of bytes from the data pack
119 * position to the end can be read.
121 * @param pack Handle to the data pack.
122 * @param bytes Number of bytes to simulate reading.
123 * @return True if can be read, false otherwise.
124 * @error Invalid handle.
126 native bool:IsPackReadable(Handle:pack, bytes);