• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ popsettings函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中popsettings函数的典型用法代码示例。如果您正苦于以下问题:C++ popsettings函数的具体用法?C++ popsettings怎么用?C++ popsettings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了popsettings函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: pushsettings

/*
 * Get a filename in cache for given md5sum.
 */
const char *filecache_getpath(TARGET *t)
{
	char buffer[1024];
	LIST *filecache;
	const char *cachedir = NULL;
	LIST *cachevar;

	pushsettings( t->settings );
	filecache = var_get( "FILECACHE" );
	if ( !filecache ) {
		popsettings( t->settings );
		return NULL;
	}

	/* get directory where objcache should reside */
	strcpy( buffer, filecache->string );
	strcat( buffer, ".PATH" );
	cachevar = var_get( buffer );
	if( cachevar ) {
		TARGET *t = bindtarget( cachevar->string );
		t->boundname = search( t->name, &t->time );
		cachedir = copystr( t->boundname );
	}

	popsettings( t->settings );

	return cachedir;
}
开发者ID:larus,项目名称:jamplus,代码行数:31,代码来源:hcache.c


示例2: bind_explicitly_located_target

static void bind_explicitly_located_target(void* xtarget, void* data)
{
    TARGET* t = (TARGET*)xtarget;
    if (! (t->flags & T_FLAG_NOTFILE) )
    {
        /* Check if there's a setting for LOCATE_TARGET */
        SETTINGS* s = t->settings;
        for(; s ; s = s->next)
        {            
            if (strcmp(s->symbol, "LOCATE") == 0) 
            {
                pushsettings(t->settings);
                t->boundname = search( t->name, &t->time );
                t->binding = t->time ? T_BIND_EXISTS : T_BIND_MISSING;
                popsettings(t->settings);

                {
                    LOCATED_TARGET lt, *lta = <
                    lt.file_name = t->boundname;
                    lt.target = t;
                    if (!located_targets)
                        located_targets = hashinit( sizeof(LOCATED_TARGET),
                                                    "located targets" );

                    /* TODO: should check if we've entered the item or not. */
                    hashenter(located_targets, (HASHDATA **)&lta);
                }

                break;
            }
        }
    }
}
开发者ID:Karlan88,项目名称:xray,代码行数:33,代码来源:rules.c


示例3: builtin_md5file

LIST *
builtin_md5file(
	PARSE	*parse,
	LOL	*args,
	int	*jmp )
{
	MD5_CTX context;
	unsigned char digest[16];
	unsigned char digest_string[33];
	unsigned char* p;
	int i;
	LIST *l;
	LIST *result;

	const size_t BUFFER_SIZE = 100 * 1024;
	unsigned char* buffer = (unsigned char*)malloc(BUFFER_SIZE);

	MD5Init(&context);

	/* For each argument */
	for (i = 0; i < args->count; ++i) {
	    l = lol_get(args, i);
	    if (l) {
		do {
			FILE* file;
			TARGET *t = bindtarget(l->string);
			pushsettings( t->settings );
			t->boundname = search( t->name, &t->time );
			popsettings( t->settings );
		    file = fopen(t->boundname, "rb");
		    if (file) {
			size_t readSize;

			do
			{
			    readSize = fread(buffer, 1, BUFFER_SIZE, file);
			    MD5Update(&context, buffer, readSize);
			} while (readSize != 0);

			fclose(file);
		    }

		    l = list_next(l);
		} while (l);
	    }
	}

	free(buffer);

	MD5Final(digest, &context);
	p = digest_string;
	for (i = 0, p = digest_string; i < 16; i++, p += 2) {
	    sprintf((char*)p, "%02x", digest[i]);
	}
	*p = 0;

	result = list_new(L0, (const char*)digest_string, 0);

	return result;
}
开发者ID:larus,项目名称:jamplus,代码行数:60,代码来源:builtins.c


示例4: filecache_disable

