本文整理汇总了C++中readPointer函数的典型用法代码示例。如果您正苦于以下问题:C++ readPointer函数的具体用法?C++ readPointer怎么用?C++ readPointer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readPointer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:levenkov,项目名称:olver,代码行数:25,代码来源:wstr_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:25,代码来源:wstr_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:30,代码来源:wtoken_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:27,代码来源:wstr_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:32,代码来源:token_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:25,代码来源:compress_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:25,代码来源:compress_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:35,代码来源:compress_agent.c
示例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;
}
开发者ID:HJvT,项目名称:hat,代码行数:33,代码来源:animnode.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:27,代码来源:compress_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:25,代码来源:str_agent.c
示例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;
}
开发者ID:HJvT,项目名称:hat,代码行数:35,代码来源:animnode.c
示例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;
}
开发者ID:HJvT,项目名称:hat,代码行数:20,代码来源:animnode.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:27,代码来源:compress_agent.c
示例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;
}
开发者ID:levenkov,项目名称:olver,代码行数:26,代码来源:line_agent.c
示例16: gzputs_cmd
static TACommandVerdict gzputs_cmd(TAThread thread,TAInputStream stream)
{
void* file;
char* s;
int res, errnum;
file = readPointer(&stream);
s = readString(&stream);
START_TARGET_OPERATION(thread);
res = gzputs(file, s);
END_TARGET_OPERATION(thread);
gzerror(file, &errnum);
writeInt(thread, errnum);
writeInt(thread, errno);
writeInt(thread, res);
sendResponse(thread);
return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:25,代码来源:compress_agent.c
示例17: readString
void File::readHeader(File::Block& block) {
block.code = readString(4);
//clean the code of potential 0s at end
string cleanCode = "";
for(char c: block.code) {
if(c != 0)
cleanCode += c;
}
block.code = cleanCode;
if(block.code != "ENDB") {
block.size = read<unsigned int>();
block.address = readPointer();
block.SDNAIndex = read<unsigned int>();
block.count = read<unsigned int>();
block.offset = file.tellg();
} else {
block.size = read<unsigned int>();
block.address = 0;
block.SDNAIndex = 0;
block.count = 0;
block.offset = file.tellg();
}
}
开发者ID:tsky1971,项目名称:ofxBlender,代码行数:25,代码来源:File.cpp
示例18: iconv_close_cmd
static TACommandVerdict iconv_close_cmd(TAThread thread, TAInputStream stream)
{
iconv_t cd;
int res;
int save_errno;
// Prepare
cd = (iconv_t)readPointer(&stream);
errno = 0;
START_TARGET_OPERATION(thread);
// Execute
res = iconv_close(cd);
save_errno = errno;
END_TARGET_OPERATION(thread);
// Response
writeInt(thread, res);
writeInt(thread, save_errno);
sendResponse(thread);
return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:26,代码来源:iconv_agent.c
示例19: confstr_cmd
static TACommandVerdict confstr_cmd(TAThread thread,TAInputStream stream)
{
int name;
size_t res;
char * buf;
size_t len;
/* Prepare */
name = readInt(&stream);
buf = (char*)readPointer(&stream);
len = readSize(&stream);
/* [ Set errno ] */
errno = readInt(&stream);
START_TARGET_OPERATION(thread);
/* Execute */
res = confstr(name,buf,len);
END_TARGET_OPERATION(thread);
/* Response */
writeSize(thread, res);
writeInt(thread, errno);
sendResponse(thread);
return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:30,代码来源:sysconf_agent.c
示例20: strndup_cmd
static TACommandVerdict strndup_cmd(TAThread thread, TAInputStream stream)
{
char* s;
size_t n;
char* res;
// Prepare
s = (char*)readPointer(&stream);
n = readSize(&stream);
START_TARGET_OPERATION(thread);
// Execute
errno = 0;
res = strndup(s,n);
END_TARGET_OPERATION(thread);
// Execute
// Response
writePointer(thread, res);
writeInt(thread, errno);
sendResponse(thread);
return taDefaultVerdict;
}
开发者ID:levenkov,项目名称:olver,代码行数:26,代码来源:str_agent.c
注:本文中的readPointer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论