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:
csoler 2009-08-25 12:04:43 +00:00
parent bb7e3684f0
commit 3c09b4f2d2
19 changed files with 846 additions and 220 deletions

View file

@ -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)