void filecache_disable(TARGET *t)
{
	BUFFER buff;
	LIST *filecache;
	pushsettings( t->settings );
	filecache = var_get( "FILECACHE" );
	if ( !filecache ) {
		popsettings( t->settings );
		return;
	}

	buffer_init(&buff);
	buffer_addstring(&buff, filecache->string, strlen(filecache->string));
	buffer_addstring(&buff, ".USE", 4);
	buffer_addchar(&buff, 0);
	var_set(buffer_ptr(&buff), list_new(L0, "0", 0), VAR_SET);
	buffer_free(&buff);

	buffer_init(&buff);
	buffer_addstring(&buff, filecache->string, strlen(filecache->string));
	buffer_addstring(&buff, ".GENERATE", 9);
	buffer_addchar(&buff, 0);
	var_set(buffer_ptr(&buff), list_new(L0, "0", 0), VAR_SET);
	buffer_free(&buff);
}
开发者ID:larus,项目名称:jamplus,代码行数:25,代码来源:hcache.c


示例5: filecache_disable

void filecache_disable(TARGET *t)
{
	BUFFER buff;
	LIST *filecache;
	char const* filecacheStr;
	pushsettings( t->settings );
	filecache = var_get( "FILECACHE" );
	if ( !list_first(filecache) ) {
		popsettings( t->settings );
		return;
	}

	filecacheStr = list_value(list_first(filecache));

	buffer_init(&buff);
	buffer_addstring(&buff, filecacheStr, strlen(filecacheStr));
	buffer_addstring(&buff, ".USE", 4);
	buffer_addchar(&buff, 0);
	var_set(buffer_ptr(&buff), list_append(L0, "0", 0), VAR_SET);
	buffer_free(&buff);

	buffer_init(&buff);
	buffer_addstring(&buff, filecacheStr, strlen(filecacheStr));
	buffer_addstring(&buff, ".GENERATE", 9);
	buffer_addchar(&buff, 0);
	var_set(buffer_ptr(&buff), list_append(L0, "0", 0), VAR_SET);
	buffer_free(&buff);
}
开发者ID:r1chi3x,项目名称:jamplus,代码行数:28,代码来源:hcache.c


示例6: swap_settings

/*
 * swap_settings() - replace the settings from the current module and
 *                   target with those from the new module and target
 */
static void swap_settings(
    module_t** current_module
    , TARGET** current_target
    , module_t* new_module
    , TARGET* new_target)
{
    if (new_module == root_module())
        new_module = 0;
    
    if (new_target == *current_target && new_module == *current_module)
        return;

    if (*current_target)
        popsettings( (*current_target)->settings );
        
    if (new_module != *current_module)
    {
        if (*current_module)
            exit_module( *current_module );

        *current_module = new_module;
        
        if (new_module)
            enter_module( new_module );
    }

    *current_target = new_target;
    if (new_target)
        pushsettings( new_target->settings );
}
开发者ID:Albermg7,项目名称:boost,代码行数:34,代码来源:make1.c


示例7: call_timing_rule

/* Look up the __TIMING_RULE__ variable on the given target, and if
 * non-empty, invoke the rule it names, passing the given
 * timing_info
 */
static void call_timing_rule(TARGET* target, timing_info* time)
{
    LIST* timing_rule;
    
    pushsettings(target->settings);
    timing_rule = var_get( "__TIMING_RULE__" );
    popsettings(target->settings);

    if (timing_rule)
    {
        /* We'll prepend $(__TIMING_RULE__[2-]) to the first argument */
        LIST* initial_args = list_copy( L0, timing_rule->next );
            
        /* Prepare the argument list */
        FRAME frame[1];
        frame_init( frame );

        /* First argument is the name of the timed target */
        lol_add( frame->args, list_new( initial_args, target->name ) );
        append_double_string(frame->args, time->user);
        append_double_string(frame->args, time->system);

        if( lol_get( frame->args, 2 ) )
            evaluate_rule( timing_rule->string, frame );
            
        /* Clean up */
        frame_free( frame );
    }
}
开发者ID:Albermg7,项目名称:boost,代码行数:33,代码来源:make1.c


示例8: cache_name

