本文整理汇总了C++中push_int函数的典型用法代码示例。如果您正苦于以下问题:C++ push_int函数的具体用法?C++ push_int怎么用?C++ push_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了push_int函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: push_creature
void LuaCreature::OnCombatStart(Unit* mTarget)
{
NULL_BINDING_CHECK
lua_engine::BeginLuaFunctionCall(m_binding->refs[CREATURE_EVENT_ON_ENTER_COMBAT]);
push_creature(_unit);
push_int(CREATURE_EVENT_ON_ENTER_COMBAT);
push_unit(mTarget);
lua_engine::ExecuteLuaFunction(3);
RELEASE_LOCK
}
开发者ID:Refuge89,项目名称:Edge-of-Chaos,代码行数:12,代码来源:creature_functions.cpp
示例2: f_path_iterator_first
static void f_path_iterator_first(INT32 args)
{
struct cairo_mod_path* pw;
cairo_path_t* path;
int j,i;
pw = (struct cairo_mod_path*)get_storage(THIS->path_obj, cairo_mod_path_program);
path = pw->path;
THIS->idx = 0;
push_int(path->num_data > 0);
}
开发者ID:Rosuav,项目名称:PiCairo,代码行数:12,代码来源:cairopath.c
示例3: f_path_iterator_next
static void f_path_iterator_next(INT32 args)
{
struct cairo_mod_path* pw;
cairo_path_t* path;
int j,i;
pw = (struct cairo_mod_path*)get_storage(THIS->path_obj, cairo_mod_path_program);
path = pw->path;
THIS->idx++;
for (i=0,j=0; j<=THIS->idx && i<path->num_data; i+= path->data[i].header.length, j++);
push_int(THIS->idx >= 0 && THIS->idx < j);
}
开发者ID:Rosuav,项目名称:PiCairo,代码行数:12,代码来源:cairopath.c
示例4: f_ldap_unbind
/*
**| method: int unbind();
**| Unbind from the bound server.
**
**| returns: the LDAP error code
**
**| note: this method uses the OpenLDAP synchronous interface.
**
**| see_also: the OpenLDAP v2 ldap_unbind(3) manual page.
*/
static void
f_ldap_unbind(INT32 args)
{
if (THIS->bound) {
THIS->lerrno = ldap_unbind_s(THIS->conn);
THIS->bound = 0;
} else
THIS->lerrno = 0;
pop_n_elems(args);
push_int(THIS->lerrno);
}
开发者ID:hww3,项目名称:pexts,代码行数:23,代码来源:ol_ldap.c
示例5: f_msg_getfd
void f_msg_getfd(INT32 args) {
MESSAGE *message;
struct object *obj;
message=THISMSG->msg;
pop_n_elems(args);
if( message->fp ) {
obj=file_make_object_from_fd(fileno(message->fp), 0x1000,0);
push_object(obj);
} else
push_int(-1);
}
开发者ID:hww3,项目名称:pexts,代码行数:13,代码来源:mailstore_main.c
示例6: image_ilbm___decode
static void image_ilbm___decode(INT32 args)
{
unsigned char *s;
ptrdiff_t len;
struct pike_string *str;
struct mapping *m;
int n;
extern void parse_iff(char *, unsigned char *, ptrdiff_t,
struct mapping *, char *);
get_all_args(NULL, args, "%S", &str);
s = (unsigned char *)str->str;
len = str->len;
pop_n_elems(args-1);
for(n=0; n<5; n++)
push_int(0);
push_mapping(m = allocate_mapping(4));
parse_iff("ILBM", s, len, m, "BODY");
mapping_index_no_free(sp-5, m, &string_[string_BMHD]);
mapping_index_no_free(sp-4, m, &string_[string_CMAP]);
mapping_index_no_free(sp-3, m, &string_[string_CAMG]);
mapping_index_no_free(sp-2, m, &string_[string_BODY]);
map_delete(m, &string_[string_BMHD]);
map_delete(m, &string_[string_CMAP]);
map_delete(m, &string_[string_CAMG]);
map_delete(m, &string_[string_BODY]);
if(TYPEOF(sp[-5]) != T_STRING)
Pike_error("Missing BMHD chunk\n");
if(TYPEOF(sp[-2]) != T_STRING)
Pike_error("Missing BODY chunk\n");
/* Extract image size from BMHD */
s = (unsigned char *)STR0(sp[-5].u.string);
len = sp[-5].u.string->len;
if(len<20)
Pike_error("Short BMHD chunk\n");
free_svalue(sp-7);
SET_SVAL(sp[-7], T_INT, NUMBER_NUMBER, integer, (s[0]<<8)|s[1]);
SET_SVAL(sp[-6], T_INT, NUMBER_NUMBER, integer, (s[2]<<8)|s[3]);
f_aggregate(7);
}
开发者ID:pikelang,项目名称:Pike,代码行数:51,代码来源:ilbm.c
示例7: f__pipe_debug
void f__pipe_debug(INT32 args)
{
pop_n_elems(args);
push_int(DO_NOT_WARN(noutputs));
push_int(DO_NOT_WARN(ninputs));
push_int(DO_NOT_WARN(nstrings));
push_int(DO_NOT_WARN(nobjects));
push_int(DO_NOT_WARN(mmapped));
push_int(DO_NOT_WARN(nbuffers));
push_int(DO_NOT_WARN(sbuffers));
f_aggregate(7);
}
开发者ID:ajinkya007,项目名称:pike-1,代码行数:12,代码来源:pipe.c
示例8: f_order
/*! @decl int order(string map)
*!
*! Returns the 'order' number for the map @[map].
*!
*! This is usually the number of seconds since Jan 1 1970 (see @[time()]).
*! When the map is changed, this number will change as well.
*!
*! @[map] is the YP-map to search in. This must be the full map name.
*! eg @tt{[email protected]} instead of just @tt{[email protected]}.
*/
static void f_order(INT32 args)
{
int err;
YP_ORDER_TYPE ret;
check_all_args(NULL, args, BIT_STRING, 0);
err = yp_order( this->domain, sp[-args].u.string->str, &ret);
YPERROR( err );
pop_n_elems( args );
push_int( (INT32) ret );
}
开发者ID:pikelang,项目名称:Pike,代码行数:24,代码来源:yp.c
示例9: port_accept
static void port_accept(INT32 args)
{
PIKE_SOCKADDR addr;
struct port *this=THIS;
int fd, err;
ACCEPT_SIZE_T len=0;
int one = 1;
if(this->box.fd < 0)
Pike_error("port->accept(): Port not open.\n");
/* FIXME: Race. */
THIS->box.revents = 0;
THREADS_ALLOW();
len=sizeof(addr);
do {
fd=fd_accept(this->box.fd, (struct sockaddr *)&addr, &len);
err = errno;
} while (fd < 0 && err == EINTR);
THREADS_DISALLOW();
INVALIDATE_CURRENT_TIME();
if(fd < 0)
{
this->my_errno=errno = err;
pop_n_elems(args);
push_int(0);
return;
}
/* We don't really care if setsockopt fails, since it's just a hint. */
while ((fd_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR,
(char *)&one, sizeof(int)) < 0) &&
(errno == EINTR))
one = 1;
my_set_close_on_exec(fd,1);
push_new_fd_object(port_fd_factory_fun_num,
fd, FILE_READ | FILE_WRITE, SOCKET_CAPABILITIES);
if (this->box.backend) {
struct object *o = Pike_sp[-1].u.object;
struct my_file *f = (struct my_file *)
(o->storage + o->prog->inherits[SUBTYPEOF(Pike_sp[-1])].storage_offset);
change_backend_for_box(&f->box, this->box.backend);
}
stack_pop_n_elems_keep_top(args);
}
开发者ID:pikelang,项目名称:Pike,代码行数:50,代码来源:socket.c
示例10: output_finish
/*
* close and free the contents of a struct output
* Note that the output struct is not freed or unlinked here,
* that is taken care of later.
*/
static INLINE void output_finish(struct object *obj)
{
struct output *o, *oi;
struct object *obji;
debug_malloc_touch(obj);
o=(struct output *)(obj->storage);
if (o->obj)
{
if(obj==THIS->firstoutput){
THIS->firstoutput=o->next;
} else
for(obji=THIS->firstoutput;obji;obji=oi->next)
{
oi=(struct output *)(obji->storage);
if(oi->next==obj)
{
oi->next=o->next;
}
}
if(o->obj->prog)
{
#ifdef BLOCKING_CLOSE
apply_low(o->obj,o->set_blocking_offset,0);
pop_stack();
#endif
push_int(0);
apply(o->obj,"set_id",1);
pop_stack();
apply(o->obj,"close",0);
pop_stack();
if(!THISOBJ->prog)
Pike_error("Pipe done callback destructed pipe.\n");
destruct(o->obj);
}
free_object(o->obj);
noutputs--;
o->obj=NULL;
THIS->living_outputs--;
finished_p(); /* Moved by per, one line down.. :) */
/* free_object(THISOBJ); */ /* What? /Hubbe */
}
}
开发者ID:ajinkya007,项目名称:pike-1,代码行数:54,代码来源:pipe.c
示例11: regexp_match
/*! @decl int match(string str)
*!
*! Returns 1 if @[str] matches the regexp bound to the regexp object.
*! Zero otherwise.
*!
*! @decl array(string) match(array(string) strs)
*!
*! Returns an array containing strings in @[strs] that match the
*! regexp bound to the regexp object.
*!
*! @bugs
*! The current implementation doesn't support searching
*! in strings containing the NUL character or any
*! wide character.
*!
*! @seealso
*! @[split]
*/
static void regexp_match(INT32 args)
{
int i;
struct regexp *regexp = THIS->regexp;
if(args < 1)
SIMPLE_TOO_FEW_ARGS_ERROR("Regexp.SimpleRegexp->match", 1);
if(Pike_sp[-args].type == T_STRING)
{
if(Pike_sp[-args].u.string->size_shift)
SIMPLE_BAD_ARG_ERROR("Regexp.SimpleRegexp->match", 1,
"Expected string (8bit)");
i = pike_regexec(regexp, (char *)STR0(Pike_sp[-args].u.string));
pop_n_elems(args);
push_int(i);
return;
}
else if(Pike_sp[-args].type == T_ARRAY)
{
struct array *arr;
int i, n;
arr = Pike_sp[-args].u.array;
for(i = n = 0; i < arr->size; i++)
{
struct svalue *sv = ITEM(arr) + i;
if(sv->type != T_STRING || sv->u.string->size_shift)
SIMPLE_BAD_ARG_ERROR("Regexp.SimpleRegexp->match", 1,
"Expected string (8bit)");
if(pike_regexec(regexp, (char *)STR0(sv->u.string)))
{
ref_push_string(sv->u.string);
n++;
}
}
f_aggregate(n);
stack_pop_n_elems_keep_top(args);
return;
}
else
SIMPLE_BAD_ARG_ERROR("Regexp.SimpleRegexp->match", 1,
"string|array(string)");
}
开发者ID:ajinkya007,项目名称:pike-1,代码行数:67,代码来源:glue.c
示例12: read_some_data
/* Read some data from the blocking object.
*
*/
static int read_some_data(void)
{
struct pipe *this = THIS;
struct input * i = this->firstinput;
if (!i || i->type != I_BLOCKING_OBJ) {
Pike_fatal("PIPE: read_some_data(): Bad input type!\n");
return -1;
}
push_int(8192);
push_int(1); /* We don't care if we don't get all 8192 bytes. */
apply(i->u.obj, "read", 2);
if ((sp[-1].type == T_STRING) && (sp[-1].u.string->len > 0)) {
append_buffer(sp[-1].u.string);
pop_stack();
THIS->sleeping = 1;
return(1); /* Success */
}
/* FIXME: Should we check the return value here? */
pop_stack();
/* EOF */
return(0); /* EOF */
}
开发者ID:ajinkya007,项目名称:pike-1,代码行数:27,代码来源:pipe.c
示例13: image_hrz_f_decode
void image_hrz_f_decode(INT32 args)
{
struct object *io;
struct pike_string *s;
int c;
get_all_args( NULL, args, "%S", &s);
if(s->len != 256*240*3) Pike_error("This is not a HRZ file\n");
push_int( 256 );
push_int( 240 );
io = clone_object( image_program, 2);
for(c=0; c<256*240; c++)
{
rgb_group pix;
pix.r = s->str[c*3]<<2 | s->str[c*3]>>4;
pix.g = s->str[c*3+1]<<2 | s->str[c*3+1]>>4;
pix.b = s->str[c*3+2]<<2 | s->str[c*3+2]>>4;
((struct image *)io->storage)->img[c] = pix;
}
pop_n_elems(args);
push_object( io );
}
开发者ID:pikelang,项目名称:Pike,代码行数:24,代码来源:hrz.c
示例14: free_input
/* Free an input */
static INLINE void free_input(input *inp) {
ninputs--;
switch(inp->type) {
case NBIO_STR:
DERR(fprintf(stderr, "Freeing string input 0x%x\n", (unsigned int)inp));
free_string(inp->u.data);
nstrings--;
break;
#ifdef USE_MMAP
case NBIO_MMAP:
DERR(fprintf(stderr, "Freeing mmap input 0x%x\n", (unsigned int)inp));
if(inp->u.mmap_storage->data != MAP_FAILED) {
munmap(inp->u.mmap_storage->data, inp->u.mmap_storage->m_len);
mmapped -= inp->u.mmap_storage->m_len;
}
push_int(0); push_int(0); push_int(0);
apply_low(inp->u.mmap_storage->file, inp->set_nb_off, 3);
apply_low(inp->u.mmap_storage->file, inp->set_b_off, 0);
pop_n_elems(2);
free_object(inp->u.mmap_storage->file);
free(inp->u.mmap_storage);
break;
#endif
case NBIO_OBJ:
push_int(0); push_int(0); push_int(0);
apply_low(inp->u.file, inp->set_nb_off, 3);
apply_low(inp->u.file, inp->set_b_off, 0);
pop_n_elems(2);
/* FALL THROUGH */
case NBIO_BLOCK_OBJ:
DERR(fprintf(stderr, "Freeing obj input 0x%x\n", (unsigned int)inp));
free_object(inp->u.file);
nobjects--;
break;
}
if(THIS->last_input == inp)
THIS->last_input = NULL;
THIS->inputs = inp->next;
if(!THIS->finished && THIS->inputs && THIS->inputs->type == NBIO_OBJ) {
/* Aha! Set read callback here */
DERR(fprintf(stderr, "Setting read/close callbacks for input 0x%x\n", (unsigned int)THIS->inputs));
push_callback(input_read_cb_off);
push_int(0);
push_callback(input_close_cb_off);
apply_low(THIS->inputs->u.file, THIS->inputs->set_nb_off, 3);
THIS->inputs->mode = READING;
}
free(inp);
}
开发者ID:Letractively,项目名称:caudium,代码行数:52,代码来源:nb_send.c
示例15: f_nbio_status
static void f_nbio_status(INT32 args)
{
pop_n_elems(args);
push_int(noutputs);
push_int(ninputs);
push_int(nstrings);
push_int(nobjects);
push_nbio_int(mmapped);
push_int(nbuffers);
push_int(sbuffers);
f_aggregate(7);
}
开发者ID:Letractively,项目名称:caudium,代码行数:12,代码来源:nb_send.c
示例16: input_finish
/* Let's guess what this function does....
*
*/
static INLINE void input_finish(void)
{
struct input *i;
while(1)
{
/* Get the next input from the queue */
i=THIS->firstinput->next;
free_input(THIS->firstinput);
THIS->firstinput=i;
if(!i) break;
switch(i->type)
{
case I_OBJ:
THIS->sleeping=0;
push_callback(offset_input_read_callback);
push_int(0);
push_callback(offset_input_close_callback);
apply_low(i->u.obj,i->set_nonblocking_offset,3);
pop_stack();
return;
case I_BLOCKING_OBJ:
if (read_some_data())
return;
continue;
case I_MMAP:
if (THIS->fd==-1) return;
continue;
case I_STRING:
append_buffer(i->u.str);
case I_NONE: break;
}
}
THIS->sleeping=0;
low_start();
finished_p();
}
开发者ID:ajinkya007,项目名称:pike-1,代码行数:47,代码来源:pipe.c
示例17: exec_eil
void exec_eil(int field_size){
Odescr *address = pop_tstack();
switch(field_size){
case sizeof(int):{
push_int(*((int *)address->inst.sval)); break;
}
case sizeof(char):{
push_char(*((char *)address->inst.sval)); break;
}
case sizeof(char *):{
char** act = (char **)address->inst.sval;
push_string(act[0]); break;
}
default:{
machine_error("EIL field_size error."); break;
}
}
freemem((char*)address, sizeof(Odescr));
// only dealloc the object and not the inst
}
开发者ID:nzaghen,项目名称:ymachine,代码行数:20,代码来源:instructions.c
示例18: f_get_term
/* array get_term(int term_num) */
static void f_get_term(INT32 args)
{
int n, term_num;
long count;
char *term;
GET_PIKE_SEARCH();
get_all_args("Search->get_term()", args, "%i", &term_num);
THREADS_ALLOW();
n = avs_getsearchterms(search->handle, term_num, &term, &count);
THREADS_DISALLOW();
if (n != AVS_OK)
Pike_error("Search->get_term(): %s\n", avs_errmsg(n));
pop_n_elems(args);
push_text(term);
push_int(count);
f_aggregate(2);
}
开发者ID:hww3,项目名称:pexts,代码行数:21,代码来源:search.c
示例19: pextsIgnorableWhitespace
static void pextsIgnorableWhitespace(void *ctx, const xmlChar *ch, int len)
{
DBG_FUNC_ENTER();
if (CB_ABSENT(ignorableWhitespaceSAX)) {
DBG_FUNC_LEAVE();
return;
}
THIS->ctxt = (xmlParserCtxtPtr)ctx;
push_object(this_object());
if (ch && len)
push_string(make_shared_binary_string((const char*)ch, (size_t) len));
else
push_int(0);
push_svalue(&THIS->user_data);
CB_CALL(ignorableWhitespaceSAX, 3);
pop_stack();
DBG_FUNC_LEAVE();
}
开发者ID:ajinkya007,项目名称:societyserver,代码行数:21,代码来源:xml_sax.c
示例20: f_parse_xml
static void f_parse_xml(INT32 args)
{
xmlDocPtr doc = NULL;
switch (THIS->parsing_method) {
case PARSE_PUSH_PARSER:
Pike_error("Push parser not implemented yet. Please bug [email protected] to implement it.");
case PARSE_MEMORY_PARSER:
doc = xmlSAXParseMemory(THIS->sax, THIS->input_data->str, THIS->input_data->len, 1);
break;
case PARSE_FILE_PARSER:
doc = xmlSAXParseFileWithData(THIS->sax, THIS->input_data->str, 1, NULL);
break;
}
if ( doc != NULL )
xmlFreeDoc(doc);
push_int(0);
}
开发者ID:ajinkya007,项目名称:societyserver,代码行数:21,代码来源:xml_sax.c
注:本文中的push_int函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论