本文整理汇总了C++中POST函数的典型用法代码示例。如果您正苦于以下问题:C++ POST函数的具体用法?C++ POST怎么用?C++ POST使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了POST函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buff_post
void buff_post(void *x, t_buff_info *buff)
{
if (buff->has_obj == false) { POST("Buffer \"%s\" not found.", buff->sym->s_name); }
else {
POST("Buffer \"%s\": Channels: %i - Frames: %i - Samplerate (smp / ms): %f",
buff->sym->s_name, buff->ch_cnt, buff->fr_cnt, buff->msr); }
}
示例2: POST
void BST<T>::POST (const TreeNode<T> *n) const {
if (n != NULL) {
POST (n->left);
POST (n->right);
std::cout << n->v << " ";
}
}
示例3: _defer_delete
void _defer_delete(t_filesys *x, t_symbol *sym, long argc, t_atom *argv)
{
TRACE("_defer_delete");
char str_cur[MAX_PATH_CHARS];
t_symbol *sym_cur = atom_getsym(argv);
_filesys_get_path(x, sym_cur->s_name, str_cur);
// Try deleting the file
int err = 0;
#ifdef WIN_VERSION
err = remove(str_cur);
#endif
#ifdef MAC_VERSION
err = remove(str_cur);
#endif
// In case of success
if (!err) { if (x->a_verbose) { POST("Removing: %s", sym_cur->s_name); } }
// ... otherwise post an error message
else {
switch (errno) {
case EACCES: MY_ERR("delete: File is open or read-only: \"%s\"",
sym_cur->s_name); break;
case ENOENT: MY_ERR("delete: File not found: \"%s\"", sym_cur->s_name); break;
default: MY_ERR("delete: Unknown error: %i", errno); break; } }
// Send a 0 or 1 message to indicate failure or success
outlet_int(x->outl_return, err ? 0 : 1);
}
示例4: _dict_recurse_value_find
void _dict_recurse_value_find(t_dict_recurse *x, t_atom *value, const char* str)
{
TRACE("_dict_recurse_value_find");
switch (x->command) {
case CMD_FIND_KEY:
if (x->has_match) { POST(" %s %s", x->path, str); }
x->has_match = false; // reset matching state
case CMD_FIND_KEY_IN:
if (x->has_match) { POST(" %s %s", x->path, str); }
break;
default: break; }
}
示例5: dns_rpz_policy2str
const char *
dns_rpz_policy2str(dns_rpz_policy_t policy) {
const char *str;
switch (policy) {
case DNS_RPZ_POLICY_PASSTHRU:
str = "PASSTHRU";
break;
case DNS_RPZ_POLICY_NXDOMAIN:
str = "NXDOMAIN";
break;
case DNS_RPZ_POLICY_NODATA:
str = "NODATA";
break;
case DNS_RPZ_POLICY_RECORD:
str = "Local-Data";
break;
case DNS_RPZ_POLICY_CNAME:
case DNS_RPZ_POLICY_WILDCNAME:
str = "CNAME";
break;
default:
str = "";
POST(str);
INSIST(0);
}
return (str);
}
示例6: streaming_readfunc
size_t streaming_readfunc(void* ptr, size_t size, size_t nmemb, void* stream) {
LOG(LOG_INFO, "entry\n");
IOBuf* b = (IOBuf*)stream;
ObjectStream* os = (ObjectStream*)b->user_data;
size_t total = (size * nmemb);
LOG(LOG_INFO, "(%08lx) curl buff %ld\n", (size_t)os, total);
// wait for producer to fill buffers
WAIT(&os->iob_full);
LOG(LOG_INFO, "(%08lx) avail-data: %ld\n", (size_t)os, b->avail);
// maybe we were requested to quit or abort?
if (b->write_count == 0) {
// called by stream_sync()
LOG(LOG_INFO, "(%08lx) got EOF\n", (size_t)os);
POST(&os->iob_empty); // polite
return 0;
}
else if (b->first->buf == (char*)1) {
// called by stream_abort()
LOG(LOG_INFO, "(%08lx) got ABORT\n", (size_t)os);
POST(&os->iob_empty); // polite
return CURL_READFUNC_ABORT;
}
// move producer's data into curl buffers.
// (Might take more than one callback)
size_t move_req = ((total <= b->avail) ? total : b->avail);
size_t moved = aws_iobuf_get_raw(b, (char*)ptr, move_req);
// track total size
os->written += moved;
LOG(LOG_INFO, "(%08lx) moved %ld (total: %ld)\n", (size_t)os, moved, os->written);
if (b->avail) {
LOG(LOG_INFO, "(%08lx) iterating (avail: %ld)\n", (size_t)os, b->avail);
POST(&os->iob_full); // next callback is pre-approved
}
else {
LOG(LOG_INFO, "(%08lx) done with buffer (total written %ld)\n", (size_t)os, os->written);
POST(&os->iob_empty); // tell producer that buffer is used
}
return moved;
}
示例7: PRE_MSG
/// Initializes the global state of the CLI.
///
/// This function can only be called once during the execution of a program,
/// unless override_for_testing is set to true.
///
/// \param argv0 The value of argv[0]; i.e. the program name.
/// \param override_for_testing Should always be set to false unless for tests
/// of this functionality, which may set this to true to redefine internal
/// state.
void
cmdline::init(const char* argv0, const bool override_for_testing)
{
if (!override_for_testing)
PRE_MSG(Progname.empty(), "cmdline::init called more than once");
Progname = utils::fs::path(argv0).leaf_name();
LD(F("Program name: %s") % Progname);
POST(!Progname.empty());
}
示例8: atomsFromPackPrivate
void atomsFromPackPrivate(ListCount count, t_atom* listReturn, Pack* pack, unsigned int* index)
{
POST("count: %i, index: %i", count, (*index));
listReturn[(*index)] = pack->name;
/*char buf[256];
atom_string(& listReturn[*index],buf, 256);
POST("Writing: [%i] = %s",*index,buf);*/
unsigned int indexStart = (*index);
(*index) += 2;
ElementPackOrAtom* pElement=ListPackOrAtomGetFirst( & pack -> listSub);
if(pElement)
{
do
{
PackOrAtom* pPackOrAtom= pElement -> pData;
if(pPackOrAtom->isAtom)
{
listReturn[*index] = pPackOrAtom->atom;
/*char buf[256];
atom_string(& listReturn[*index],buf, 256);
POST("Writing: [%i] = %s",*index,buf);*/
(*index) += 1;
}
else
{
atomsFromPackPrivate( count- (*index), listReturn, &pPackOrAtom->pack, index);
//POST("end recursion!");
/*POST("INFO:");
char hurz[256];
atom_string(listReturn+temp,hurz,256);
post(hurz);*/
}
pElement = ListPackOrAtomGetNext( &pack->listSub, pElement);
}
while(pElement);
}
SETFLOAT(&listReturn[indexStart+1], (*index)-indexStart-2);
/*char buf2[256];
atom_string(& listReturn[indexStart+1], buf2, 256);
POST("Writing: [%i] = %s",indexStart+1,buf2);*/
/*
char buf3[256] = "";
//POST("indexStart: %i",indexStart,count
for(int i = indexStart; i < indexStart+count; i++)
{
atom_string(listReturn+i,buf3,256);
//post(buf3);
POST("\tatomList[%i]: %s", i, buf3);
}
*/
}
示例9: dict_re_simulate
void dict_re_simulate(t_dict_recurse *x, t_symbol *sym, long argc, t_atom *argv)
{
TRACE("dict_re_simulate");
t_bool test = re_simulate(x->re2, atom_getsym(argv)->s_name);
MY_ASSERT(x->re2->err != ERR_NONE, "Simulation error.");
POST("Search: %s - Match: %s%s%s - %s", x->re2->re_search_s, atom_getsym(argv)->s_name,
(x->re2->repl_sub_cnt) ? " - Replace: " : "", (x->re2->repl_sub_cnt) ? x->re2->replace_p : "",
test ? "MATCH" : "NO MATCH");
}
示例10: send
String thethingsiOClient::send() {
String received = "";
if (POST(regular_client, "/v2/things/" + token, "{\"values\":[" + data + "]}")) {
data = "";
delay(1000);
while (regular_client->available()) {
char c = (char)regular_client->read();
received.concat(c);
}
}
return received;
}
示例11: dict_re_compile
void dict_re_compile(t_dict_recurse *x, t_symbol *sym, long argc, t_atom *argv)
{
TRACE("dict_re_compile");
if (argc == 1) { re_compile(x->re2, atom_getsym(argv)->s_name, NULL); }
else if (argc == 2) { re_compile(x->re2, atom_getsym(argv)->s_name, atom_getsym(argv + 1)->s_name); }
MY_ASSERT(x->re2->err != ERR_NONE, "Compilation error.");
POST("Compile: %s %s - RPN: %s - States: %i - Flags: %i - Substr: %i %s",
x->re2->re_search_s, atom_getsym(argv + 1)->s_name, x->re2->rpn_s, x->re2->state_cnt,
x->re2->capt_flags, x->re2->repl_sub_cnt, x->re2->repl_sub_s);
}
示例12: stream_get
// Accept as much as <size>, from the streaming GET, into caller's <buf>.
// We may discover EOF at any time. In that case, we'll return however
// much was actually read. The next call
// will just short-circuit to return 0, signalling EOF to caller.
//
// return -1 with errno, for failures.
// else return number of chars we get.
//
ssize_t stream_get(ObjectStream* os,
char* buf,
size_t size) {
static const int get_timeout_sec = 10; /* totally made up out of thin air */
IOBuf* b = &os->iob; // shorthand
LOG(LOG_INFO, "entry\n");
if (! (os->flags & OSF_OPEN)) {
LOG(LOG_ERR, "%s isn't open\n", os->url);
errno = EINVAL; /* ?? */
return -1;
}
if (! (os->flags & OSF_READING)) {
LOG(LOG_ERR, "%s isn't open for reading\n", os->url);
errno = EINVAL; /* ?? */
return -1;
}
if (os->flags & OSF_EOF) {
LOG(LOG_INFO, "already at EOF\n");
return 0; // b->write_count;
}
os->flags &= ~(OSF_EOB);
aws_iobuf_reset(b); // doesn't affect <user_data>
aws_iobuf_extend_static(b, (char*)buf, size);
LOG(LOG_INFO, "got %ld-byte buffer for writefn\n", size);
// let writefn move data
POST(&os->iob_empty);
// wait for writefn to fill our buffer
LOG(LOG_INFO, "waiting for writefn\n");
SAFE_WAIT(&os->iob_full, get_timeout_sec, os);
// SAFE_WAIT_KILL(&os->iob_full, get_timeout_sec, os);
// writefn detected CURL EOF?
if (os->flags & OSF_EOF) {
LOG(LOG_INFO, "EOF is asserted\n");
}
if (os->flags & OSF_EOB) {
LOG(LOG_INFO, "EOB is asserted\n");
}
os->written += b->write_count;
LOG(LOG_INFO, "returning %ld (total=%ld)\n", b->write_count, os->written);
return (b->write_count);
}
示例13: mouse_multi_click2
void
mouse_multi_click2(size_t num_clicks, CGPoint point)
{
CGEventRef base_event = NEW_EVENT(
kCGEventLeftMouseDown,
point,
kCGMouseButtonLeft
);
CGEventSetIntegerValueField(base_event, kCGMouseEventClickState, num_clicks);
CHANGE(base_event, kCGEventLeftMouseDown);
POST(base_event);
CHANGE(base_event, kCGEventLeftMouseUp);
POSTRELEASE(base_event);
}
示例14: MY_ASSERT
void *filesys_new(t_symbol *sym, long argc, t_atom *argv)
{
t_filesys *x = NULL;
x = (t_filesys *)object_alloc(filesys_class);
MY_ASSERT(!x, NULL, "Object allocation failed.");
x->outl_return = bangout((t_object*)x); // Outlet 1: 0 or 1 for failure or success (int)
x->outl_mess = outlet_new((t_object*)x, NULL); // Outlet 0: General messages
_filesys_cd_patcher(x);
POST("New object created: directory: %s", x->dir_s);
return(x);
}
示例15: initialize_var
static
void
initialize_var(struct var *var, const char *envname)
{
PRE(var->value == NULL);
if (atf_env_has(envname)) {
const char *val = atf_env_get(envname);
if (strlen(val) > 0 || var->can_be_empty)
var->value = val;
else
var->value = var->default_value;
} else
var->value = var->default_value;
POST(var->value != NULL);
}