mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-08 17:15:16 -04:00
added regexp search to turtle router
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1564 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bb7e3684f0
commit
3c09b4f2d2
19 changed files with 846 additions and 220 deletions
|
@ -32,6 +32,40 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
/* UInt8 get/set */
|
||||
|
||||
bool getRawUInt8(void *data, uint32_t size, uint32_t *offset, uint8_t *out)
|
||||
{
|
||||
/* first check there is space */
|
||||
if (size < *offset + 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
void *buf = (void *) &(((uint8_t *) data)[*offset]);
|
||||
|
||||
/* extract the data */
|
||||
memcpy(out, buf, sizeof(uint8_t));
|
||||
(*offset) += 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool setRawUInt8(void *data, uint32_t size, uint32_t *offset, uint8_t in)
|
||||
{
|
||||
/* first check there is space */
|
||||
if (size < *offset + 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void *buf = (void *) &(((uint8_t *) data)[*offset]);
|
||||
|
||||
/* pack it in */
|
||||
memcpy(buf, &in, sizeof(uint8_t));
|
||||
|
||||
(*offset) += 1;
|
||||
return true;
|
||||
}
|
||||
/* UInt16 get/set */
|
||||
|
||||
bool getRawUInt16(void *data, uint32_t size, uint32_t *offset, uint16_t *out)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue