⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strtotext.c

📁 Nxlib,一个模拟xlib的程序。使用microwindows的库来运行需要xlib支持的程序。
💻 C
字号:
#include "nxlib.h"#include <string.h>#include <X11/Xutil.h>#include <X11/Xatom.h>StatusXStringListToTextProperty(char **argv, int argc, XTextProperty * ret){	char *buffer;	int count = 0, i;	XTextProperty proto;	for (i = 0; i < argc; i++)		count += (argv[i] ? strlen(argv[i]) : 0) + 1;	proto.encoding = XA_STRING;	proto.format = 8;	proto.value = 0;	if (count > 0) {		proto.nitems = count - 1;		buffer = (char *) Xmalloc(count);		if (!buffer)			return 0;		proto.value = buffer;		for (i = 0; i < argc; i++) {			if (argv[i]) {				strcpy(buffer, argv[i]);				buffer += strlen(argv[i] + 1);			} else {				*buffer++ = '\0';			}		}	} else {		proto.nitems = 0;		if (!(proto.value = (char *) Xmalloc(1)))			return 0;		*proto.value = '\0';	}	memcpy(ret, &proto, sizeof(*ret));	return 1;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -