您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ wstrdup函数代码示例

51自学网 2021-06-03 10:08:14
  C++
这篇教程C++ wstrdup函数代码示例写得很实用,希望能帮到您。

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

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

示例1: addWMMenuEntryCallback

/* upon fully deducing one particular menu entry, parsers call back to this * function to have said menu entry added to the wm menu. initializes wm menu * with a root element if needed. */static void addWMMenuEntryCallback(WMMenuEntry *aEntry){	WMMenuEntry *wm;	WMTreeNode *at;	wm = (WMMenuEntry *)wmalloc(sizeof(WMMenuEntry));	/* this entry */	at = (WMTreeNode *)NULL;				/* will be a child of this entry */	if (!menu) {		WMMenuEntry *root;		root = (WMMenuEntry *)wmalloc(sizeof(WMMenuEntry));		root->Name = "Applications";		root->CmdLine = NULL;		root->SubMenu = NULL;		root->Flags = 0;		menu = WMCreateTreeNode(root);	}	if (aEntry->SubMenu)		at = findPositionInMenu(aEntry->SubMenu);	if (!at)		at = menu;	wm->Flags = aEntry->Flags;	wm->Name = wstrdup(aEntry->Name);	wm->CmdLine = wstrdup(aEntry->CmdLine);	wm->SubMenu = NULL;	WMAddItemToTree(at, wm);}
开发者ID:awmaker,项目名称:awmaker,代码行数:36,


示例2: xdg_to_wm

/* coerce an xdg entry type into a wm entry type */static Bool xdg_to_wm(XDGMenuEntry **xdg, WMMenuEntry **wm){	char *p;	/* Exec or TryExec is mandatory */	if (!((*xdg)->Exec || (*xdg)->TryExec))		return False;	/* if there's no Name, use the first word of Exec or TryExec	 */	if ((*xdg)->Name) {		(*wm)->Name = (*xdg)->Name;	} else  {		if ((*xdg)->Exec)			(*wm)->Name = wstrdup((*xdg)->Exec);		else /* (*xdg)->TryExec */			(*wm)->Name = wstrdup((*xdg)->TryExec);		p = strchr((*wm)->Name, ' ');		if (p)			*p = '/0';	}	if ((*xdg)->Exec)		(*wm)->CmdLine = (*xdg)->Exec;	else					/* (*xdg)->TryExec */		(*wm)->CmdLine = (*xdg)->TryExec;	(*wm)->SubMenu = (*xdg)->Category;	(*wm)->Flags = (*xdg)->Flags;	return True;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:35,


示例3: secure_getenv

char *wgethomedir(){	static char *home = NULL;	char *tmp;	struct passwd *user;	if (home)		return home;#ifdef HAVE_SECURE_GETENV	tmp = secure_getenv("HOME");#else	tmp = getenv("HOME");#endif	if (tmp) {		home = wstrdup(tmp);		return home;	}	user = getpwuid(getuid());	if (!user) {		werror(_("could not get password entry for UID %i"), getuid());		home = "/";		return home;	}	if (!user->pw_dir)		home = "/";	else		home = wstrdup(user->pw_dir);	return home;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:33,


示例4: getMenuHierarchyFor

/* get the (first) xdg main category from a list of categories */static void  getMenuHierarchyFor(char **xdgmenuspec){	char *category, *p;	char buf[1024];	if (!*xdgmenuspec || !**xdgmenuspec)		return;	category = wstrdup(*xdgmenuspec);	wfree(*xdgmenuspec);	memset(buf, 0, sizeof(buf));	p = strtok(category, ";");	while (p) {		/* get a known category */		if (strcmp(p, "AudioVideo") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Audio & Video"));			break;		} else if (strcmp(p, "Audio") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Audio"));			break;		} else if (strcmp(p, "Video") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Video"));			break;		} else if (strcmp(p, "Development") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Development"));			break;		} else if (strcmp(p, "Education") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Education"));			break;		} else if (strcmp(p, "Game") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Game"));			break;		} else if (strcmp(p, "Graphics") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Graphics"));			break;		} else if (strcmp(p, "Network") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Network"));			break;		} else if (strcmp(p, "Office") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Office"));			break;		} else if (strcmp(p, "Settings") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Settings"));			break;		} else if (strcmp(p, "System") == 0) {			snprintf(buf, sizeof(buf), "%s", _("System"));			break;		} else if (strcmp(p, "Utility") == 0) {			snprintf(buf, sizeof(buf), "%s", _("Utility"));			break;		}		p = strtok(NULL, ";");	}	if (!*buf)		/* come up with something if nothing found */		snprintf(buf, sizeof(buf), "%s", _("Applications"));	*xdgmenuspec = wstrdup(buf);}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:62,


