本文整理汇总了C++中readPointer函数的典型用法代码示例。如果您正苦于以下问题:C++ readPointer函数的具体用法?C++ readPointer怎么用?C++ readPointer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readPointer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wcpncpy_cmd
static TACommandVerdict wcpncpy_cmd(TAThread thread,TAInputStream stream)
{
wchar_t* dest;
wchar_t* src;
size_t n;
wchar_t* res;
// Prepare
dest = (wchar_t*)readPointer(&stream);
src = (wchar_t*)readPointer(&stream);
n = readSize(&stream);
START_TARGET_OPERATION(thread);
// Execute
res = wcpncpy(dest, src, n);
END_TARGET_OPERATION(thread);
// Response
writePointer(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
示例2: wcsncpy_cmd
static TACommandVerdict wcsncpy_cmd(TAThread thread, TAInputStream stream)
{
wchar_t* ws1;
wchar_t* ws2;
size_t n;
wchar_t* res;
// Prepare
ws1 = (wchar_t*)readPointer(&stream);
ws2 = (wchar_t*)readPointer(&stream);
n = readSize(&stream);
START_TARGET_OPERATION(thread);
// Execute
res = wcsncpy(ws1, ws2, n);
END_TARGET_OPERATION(thread);
// Response
writePointer(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
示例3: wcstok_cmd
static TACommandVerdict wcstok_cmd(TAThread thread,TAInputStream stream)
{
wchar_t* stringp, *buff, *delim, *res;
/*
freopen(NULL, "a+", stdout);
orient=fwide(stdout, 0);
wprintf(L"Before wcstok(wprintf): mode==%ls\n", orient>0?L"Wide": orient<0?L"Byte":L"Non oriented");
wprintf(L"Test==%ls\n", test);
ta_debug_printf("Before wcstok(printf): mode==%s\n", orient>0?"Wide": orient<0?"Byte":"Non oriented");
*/
// Prepare
stringp=(wchar_t*)readPointer(&stream);
delim=(wchar_t*)readPointer(&stream);
buff=(wchar_t*)readPointer(&stream);
// Execute
START_TARGET_OPERATION(thread);
res = wcstok(stringp, delim, &buff);
END_TARGET_OPERATION(thread);
// Response
writePointer(thread, res);
writePointer(thread, buff);
sendResponse(thread);
return taDefaultVerdict;
}
示例4: wcscmp_cmd
static TACommandVerdict wcscmp_cmd(TAThread thread, TAInputStream stream)
{
wchar_t* ws1;
wchar_t* ws2;
int res;
// Prepare
ws1 = (wchar_t*)readPointer(&stream);
ws2 = (wchar_t*)readPointer(&stream);
START_TARGET_OPERATION(thread);
print_wstring(ws1);
print_wstring(ws2);
// Execute
res = wcscmp(ws1, ws2);
ta_debug_printf("res %d\n", res);
END_TARGET_OPERATION(thread);
// Response
writeInt(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
示例5: strtok_r_cmd
static TACommandVerdict strtok_r_cmd(TAThread thread,TAInputStream stream)
{
char* stringp, *buff;
char *delim, *res;
// Prepare
stringp=(char*)readPointer(&stream);
delim=(char*)readPointer(&stream);
buff=(char*)readPointer(&stream);
ta_debug_printf("strtok_r...\n");
ta_debug_printf("stringp==%s\n", stringp);
ta_debug_printf("delim==%s\n", delim);
// Execute
START_TARGET_OPERATION(thread);
res = strtok_r(stringp, delim, &buff);
END_TARGET_OPERATION(thread);
ta_debug_printf("After...\n");
ta_debug_printf("stringp==%s\n", stringp);
ta_debug_printf("delim==%s\n", delim);
ta_debug_printf("buff==%s\n", buff);
// Response
writePointer(thread, res);
writePointer(thread, buff);
sendResponse(thread);
return taDefaultVerdict;
}
示例6: gzgets_cmd
static TACommandVerdict gzgets_cmd(TAThread thread,TAInputStream stream)
{
void* file;
char* buf, *res;
int len, errnum;
file = readPointer(&stream);
buf = (char*)readPointer(&stream);
len = readInt(&stream);
START_TARGET_OPERATION(thread);
res = gzgets(file, buf, len);
END_TARGET_OPERATION(thread);
gzerror(file, &errnum);
writeInt(thread, errnum);
writePointer(thread, (void*)res);
sendResponse(thread);
return taDefaultVerdict;
}
示例7: compress_cmd
static TACommandVerdict compress_cmd(TAThread thread,TAInputStream stream)
{
Bytef * dest, *source;
uLongf destLen, sourceLen;
int res;
dest = readPointer(&stream);
destLen = readULong(&stream);
source = readPointer(&stream);
sourceLen=readULong(&stream);
START_TARGET_OPERATION(thread);
res = compress(dest, &destLen, source, sourceLen);
END_TARGET_OPERATION(thread);
writePointer(thread, dest);
writeULong(thread, destLen);
writeInt(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
示例8: compress2_cmd
static TACommandVerdict compress2_cmd(TAThread thread,TAInputStream stream)
{
Bytef * dest, *source;
uLongf destLen, sourceLen;
int res, level;
dest = readPointer(&stream);
destLen = readULong(&stream);
source = readPointer(&stream);
sourceLen = readULong(&stream);
level = readInt(&stream);
ta_debug_printf("level==%d\n", level);
ta_debug_printf("source==%s\n", source);
START_TARGET_OPERATION(thread);
if(level==-1)
res = compress2(dest, &destLen, source, sourceLen,
Z_DEFAULT_COMPRESSION);
else
res = compress2(dest, &destLen, source, sourceLen, level);
END_TARGET_OPERATION(thread);
ta_debug_printf("dest==%s\n", dest);
writePointer(thread, dest);
writeULong(thread, destLen);
writeInt(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
示例9: readExpValueApp
/**
* Attempt to read a value applicaiton expression type node at a certain offset.
*
* @param hatFile The file to read the node from.
* @param offset The offset where the start of the node should be.
* @return A node construct containing the read values.
*/
node* readExpValueApp(FILE *hatFile, unsigned long offset)
{
int argIndex;
node *newNode = (node *)malloc(sizeof(node));
char tag;
newNode->nodeType = ExpValueApp;
newNode->offset = offset;
setFilePos(hatFile, offset);
tag = readByte(hatFile);
if (newNode->params.expValueApp.hasUse = hasSrcPos(tag))
{
newNode->params.expValueApp.use = readPointer(hatFile);
}
newNode->params.expValueApp.parent = readPointer(hatFile);
newNode->params.expValueApp.function = readPointer(hatFile);
newNode->params.expValueApp.arity = readArity(hatFile);
newNode->params.expValueApp.args = (unsigned long *)malloc(newNode->params.expValueApp.arity * sizeof(unsigned long));
for (argIndex = 0; argIndex < newNode->params.expValueApp.arity; argIndex++)
{
newNode->params.expValueApp.args[argIndex] = readPointer(hatFile);
}
return newNode;
}
示例10: gzread_cmd
static TACommandVerdict gzread_cmd(TAThread thread,TAInputStream stream)
{
void* file, *buf;
unsigned int len;
int errnum, res;
file = readPointer(&stream);
buf = readPointer(&stream);
len = readUInt(&stream);
START_TARGET_OPERATION(thread);
errno = 0;
res = gzread(file, buf, len);
END_TARGET_OPERATION(thread);
gzerror(file, &errnum);
writeInt(thread, errnum);
writeInt(thread, errno);
writeInt(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
示例11: strncpy_cmd
static TACommandVerdict strncpy_cmd(TAThread thread, TAInputStream stream)
{
char* s1;
char* s2;
size_t n;
char* res;
// Prepare
s1 = (char*)readPointer(&stream);
s2 = (char*)readPointer(&stream);
n = readSize(&stream);
START_TARGET_OPERATION(thread);
// Execute
res = strncpy(s1, s2, n);
END_TARGET_OPERATION(thread);
// Response
writePointer(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
示例12: readAtomConstructor
/**
* Attempt to read an atom constructor type node at a certain offset.
*
* @param hatFile The file to read the node from.
* @param offset The offset where the start of the node should be.
* @return A node construct containing the read values.
*/
node* readAtomConstructor(FILE *hatFile, unsigned long offset)
{
int argIndex;
char tag;
node *newNode = (node *)malloc(sizeof(node));
newNode->nodeType = AtomConstructor;
newNode->offset = offset;
setFilePos(hatFile, offset);
tag = readByte(hatFile);
newNode->params.atomConstructor.module = readPointer(hatFile);
newNode->params.atomConstructor.filePos = readPosition(hatFile);
readPosition(hatFile); /* skip position end */
newNode->params.atomConstructor.fix = readFixPri(hatFile);
newNode->params.atomConstructor.arity = readArity(hatFile);
newNode->params.atomConstructor.name = readString(hatFile);
if (newNode->params.atomConstructor.hasFields = hasFields(tag))
{
newNode->params.atomConstructor.args = (unsigned long *)malloc(newNode->params.atomConstructor.arity * sizeof(unsigned long));
for (argIndex = 0; argIndex < newNode->params.atomConstructor.arity; argIndex++)
{
newNode->params.atomConstructor.args[argIndex] = readPointer(hatFile);
}
}
return newNode;
}
示例13: readExpHidden
/**
* Attempt to read a hidden expression type node at a certain offset.
*
* @param hatFile The file to read the node from.
* @param offset The offset where the start of the node should be.
* @return A node construct containing the read values.
*/
node* readExpHidden(FILE *hatFile, unsigned long offset)
{
node *newNode = (node *)malloc(sizeof(node));
newNode->nodeType = ExpHidden;
newNode->offset = offset;
setFilePos(hatFile, offset + 1);
newNode->params.expHidden.parent = readPointer(hatFile);
newNode->params.expHidden.result = readPointer(hatFile);
return newNode;
}
示例14: crc32_cmd
static TACommandVerdict crc32_cmd(TAThread thread,TAInputStream stream)
{
uLong crc, res;
uInt len;
Bytef* buf;
// Prepare
crc = readULong(&stream);
buf = readPointer(&stream);
len = readUInt(&stream);
START_TARGET_OPERATION(thread);
res = crc32(crc, buf, len);
END_TARGET_OPERATION(thread);
if(buf==0)
ta_debug_printf("res==%u\n", res);
// Response
writeULong(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
示例15: mvwhline_cmd
static TACommandVerdict mvwhline_cmd(TAThread thread,TAInputStream stream)
{
WINDOW *win;
chtype ch;
int n;
int y;
int x;
int res;
win = readPointer(&stream);
y = readInt(&stream);
x = readInt(&stream);
ch = readChType(&stream);
n = readInt(&stream);
START_TARGET_OPERATION(thread);
res = mvwhline(win, y, x, ch, n);
END_TARGET_OPERATION(thread);
writeInt(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}