static const char * cache_name( void )
{
    static OBJECT * name = 0;
    if ( !name )
    {
        LIST * hcachevar = var_get( root_module(), constant_HCACHEFILE );

        if ( !list_empty( hcachevar ) )
        {
            TARGET * t = bindtarget( list_front( hcachevar ) );

            pushsettings( root_module(), t->settings );
            /* Do not expect the cache file to be generated, so pass 0 as the
             * third argument to search. Expect the location to be specified via
             * LOCATE, so pass 0 as the fourth arugment.
             */
            object_free( t->boundname );
            t->boundname = search( t->name, &t->time, 0, 0 );
            popsettings( root_module(), t->settings );

            name = object_copy( t->boundname );
        }
    }
    return name ? object_str( name ) : 0;
}
开发者ID:0xDEC0DE8,项目名称:mcsema,代码行数:25,代码来源:hcache.c


示例9: LS_jam_setvar

int LS_jam_setvar(ls_lua_State *L)
{
    int numParams = ls_lua_gettop(L);
    if (numParams < 2  ||  numParams > 3)
	return 0;

    if (!ls_lua_isstring(L, 1))
	return 0;

    if (numParams == 2)
    {
	var_set(ls_lua_tostring(L, 1), luahelper_addtolist(L, L0, 2), VAR_SET);
    }
    else
    {
	TARGET *t;

	if (!ls_lua_isstring(L, 2))
	    return 0;

	t = bindtarget(ls_lua_tostring(L, 1));
	pushsettings(t->settings);
	var_set(ls_lua_tostring(L, 2), luahelper_addtolist(L, L0, 3), VAR_SET);
	popsettings(t->settings);
    }

    return 0;
}
开发者ID:lucasmeijer,项目名称:jamplus,代码行数:28,代码来源:luasupport.c


示例10: compile_on

LIST *
compile_on(
	PARSE	*parse,
	FRAME	*frame )
{
	LIST    *nt = parse_evaluate( parse->left, frame );
	LIST	*result = 0;

	if( DEBUG_COMPILE )
	{
	    debug_compile( 0, "on", frame );
	    list_print( nt );
	    printf( "\n" );
	}

	if( nt )
	{
	    TARGET *t = bindtarget( nt->string );
	    pushsettings( t->settings );

	    result = parse_evaluate( parse->right, frame );

	    popsettings( t->settings );
	}

	list_free( nt );

	return result;
}
开发者ID:Albermg7,项目名称:boost,代码行数:29,代码来源:compile.c


示例11: compile_foreach

LIST * compile_foreach( PARSE * parse, FRAME * frame )
{
    LIST     * nv = parse_evaluate( parse->left, frame );
    LIST     * l;
    SETTINGS * s = 0;

    if ( parse->num )
    {
        s = addsettings( s, VAR_SET, parse->string, L0 );
        pushsettings( s );
    }

    /* Call var_set to reset $(parse->string) for each val. */

    for ( l = nv; l; l = list_next( l ) )
    {
        LIST * val = list_new( L0, copystr( l->string ) );
        var_set( parse->string, val, VAR_SET );
        list_free( parse_evaluate( parse->right, frame ) );
    }

    if ( parse->num )
    {
        popsettings( s );
        freesettings( s );
    }

    list_free( nv );

    return L0;
}
开发者ID:4ukuta,项目名称:core,代码行数:31,代码来源:compile.c


示例12: pushsettings

