当前位置: 首页>>代码示例>>C++>>正文


C++ STRCPY函数代码示例

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


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

示例1: init_server

static int init_server(tcp_listener_relay_server_type* server,
		       const char* ifname,
		       const char *local_address, 
		       int port, 
		       int verbose,
		       ioa_engine_handle e,
		       uint32_t *stats) {

  if(!server) return -1;

  server->stats=stats;

  if(ifname) STRCPY(server->ifname,ifname);

  if(make_ioa_addr((const u08bits*)local_address, port, &server->addr)<0) {
    return -1;
  }

  server->verbose=verbose;
  
  server->e = e;
  
  return create_server_listener(server);
}
开发者ID:arnaudcoquelet,项目名称:oss_core,代码行数:24,代码来源:tcp_listener.c

示例2: amslog_reg

RET_CODE amslog_reg(INT32 mod_index, amslog_t *plog)
{    
	if (mod_index >= 0 && mod_index < (LOG_NUM+1))
	{
		if (STRLEN(plog->mod_name) < MAX_LOG_NAME_LENGTH)
			STRCPY(amslog[mod_index].mod_name, plog->mod_name);
		else
		{
			//error
			//#@$#@%, wait string.c to add STRNCPY function!!!!!
			//STRNCPY(amslog[mod_index].mod_name, plog->mod_name, MAX_LOG_NAME_LENGTH-1);
			//amslog[mod_index].mod_name[MAX_LOG_NAME_LENGTH-1] = '\0';
		}

        amslog[mod_index].log_level = plog->log_level;
        
		return SUCCESS;
	}
	else
	{
		//error!
		return ERR_PARA;
	}
}
开发者ID:jinfeng-geeya,项目名称:3202C,代码行数:24,代码来源:log.c

示例3: str_var_find

/** Set or add data string, depending whether string is already defined. */
StringData *str_var_set(const char *name, const char *string, ...)
{
	/* Variables. */
	StringData *err = NULL, *st;
	va_list args;
	
	st = str_var_find(name);
	
	if (!st)
	{
		st = (StringData *)malloc(sizeof(StringData));
		HIP_IFEL(!st, NULL, "malloc()");
		memset(st, 0, sizeof(StringData));
		STRCPY(st->name, name);
		
		if (str_data_last)
		{
			str_data_last->next = (void *)st;
			str_data_last = st;
		}
		else
		{
			str_data = st;
			str_data_last = st;
		}

		str_count++;
	}
	
	va_start(args, string);
	VSPRINTHUGESTR(st->data, string, args);
	va_end(args);

out_err:
	return err;
}
开发者ID:surki,项目名称:hipl,代码行数:37,代码来源:str_var.c

示例4: get_realm

realm_params_t* get_realm(char* name)
{
	if(name && name[0]) {
		lock_realms();
		ur_string_map_value_type value = 0;
		ur_string_map_key_type key = (ur_string_map_key_type)name;
		if (ur_string_map_get(realms, key, &value)) {
			unlock_realms();
			return (realm_params_t*)value;
		} else {
			realm_params_t *ret = (realm_params_t*)turn_malloc(sizeof(realm_params_t));
			ns_bcopy(default_realm_params_ptr,ret,sizeof(realm_params_t));
			STRCPY(ret->options.name,name);
			value = (ur_string_map_value_type)ret;
			ur_string_map_put(realms, key, value);
			ret->status.alloc_counters =  ur_string_map_create(NULL);
			add_to_secrets_list(&realms_list, name);
			unlock_realms();
			return ret;
		}
	}

	return default_realm_params_ptr;
}
开发者ID:akshayncord,项目名称:coturn,代码行数:24,代码来源:userdb.c

示例5: main

int main(int argc, char **argv)
{
	int port = 0;
	int messagenumber = 5;
	char local_addr[256];
	int c;
	int mclient = 1;
	char peer_address[129] = "\0";
	int peer_port = PEER_DEFAULT_PORT;

	char rest_api_separator = ':';
	int use_null_cipher=0;

	set_logfile("stdout");

	set_execdir();

	set_system_parameters(0);

	ns_bzero(local_addr, sizeof(local_addr));

	while ((c = getopt(argc, argv, "d:p:l:n:L:m:e:r:u:w:i:k:z:W:C:E:F:vsyhcxXgtTSAPDNOUHMRIGB")) != -1) {
		switch (c){
		case 'B':
			random_disconnect = 1;
			break;
		case 'G':
			extra_requests = 1;
			break;
		case 'F':
			STRCPY(cipher_suite,optarg);
			break;
		case 'I':
			no_permissions = 1;
			break;
		case 'M':
			mobility = 1;
			break;
		case 'H':
			shatype = SHATYPE_SHA256;
			break;
		case 'E':
		{
			char* fn = find_config_file(optarg,1);
			if(!fn) {
				fprintf(stderr,"ERROR: file %s not found\n",optarg);
				exit(-1);
			}
			STRCPY(ca_cert_file,fn);
		}
			break;
		case 'O':
			dos = 1;
			break;
		case 'C':
			rest_api_separator=*optarg;
			break;
		case 'D':
			mandatory_channel_padding = 1;
			break;
		case 'N':
			negative_test = 1;
			break;
		case 'R':
			negative_protocol_test = 1;
			break;
		case 'z':
			RTP_PACKET_INTERVAL = atoi(optarg);
			break;
		case 'A':
			use_short_term = 1;
			break;
		case 'u':
			STRCPY(g_uname, optarg);
			break;
		case 'w':
			STRCPY(g_upwd, optarg);
			break;
		case 'g':
			dont_fragment = 1;
			break;
		case 'd':
			STRCPY(client_ifname, optarg);
			break;
		case 'x':
			default_address_family = STUN_ATTRIBUTE_REQUESTED_ADDRESS_FAMILY_VALUE_IPV6;
			break;
		case 'X':
			default_address_family = STUN_ATTRIBUTE_REQUESTED_ADDRESS_FAMILY_VALUE_IPV4;
			break;
		case 'l':
			clmessage_length = atoi(optarg);
			break;
		case 's':
			do_not_use_channel = 1;
			break;
		case 'n':
			messagenumber = atoi(optarg);
			break;
		case 'p':
//.........这里部分代码省略.........
开发者ID:avble,项目名称:00_prj_vr_rc,代码行数:101,代码来源:mainuclient.c

示例6: defined


//.........这里部分代码省略.........
                    "../../../../common/",                              // up 4 in tree, "../../../common/" subdir
                    "../../../../common/data/",                         // up 4 in tree, "../../../common/data/" subdir
                    "../../../../data/",                                // up 4 in tree, "../../../data/" subdir
                    "../../../../../",                                // up 5 in tree
                    "../../../../../src/<executable_name>/",          // up 5 in tree, "/src/<executable_name>/" subdir
                    "../../../../../src/<executable_name>/data/",     // up 5 in tree, "/src/<executable_name>/data/" subdir
                    "../../../../../src/<executable_name>/src/",      // up 5 in tree, "/src/<executable_name>/src/" subdir
                    "../../../../../src/<executable_name>/inc/",      // up 5 in tree, "/src/<executable_name>/inc/" subdir
                    "../../../../../sandbox/<executable_name>/",      // up 5 in tree, "/sandbox/<executable_name>/" subdir
                    "../../../../../sandbox/<executable_name>/data/", // up 5 in tree, "/sandbox/<executable_name>/data/" subdir
                    "../../../../../sandbox/<executable_name>/src/",  // up 5 in tree, "/sandbox/<executable_name>/src/" subdir
                    "../../../../../sandbox/<executable_name>/inc/",   // up 5 in tree, "/sandbox/<executable_name>/inc/" subdir
                    "../../../../../0_Simple/<executable_name>/data/",     // up 5 in tree, "/0_Simple/<executable_name>/" subdir
                    "../../../../../1_Utilities/<executable_name>/data/",  // up 5 in tree, "/1_Utilities/<executable_name>/" subdir
                    "../../../../../2_Graphics/<executable_name>/data/",   // up 5 in tree, "/2_Graphics/<executable_name>/" subdir
                    "../../../../../3_Imaging/<executable_name>/data/",    // up 5 in tree, "/3_Imaging/<executable_name>/" subdir
                    "../../../../../4_Finance/<executable_name>/data/",    // up 5 in tree, "/4_Finance/<executable_name>/" subdir
                    "../../../../../5_Simulations/<executable_name>/data/",// up 5 in tree, "/5_Simulations/<executable_name>/" subdir
                    "../../../../../6_Advanced/<executable_name>/data/",   // up 5 in tree, "/6_Advanced/<executable_name>/" subdir
                    "../../../../../7_CUDALibraries/<executable_name>/data/", // up 5 in tree, "/7_CUDALibraries/<executable_name>/" subdir
                    "../../../../../8_Android/<executable_name>/data/",    // up 5 in tree, "/8_Android/<executable_name>/" subdir
                    "../../../../../samples/<executable_name>/data/",      // up 5 in tree, "/samples/<executable_name>/" subdir
                    "../../../../../common/",                         // up 5 in tree, "../../../common/" subdir
                    "../../../../../common/data/",                    // up 5 in tree, "../../../common/data/" subdir
            };

    // Extract the executable name
    std::string executable_name;

    if (executable_path != 0)
    {
        executable_name = std::string(executable_path);

#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
        // Windows path delimiter
        size_t delimiter_pos = executable_name.find_last_of('\\');
        executable_name.erase(0, delimiter_pos + 1);

        if (executable_name.rfind(".exe") != std::string::npos)
        {
            // we strip .exe, only if the .exe is found
            executable_name.resize(executable_name.size() - 4);
        }

#else
        // Linux & OSX path delimiter
        size_t delimiter_pos = executable_name.find_last_of('/');
        executable_name.erase(0,delimiter_pos+1);
#endif
    }

    // Loop over all search paths and return the first hit
    for (unsigned int i = 0; i < sizeof(searchPath)/sizeof(char *); ++i)
    {
        std::string path(searchPath[i]);
        size_t executable_name_pos = path.find("<executable_name>");

        // If there is executable_name variable in the searchPath
        // replace it with the value
        if (executable_name_pos != std::string::npos)
        {
            if (executable_path != 0)
            {
                path.replace(executable_name_pos, strlen("<executable_name>"), executable_name);
            }
            else
            {
                // Skip this path entry if no executable argument is given
                continue;
            }
        }

#ifdef _DEBUG
        printf("sdkFindFilePath <%s> in %s\n", filename, path.c_str());
#endif

        // Test if the file exists
        path.append(filename);
        FILE *fp;
        FOPEN(fp, path.c_str(), "rb");

        if (fp != NULL)
        {
            fclose(fp);
            // File found
            // returning an allocated array here for backwards compatibility reasons
            char *file_path = (char *) malloc(path.length() + 1);
            STRCPY(file_path, path.length() + 1, path.c_str());
            return file_path;
        }

        if (fp)
        {
            fclose(fp);
        }
    }

    // File not found
    return 0;
}
开发者ID:Hopobcn,项目名称:nbody,代码行数:101,代码来源:helper_string.hpp

示例7: STRCPY_T

void AAIConfig::LoadConfig(AAI *ai)
{
	// this size equals the one used in "AIAICallback::GetValue(AIVAL_LOCATE_FILE_..."
	char filename[2048];
	char buffer[500];

	MAX_UNITS = ai->Getcb()->GetMaxUnits();

	FILE* file = NULL;

	STRCPY_T(buffer, sizeof(buffer), MAIN_PATH);
	STRCAT_T(buffer, sizeof(buffer), MOD_CFG_PATH);
	const std::string modHumanName = MakeFileSystemCompatible(ai->Getcb()->GetModHumanName());
	STRCAT_T(buffer, sizeof(buffer), modHumanName.c_str());
	STRCAT_T(buffer, sizeof(buffer), ".cfg");
	STRCPY_T(filename, sizeof(filename), buffer);
	ai->Getcb()->GetValue(AIVAL_LOCATE_FILE_R, filename);
	file = fopen(filename, "r");
	if (file == NULL) {
		ai->Log("Mod config file %s not found\n", filename);
		ai->Log("Now trying with legacy mod config file name ...\n");
		STRCPY_T(buffer, sizeof(buffer), MAIN_PATH);
		STRCAT_T(buffer, sizeof(buffer), MOD_CFG_PATH);
		const std::string modName = MakeFileSystemCompatible(ai->Getcb()->GetModName());
		STRCAT_T(buffer, sizeof(buffer), modName.c_str());
		ReplaceExtension(buffer, filename, sizeof(filename), ".cfg");
		ai->Getcb()->GetValue(AIVAL_LOCATE_FILE_R, filename);
		file = fopen(filename, "r");
	}
	if (file == NULL) {
		ai->Log("Mod config file %s not found\n", filename);
		ai->Log("Now trying with version independent mod config file name ...\n");
		STRCPY_T(buffer, sizeof(buffer), MAIN_PATH);
		STRCAT_T(buffer, sizeof(buffer), MOD_CFG_PATH);
		const std::string modShortName = MakeFileSystemCompatible(ai->Getcb()->GetModShortName());
		STRCAT_T(buffer, sizeof(buffer), modShortName.c_str());
		STRCAT_T(buffer, sizeof(buffer), ".cfg");
		STRCPY_T(filename, sizeof(filename), buffer);
		ai->Getcb()->GetValue(AIVAL_LOCATE_FILE_R, filename);
		file = fopen(filename, "r");
	}
	if (file == NULL) {
		ai->Log("Mod config file %s not found\n", filename);
		ai->Log("Give up trying to find mod config file (required).\n");
		initialized = false;
		return;
	}

	char keyword[50];
	int ival;
	float fval;
	const UnitDef *def;

	bool error = false;
//	bool loaded = false;

	if(file)
	{
		ai->Log("Using mod config file %s\n", filename);

		while(EOF != fscanf(file, "%s", keyword))
		{
			if(!strcmp(keyword,"SIDES"))
			{
				fscanf(file, "%i", &ival);
				SIDES = ival;
			}
			else if(!strcmp(keyword, "START_UNITS"))
			{
				START_UNITS = new char*[SIDES];

				for(int i = 0; i < SIDES; i++)
				{
					START_UNITS[i] = new char[20];
					fscanf(file, "%s", filename);
					STRCPY(START_UNITS[i], filename);

					if(!ai->Getcb()->GetUnitDef(START_UNITS[i]))
					{
						ai->Log("ERROR: loading starting units - could not find unit %s\n", START_UNITS[i]);
						error = true;
						break;
					}
				}
			}
			else if(!strcmp(keyword, "SIDE_NAMES"))
			{
				SIDE_NAMES = new char*[SIDES];

				for(int i = 0; i < SIDES; i++)
				{
					SIDE_NAMES[i] = new char[80];
					fscanf(file, "%s", filename);
					STRCPY(SIDE_NAMES[i], filename);
				}
			}
			else if(!strcmp(keyword, "SCOUTS"))
			{
				// get number of scouts
				fscanf(file, "%i", &ival);
//.........这里部分代码省略.........
开发者ID:AMDmi3,项目名称:spring,代码行数:101,代码来源:AAIConfig.cpp

示例8: workshop_toolbar_button

/*ARGSUSED*/
    void
workshop_toolbar_button(
	char	*label,
	char	*verb,
	char	*senseVerb,
	char	*filepos,
	char	*help,
	char	*sense,
	char	*file,
	char	*left)
{
    char	cbuf[BUFSIZ + MAXPATHLEN];
    char	namebuf[BUFSIZ];
    static int	tbid = 1;
    char_u	*p;

#ifdef WSDEBUG_TRACE
    if (WSDLEVEL(WS_TRACE_VERBOSE))
	wsdebug("workshop_toolbar_button(\"%s\", %s, %s,\n"
		"\t%s, \"%s\", %s,\n\t\"%s\",\n\t<%s>)\n",
		label   && *label   ? label   : "<None>",
		verb    && *verb    ? verb    : "<None>",
		senseVerb && *senseVerb    ? senseVerb    : "<None>",
		filepos && *filepos ? filepos : "<None>",
		help    && *help    ? help    : "<None>",
		sense   && *sense   ? sense   : "<None>",
		file    && *file    ? file    : "<None>",
		left    && *left    ? left    : "<None>");
    else if (WSDLEVEL(WS_TRACE))
	wstrace("workshop_toolbar_button(\"%s\", %s)\n",
		label   && *label   ? label   : "<None>",
		verb    && *verb    ? verb    : "<None>");
#endif
#ifdef WSDEBUG_SENSE
    if (ws_debug)
	wsdebug("button: %-21.20s%-21.20s(%s)\n", label, verb,
		*sense == '1' ? "Sensitive" : "Insensitive");
#endif

    if (left && *left && atoi(left) > 0)
    {
	/* Add a separator (but pass the width passed after the ':') */
	sprintf(cbuf, "amenu 1.%d ToolBar.-sep%d:%s- <nul>",
		tbpri - 5, tbid++, left);

	coloncmd(cbuf, True);
    }

    p = vim_strsave_escaped((char_u *)label, (char_u *)"\\. ");
    sprintf(namebuf, "ToolBar.%s", p);
    vim_free(p);
    STRCPY(cbuf, "amenu <silent> ");
    if (file != NULL && *file != NUL)
    {
	p = vim_strsave_escaped((char_u *)file, (char_u *)" ");
	sprintf(cbuf + STRLEN(cbuf), "icon=%s ", p);
	vim_free(p);
    }
    sprintf(cbuf + STRLEN(cbuf), "1.%d %s :wsverb %s<CR>",
							tbpri, namebuf, verb);

    /* Define the menu item */
    coloncmd(cbuf, True);

    if (*sense == '0')
    {
	/* If menu isn't sensitive at startup... */
	sprintf(cbuf, "amenu disable %s", namebuf);
	coloncmd(cbuf, True);
    }

    if (help && *help)
    {
	/* Do the tooltip */
	sprintf(cbuf, "tmenu %s %s", namebuf, help);
	coloncmd(cbuf, True);
    }

    addMenu(namebuf, NULL, verb);
    tbpri += 10;
}
开发者ID:UTSASRG,项目名称:DoubleTake,代码行数:82,代码来源:workshop.c

示例9: util_allocStrCpy

char* util_allocStrCpy(const char* toCopy) {

	char* copy = (char*) calloc(strlen(toCopy)+1, sizeof(char));
	STRCPY(copy, toCopy);
	return copy;
}
开发者ID:genxinzou,项目名称:svn-spring-archive,代码行数:6,代码来源:Util.c

示例10: qf_init


//.........这里部分代码省略.........
			}
			if (adr_cnt == 7)
			{
				EMSG("too many % in format string");
				goto error2;
			}
			++pfmt;
		}
		if (i >= maxlen - 6)
		{
			EMSG("invalid format string");
			goto error2;
		}
	}
	fmtstr[i] = NUL;

	while (fgets((char *)IObuff, CMDBUFFSIZE, fd) != NULL && !got_int)
	{
		if ((qfp = (struct qf_line *)alloc((unsigned)sizeof(struct qf_line))) == NULL)
			goto error2;

		IObuff[CMDBUFFSIZE] = NUL;	/* for very long lines */
		namebuf[0] = NUL;
		errmsg[0] = NUL;
		lnum = 0;
		col = 0;
		enr = -1;
		type = 0;
		valid = TRUE;

		if (sscanf((char *)IObuff, (char *)fmtstr, adr[0], adr[1], adr[2], adr[3],
												adr[4], adr[5]) != adr_cnt)
		{
			namebuf[0] = NUL;			/* something failed, remove file name */
			valid = FALSE;
			STRCPY(errmsg, IObuff);		/* copy whole line to error message */
			if ((pfmt = STRRCHR(errmsg, '\n')) != NULL)
				*pfmt = NUL;
#ifdef MSDOS
			if ((pfmt = STRRCHR(errmsg, '\r')) != NULL)
				*pfmt = NUL;
#endif
		}

		if (namebuf[0] == NUL)			/* no file name */
			qfp->qf_fnum = 0;
		else
			qfp->qf_fnum = buflist_add(namebuf);
		if ((qfp->qf_text = strsave(errmsg)) == NULL)
			goto error1;
		qfp->qf_lnum = lnum;
		qfp->qf_col = col;
		qfp->qf_nr = enr;
		qfp->qf_type = type;
		qfp->qf_valid = valid;

		if (qf_count == 0)		/* first element in the list */
		{
			qf_start = qfp;
			qfp->qf_prev = qfp;	/* first element points to itself */
		}
		else
		{
			qfp->qf_prev = qfprev;
			qfprev->qf_next = qfp;
		}
		qfp->qf_next = qfp;		/* last element points to itself */
		qfp->qf_cleared = FALSE;
		qfprev = qfp;
		++qf_count;
		if (qf_index == 0 && qfp->qf_valid)		/* first valid entry */
		{
			qf_index = qf_count;
			qf_ptr = qfp;
		}
		breakcheck();
	}
	free(fmtstr);
	if (!ferror(fd))
	{
		if (qf_index == 0)		/* no valid entry found */
		{
			qf_ptr = qf_start;
			qf_index = 1;
			qf_nonevalid = TRUE;
		}
		else
			qf_nonevalid = FALSE;
		fclose(fd);
		qf_jump(0, 0);			/* display first error */
		return OK;
	}
	emsg(e_readerrf);
error1:
	free(qfp);
error2:
	fclose(fd);
	qf_free();
	return FAIL;
}
开发者ID:alpaca-tc,项目名称:vim_practices,代码行数:101,代码来源:quickfix.c

示例11: lan_item_con_callback

static PRESULT lan_item_con_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	UINT8	unact,input;
	UINT8	id = OSD_GetObjID(pObj);
	POBJECT_HEAD submenu;
	SYSTEM_DATA* p_sys_data=sys_data_get();
	UINT8 lang_code[8];

	switch(event)
	{		
	case EVN_FOCUS_PRE_GET:
		break;
		
	case EVN_FOCUS_PRE_LOSE:
		break;

	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16) ;
#ifdef SHOW_WELCOME_SCREEN
		if(id != ITEM_NEXT_ID)
		{
#endif
			if(unact == VACT_ENTER)
		{
			win_language_enter_key(pObj,id);
		}
		else if(unact == VACT_DECREASE)
		{
			win_language_left_key(pObj,id);
		}
		else if(unact == VACT_INCREASE)
		{
			win_language_right_key(pObj,id);
		}
#ifdef SHOW_WELCOME_SCREEN
		}
		else if(unact == VACT_ENTER)
		{
    #ifdef EPG_MULTI_LANG
			/*set epg language*/
			p_sys_data = sys_data_get();
			STRCPY(lang_code,stream_iso_639lang_abbr[p_sys_data->lang.OSD_lang]);
			epg_set_lang_code(lang_code);
    #endif

    #ifndef NEW_DEMO_FRAME
			UIChChgApplyAudLanguage();
    #endif
			sys_data_save(1);
       	 	TTXEng_set_g0_set();
			//show_win_as_welcome = FALSE;

			submenu = (POBJECT_HEAD) & win_country_net_con;
			if (OSD_ObjOpen(submenu, 0xFFFFFFFF) != PROC_LEAVE)
			{
				menu_stack_pop();
				menu_stack_push(submenu);
			}
		}
#endif
		ret = PROC_LOOP;
		break;
	}
	return ret;

}
开发者ID:alkap007,项目名称:ali3606,代码行数:67,代码来源:win_language.c

示例12: win_language_right_key

void win_language_right_key(POBJECT_HEAD pObj,UINT8 id)
{
	SYSTEM_DATA* p_sys_data=sys_data_get();
	UINT8 lang_code[8]={0};
	switch(id)
	{
		case MENU_LANGUAGE_MENU_LAN:
			if(p_sys_data->lang.OSD_lang==(MENU_LANGUAGE_OSD_NUMBER-1))
			{
				p_sys_data->lang.OSD_lang=0;
			}
			else
			{
				p_sys_data->lang.OSD_lang++;
			}
			win_lan_set_menu_lan_string(p_sys_data->lang.OSD_lang);
			sys_data_select_language(p_sys_data->lang.OSD_lang);
			wincom_open_subtitle((POBJECT_HEAD)&win_lan_con,RS_SYSTEM_LANGUAGE, 0);
			OSD_TrackObject((POBJECT_HEAD)&win_lan_con,C_DRAW_SIGN_EVN_FLG| C_UPDATE_ALL);
			break;
		case MENU_LANGUAGE_1ST_AUDIO_LAN:
			if(p_sys_data->lang.Audio_lang_1==(MENU_LANGUAGE_STREAM_NUMBER-1))
			{
				p_sys_data->lang.Audio_lang_1=0;
			}
			else
			{
				p_sys_data->lang.Audio_lang_1++;
			}
			win_lan_set_1st_audio_lan_string(p_sys_data->lang.Audio_lang_1);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			ap_language_setting(p_sys_data->lang.Audio_lang_1, p_sys_data->lang.Audio_lang_2);
			break;
		case MENU_LANGUAGE_2ND_AUDIO_LAN:
			if(p_sys_data->lang.Audio_lang_2==(MENU_LANGUAGE_STREAM_NUMBER-1))
			{
				p_sys_data->lang.Audio_lang_2=0;
			}
			else
			{
				p_sys_data->lang.Audio_lang_2++;
			}
			win_lan_set_2nd_audio_lan_string(p_sys_data->lang.Audio_lang_2);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			ap_language_setting(p_sys_data->lang.Audio_lang_1, p_sys_data->lang.Audio_lang_2);
			break;
		case MENU_LANGUAGE_SUB_LAN:
			if(p_sys_data->lang.sub_lang==(MENU_LANGUAGE_STREAM_NUMBER-1))
			{
				p_sys_data->lang.sub_lang=0;
			}
			else
			{
				p_sys_data->lang.sub_lang++;
			}
			p_sys_data->osd_set.subtitle_display = 1;/*select sub on */
			p_sys_data->osd_set.subtitle_lang = 0xFF;
			win_lan_set_subtitle_lan_string(p_sys_data->lang.sub_lang);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		case MENU_LANGUAGE_TXT_LAN:
			if(p_sys_data->lang.ttx_lang==(MENU_LANGUAGE_STREAM_NUMBER-1))
			{
				p_sys_data->lang.ttx_lang=0;
			}
			else
			{
				p_sys_data->lang.ttx_lang++;
			}
			win_lan_set_teletext_lan_string(p_sys_data->lang.ttx_lang);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
	#ifdef ORDER_GZ1207009
		case MENU_LANGUAGE_EPG_LAN:
			if(p_sys_data->lang.epg_lang==(MENU_LANGUAGE_STREAM_NUMBER-1))
			{
				p_sys_data->lang.epg_lang=0;
			}
			else
			{
				p_sys_data->lang.epg_lang++;
			}
			win_lan_set_epg_lan_string(p_sys_data->lang.epg_lang);

			STRCPY(lang_code,stream_iso_639lang_abbr[p_sys_data->lang.epg_lang]);
			epg_set_lang_code(lang_code);
			
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
	#endif
	}
}
开发者ID:alkap007,项目名称:ali3606,代码行数:92,代码来源:win_language.c

示例13: win_language_enter_key

void win_language_enter_key(POBJECT_HEAD pObj,UINT8 id)
{
	SYSTEM_DATA* p_sys_data=sys_data_get();
	OSD_RECT rect;
	COM_POP_LIST_PARAM_T param;
	UINT8 lang_code[8]={0};
	
	rect.uLeft=CON_L+TXTS_L_OF;
	rect.uWidth=TXTS_W;
	rect.uHeight=350;//340;
	param.selecttype = POP_LIST_SINGLESELECT;
	switch(id)
	{
		case MENU_LANGUAGE_MENU_LAN:
			rect.uTop=CON_T;
			param.cur=p_sys_data->lang.OSD_lang;
			p_sys_data->lang.OSD_lang = win_com_open_sub_list(POP_LIST_MENU_LANGUAGE_OSD,&rect,&param);
			win_lan_set_menu_lan_string(p_sys_data->lang.OSD_lang);
			sys_data_select_language(p_sys_data->lang.OSD_lang);
			wincom_open_subtitle((POBJECT_HEAD)&win_lan_con,RS_SYSTEM_LANGUAGE, 0);
			OSD_TrackObject((POBJECT_HEAD)&win_lan_con,C_DRAW_SIGN_EVN_FLG| C_UPDATE_ALL);
			break;
		case MENU_LANGUAGE_1ST_AUDIO_LAN:
			rect.uTop=CON_T + (CON_H + CON_GAP)*1;
			param.cur=p_sys_data->lang.Audio_lang_1;
			p_sys_data->lang.Audio_lang_1 = win_com_open_sub_list(POP_LIST_MENU_LANGUAGE_STREAM,&rect,&param);
			win_lan_set_1st_audio_lan_string(p_sys_data->lang.Audio_lang_1);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			ap_language_setting(p_sys_data->lang.Audio_lang_1, p_sys_data->lang.Audio_lang_2);
			break;
		case MENU_LANGUAGE_2ND_AUDIO_LAN:
			rect.uTop=CON_T + (CON_H + CON_GAP)*2;
			param.cur=p_sys_data->lang.Audio_lang_2;
			p_sys_data->lang.Audio_lang_2 = win_com_open_sub_list(POP_LIST_MENU_LANGUAGE_STREAM,&rect,&param);
			win_lan_set_2nd_audio_lan_string(p_sys_data->lang.Audio_lang_2);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			ap_language_setting(p_sys_data->lang.Audio_lang_1, p_sys_data->lang.Audio_lang_2);
			break;
		case MENU_LANGUAGE_SUB_LAN:
			rect.uTop=CON_T + (CON_H + CON_GAP)*3;
			param.cur=p_sys_data->lang.sub_lang;
			p_sys_data->lang.sub_lang = win_com_open_sub_list(POP_LIST_MENU_LANGUAGE_STREAM,&rect,&param);
			p_sys_data->osd_set.subtitle_display = 1;/*select sub on */
			p_sys_data->osd_set.subtitle_lang = 0xFF;
			win_lan_set_subtitle_lan_string(p_sys_data->lang.sub_lang);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
		case MENU_LANGUAGE_TXT_LAN:
			rect.uTop=CON_T + (CON_H + CON_GAP)*3;
			rect.uHeight=300;
			param.cur=p_sys_data->lang.ttx_lang;
			p_sys_data->lang.ttx_lang = win_com_open_sub_list(POP_LIST_MENU_LANGUAGE_STREAM,&rect,&param);
			win_lan_set_teletext_lan_string(p_sys_data->lang.ttx_lang);
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
	#ifdef ORDER_GZ1207009
		case MENU_LANGUAGE_EPG_LAN:
			rect.uTop=CON_T + (CON_H + CON_GAP)*3;
			rect.uHeight=300;
			param.cur=p_sys_data->lang.epg_lang;
			p_sys_data->lang.epg_lang = win_com_open_sub_list(POP_LIST_MENU_LANGUAGE_STREAM,&rect,&param);
			win_lan_set_epg_lan_string(p_sys_data->lang.epg_lang);

			STRCPY(lang_code,stream_iso_639lang_abbr[p_sys_data->lang.epg_lang]);
			epg_set_lang_code(lang_code);
			
			OSD_TrackObject(pObj,C_UPDATE_ALL);
			break;
	#endif
	}
}
开发者ID:alkap007,项目名称:ali3606,代码行数:71,代码来源:win_language.c

示例14: KEY2TERMCAP1

/*
 * Return a string which contains the name of the given key when the given
 * modifiers are down.
 */
char_u *get_special_key_name(int c, int modifiers)
{
  static char_u string[MAX_KEY_NAME_LEN + 1];

  int i, idx;
  int table_idx;
  char_u  *s;

  string[0] = '<';
  idx = 1;

  /* Key that stands for a normal character. */
  if (IS_SPECIAL(c) && KEY2TERMCAP0(c) == KS_KEY)
    c = KEY2TERMCAP1(c);

  /*
   * Translate shifted special keys into unshifted keys and set modifier.
   * Same for CTRL and ALT modifiers.
   */
  if (IS_SPECIAL(c)) {
    for (i = 0; modifier_keys_table[i] != 0; i += MOD_KEYS_ENTRY_SIZE)
      if (       KEY2TERMCAP0(c) == (int)modifier_keys_table[i + 1]
                 && (int)KEY2TERMCAP1(c) == (int)modifier_keys_table[i + 2]) {
        modifiers |= modifier_keys_table[i];
        c = TERMCAP2KEY(modifier_keys_table[i + 3],
            modifier_keys_table[i + 4]);
        break;
      }
  }

  /* try to find the key in the special key table */
  table_idx = find_special_key_in_table(c);

  /*
   * When not a known special key, and not a printable character, try to
   * extract modifiers.
   */
  if (c > 0
      && (*mb_char2len)(c) == 1
      ) {
    if (table_idx < 0
        && (!vim_isprintc(c) || (c & 0x7f) == ' ')
        && (c & 0x80)) {
      c &= 0x7f;
      modifiers |= MOD_MASK_ALT;
      /* try again, to find the un-alted key in the special key table */
      table_idx = find_special_key_in_table(c);
    }
    if (table_idx < 0 && !vim_isprintc(c) && c < ' ') {
      c += '@';
      modifiers |= MOD_MASK_CTRL;
    }
  }

  /* translate the modifier into a string */
  for (i = 0; mod_mask_table[i].name != 'A'; i++)
    if ((modifiers & mod_mask_table[i].mod_mask)
        == mod_mask_table[i].mod_flag) {
      string[idx++] = mod_mask_table[i].name;
      string[idx++] = (char_u)'-';
    }

  if (table_idx < 0) {          /* unknown special key, may output t_xx */
    if (IS_SPECIAL(c)) {
      string[idx++] = 't';
      string[idx++] = '_';
      string[idx++] = (char_u)KEY2TERMCAP0(c);
      string[idx++] = KEY2TERMCAP1(c);
    }
    /* Not a special key, only modifiers, output directly */
    else {
      if (has_mbyte && (*mb_char2len)(c) > 1)
        idx += (*mb_char2bytes)(c, string + idx);
      else if (vim_isprintc(c))
        string[idx++] = (char_u)c;
      else {
        s = transchar(c);
        while (*s)
          string[idx++] = *s++;
      }
    }
  } else {            /* use name of special key */
    STRCPY(string + idx, key_names_table[table_idx].name);
    idx = (int)STRLEN(string);
  }
  string[idx++] = '>';
  string[idx] = NUL;
  return string;
}
开发者ID:Happy-Dude,项目名称:neovim,代码行数:93,代码来源:keymap.c

示例15: win_get_fullname

void win_get_fullname(char *fullname,char *path, char *name)
{
	STRCPY(fullname, path);
	strcat(fullname, "/");
	strcat(fullname, name);
}
开发者ID:Janesak1977,项目名称:ali3602,代码行数:6,代码来源:media_control.c


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