示例5: wFetchName

/* XFetchName Wrapper */Bool wFetchName(Display *dpy, Window win, char **winname){	XTextProperty text_prop;	char **list;	int num;	if (XGetWMName(dpy, win, &text_prop)) {		if (text_prop.value && text_prop.nitems > 0) {			if (text_prop.encoding == XA_STRING) {				*winname = wstrdup((char *)text_prop.value);				XFree(text_prop.value);			} else {				text_prop.nitems = strlen((char *)text_prop.value);				if (XmbTextPropertyToTextList(dpy, &text_prop, &list, &num) >=				    Success && num > 0 && *list) {					XFree(text_prop.value);					*winname = wstrdup(*list);					XFreeStringList(list);				} else {					*winname = wstrdup((char *)text_prop.value);					XFree(text_prop.value);				}			}		} else {			/* the title is set, but it was set to none */			*winname = wstrdup("");		}		return True;	} else {		/* the hint is probably not set */		*winname = NULL;		return False;	}}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:36,


示例6: createWindow

/*-------------------------------------- * Function: createWindow(title, width, height) *------------------------------------*/static void createWindow(const string* title, int width, int height) {    RECT window_rect = { 0 };    window_rect.right  = width;    window_rect.bottom = height;    AdjustWindowRectEx(&window_rect, WindowStyle, FALSE, WindowStyleEx);    int window_width  = window_rect.right  - window_rect.left;    int window_height = window_rect.bottom - window_rect.top;    registerWindowClass();    window = malloc(sizeof(windowT));    wchar_t* class_name  = wstrdup(ClassName);    wchar_t* window_name = wstrdup(title);    window->hwnd = CreateWindowExW(WindowStyleEx,                                   class_name,                                   window_name,                                   WindowStyle,                                   CW_USEDEFAULT,                                   CW_USEDEFAULT,                                   window_width,                                   window_height,                                   HWND_DESKTOP,                                   NULL,                                   GetModuleHandleW(NULL),                                   NULL);    free(class_name);    free(window_name);    assert(window->hwnd != NULL);    RECT desktop_rect;    GetClientRect(GetDesktopWindow(), &desktop_rect);    MoveWindow(window->hwnd,               (desktop_rect.right  - desktop_rect.left - window_width ) / 2,               (desktop_rect.bottom - desktop_rect.top  - window_height) / 2,               window_width,               window_height,               FALSE);    ShowWindow(window->hwnd, SW_SHOW);    window->hdc = GetDC(window->hwnd);    //assert(window->hdc != NULL);    window->width  = width;    window->height = height;}
开发者ID:philiparvidsson,项目名称:ral-viz,代码行数:58,


示例7: wmc_to_wm

/* normalize and convert one wmconfig-format entry to wm format */static Bool wmc_to_wm(WMConfigMenuEntry **wmc, WMMenuEntry **wm){	char *p;	size_t slen;	/* only Exec is mandatory, and it's better exist in a known place */	if (!((*wmc)->Exec &&	     *(*wmc)->Exec &&	     fileInPath((*wmc)->Exec)))		return False;	/* normalize Exec: wmconfig tends to stick an ampersand	 * at the end of everything, which we don't need */	slen = strlen((*wmc)->Exec) - 1;	p = (*wmc)->Exec;	while (slen > 0 && (isspace(*(p + slen)) || *(p + slen) == '&'))		*(p + slen--) = '/0';	/* if there's no Name, use the first word of Exec; still better	 * than nothing. i realize it's highly arguable whether `xterm' from	 * `xterm -e "ssh dev push-to-prod"' is helpful or not, but since	 * the alternative is to completely lose the entry, i opt for this.	 * you could just fix the descriptor file to have a label <G> */	if (!(*wmc)->Name) {		(*wmc)->Name = wstrdup((*wmc)->Exec);		p = strchr((*wmc)->Name, ' ');		if (p)			*p = '/0';	}	/* if there's no Category, use "Applications"; apparently "no category"	 * can manifest both as no `group' descriptor at all, or a group	 * descriptor of "" */	if (!(*wmc)->Category || !*(*wmc)->Category)		(*wmc)->Category = wstrdup("Applications");	/* the `restart' type is used for restart, restart other	 * wm and quit current wm too. separate these cases. */	if ((*wmc)->Restart) {		if (strcmp((*wmc)->Restart, "restart") == 0)			(*wmc)->Flags |= F_RESTART_SELF;		else if (strcmp((*wmc)->Restart, "quit") == 0)			(*wmc)->Flags |= F_QUIT;		else			(*wmc)->Flags |= F_RESTART_OTHER;	}	(*wm)->Name = (*wmc)->Name;	(*wm)->CmdLine = (*wmc)->Exec;	(*wm)->SubMenu = (*wmc)->Category;	(*wm)->Flags = (*wmc)->Flags;	return True;}
开发者ID:awmaker,项目名称:awmaker,代码行数:55,


示例8: wstrdup

char *GetShortcutString(const char *shortcut){	char *buffer = NULL;	char *k;	int control = 0;	char *tmp, *text;	tmp = text = wstrdup(shortcut);	/* get modifiers */	while ((k = strchr(text, '+')) != NULL) {		int mod;		*k = 0;		mod = wXModifierFromKey(text);		if (mod < 0) {			return wstrdup("bug");		}		if (strcasecmp(text, "Meta") == 0) {			buffer = wstrappend(buffer, "M+");		} else if (strcasecmp(text, "Alt") == 0) {			buffer = wstrappend(buffer, "A+");		} else if (strcasecmp(text, "Shift") == 0) {			buffer = wstrappend(buffer, "Sh+");		} else if (strcasecmp(text, "Mod1") == 0) {			buffer = wstrappend(buffer, "M1+");		} else if (strcasecmp(text, "Mod2") == 0) {			buffer = wstrappend(buffer, "M2+");		} else if (strcasecmp(text, "Mod3") == 0) {			buffer = wstrappend(buffer, "M3+");		} else if (strcasecmp(text, "Mod4") == 0) {			buffer = wstrappend(buffer, "M4+");		} else if (strcasecmp(text, "Mod5") == 0) {			buffer = wstrappend(buffer, "M5+");		} else if (strcasecmp(text, "Control") == 0) {			control = 1;		} else {			buffer = wstrappend(buffer, text);		}		text = k + 1;	}	if (control) {		buffer = wstrappend(buffer, "^");	}	buffer = wstrappend(buffer, text);	wfree(tmp);	return buffer;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:51,


示例9: wstrdup

Panel *InitMouseSettings(WMWidget *parent){	_Panel *panel;	modifierNames[0] = wstrdup(_("Shift"));	modifierNames[1] = wstrdup(_("Lock"));	modifierNames[2] = wstrdup(_("Control"));	modifierNames[3] = wstrdup(_("Mod1"));	modifierNames[4] = wstrdup(_("Mod2"));	modifierNames[5] = wstrdup(_("Mod3"));	modifierNames[6] = wstrdup(_("Mod4"));	modifierNames[7] = wstrdup(_("Mod5"));	panel = wmalloc(sizeof(_Panel));	panel->sectionName = _("Mouse Preferences");	panel->description = _("Mouse speed/acceleration, double click delay,/n" "mouse button bindings etc.");	panel->parent = parent;	panel->callbacks.createWidgets = createPanel;	panel->callbacks.updateDomain = storeData;	AddSection(panel, ICON_FILE);	return panel;}
开发者ID:awmaker,项目名称:awmaker,代码行数:28,


示例10: storeData

static void storeData(_Panel * panel){	char buffer[64];	int i;	char *tmp, *p;	WMUserDefaults *udb = WMGetStandardUserDefaults();	if (!WMGetUDBoolForKey(udb, "NoXSetStuff")) {		tmp = WMGetTextFieldText(panel->threT);		if (strlen(tmp) == 0) {			wfree(tmp);			tmp = wstrdup("4");		}		sprintf(buffer, XSET " m %i/%i %s/n", (int)(panel->acceleration * 10), 10, tmp);		storeCommandInScript(XSET " m", buffer);		wfree(tmp);	}	tmp = WMGetTextFieldText(panel->ddelaT);	if (sscanf(tmp, "%i", &i) == 1 && i > 0)		SetIntegerForKey(i, "DoubleClickTime");	wfree(tmp);	SetBoolForKey(WMGetButtonSelected(panel->disaB), "DisableWSMouseActions");	for (i = 0; i < wlengthof(button_list); i++) {		const char *db_value;		int action;		action = WMGetPopUpButtonSelectedItem(panel->mouse_action[i].popup);		if (button_list[i].type == T_BUTTON)			db_value = button_actions[action].db_value;		else			db_value = wheel_actions[action].db_value;		SetStringForKey(db_value, button_list[i].db_key);	}	tmp = WMGetPopUpButtonItem(panel->grabP, WMGetPopUpButtonSelectedItem(panel->grabP));	tmp = wstrdup(tmp);	p = strchr(tmp, ' ');	if (p != NULL)		*p = '/0';	SetStringForKey(tmp, "ModifierKey");	wfree(tmp);}
开发者ID:awmaker,项目名称:awmaker,代码行数:49,


示例11: install

voidinstall(wchar_t *nam, wchar_t *val, int mode){	struct nlist *np;	wchar_t	*cp;	int		l;	if (mode == PUSH)		(void) lookup(nam);	/* lookup sets hshval */	else		while (undef(nam))	/* undef calls lookup */			;	np = xcalloc(1, sizeof (*np));	np->name = wstrdup(nam);	np->next = hshtab[hshval];	hshtab[hshval] = np;	cp = xcalloc((l = wcslen(val))+1, sizeof (*val));	np->def = cp;	cp = &cp[l];	while (*val)		*--cp = *val++;}
开发者ID:AlainODea,项目名称:illumos-gate,代码行数:25,


示例12: WMSetMenuItemShortcut

void WMSetMenuItemShortcut(WMMenuItem * item, const char *shortcut){	if (item->shortcutKey)		wfree(item->shortcutKey);	item->shortcutKey = wstrdup(shortcut);}
开发者ID:crmafra,项目名称:wmaker,代码行数:7,


示例13: hash

static Dict *install(char *name, uint versions, uint model,                      Parser *parser, CheckAttribs *chkattrs){    Dict *np;    unsigned hashval;    if ((np = lookup(name)) == null)    {        np = (Dict *)MemAlloc(sizeof(*np));        if (np == null || (np->name = wstrdup(name)) == null)            return null;        hashval = hash(name);        np->next = hashtab[hashval];        np->model = 0;        hashtab[hashval] = np;    }    np->versions = versions;    np->model |= model;    np->parser = parser;    np->chkattrs = chkattrs;    return np;}
开发者ID:IliyanKafedzhiev,项目名称:FacultyOfMathematicAndInformatic,代码行数:25,


示例14: browseForFile

static void browseForFile(WMWidget * self, void *clientData){	_Panel *panel = (_Panel *) clientData;	WMFilePanel *filePanel;	char *text, *oldprog, *newprog;	filePanel = WMGetOpenPanel(WMWidgetScreen(self));	text = WMGetTextFieldText(panel->commandT);	oldprog = wtrimspace(text);	wfree(text);	if (oldprog[0] == 0 || oldprog[0] != '/') {		wfree(oldprog);		oldprog = wstrdup("/");	} else {		char *ptr = oldprog;		while (*ptr && !isspace(*ptr))			ptr++;		*ptr = 0;	}	WMSetFilePanelCanChooseDirectories(filePanel, False);	if (WMRunModalFilePanelForDirectory(filePanel, panel->parent, oldprog, _("Select Program"), NULL) == True) {		newprog = WMGetFilePanelFileName(filePanel);		WMSetTextFieldText(panel->commandT, newprog);		updateMenuItem(panel, panel->currentItem, panel->commandT);		wfree(newprog);	}	wfree(oldprog);}
开发者ID:awmaker,项目名称:awmaker,代码行数:33,


示例15: registerWindowClass

/*-------------------------------------- * Function: registerWindowClass() *------------------------------------*/static void registerWindowClass(void) {    WNDCLASSEXW wcx = { 0 };    wchar_t* class_name = wstrdup(ClassName);    wcx.cbSize        = sizeof(WNDCLASSEXW);    wcx.style         = CS_HREDRAW | CS_VREDRAW;    wcx.lpfnWndProc   = WindowProc;    wcx.cbClsExtra    = 0;    wcx.cbWndExtra    = 0;    wcx.hInstance     = GetModuleHandleW(NULL);    wcx.hIcon         = LoadIconW(NULL, IDI_APPLICATION);    wcx.hCursor       = LoadCursorW(NULL, IDC_ARROW);    wcx.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);    wcx.lpszMenuName  = NULL;    wcx.lpszClassName = class_name;    wcx.hIconSm       = NULL;    if (!RegisterClassExW(&wcx)) {        free(class_name);        error("could not register window class");    }    free(class_name);}
开发者ID:philiparvidsson,项目名称:ral-viz,代码行数:28,


示例16: memset

/* returns the leaf an entry with the submenu spec `submenu' attaches to. * creates `submenu' path (anchored to the root) along the way. */static WMTreeNode *findPositionInMenu(const char *submenu){	char *q;	WMMenuEntry *wm;	WMTreeNode *node, *pnode;	char buf[1024];	/* qualify submenu with "Applications/" (the root node) */	memset(buf, 0, sizeof(buf));	snprintf(buf, sizeof(buf), "Applications/%s", submenu);	/* start at the root */	node = menu;	q = strtok(buf, "/");	while (q) {		pnode = node;		node = WMFindInTreeWithDepthLimit(pnode, nodeFindSubMenuByNameFunc, q, 1);		if (!node) {			wm = (WMMenuEntry *)wmalloc(sizeof(WMMenuEntry));			wm->Flags = 0;			wm->Name = wstrdup(q);			wm->CmdLine = NULL;			wm->SubMenu = NULL;			node = WMAddNodeToTree(pnode, WMCreateTreeNode(wm));		}		q = strtok(NULL, "/");	}	return node;}
开发者ID:awmaker,项目名称:awmaker,代码行数:34,


示例17: wmconfig_validate_file

/* an example to illustrate validateFilename. * with wmconfig, no special handling is needed */Bool wmconfig_validate_file(const char *filename, const struct stat *st, int tflags, struct FTW *ftw){	(void)filename;	(void)st;	(void)tflags;	(void)ftw;	return True;#if 0	/* not dead code, example */	/* or we could have gone intro extremes */	char *base_name;	Bool ret;	(void)tflags;	base_name = wstrdup(filename + ftw->base);	ret = True;	if (!S_ISREG(st->st_mode) ||				/* not a regular file */	    (st->st_uid != 0 && st->st_uid != getuid()) ||	/* bad guy injected this file */	    strpbrk(base_name, ".") ||				/* wmconfig typically has no extension */	    st->st_size >= 128 * 131072	||			/* noone writes wmconfig files > 128K */	    st->st_size == 0 ||					/* nor empty ones */	    ftw->level > 16)					/* how did we get this deep? */		ret = False;	wfree(base_name);	return ret;#endif}
开发者ID:awmaker,项目名称:awmaker,代码行数:35,


示例18: wexpandpath

char *wfindfileinarray(WMPropList *array, const char *file){	int i;	char *path;	int len, flen;	char *fullpath;	if (!file)		return NULL;	if (*file == '/' || *file == '~' || !array) {		if (access(file, F_OK) < 0) {			fullpath = wexpandpath(file);			if (!fullpath)				return NULL;			if (access(fullpath, F_OK) < 0) {				wfree(fullpath);				return NULL;			} else {				return fullpath;			}		} else {			return wstrdup(file);		}	}	flen = strlen(file);	for (i = 0; i < WMGetPropListItemCount(array); i++) {		WMPropList *prop;		char *p;		prop = WMGetFromPLArray(array, i);		if (!prop)			continue;		p = WMGetFromPLString(prop);		len = strlen(p);		path = wmalloc(len + flen + 2);		path = memcpy(path, p, len);		path[len] = 0;		if (wstrlcat(path, "/", len + flen + 2) >= len + flen + 2 ||		    wstrlcat(path, file, len + flen + 2) >= len + flen + 2) {			wfree(path);			return NULL;		}		/* expand tilde */		fullpath = wexpandpath(path);		wfree(path);		if (fullpath) {			/* check if file exists */			if (access(fullpath, F_OK) == 0) {				return fullpath;			}			wfree(fullpath);		}	}	return NULL;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:59,


示例19: getLocalizedStringValue

/* get a localized string value from line. allocates target, which must be wfreed later. * matching is dependent on the current value of target as well as on the * level the current value is matched on. guts matching algorithm is in * compare_matchlevel(). */static void getLocalizedStringValue(char **target, const char *line, int *match_level){	const char *p;	char *locale;	int kstart;	int sqbstart, sqbend;	p = line;	kstart = 0;	sqbstart = 0;	sqbend = 0;	locale = NULL;	/* skip until after '=', mark if '[' and ']' is found */	while (*(p + kstart) && *(p + kstart) != '=') {		switch (*(p + kstart)) {			case '[': sqbstart = kstart + 1;break;			case ']': sqbend = kstart;	break;			default	:			break;		}		kstart++;	}	kstart++;	/* skip whitespace */	while (isspace(*(p + kstart)))		kstart++;	if (sqbstart > 0 && sqbend > sqbstart)		locale = wstrndup(p + sqbstart, sqbend - sqbstart);	/* if there is no value yet and this is the default key, return */	if (!*target && !locale) {		*match_level = MATCH_DEFAULT;		*target = wstrdup(p + kstart);		return;	}	if (compare_matchlevel(match_level, locale)) {		wfree(locale);		*target = wstrdup(p + kstart);		return;	}	return;}
开发者ID:cneira,项目名称:wmaker-crm,代码行数:51,


示例20: inet_ntop

char *WDMGetHostAddr(struct sockaddr *from){	char ipbuf[128];			/* FIXME: I don't like fixed size buffers */	inet_ntop(from->sa_family, WDMSockaddrGetAddr(from, NULL), ipbuf, sizeof(ipbuf));	return wstrdup(ipbuf);}
开发者ID:bbidulock,项目名称:wdm,代码行数:8,


示例21: unregisterWindowClass

/*-------------------------------------- * Function: registerWindowClass() *------------------------------------*/static void unregisterWindowClass(void) {    wchar_t* class_name = wstrdup(ClassName);    if (!UnregisterClassW(class_name, GetModuleHandleW(NULL)))        warn("could not unregister window class");    free(class_name);}
开发者ID:philiparvidsson,项目名称:ral-viz,代码行数:11,


示例22: return

/* HTS_strdup: wrapper for strdup */char *HTS_strdup(const char *string) {#ifdef FESTIVAL    return (wstrdup(string));#else    char *buff = (char *) HTS_calloc(strlen(string) + 1, sizeof(char));    strcpy(buff, string);    return buff;#endif                          /* FESTIVAL */}
开发者ID:vsooda,项目名称:cppmary,代码行数:10,


示例23: wWorkspaceRename

void wWorkspaceRename(WScreen *scr, int workspace, const char *name){	char buf[MAX_WORKSPACENAME_WIDTH + 1];	char *tmp;	if (workspace >= w_global.workspace.count)		return;	/* trim white spaces */	tmp = wtrimspace(name);	if (strlen(tmp) == 0) {		snprintf(buf, sizeof(buf), _("Workspace %i"), workspace + 1);	} else {		strncpy(buf, tmp, MAX_WORKSPACENAME_WIDTH);	}	buf[MAX_WORKSPACENAME_WIDTH] = 0;	wfree(tmp);	/* update workspace */	wfree(w_global.workspace.array[workspace]->name);	w_global.workspace.array[workspace]->name = wstrdup(buf);	if (w_global.clip.ws_menu) {		if (strcmp(w_global.clip.ws_menu->entries[workspace + MC_WORKSPACE1]->text, buf) != 0) {			wfree(w_global.clip.ws_menu->entries[workspace + MC_WORKSPACE1]->text);			w_global.clip.ws_menu->entries[workspace + MC_WORKSPACE1]->text = wstrdup(buf);			wMenuRealize(w_global.clip.ws_menu);		}	}	if (w_global.workspace.menu) {		if (strcmp(w_global.workspace.menu->entries[workspace + MC_WORKSPACE1]->text, buf) != 0) {			wfree(w_global.workspace.menu->entries[workspace + MC_WORKSPACE1]->text);			w_global.workspace.menu->entries[workspace + MC_WORKSPACE1]->text = wstrdup(buf);			wMenuRealize(w_global.workspace.menu);		}	}	if (w_global.clip.icon)		wClipIconPaint();	WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void *)(uintptr_t) workspace);}
开发者ID:jafd,项目名称:wmaker,代码行数:43,


示例24: WMSetMenuItemTitle

void WMSetMenuItemTitle(WMMenuItem * item, const char *title){	if (item->title)		wfree(item->title);	if (title)		item->title = wstrdup(title);	else		item->title = NULL;}
开发者ID:crmafra,项目名称:wmaker,代码行数:10,


示例25: wcstoupper

WCHAR* wcstoupper(const WCHAR *s){    WCHAR* u = NULL;    WCHAR* p = NULL;    for(u = p = wstrdup(s); *p; ++p) {        *p=towupper(*p);    }    return u;}
开发者ID:fieldwind,项目名称:syncsdk,代码行数:11,


示例26: wcstolower

WCHAR* wcstolower(const WCHAR *s){    WCHAR* l = NULL;    WCHAR* p = NULL;    for(l = p = wstrdup(s); *p; ++p) {        *p=towlower(*p);    }    return l;}
开发者ID:fieldwind,项目名称:syncsdk,代码行数:11,


示例27: WDMSockaddrGetAddr

char *WDMGetHostName(struct sockaddr *from){	struct hostent *he;	void *addr;	int len;	addr = WDMSockaddrGetAddr(from, &len);	if ((he = gethostbyaddr(addr, len, from->sa_family)) == NULL)		return NULL;	return wstrdup(he->h_name);}
开发者ID:bbidulock,项目名称:wdm,代码行数:12,



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


C++ wstring函数代码示例
C++ wstrace函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。