本文整理汇总了C++中RETURN_BOOL函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_BOOL函数的具体用法?C++ RETURN_BOOL怎么用?C++ RETURN_BOOL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_BOOL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
示例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'));
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例14: PHP_METHOD
/**
* {@inheritdoc}
*/
PHP_METHOD(Phalcon_Session_Adapter_Memcache, gc) {
RETURN_BOOL(1);
}
示例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:
//.........这里部分代码省略.........