本文整理汇总了C++中RETURN_STRING函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_STRING函数的具体用法?C++ RETURN_STRING怎么用?C++ RETURN_STRING使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_STRING函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
PHP_METHOD(Test_Statements, testElseIf) {
zval *num_param = NULL;
int num;
zval this_zv;
zval *this_ptr = getThis();
if (EXPECTED(this_ptr)) {
ZVAL_OBJ(&this_zv, Z_OBJ_P(this_ptr));
this_ptr = &this_zv;
} else this_ptr = NULL;
zephir_fetch_params(0, 1, 0, &num_param);
num = zephir_get_intval(num_param);
if (num > 0) {
RETURN_STRING("more");
} else if (num == 0) {
RETURN_STRING("equal");
} else if (num == -1) {
RETURN_STRING("-1");
} else {
RETURN_STRING("less");
}
}
示例2: PHP_FUNCTION
/* {{{ proto string basedir_calculate()
*/
static PHP_FUNCTION(basedir_calculate)
{
char *new_basedir;
char *path, *uri, *path_info, *component;
#if PHP_MAJOR_VERSION < 7
int path_len, uri_len, path_info_len, component_len;
#else
size_t path_len, uri_len, path_info_len, component_len;
#endif
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssss", &path, &path_len, &uri, &uri_len, &path_info, &path_info_len, &component, &component_len) == FAILURE) {
return;
}
new_basedir = emalloc(path_len + PATH_MAX + 1);
new_basedir[0] = '\0';
calculate_basedir(path, uri, path_info, component, new_basedir);
#if PHP_MAJOR_VERSION < 7
RETURN_STRING(new_basedir, 0);
#else
RETURN_STRING(new_basedir);
#endif
}
示例3: PHP_METHOD
/* {{{ proto int hashtable.get(string key)
Get a value from item by its key. Returns empty string if not found. */
PHP_METHOD(hashtableObj, get)
{
char *key;
long key_len = 0;
zval *zobj = getThis();
const char *value = NULL;
php_hashtable_object *php_hashtable;
PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&key, &key_len) == FAILURE) {
PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
return;
}
PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
php_hashtable = (php_hashtable_object *) zend_object_store_get_object(zobj TSRMLS_CC);
value = hashTableObj_get(php_hashtable->hashtable, key);
if (value == NULL) {
RETURN_STRING("",1);
}
RETURN_STRING((char *)value, 1);
}
示例4: PHP_METHOD
/**
* Returns the string meaning of a logger constant
*/
PHP_METHOD(Phalcon_Logger_Formatter_Firephp, getTypeString) {
zval *type_param = NULL;
int type;
zephir_fetch_params(0, 1, 0, &type_param);
type = zephir_get_intval(type_param);
do {
if (type == 0 || type == 1 || type == 3) {
RETURN_STRING("ERROR", 1);
}
if (type == 2 || type == 4) {
RETURN_STRING("WARN", 1);
}
if (type == 6 || type == 5 || type == 8) {
RETURN_STRING("INFO", 1);
}
if (type == 7 || type == 9) {
RETURN_STRING("LOG", 1);
}
} while(0);
RETURN_STRING("CUSTOM", 1);
}
示例5: zephir_is_basic_charset
/**
* Check if a string is encoded with ASCII or ISO-8859-1
*/
void zephir_is_basic_charset(zval *return_value, const zval *param)
{
unsigned int i;
unsigned int ch;
int iso88591 = 0;
for (i = 0; i < Z_STRLEN_P(param); i++) {
ch = Z_STRVAL_P(param)[i];
if (ch != '\0') {
if (ch == 172 || (ch >= 128 && ch <= 159)) {
continue;
}
if (ch >= 160 && ch <= 255) {
iso88591 = 1;
continue;
}
}
RETURN_FALSE;
}
if (!iso88591) {
RETURN_STRING("ASCII");
}
RETURN_STRING("ISO-8859-1");
}
示例6: phalcon_is_basic_charset
/**
* Check if a string is encoded with ASCII or ISO-8859-1
*/
void phalcon_is_basic_charset(zval *return_value, const zval *param){
int i;
unsigned char ch;
int iso88591 = 0;
for (i = 0; i < Z_STRLEN_P(param); i++) {
ch = (unsigned char)(Z_STRVAL_P(param)[i]);
if (ch != '\0') {
if (ch == 172 || (ch >= 128 && ch <= 159)) {
continue;
}
if (ch >= 160) {
iso88591 = 1;
continue;
}
}
RETURN_FALSE;
}
if (!iso88591) {
RETURN_STRING("ASCII", 1);
}
RETURN_STRING("ISO-8859-1", 1);
}
示例7: PHP_METHOD
/* {{{ proto string shape.getValue(layerObj layer, string fieldName)
Returns value for specified field name. */
PHP_METHOD(shapeObj, getValue)
{
zval *zobj = getThis();
zval *zlayer;
char *fieldName;
long fieldName_len;
int i;
php_layer_object *php_layer;
php_shape_object *php_shape;
PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Os",
&zlayer, mapscript_ce_layer,
&fieldName, &fieldName_len) == FAILURE) {
PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
return;
}
PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
php_shape = (php_shape_object *) zend_object_store_get_object(zobj TSRMLS_CC);
php_layer = (php_layer_object *) zend_object_store_get_object(zlayer TSRMLS_CC);
if (php_shape->shape->numvalues != php_layer->layer->numitems)
RETURN_STRING("", 1);
for(i=0; i<php_layer->layer->numitems; i++)
{
if (strcasecmp(php_layer->layer->items[i], fieldName)==0)
{
RETURN_STRING(php_shape->shape->values[i], 1);
}
}
}
示例8: PHP_FUNCTION
static PHP_FUNCTION(debug)
{
#if PHP_MAJOR_VERSION < 7
RETURN_STRING("Hello Dave",0);
#else
RETURN_STRING("Hello Dave");
#endif
}
示例9: RETURN_STRING
wxString SjTrackInfo::GetValue(long ti) const
{
#define RETURN_STRING(n) \
return (n);
#define RETURN_LONG(n) \
return wxString::Format("%i", (int)(n));
switch( ti )
{
case SJ_TI_URL: RETURN_STRING (m_url);
case SJ_TI_TRACKNAME: RETURN_STRING (m_trackName);
case SJ_TI_TRACKNR: RETURN_LONG (m_trackNr);
case SJ_TI_TRACKCOUNT: RETURN_LONG (m_trackCount);
case SJ_TI_DISKNR: RETURN_LONG (m_diskNr);
case SJ_TI_DISKCOUNT: RETURN_LONG (m_diskCount);
case SJ_TI_LEADARTISTNAME: RETURN_STRING (m_leadArtistName);
case SJ_TI_ORGARTISTNAME: RETURN_STRING (m_orgArtistName);
case SJ_TI_COMPOSERNAME: RETURN_STRING (m_composerName);
case SJ_TI_ALBUMNAME: RETURN_STRING (m_albumName);
case SJ_TI_GENRENAME: RETURN_STRING (m_genreName);
case SJ_TI_GROUPNAME: RETURN_STRING (m_groupName);
case SJ_TI_COMMENT: RETURN_STRING (m_comment);
case SJ_TI_BEATSPERMINUTE: RETURN_LONG (m_beatsPerMinute);
case SJ_TI_RATING: RETURN_LONG (m_rating);
case SJ_TI_YEAR: RETURN_LONG (m_year);
case SJ_TI_PLAYTIMEMS: RETURN_LONG (m_playtimeMs);
case SJ_TI_X_TIMESPLAYED: RETURN_LONG (m_timesPlayed);
case SJ_TI_X_CHANNELS: RETURN_LONG (m_channels);
}
wxASSERT( 0 );
return "***";
}
示例10: n
Handle<Value> MSMap::PropertyGetter (Local<String> property, const AccessorInfo& info) {
MSMap *map = ObjectWrap::Unwrap<MSMap>(info.This());
v8::String::AsciiValue n(property);
if (strcmp(*n, "width") == 0) {
RETURN_NUMBER(map->this_->width);
} else if (strcmp(*n, "height") == 0) {
RETURN_NUMBER(map->this_->height);
} else if (strcmp(*n, "status") == 0) {
RETURN_NUMBER(map->this_->status);
} else if (strcmp(*n, "maxsize") == 0) {
RETURN_NUMBER(map->this_->maxsize);
} else if (strcmp(*n, "cellsize") == 0) {
RETURN_NUMBER(map->this_->cellsize);
} else if (strcmp(*n, "units") == 0) {
RETURN_NUMBER(map->this_->units);
} else if (strcmp(*n, "scaledenom") == 0) {
RETURN_NUMBER(map->this_->scaledenom);
} else if (strcmp(*n, "resolution") == 0) {
RETURN_NUMBER(map->this_->resolution);
} else if (strcmp(*n, "defresolution") == 0) {
RETURN_NUMBER(map->this_->defresolution);
} else if (strcmp(*n, "imagetype") == 0) {
RETURN_STRING(map->this_->imagetype);
} else if (strcmp(*n, "mimetype") == 0) {
RETURN_STRING(map->this_->outputformat->mimetype);
} else if (strcmp(*n, "shapepath") == 0) {
RETURN_STRING(map->this_->shapepath);
} else if (strcmp(*n, "mappath") == 0) {
RETURN_STRING(map->this_->mappath);
} else if (strcmp(*n, "name") == 0) {
RETURN_STRING(map->this_->name);
} else if (strcmp(*n, "outputformat") == 0) {
HandleScope scope;
return scope.Close(MSOutputFormat::New(map->this_->outputformat));
} else if (strcmp(*n, "projection") == 0) {
HandleScope scope;
return scope.Close(MSProjection::New(&map->this_->projection));
} else if (strcmp(*n, "layers") == 0) {
HandleScope scope;
return scope.Close(MSLayers::New(map->this_));
} else if (strcmp(*n, "metadata") == 0) {
HandleScope scope;
#if MS_VERSION_NUM < 60400
Handle<ObjectTemplate> objTempl = ObjectTemplate::New();
Local<Object> result = objTempl->NewInstance();
return scope.Close(result);
#else
return scope.Close(MSHashTable::New(&(map->this_->web.metadata)));
#endif
} else if (strcmp(*n, "extent") == 0) {
HandleScope scope;
return scope.Close(MSRect::New(&map->this_->extent));
}
return Undefined();
}
示例11: get_icu_value_src_php
/* {{{
* Gets the value from ICU , called when PHP userspace function is called
* common code shared by get_primary_language,get_script or get_region or get_variant
*/
static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
{
char* loc_name = NULL;
int loc_name_len = 0;
char* tag_value = NULL;
char* empty_result = "";
int result = 0;
char* msg = NULL;
UErrorCode status = U_ZERO_ERROR;
intl_error_reset( NULL TSRMLS_CC );
if(zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s",
&loc_name ,&loc_name_len ) == FAILURE) {
spprintf(&msg , 0, "locale_get_%s : unable to parse input params", tag_name );
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, msg , 1 TSRMLS_CC );
efree(msg);
RETURN_FALSE;
}
if(loc_name_len == 0) {
loc_name = INTL_G(default_locale);
}
/* Call ICU get */
tag_value = get_icu_value_internal( loc_name , tag_name , &result ,0);
/* No value found */
if( result == -1 ) {
if( tag_value){
efree( tag_value);
}
RETURN_STRING( empty_result , TRUE);
}
/* value found */
if( tag_value){
RETURN_STRING( tag_value , FALSE);
}
/* Error encountered while fetching the value */
if( result ==0) {
spprintf(&msg , 0, "locale_get_%s : unable to get locale %s", tag_name , tag_name );
intl_error_set( NULL, status, msg , 1 TSRMLS_CC );
efree(msg);
RETURN_NULL();
}
}
示例12: PHP_METHOD
PHP_METHOD(Phalcon_Internal_TestParent, smp1){
PHALCON_MM_GROW();
PHALCON_MM_RESTORE();
RETURN_STRING("parent-protected", 1);
}
示例13: PHP_METHOD
/* {{{ MongoCode::__toString()
*/
PHP_METHOD(MongoCode, __toString)
{
zval *zode = zend_read_property(mongo_ce_Code, getThis(), "code", strlen("code"), NOISY TSRMLS_CC);
convert_to_string_ex(&zode);
RETURN_STRING(Z_STRVAL_P(zode), 1);
}
示例14: PHP_METHOD
static PHP_METHOD(php_midgard_reflection_method, getDocComment)
{
reflection_object *intern;
zend_function *fptr;
RETVAL_FALSE;
if (zend_parse_parameters_none() == FAILURE)
return;
GET_REFLECTION_OBJECT_PTR(fptr);
if (fptr->type == ZEND_USER_FUNCTION) {
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3
RETURN_FALSE;
#endif
if (fptr->op_array.doc_comment) {
RETURN_STRINGL(fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, 1);
} else {
RETURN_FALSE;
}
} else {
zval *ref_class = zend_read_property(php_midgard_reflection_class_class, getThis(), "class", sizeof("class")-1, 0 TSRMLS_CC); \
zval *ref_method = zend_read_property(php_midgard_reflection_class_class, getThis(), "name", sizeof("name")-1, 0 TSRMLS_CC); \
if (!ref_class || !ref_method)
RETURN_FALSE;
const char *comment = php_midgard_docs_get_method_comment((const gchar *) Z_STRVAL_P(ref_class), (const gchar *) Z_STRVAL_P(ref_method));
RETURN_STRING ((char *)comment, 1);
}
}
示例15: PHP_METHOD
/* {{{ MongoCursor->key
*/
PHP_METHOD(MongoCursor, key) {
zval **id;
mongo_cursor *cursor = (mongo_cursor*)zend_object_store_get_object(getThis() TSRMLS_CC);
MONGO_CHECK_INITIALIZED(cursor->link, MongoCursor);
if (cursor->current &&
Z_TYPE_P(cursor->current) == IS_ARRAY &&
zend_hash_find(HASH_P(cursor->current), "_id", 4, (void**)&id) == SUCCESS) {
if (Z_TYPE_PP(id) == IS_OBJECT) {
#if ZEND_MODULE_API_NO >= 20060613
zend_std_cast_object_tostring(*id, return_value, IS_STRING TSRMLS_CC);
#else
zend_std_cast_object_tostring(*id, return_value, IS_STRING, 0 TSRMLS_CC);
#endif /* ZEND_MODULE_API_NO >= 20060613 */
}
else {
RETVAL_ZVAL(*id, 1, 0);
convert_to_string(return_value);
}
}
else {
RETURN_STRING("", 1);
}
}