本文整理汇总了C++中RETURN_BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_BOOL函数的具体用法?C++ RETURN_BOOL怎么用?C++ RETURN_BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_BOOL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: PHP_FUNCTION
U_CFUNC PHP_FUNCTION(intlcal_is_set)
{
zend_long field;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(),
"Ol", &object, Calendar_ce_ptr, &field) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_is_set: bad arguments", 0 TSRMLS_CC);
RETURN_FALSE;
}
if (field < 0 || field >= UCAL_FIELD_COUNT) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlcal_is_set: invalid field", 0 TSRMLS_CC);
RETURN_FALSE;
}
CALENDAR_METHOD_FETCH_OBJECT;
RETURN_BOOL((int)co->ucal->isSet((UCalendarDateFields)field));
}
开发者ID:KomaBeyond,项目名称:php-src,代码行数:22,代码来源:calendar_methods.cpp
示例2: PHP_METHOD
/* {{{ proto bool Runkit_Sandbox_Parent::print(mixed var)
Echo through the sandbox
Avoid the sandbox's output_handler */
PHP_METHOD(Runkit_Sandbox_Parent,print)
{
php_runkit_sandbox_parent_object *objval;
char *str;
int len;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &str, &len) == FAILURE) {
RETURN_FALSE;
}
PHP_RUNKIT_SANDBOX_PARENT_FETCHBOX_VERIFY_ACCESS(objval, this_ptr);
if (!objval->self->parent_echo) {
php_error_docref(NULL, E_WARNING, "Access to echo data in the parent context is not enabled");
RETURN_FALSE;
}
PHP_RUNKIT_SANDBOX_PARENT_BEGIN(objval)
PHPWRITE(str,len);
PHP_RUNKIT_SANDBOX_PARENT_END(objval)
RETURN_BOOL(len > 1 || (len == 1 && str[0] != '0'));
}
开发者ID:TysonAndre,项目名称:runkit7,代码行数:25,代码来源:runkit_sandbox_parent.c
示例3: PHP_METHOD
PHP_METHOD(Test_Mcall, optionalParameterBoolean) {
zval *start_param = NULL;
zend_bool start;
zephir_fetch_params(0, 0, 1, &start_param);
if (!start_param) {
start = 1;
} else {
if (Z_TYPE_P(start_param) != IS_BOOL) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'start' must be a bool") TSRMLS_CC);
RETURN_NULL();
}
start = Z_BVAL_P(start_param);
}
RETURN_BOOL(start);
}
开发者ID:javierfortea,项目名称:zephir,代码行数:22,代码来源:mcall.c
示例4: PHP_FUNCTION
U_CFUNC PHP_FUNCTION(intlgregcal_is_leap_year)
{
zend_long year;
CALENDAR_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"Ol", &object, GregorianCalendar_ce_ptr, &year) == FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_is_leap_year: bad arguments", 0);
RETURN_FALSE;
}
if (year < INT32_MIN || year > INT32_MAX) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intlgregcal_is_leap_year: year out of bounds", 0);
RETURN_FALSE;
}
CALENDAR_METHOD_FETCH_OBJECT;
RETURN_BOOL((int)fetch_greg(co)->isLeapYear((int32_t)year));
}
开发者ID:bdewar,项目名称:php-src,代码行数:22,代码来源:gregoriancalendar_methods.cpp
示例5: PHP_METHOD
PHP_METHOD(WinGdiPath, frameRectangle)
{
wingdi_devicecontext_object *dc_obj;
wingdi_brush_object *br_obj;
wingdi_path_object *path_obj;
zval *coords_zval,
*br_zval,
**tmp;
RECT rect_coords;
WINGDI_ERROR_HANDLING();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &br_zval, &coords_zval) == FAILURE)
return;
WINGDI_RESTORE_ERRORS();
path_obj = zend_object_store_get_object(getThis() TSRMLS_CC);
dc_obj = zend_object_store_get_object(path_obj->device_context TSRMLS_CC);
if (Z_TYPE_P(br_zval) == IS_OBJECT)
br_obj = zend_object_store_get_object(br_zval TSRMLS_CC);
else
{
php_error_docref(NULL TSRMLS_CC, E_ERROR, "expected an object for parameter 2, got %s",
zend_zval_type_name(br_zval));
return;
}
// Is this the best way to do this?
zend_hash_index_find(Z_ARRVAL_P(coords_zval), 0, (void **)&tmp);
rect_coords.top = Z_LVAL_PP(tmp);
zend_hash_index_find(Z_ARRVAL_P(coords_zval), 1, (void **)&tmp);
rect_coords.left = Z_LVAL_PP(tmp);
zend_hash_index_find(Z_ARRVAL_P(coords_zval), 2, (void **)&tmp);
rect_coords.bottom = Z_LVAL_PP(tmp);
zend_hash_index_find(Z_ARRVAL_P(coords_zval), 3, (void **)&tmp);
rect_coords.right = Z_LVAL_PP(tmp);
RETURN_BOOL(FrameRect(dc_obj->hdc, &rect_coords, br_obj->brush_handle));
}
开发者ID:winapiforphp,项目名称:gdi,代码行数:39,代码来源:path.c
示例6: PHP_METHOD
/**
* Gets an attribute a message using the array syntax
*
*<code>
* print_r($messages[0]);
*</code>
*
* @param int index
* @return Phalcon\Validation\Message
*/
PHP_METHOD(Phalcon_Validation_Message_Group, offsetGet) {
zval *index_param = NULL, *message, *_0;
int index;
zephir_fetch_params(0, 1, 0, &index_param);
if (unlikely(Z_TYPE_P(index_param) != IS_LONG)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'index' must be a long/integer") TSRMLS_CC);
RETURN_NULL();
}
index = Z_LVAL_P(index_param);
_0 = zephir_fetch_nproperty_this(this_ptr, SL("_messages"), PH_NOISY_CC);
if (zephir_array_isset_long_fetch(&message, _0, index, 1 TSRMLS_CC)) {
RETURN_CTORW(message);
}
RETURN_BOOL(0);
}
开发者ID:3axap4eHko,项目名称:cphalcon,代码行数:32,代码来源:group.zep.c
示例7: PHP_METHOD
/* {{{ proto boolean XMLReader::next([string localname])
Moves the position of the current instance to the next node in the stream. */
PHP_METHOD(xmlreader, next)
{
zval *id;
int retval;
size_t name_len=0;
xmlreader_object *intern;
char *name = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &name, &name_len) == FAILURE) {
return;
}
id = getThis();
intern = Z_XMLREADER_P(id);
if (intern != NULL && intern->ptr != NULL) {
#if LIBXML_VERSION <= 20617
/* Bug in libxml prevents a next in certain cases when positioned on end of element */
if (xmlTextReaderNodeType(intern->ptr) == XML_READER_TYPE_END_ELEMENT) {
retval = xmlTextReaderRead(intern->ptr);
} else
#endif
retval = xmlTextReaderNext(intern->ptr);
while (name != NULL && retval == 1) {
if (xmlStrEqual(xmlTextReaderConstLocalName(intern->ptr), (xmlChar *)name)) {
RETURN_TRUE;
}
retval = xmlTextReaderNext(intern->ptr);
}
if (retval == -1) {
RETURN_FALSE;
} else {
RETURN_BOOL(retval);
}
}
php_error_docref(NULL, E_WARNING, "Load Data before trying to read");
RETURN_FALSE;
}
开发者ID:LTD-Beget,项目名称:php-src,代码行数:40,代码来源:php_xmlreader.c
示例8: PHP_METHOD
PHP_METHOD(Label, equal) {
php_jit_label_t *plabels[2];
php_jit_function_t *pfuncs[2];
zval *zlabel;
if (php_jit_parameters("O", &zlabel, jit_label_ce) != SUCCESS) {
php_jit_exception("unexpected parameters, expected (Label label)");
return;
}
plabels[0] = PHP_JIT_FETCH_LABEL(getThis());
plabels[1] = PHP_JIT_FETCH_LABEL(zlabel);
pfuncs[0] = PHP_JIT_FETCH_FUNCTION(&plabels[0]->zfunc);
pfuncs[1] = PHP_JIT_FETCH_FUNCTION(&plabels[1]->zfunc);
if (pfuncs[0]->func != pfuncs[1]->func) {
RETURN_FALSE;
}
RETURN_BOOL(jit_function_labels_equal(pfuncs[0]->func, plabels[0]->label, plabels[1]->label));
}
开发者ID:krakjoe,项目名称:jitfu,代码行数:23,代码来源:label.c
示例9: PHP_METHOD
static PHP_METHOD(midgard_workspace_manager, purge_content)
{
char *type;
int type_length;
zval *z_workspace;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sO", &type, &type_length, &z_workspace, php_midgard_workspace_class) == FAILURE) {
return;
}
MidgardWorkspaceManager *self = MIDGARD_WORKSPACE_MANAGER(__php_gobject_ptr(getThis()));
MidgardWorkspace *workspace = MIDGARD_WORKSPACE(__php_gobject_ptr(z_workspace));
GError *error = NULL;
zend_bool result = midgard_workspace_manager_purge_content(self, type, workspace, &error);
if (error) {
zend_throw_exception_ex(NULL, 0 TSRMLS_CC, "Failed to purge %s content from workspace. %s", type, error->message);
g_error_free(error);
}
RETURN_BOOL(result);
}
开发者ID:William-Wai,项目名称:midgard-php5,代码行数:23,代码来源:php_midgard_workspace_storage.c
示例10: PHP_METHOD
static PHP_METHOD(midgard_connection, set_loglevel)
{
RETVAL_NULL();
MidgardConnection *mgd =__midgard_connection_get_ptr(getThis());
CHECK_MGD(mgd);
char *level;
int level_length;
zval *callback;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &level, &level_length, &callback) == FAILURE)
return;
/* no support for callback atm */
gboolean rv = midgard_connection_set_loglevel(mgd, (gchar *)level, php_midgard_log_errors);
global_loghandler = midgard_connection_get_loghandler(mgd);
if (MGDG(midgard_memory_debug)) {
php_printf("---> global_loghandler = %d\n", global_loghandler);
}
RETURN_BOOL(rv);
}
开发者ID:indeyets,项目名称:midgard-php5,代码行数:23,代码来源:php_midgard_connection.c
示例11: PHP_FUNCTION
U_CFUNC PHP_FUNCTION(intltz_has_same_rules)
{
zval *other_object;
TimeZone_object *other_to;
TIMEZONE_METHOD_INIT_VARS;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(),
"OO", &object, TimeZone_ce_ptr, &other_object, TimeZone_ce_ptr)
== FAILURE) {
intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_has_same_rules: bad arguments", 0);
RETURN_FALSE;
}
TIMEZONE_METHOD_FETCH_OBJECT;
other_to = Z_INTL_TIMEZONE_P(other_object);
if (other_to->utimezone == NULL) {
intl_errors_set(&to->err, U_ILLEGAL_ARGUMENT_ERROR,
"intltz_has_same_rules: The second IntlTimeZone is unconstructed", 0);
RETURN_FALSE;
}
RETURN_BOOL(to->utimezone->hasSameRules(*other_to->utimezone));
}
开发者ID:GreenLightt,项目名称:php-src,代码行数:23,代码来源:timezone_methods.cpp
示例12: children
/* {{{ proto bool SimpleXMLIterator::hasChildren()
Check whether element has children (elements) */
PHP_METHOD(ce_SimpleXMLIterator, hasChildren)
{
php_sxe_object *sxe = Z_SXEOBJ_P(getThis());
php_sxe_object *child;
xmlNodePtr node;
if (zend_parse_parameters_none() == FAILURE) {
return;
}
if (Z_ISUNDEF(sxe->iter.data) || sxe->iter.type == SXE_ITER_ATTRLIST) {
RETURN_FALSE;
}
child = Z_SXEOBJ_P(&sxe->iter.data);
GET_NODE(child, node);
if (node) {
node = node->children;
}
while (node && node->type != XML_ELEMENT_NODE) {
node = node->next;
}
RETURN_BOOL(node ? 1 : 0);
}
开发者ID:20uf,项目名称:php-src,代码行数:26,代码来源:sxe.c
示例13: property
/* {{{ proto boolean XMLReader::getParserProperty(int property)
Indicates whether given property (one of the parser option constants) is set or not on parser */
PHP_METHOD(xmlreader, getParserProperty)
{
zval *id;
zend_long property;
int retval = -1;
xmlreader_object *intern;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &property) == FAILURE) {
return;
}
id = getThis();
intern = Z_XMLREADER_P(id);
if (intern && intern->ptr) {
retval = xmlTextReaderGetParserProp(intern->ptr,property);
}
if (retval == -1) {
php_error_docref(NULL, E_WARNING, "Invalid parser property");
RETURN_FALSE;
}
RETURN_BOOL(retval);
}
开发者ID:LTD-Beget,项目名称:php-src,代码行数:26,代码来源:php_xmlreader.c
示例14: PHP_METHOD
/**
* {@inheritdoc}
*/
PHP_METHOD(Phalcon_Session_Adapter_Memcache, gc) {
RETURN_BOOL(1);
}
开发者ID:raphaelfruneaux,项目名称:cphalcon,代码行数:9,代码来源:memcache.zep.c
示例15: phar_fancy_stat
/* {{{ php_stat
*/
static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value)
{
zval stat_dev, stat_ino, stat_mode, stat_nlink, stat_uid, stat_gid, stat_rdev,
stat_size, stat_atime, stat_mtime, stat_ctime, stat_blksize, stat_blocks;
int rmask=S_IROTH, wmask=S_IWOTH, xmask=S_IXOTH; /* access rights defaults to other */
char *stat_sb_names[13] = {
"dev", "ino", "mode", "nlink", "uid", "gid", "rdev",
"size", "atime", "mtime", "ctime", "blksize", "blocks"
};
#ifndef NETWARE
if (type >= FS_IS_W && type <= FS_IS_X) {
if(stat_sb->st_uid==getuid()) {
rmask=S_IRUSR;
wmask=S_IWUSR;
xmask=S_IXUSR;
} else if(stat_sb->st_gid==getgid()) {
rmask=S_IRGRP;
wmask=S_IWGRP;
xmask=S_IXGRP;
} else {
int groups, n, i;
gid_t *gids;
groups = getgroups(0, NULL);
if(groups > 0) {
gids=(gid_t *)safe_emalloc(groups, sizeof(gid_t), 0);
n=getgroups(groups, gids);
for(i=0;i<n;++i){
if(stat_sb->st_gid==gids[i]) {
rmask=S_IRGRP;
wmask=S_IWGRP;
xmask=S_IXGRP;
break;
}
}
efree(gids);
}
}
}
#endif
switch (type) {
case FS_PERMS:
RETURN_LONG((zend_long)stat_sb->st_mode);
case FS_INODE:
RETURN_LONG((zend_long)stat_sb->st_ino);
case FS_SIZE:
RETURN_LONG((zend_long)stat_sb->st_size);
case FS_OWNER:
RETURN_LONG((zend_long)stat_sb->st_uid);
case FS_GROUP:
RETURN_LONG((zend_long)stat_sb->st_gid);
case FS_ATIME:
#ifdef NETWARE
RETURN_LONG((zend_long)stat_sb->st_atime.tv_sec);
#else
RETURN_LONG((zend_long)stat_sb->st_atime);
#endif
case FS_MTIME:
#ifdef NETWARE
RETURN_LONG((zend_long)stat_sb->st_mtime.tv_sec);
#else
RETURN_LONG((zend_long)stat_sb->st_mtime);
#endif
case FS_CTIME:
#ifdef NETWARE
RETURN_LONG((zend_long)stat_sb->st_ctime.tv_sec);
#else
RETURN_LONG((zend_long)stat_sb->st_ctime);
#endif
case FS_TYPE:
if (S_ISLNK(stat_sb->st_mode)) {
RETURN_STRING("link");
}
switch(stat_sb->st_mode & S_IFMT) {
case S_IFDIR: RETURN_STRING("dir");
case S_IFREG: RETURN_STRING("file");
}
php_error_docref(NULL, E_NOTICE, "Unknown file type (%u)", stat_sb->st_mode & S_IFMT);
RETURN_STRING("unknown");
case FS_IS_W:
RETURN_BOOL((stat_sb->st_mode & wmask) != 0);
case FS_IS_R:
RETURN_BOOL((stat_sb->st_mode&rmask)!=0);
case FS_IS_X:
RETURN_BOOL((stat_sb->st_mode&xmask)!=0 && !S_ISDIR(stat_sb->st_mode));
case FS_IS_FILE:
RETURN_BOOL(S_ISREG(stat_sb->st_mode));
case FS_IS_DIR:
RETURN_BOOL(S_ISDIR(stat_sb->st_mode));
case FS_IS_LINK:
RETURN_BOOL(S_ISLNK(stat_sb->st_mode));
case FS_EXISTS:
RETURN_TRUE; /* the false case was done earlier */
case FS_LSTAT:
/* FALLTHROUGH */
case FS_STAT:
//.........这里部分代码省略.........
开发者ID:Tyrael,项目名称:php-src,代码行数:101,代码来源:func_interceptors.c
示例16: PHP_METHOD
/**
* Returns true if the event watcher is pending (ie. it has outstanding events but
* the callback has not been called yet).
*
* @return boolean
* @return null If object has not been initialized
*/
PHP_METHOD(Event, isPending)
{
event_object *obj = (event_object *)zend_object_store_get_object(getThis() TSRMLS_CC);
RETURN_BOOL(event_is_pending(obj));
}
开发者ID:m4rw3r,项目名称:php-libev,代码行数:13,代码来源:Events.c
示例17: PHP_METHOD
/** {{{ proto bool Win\Gdi\Window::endPaint( paint_data );
Marks the end of painting in the specified window.
*/
PHP_METHOD( WinGdiWindow, endPaint )
{
wingdi_devicecontext_object * dc_object;
wingdi_window_object * window_object = zend_object_store_get_object( getThis() TSRMLS_CC );
HashTable * paint_data;
PAINTSTRUCT paint_struct;
WINGDI_ERROR_HANDLING();
if ( zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "h", &paint_data ) == FAILURE )
return;
WINGDI_RESTORE_ERRORS();
// Error checking
// Not sure about the error messages
if ( ! zend_hash_exists( paint_data, "hdc", strlen( "hdc" ) + 1 ) )
{
php_error( E_ERROR, "no 'hdc' element found in array" );
return;
}
else if ( ! zend_hash_exists( paint_data, "erase", strlen( "erase" ) + 1 ) )
{
php_error( E_ERROR, "no 'erase' element found in array" );
return;
}
else if ( ! zend_hash_exists( paint_data, "paint", strlen( "paint" ) + 1 ) )
{
php_error( E_ERROR, "no 'paint' element found in array" );
return;
}
else
{
zval ** hdc_element,
** erase_element,
** paint_element,
** left = NULL, ** top = NULL, ** right = NULL, ** bottom = NULL;
HashTable * paint_rect;
zend_hash_find( paint_data, "hdc", strlen( "hdc" ) + 1, ( void ** ) &hdc_element );
dc_object = ( wingdi_devicecontext_object * ) zend_objects_get_address( * hdc_element TSRMLS_CC );
paint_struct.hdc = dc_object->hdc;
zend_hash_find( paint_data, "erase", strlen( "erase" ) + 1, ( void ** ) &erase_element );
paint_struct.fErase = Z_BVAL_PP( erase_element );
zend_hash_find( paint_data, "paint", strlen( "paint" ) + 1, ( void ** ) &paint_element );
if ( Z_TYPE_PP( paint_element ) != IS_ARRAY || zend_hash_num_elements( Z_ARRVAL_PP( paint_element ) ) < 4 )
{
php_error( E_ERROR, "expected an array of for elements for 'paint' element of array" );
return;
}
paint_rect = Z_ARRVAL_PP( paint_element );
// TODO: error checking
zend_hash_index_find( paint_rect, 0, ( void ** ) &left );
zend_hash_index_find( paint_rect, 1, ( void ** ) &top );
zend_hash_index_find( paint_rect, 2, ( void ** ) &right );
zend_hash_index_find( paint_rect, 3, ( void ** ) &bottom );
paint_struct.rcPaint.left = Z_LVAL_PP( left );
paint_struct.rcPaint.top = Z_LVAL_PP( top );
paint_struct.rcPaint.right = Z_LVAL_PP( right );
paint_struct.rcPaint.bottom = Z_LVAL_PP( bottom );
RETURN_BOOL( EndPaint( window_object->window_handle, &paint_struct ) );
}
}
开发者ID:winapiforphp,项目名称:gdi,代码行数:67,代码来源:window.c
示例18: PHP_METHOD
static PHP_METHOD(Operand, isConstant) {
php_inspector_operand_t *operand =
php_inspector_operand_this();
RETURN_BOOL(operand->type & IS_CONST);
}
开发者ID:krakjoe,项目名称:inspector,代码行数:6,代码来源:operand.c
示例19: PHP_METHOD
PHP_METHOD(Mongo, getSlaveOkay)
{
mongoclient *link;
PHP_MONGO_GET_LINK(getThis());
RETURN_BOOL(link->servers->read_pref.type != MONGO_RP_PRIMARY);
}
开发者ID:Jensen2k,项目名称:mongo-php-driver,代码行数:6,代码来源:mongo.c
示例20: PHP_METHOD
PHP_METHOD(Struct, isPointer) {
RETURN_BOOL(0);
}
开发者ID:krakjoe,项目名称:jitfu,代码行数:3,代码来源:struct.c
注:本文中的RETURN_BOOL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论