static void call_action_rule
(
    TARGET * target,
    int status,
    timing_info const * time,
    char const * executed_command,
    char const * command_output
)
{
    LIST * action_rule;

    pushsettings( root_module(), target->settings );
    action_rule = var_get( root_module(), constant_ACTION_RULE );
    popsettings( root_module(), target->settings );

    if ( !list_empty( action_rule ) )
    {
        /* rule action-rule (
            args * :
            target :
            command status start end user system :
            output ? ) */

        /* Prepare the argument list. */
        FRAME frame[ 1 ];
        OBJECT * rulename = list_front( action_rule );
        frame_init( frame );

        /* args * :: $(__ACTION_RULE__[2-]) */
        lol_add( frame->args, list_copy_range( action_rule, list_next(
            list_begin( action_rule ) ), list_end( action_rule ) ) );

        /* target :: the name of the target */
        lol_add( frame->args, list_new( object_copy( target->name ) ) );

        /* command status start end user system :: info about the action command
         */
        lol_add( frame->args,
            list_push_back( list_push_back( list_push_back( list_push_back( list_push_back( list_new(
                object_new( executed_command ) ),
                outf_int( status ) ),
                outf_time( &time->start ) ),
                outf_time( &time->end ) ),
                outf_double( time->user ) ),
                outf_double( time->system ) ) );

        /* output ? :: the output of the action command */
        if ( command_output )
            lol_add( frame->args, list_new( object_new( command_output ) ) );
        else
            lol_add( frame->args, L0 );

        /* Call the rule. */
        evaluate_rule( bindrule( rulename, root_module() ), rulename, frame );

        /* Clean up. */
        frame_free( frame );
    }
}
开发者ID:AlexMioMio,项目名称:boost,代码行数:59,代码来源:make1.c


示例13: make1bind

static void make1bind( TARGET * t )
{
    if ( t->flags & T_FLAG_NOTFILE )
        return;

    pushsettings( root_module(), t->settings );
    object_free( t->boundname );
    t->boundname = search( t->name, &t->time, 0, t->flags & T_FLAG_ISFILE );
    t->binding = timestamp_empty( &t->time ) ? T_BIND_MISSING : T_BIND_EXISTS;
    popsettings( root_module(), t->settings );
}
开发者ID:CarterTsai,项目名称:clasp,代码行数:11,代码来源:make1.c


示例14: make1bind

static void
make1bind( 
	TARGET	*t )
{
	if( t->flags & T_FLAG_NOTFILE )
	    return;

	pushsettings( t->settings );
	t->boundname = search( t->name, &t->time, 0 );
	t->binding = t->time ? T_BIND_EXISTS : T_BIND_MISSING;
	popsettings( t->settings );
}
开发者ID:Albermg7,项目名称:boost,代码行数:12,代码来源:make1.c


示例15: call_action_rule

/* Look up the __ACTION_RULE__ variable on the given target, and if
 * non-empty, invoke the rule it names, passing the given info, 
 * timing_info, executed command and command output
 */
static void call_action_rule(TARGET* target, int status, timing_info* time,
    char *executed_command, char *command_output)
{
    LIST* action_rule;

    pushsettings(target->settings);
    action_rule = var_get( "__ACTION_RULE__" );
    popsettings(target->settings);

    if (action_rule)
    {
        /* rule action-rule (
            args * :
            target :
            command status start end user system :
            output ? ) */

        /* Prepare the argument list */
        FRAME frame[1];
        frame_init( frame );

        /* args * :: $(__ACTION_RULE__[2-]) */
        lol_add( frame->args, list_copy( L0, action_rule->next ) );

        /* target :: the name of the target */
        lol_add( frame->args, list_new( L0, target->name ) );

        /* command status start end user system :: info about the action command */
        lol_add( frame->args,
            list_new( list_new( list_new( list_new( list_new( list_new( L0,
                newstr(executed_command) ),
                outf_int(status) ),
                outf_time(time->start) ),
                outf_time(time->end) ),
                outf_double(time->user) ),
                outf_double(time->system) ) );

        /* output ? :: the output of the action command */
        if (command_output)
            lol_add(frame->args, list_new(L0, newstr(command_output)));
        else
            lol_add(frame->args, L0);

        /* Call the rule. */
        evaluate_rule( action_rule->string, frame );

        /* Clean up */
        frame_free( frame );
    }
}
开发者ID:DieselPowerKOR,项目名称:quakeslash,代码行数:54,代码来源:make1.c


示例16: LS_jam_getvar

