Merge pull request #122 from peace-maker/datapack_funcpointer

Add WritePackFunction and ReadPackFunction natives
This commit is contained in:
David Anderson
2014-08-12 10:33:27 -07:00
5 changed files with 176 additions and 12 deletions
+14
View File
@@ -113,6 +113,13 @@ namespace SourceMod
* @return Pointer to the data, or NULL if out of bounds.
*/
virtual void *ReadMemory(size_t *size) const =0;
/**
* @brief Reads a function pointer from the data stream.
*
* @return A function pointer read from the current position.
*/
virtual cell_t ReadFunction() const =0;
};
/**
@@ -160,6 +167,13 @@ namespace SourceMod
* @return Current position of the stream beforehand.
*/
virtual size_t CreateMemory(size_t size, void **addr) =0;
/**
* @brief Packs one function pointer into the data stream.
*
* @param function The function pointer to write.
*/
virtual void PackFunction(cell_t function) =0;
};
}