int LS_jam_getvar(ls_lua_State *L)
{
    LIST *list;
    LISTITEM* item;
    int index;

    int numParams = ls_lua_gettop(L);
    if (numParams < 1  ||  numParams > 2)
        return 0;

    if (!ls_lua_isstring(L, 1))
        return 0;

    if (numParams == 1)
    {
        list = var_get(ls_lua_tostring(L, 1));
    }
    else
    {
        TARGET *t;

        if (!ls_lua_isstring(L, 2))
            return 0;

        t = bindtarget(ls_lua_tostring(L, 1));
        pushsettings(t->settings);
        list = var_get(ls_lua_tostring(L, 2));
        popsettings(t->settings);
    }

    ls_lua_newtable(L);
    index = 1;
    for (item = list_first(list); item; item = list_next(item), ++index)
    {
        ls_lua_pushnumber(L, index);
        ls_lua_pushstring(L, list_value(item));
        ls_lua_settable(L, -3);
    }

    return 1;
}
开发者ID:caryhaynie,项目名称:jamplus,代码行数:41,代码来源:luasupport.c


示例17: compile_include

LIST *
compile_include(
    PARSE   *parse,
    FRAME *frame )
{
    LIST    *nt = parse_evaluate( parse->left, frame );

    if( DEBUG_COMPILE )
    {
        debug_compile( 0, "include", frame);
        list_print( nt );
        printf( "\n" );
    }

    if( nt )
    {
        TARGET *t = bindtarget( nt->string );

            /* DWA 2001/10/22 - Perforce Jam clears the arguments here, which
             * prevents an included file from being treated as part of the body
             * of a rule. I didn't see any reason to do that, so I lifted the
             * restriction.
             */
               
        /* Bind the include file under the influence of */
        /* "on-target" variables.  Though they are targets, */
        /* include files are not built with make(). */

        pushsettings( t->settings );
        /* We don't expect that file to be included is generated by some
           action. Therefore, pass 0 as third argument. */
        t->boundname = search( t->name, &t->time, 0 );
        popsettings( t->settings );

        parse_file( t->boundname, frame );
    }

    list_free( nt );

    return L0;
}
开发者ID:Albermg7,项目名称:boost,代码行数:41,代码来源:compile.c


示例18: popsettings

static void swap_settings
(
    module_t * * current_module,
    TARGET   * * current_target,
    module_t   * new_module,
    TARGET     * new_target
)
{
    if ( ( new_target == *current_target ) &&
        ( new_module == *current_module ) )
        return;

    if ( *current_target )
        popsettings( *current_module, (*current_target)->settings );

    if ( new_target )
        pushsettings( new_module, new_target->settings );

    *current_module = new_module;
    *current_target = new_target;
}
开发者ID:CarterTsai,项目名称:clasp,代码行数:21,代码来源:make1.c


示例19: cache_name

/*
 * Return the name of the header cache file.  May return NULL.
 *
 * The user sets this by setting the HCACHEFILE variable in a Jamfile.
 * We cache the result so the user can't change the cache file during
 * header scanning.
 */
static char*
cache_name(void)
{
    static char* name = 0;
    if (!name) {
	LIST *hcachevar = var_get("HCACHEFILE");

	if (hcachevar) {
	    TARGET *t = bindtarget( hcachevar->string );

	    pushsettings( t->settings );
	    t->boundname = search( t->name, &t->time );
	    popsettings( t->settings );

	    if (hcachevar) {
		name = copystr(t->boundname);
	    }
	}
    }
    return name;
}
开发者ID:Karlan88,项目名称:xray,代码行数:28,代码来源:hcache.c


示例20: make1bind

static void
make1bind( 
	TARGET	*t,
	int	warn )
{
	if( t->flags & T_FLAG_NOTFILE )
	    return;

	/* Sources to 'actions existing' are never in the dependency */
	/* graph (if they were, they'd get built and 'existing' would */
	/* be superfluous, so throttle warning message about independent */
	/* targets. */

	if( warn )
	    printf( "warning: using independent target %s\n", t->name );

	pushsettings( t->settings );
	t->boundname = search( t->name, &t->time );
	t->binding = t->time ? T_BIND_EXISTS : T_BIND_MISSING;
	popsettings( t->settings );
}
开发者ID:Karlan88,项目名称:xray,代码行数:21,代码来源:make1.c



注:本文中的popsettings函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ popstackmark函数代码示例发布时间:2022-05-30
下一篇:
C++ popmessage函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap