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

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

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

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

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

示例1: mkdirp

intmkdirp(const char *path, mode_t mode, mode_t pmode){	char tmp[PATH_MAX], *p;	struct stat st;	if (stat(path, &st) == 0) {		if (S_ISDIR(st.st_mode))			return 0;		errno = ENOTDIR;		weprintf("%s:", path);		return -1;	}	estrlcpy(tmp, path, sizeof(tmp));	for (p = tmp + (tmp[0] == '/'); *p; p++) {		if (*p != '/')			continue;		*p = '/0';		if (mkdir(tmp, pmode) < 0 && errno != EEXIST) {			weprintf("mkdir %s:", tmp);			return -1;		}		*p = '/';	}	if (mkdir(tmp, mode) < 0 && errno != EEXIST) {		weprintf("mkdir %s:", tmp);		return -1;	}	return 0;}
开发者ID:michaelforney,项目名称:sbase,代码行数:31,


示例2: main

intmain(int argc, char *argv[]){	mode_t mode = 0, mask;	int mflag = 0, ret = 0;	ARGBEGIN {	case 'm':		mflag = 1;		mask = getumask();		mode = parsemode(EARGF(usage()), mode, mask);		break;	default:		usage();	} ARGEND;	if (!argc)		usage();	for (; *argv; argc--, argv++) {		if (mkfifo(*argv, S_IRUSR | S_IWUSR | S_IRGRP |		    S_IWGRP | S_IROTH | S_IWOTH) < 0) {			weprintf("mkfifo %s:", *argv);			ret = 1;		} else if (mflag) {			if (chmod(*argv, mode) < 0) {				weprintf("chmod %s:", *argv);				ret = 1;			}		}	}	return ret;}
开发者ID:rovaughn,项目名称:distro,代码行数:34,


示例3: setup_signal_handlers

void setup_signal_handlers(){	struct sigaction feh_sh;	sigset_t feh_ss;	if (		(sigemptyset(&feh_ss) == -1) ||		(sigaddset(&feh_ss, SIGUSR1) == -1) ||		(sigaddset(&feh_ss, SIGUSR2) == -1))	{		weprintf("Failed to set up signal mask, SIGUSR1/2 won't work");		return;	}	feh_sh.sa_handler = feh_handle_signal;	feh_sh.sa_mask    = feh_ss;	feh_sh.sa_flags   = 0;	if (		(sigaction(SIGUSR1, &feh_sh, NULL) == -1) ||		(sigaction(SIGUSR2, &feh_sh, NULL) == -1))	{		weprintf("Failed to set up signal handler, SIGUSR1/2 won't work");		return;	}	return;}
开发者ID:talisein,项目名称:feh,代码行数:27,


示例4: mounted

static intmounted(const char *dir){	FILE *fp;	struct mntent *me, mebuf;	struct stat st1, st2;	char linebuf[256];	if (stat(dir, &st1) < 0) {		weprintf("stat %s:", dir);		return 0;	}	if (!(fp = setmntent("/proc/mounts", "r")))		eprintf("setmntent %s:", "/proc/mounts");	while ((me = getmntent_r(fp, &mebuf, linebuf, sizeof(linebuf)))) {		if (stat(me->mnt_dir, &st2) < 0) {			weprintf("stat %s:", me->mnt_dir);			continue;		}		if (st1.st_dev == st2.st_dev &&		    st1.st_ino == st2.st_ino)			return 1;	}	endmntent(fp);	return 0;}
开发者ID:rovaughn,项目名称:distro,代码行数:28,


示例5: pri_exec

static intpri_exec(struct arg *arg){	int status;	size_t len;	pid_t pid;	char **sp, ***brace;	struct execarg *e = arg->extra.p;	if (e->isplus) {		len = strlen(arg->path) + 1;		/* if we reached ARG_MAX, fork, exec, wait, free file names, reset list */		if (len + e->u.p.arglen + e->u.p.filelen + envlen > argmax) {			e->argv[e->u.p.next] = NULL;			switch((pid = fork())) {			case -1:				eprintf("fork:");			case 0:				execvp(*e->argv, e->argv);				weprintf("exec %s failed:", *e->argv);				_exit(1);			}			waitpid(pid, &status, 0);			gflags.ret = gflags.ret || status;			for (sp = e->argv + e->u.p.first; *sp; sp++)				free(*sp);			e->u.p.next = e->u.p.first;			e->u.p.filelen = 0;		}		/* if we have too many files, realloc (with space for NULL termination) */		if (e->u.p.next + 1 == e->u.p.cap)			e->argv = ereallocarray(e->argv, e->u.p.cap *= 2, sizeof(*e->argv));		e->argv[e->u.p.next++] = estrdup(arg->path);		e->u.p.filelen += len + sizeof(arg->path);		return 1;	} else {		/* insert path everywhere user gave us {} */		for (brace = e->u.s.braces; *brace; brace++)			**brace = arg->path;		switch((pid = fork())) {		case -1:			eprintf("fork:");		case 0:			execvp(*e->argv, e->argv);			weprintf("exec %s failed:", *e->argv);			_exit(1);		}		/* FIXME: propper course of action for all waitpid() on EINTR? */		waitpid(pid, &status, 0);		return !!status;	}}
开发者ID:maandree,项目名称:sbase,代码行数:60,


示例6: mounthelper

static intmounthelper(const char *fsname, const char *dir, const char *fstype){	pid_t pid;	char eprog[PATH_MAX];	char const *eargv[10];	int status, i;	pid = fork();	switch(pid) {	case -1:		break;	case 0:		snprintf(eprog, sizeof(eprog), "mount.%s", fstype);		i = 0;		eargv[i++] = eprog;		if (argflags & MS_BIND)			eargv[i++] = "-B";		if (argflags & MS_MOVE)			eargv[i++] = "-M";		if (argflags & MS_REC)			eargv[i++] = "-R";		if (argopts) {			eargv[i++] = "-o";			eargv[i++] = argopts;		}		eargv[i++] = fsname;		eargv[i++] = dir;		eargv[i] = NULL;		execvp(eprog, (char * const *)eargv);		if (errno == ENOENT)			_exit(1);		weprintf("execvp:");		_exit(1);		break;	default:		if (waitpid(pid, &status, 0) < 0) {			weprintf("waitpid:");			return -1;		}		if (WIFEXITED(status))			return WEXITSTATUS(status);		else if (WIFSIGNALED(status))			return 1;		break;	}	return 0;}
开发者ID:rovaughn,项目名称:distro,代码行数:51,


示例7: resolve_v6name

int resolve_v6name(const char *name, in6_addr *v6addr){	in_addr v4addr;	// if the name is just an address, convert it to binary	if (inet_pton(AF_INET6, name, v6addr))		return 0;	else if (inet_pton(AF_INET, name, &v4addr)) {		to_v6addr(v4addr.s_addr, v6addr);		return 0;	}	// otherwise, resolve the name	struct addrinfo hints;	memset(&hints, 0, sizeof(hints));	hints.ai_family = AF_INET6; // accept v6 addrs	struct addrinfo *result;	if (getaddrinfo(name, NULL, NULL, &result) != 0) {		weprintf("getaddrinfo(%s) failed:", name);		return -1;	}	if (result->ai_family == AF_INET)		to_v6addr(((struct sockaddr_in *)result->ai_addr)->sin_addr.s_addr,				  v6addr);	else		v6_addr_copy(v6addr,					 &((struct sockaddr_in6 *)result->ai_addr)->sin6_addr);	freeaddrinfo(result);	return 0;}
开发者ID:michaelstorm,项目名称:Tangent,代码行数:33,


示例8: check_options

static void check_options(void){	int i;	for (i = 0; i < 10; i++) {		if (opt.actions[i] && !opt.hold_actions[i] && (opt.actions[i][0] == ';')) {			opt.hold_actions[i] = 1;			opt.actions[i] = &opt.actions[i][1];		}	}	if ((opt.index + opt.collage) > 1) {		weprintf("you can't use collage mode and index mode together./n"				"   I'm going with index");		opt.collage = 0;	}	if (opt.full_screen && opt.multiwindow) {		eprintf("You cannot combine --fullscreen with --multiwindow");	}	if (opt.list && (opt.multiwindow || opt.index || opt.collage)) {		eprintf("You cannot combine --list with other modes");	}	if (opt.loadables && opt.unloadables) {		eprintf("You cannot combine --loadable with --unloadable");	}	return;}
开发者ID:BlackLight,项目名称:feh,代码行数:30,


示例9: mnt_show

static intmnt_show(const char *fsname, const char *dir){	struct statvfs s;	unsigned long long total, used, avail;	int capacity = 0;	int bs;	if (statvfs(dir, &s) < 0) {		weprintf("statvfs %s:", dir);		return -1;	}	bs = s.f_frsize / blksize;	total = s.f_blocks * bs;	avail = s.f_bfree * bs;	used = total - avail;	if (used + avail) {		capacity = (used * 100) / (used + avail);		if (used * 100 != capacity * (used + avail))			capacity++;	}	if (hflag)		print_human(fsname, total, used, avail, capacity, dir);	else		printf("%-12s %9llu %9llu %9llu %7d%%  %s/n",		       fsname, total, used, avail, capacity, dir);	return 0;}
开发者ID:rovaughn,项目名称:distro,代码行数:32,


示例10: main

intmain(int argc, char *argv[]){	char *path;	int found = 0, foundall = 1;	ARGBEGIN {	case 'a':		aflag = 1;		break;	default:		usage();	} ARGEND	if (!argc)		usage();	if (!(path = getenv("PATH")))		enprintf(3, "$PATH is not set/n");	for (; *argv; argc--, argv++) {		if (which(path, *argv)) {			found = 1;		} else {			weprintf("%s: command not found./n", *argv);			foundall = 0;		}	}	return found ? foundall ? 0 : 1 : 2;}
开发者ID:maandree,项目名称:sbase,代码行数:31,


示例11: feh_set_parse_bb_partial

static void feh_set_parse_bb_partial(fehbutton *button, char *binding){	char *cur = binding;	int mod = 0;	if (!*binding) {		button->button = 0;		return;	}	while (cur[1] == '-') {		switch (cur[0]) {			case 'C':				mod |= ControlMask;				break;			case 'S':				mod |= ShiftMask;				break;			case '1':				mod |= Mod1Mask;				break;			case '4':				mod |= Mod4Mask;				break;			default:				weprintf("buttons: invalid modifier %c in /"%s/"", cur[0], binding);				break;		}		cur += 2;	}	button->button = atoi(cur);	button->modifier = mod;}
开发者ID:BlackLight,项目名称:feh,代码行数:34,


示例12: main

intmain(int argc, char *argv[]){	int savederrno;	ARGBEGIN {	case 'i':		if (environ)			*environ = NULL;		break;	case 'u':		unsetenv(EARGF(usage()));		break;	default:		usage();	} ARGEND;	for (; *argv && strchr(*argv, '='); argc--, argv++)		putenv(*argv);	if (*argv) {		execvp(*argv, argv);		savederrno = errno;		weprintf("execvp %s:", *argv);		_exit(126 + (savederrno == EEXIST));	}	for (; environ && *environ; environ++)		puts(*environ);	return fshut(stdout, "<stdout>");}
开发者ID:rovaughn,项目名称:distro,代码行数:32,


示例13: weprintf

char *feh_http_load_image(char *url){	weprintf(		"Cannot load image %s/n Please recompile with libcurl support",		url	);	return NULL;}
开发者ID:phrac,项目名称:feh-browser,代码行数:8,


示例14: malloc

void *wemalloc(size_t n){	void *p;	p = malloc(n);	if (p == NULL)		weprintf("malloc of %u bytes failed:", n);	return p;}
开发者ID:Faylecake,项目名称:githubpls,代码行数:9,


示例15: realloc

void *werealloc(void *vp, size_t n){	void *p;		p = realloc(vp, n);	if (p == NULL)		weprintf("realloc of %u bytes failed:", n);	return p;}
开发者ID:Faylecake,项目名称:githubpls,代码行数:9,


示例16: main

intmain(int argc, char *argv[]){	int i;	int ret = 0;	int all = 0;	struct mntent *me;	FILE *fp;	ARGBEGIN {	case 'a':		all = 1;		break;	default:		usage();	} ARGEND;	if ((!all && argc < 1) || (all && argc > 0))		usage();	if (all) {		fp = setmntent("/etc/fstab", "r");		if (!fp)			eprintf("setmntent %s:", "/etc/fstab");		while ((me = getmntent(fp)) != NULL) {			if (strcmp(me->mnt_type, MNTTYPE_SWAP) == 0) {				if (swapoff(me->mnt_fsname) < 0) {					weprintf("swapoff %s:", me->mnt_fsname);					ret = 1;				}			}		}		endmntent(fp);	} else {		for (i = 0; i < argc; i++) {			if (swapoff(argv[i]) < 0) {				weprintf("swapoff %s:", argv[i]);				ret = 1;			}		}	}	return ret;}
开发者ID:michaelforney,项目名称:ubase,代码行数:43,


示例17: handle_packet

/* handle_packet: snarf packet from network and dispatch */voidhandle_packet(int network){    int packet_len, from_len;    struct sockaddr_in from;    byte buf[BUFSIZE];    from_len = sizeof(from);    packet_len = recvfrom(network, buf, sizeof(buf), 0,			  (struct sockaddr *) &from, &from_len);    if (packet_len < 0) {       if (errno != EAGAIN) {	   weprintf("recvfrom failed:");  /* ignore errors for now */	   return;       }       weprintf("handle_packet: EAGAIN");       return;   /* pick up this packet later */    }    dispatch(&srv, packet_len, buf);}
开发者ID:surki,项目名称:hipl,代码行数:21,


示例18: parsepair

static intparsepair(char *pair){	char *p;	char *variable;	char *value;	for (p = pair; *p; p++) {		if (p[0] == '.' && p[1] == '.') {			weprintf("malformed input: %s/n", pair);			return -1;		}	}	p = strchr(pair, '=');	if (p) {		if (p[1] == '/0') {			weprintf("malformed input: %s/n", pair);			return -1;		}		*p = '/0';		value = &p[1];	} else {		value = NULL;	}	variable = pair;	if (value) {		if (setsysctl(variable, value) < 0) {			weprintf("failed to set sysctl for %s/n", variable);			return -1;		}	} else {		if (getsysctl(variable, &value) < 0) {			weprintf("failed to get sysctl for %s/n", variable);			return -1;		}		printf("%s = %s/n", variable, value);		free(value);	}	return 0;}
开发者ID:michaelforney,项目名称:ubase,代码行数:41,


示例19: send_raw_v6

void send_raw_v6(int sock, in6_addr *addr, in_port_t port, int n, uchar *buf){	struct sockaddr_in6 dest;	memset(&dest, 0, sizeof(dest));	dest.sin6_family = AF_INET6;	dest.sin6_port = htons(port);	v6_addr_copy(&dest.sin6_addr, addr);	if (sendto(sock, buf, n, 0, (struct sockaddr *)&dest, sizeof(dest)) < 0)		weprintf("sendto failed:");}
开发者ID:michaelstorm,项目名称:Tangent,代码行数:12,


示例20: send_raw_v4

void send_raw_v4(int sock, in6_addr *addr, in_port_t port, int n, uchar *buf){	struct sockaddr_in dest;	assert(V4_MAPPED(addr));	memset(&dest, 0, sizeof(dest));	dest.sin_family = AF_INET;	dest.sin_port = htons(port);	dest.sin_addr.s_addr = to_v4addr(addr);	if (sendto(sock, buf, n, 0, (struct sockaddr *)&dest, sizeof(dest)) < 0)		weprintf("sendto failed:");}
开发者ID:michaelstorm,项目名称:Tangent,代码行数:13,


示例21: setup_signal_handlers

void setup_signal_handlers(){	reload_signal_flag = 0;	struct sigaction feh_sh;	sigset_t feh_ss;	if (		(sigemptyset(&feh_ss) == -1) ||		(sigaddset(&feh_ss, SIGUSR1) == -1) ||		(sigaddset(&feh_ss, SIGUSR2) == -1) ||		(sigaddset(&feh_ss, SIGALRM) == -1) ||		(sigaddset(&feh_ss, SIGTERM) == -1) ||		(sigaddset(&feh_ss, SIGQUIT) == -1) ||		(sigaddset(&feh_ss, SIGINT) == -1) ||		(sigaddset(&feh_ss, SIGURG) == -1))	{		weprintf("Failed to set up signal masks");		return;	}	feh_sh.sa_handler = feh_handle_signal;	feh_sh.sa_mask    = feh_ss;	feh_sh.sa_flags   = 0;	if (		(sigaction(SIGUSR1, &feh_sh, NULL) == -1) ||		(sigaction(SIGUSR2, &feh_sh, NULL) == -1) ||		(sigaction(SIGALRM, &feh_sh, NULL) == -1) ||		(sigaction(SIGTERM, &feh_sh, NULL) == -1) ||		(sigaction(SIGQUIT, &feh_sh, NULL) == -1) ||		(sigaction(SIGINT, &feh_sh, NULL) == -1) ||		(sigaction(SIGURG, &feh_sh, NULL) == -1))	{		weprintf("Failed to set up signal handler");		return;	}	return;}
开发者ID:mscalora,项目名称:feh,代码行数:38,


示例22: feh_set_parse_kb_partial

static void feh_set_parse_kb_partial(fehkey *key, int index, char *ks) {	char *cur = ks;	int mod = 0;	if (!*ks) {		key->keysyms[index] = 0;		return;	}	while (cur[1] == '-') {		switch (cur[0]) {			case 'C':				mod |= ControlMask;				break;			case 'S':				mod |= ShiftMask;				break;			case '1':				mod |= Mod1Mask;				break;			case '4':				mod |= Mod4Mask;				break;			default:				weprintf("keys: invalid modifier %c in /"%s/"", cur[0], ks);				break;		}		cur += 2;	}	key->keysyms[index] = XStringToKeysym(cur);	if (isascii(key->keysyms[index]))		mod &= ~ShiftMask;	key->keystates[index] = mod;	if (key->keysyms[index] == NoSymbol)		weprintf("keys: Invalid keysym: %s", cur);}
开发者ID:EvinceMoi,项目名称:feh,代码行数:38,


示例23: main

/* grep main: search for regexp in files */int main(int argc, char *argv[]){	int i, o, nmatch;	struct re *regexp;	FILE *f;	setprogname("grep");	while ((o = getopt(argc, argv, "cnv")) != -1) {		switch (o) {			case 'c':				count_only = 1;				break;			case 'n':				line_numbers = 1;				break;			case 'v':				invert = 1;				break;			case '?':			default:				/* getopt prints an error message */				exit(2);				break;		}	}	if (optind == argc)		eprintf("usage: grep regexp [file ...]");	nmatch = 0;	regexp = compile(argv[optind]);	if (regexp == NULL)		eprintf("can't compile regular expression");	if (argc - optind == 1) {		if (grep(regexp, stdin, NULL))			nmatch++;	} else {		for (i = optind + 1; i < argc; i++) {			f = fopen(argv[i], "r");			if (f == NULL) {				weprintf("can't open %s:", argv[i]);				continue;			}			if (grep(regexp, f, argc - optind>2 ? argv[i] : NULL) > 0)				nmatch++;			fclose(f);		}	}	freeregexp(regexp);	return nmatch == 0;}
开发者ID:wonury,项目名称:the.practice.of.programming,代码行数:51,


示例24: feh_event_handle_stdin

void feh_event_handle_stdin(){	char stdin_buf[2];	static char is_esc = 0;	KeySym keysym = NoSymbol;	if (read(STDIN_FILENO, &stdin_buf, 1) == -1) {		control_via_stdin = 0;		if (isatty(STDIN_FILENO) && getpgrp() == (tcgetpgrp(STDIN_FILENO))) {			weprintf("reading a command from stdin failed - disabling control via stdin");			restore_stdin();		}		return;	}	stdin_buf[1] = '/0';	// escape?	if (stdin_buf[0] == 0x1b) {		is_esc = 1;		return;	}	if ((is_esc == 1) && (stdin_buf[0] == '[')) {		is_esc = 2;		return;	}	if (stdin_buf[0] == ' ')		keysym = XK_space;	else if (stdin_buf[0] == '/n')		keysym = XK_Return;	else if ((stdin_buf[0] == '/b') || (stdin_buf[0] == 127))		keysym = XK_BackSpace;	else if (is_esc == 2) {		if (stdin_buf[0] == 'A')			keysym = XK_Up;		else if (stdin_buf[0] == 'B')			keysym = XK_Down;		else if (stdin_buf[0] == 'C')			keysym = XK_Right;		else if (stdin_buf[0] == 'D')			keysym = XK_Left;		is_esc = 0;	}	else		keysym = XStringToKeysym(stdin_buf);	if (window_num)		feh_event_handle_generic(windows[0], is_esc * Mod1Mask, keysym, 0);	is_esc = 0;}
开发者ID:Ferada,项目名称:feh,代码行数:50,


示例25: main

intmain(int argc, char *argv[]){	int cflag = 0, sflag = 0;	int fd, i, ret = 0;	long size = 0;	ARGBEGIN {	case 's':		sflag = 1;		size = estrtol(EARGF(usage()), 10);		break;	case 'c':		cflag = 1;		break;	default:		usage();	} ARGEND;	if (argc < 1 || sflag == 0)		usage();	for (i = 0; i < argc; i++) {		fd = open(argv[i], O_WRONLY | (cflag ? 0 : O_CREAT), 0644);		if (fd < 0) {			weprintf("open: cannot open `%s' for writing:", argv[i]);			ret = 1;			continue;		}		if (ftruncate(fd, size) < 0) {			weprintf("ftruncate: cannot open `%s' for writing:", argv[i]);			ret = 1;		}		close(fd);	}	return ret;}
开发者ID:michaelforney,项目名称:ubase,代码行数:37,


示例26: feh_edit_inplace_lossless

void feh_edit_inplace_lossless(winwidget w, int op){	char *filename = FEH_FILE(w->file->data)->filename;	int len = strlen(filename) + 1;	char *file_str = emalloc(len);	int pid, status;	int devnull = -1;	char op_name[]  = "rotate";     /* message */	char op_op[]    = "-rotate";    /* jpegtran option */	char op_value[] = "horizontal"; /* jpegtran option's value */	if (op == INPLACE_EDIT_FLIP) {		sprintf(op_name,  "flip");		sprintf(op_op,    "-flip");		sprintf(op_value, "vertical");	} else if (op == INPLACE_EDIT_MIRROR) {		sprintf(op_name,  "mirror");		sprintf(op_op,    "-flip");	} else		snprintf(op_value, 4, "%d", 90 * op);	snprintf(file_str, len, "%s", filename);	if ((pid = fork()) < 0) {		im_weprintf(w, "lossless %s: fork failed:", op_name);		free(file_str);		return;	}	else if (pid == 0) {		execlp("jpegtran", "jpegtran", "-copy", "all", op_op, op_value,				"-outfile", file_str, file_str, NULL);		weprintf("lossless %s: Is 'jpegtran' installed? Failed to exec:", op_name);		_exit(1);	}	else {		waitpid(pid, &status, 0);		if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {			im_weprintf(w,					"lossless %s: Got exitcode %d from jpegtran."					" Commandline was: "					"jpegtran -copy all %s %s -outfile %s %s",					op_name, status >> 8, op_op, op_value, file_str, file_str);			free(file_str);			return;		}	}
开发者ID:Caellian,项目名称:feh,代码行数:49,


示例27: fshut

intfshut(FILE *fp, const char *fname){	int ret = 0;	/* fflush() is undefined for input streams by ISO C,	 * but not POSIX 2008 if you ignore ISO C overrides.	 * Leave it unchecked an rely on the following	 * functions to detect errors.	 */	fflush(fp);	if (ferror(fp) && !ret) {		weprintf("ferror %s:", fname);		ret = 1;	}	if (fclose(fp) && !ret) {		weprintf("fclose %s:", fname);		ret = 1;	}	return ret;}
开发者ID:rovaughn,项目名称:distro,代码行数:24,


示例28: who_am_i

static void who_am_i (kbicho_s *b){	bicho_msg_s	m;	int		rc;	m.m_method = BICHO_WHO_AM_I;	rc = call_tau(b->kb_key, &m);	if (rc) {		weprintf("who_am_i failed %d", rc);		return;	}	strlcpy(b->kb_name, m.bi_name, TAU_NAME);	uuid_copy(b->kb_id, m.bi_id);	PRs(b->kb_name);}
开发者ID:taysom,项目名称:tau,代码行数:15,


示例29: get_local_addr_uname

/*************************************************************************** * * Purpose: Get IP address of local machine by uname/gethostbyname * * Return: As an unsigned long in network byte order * **************************************************************************/static uint32_t get_local_addr_uname(){	struct utsname myname;	uint32_t addr;	if (uname(&myname) < 0)		weprintf("uname failed:");	else		addr = name_to_addr(myname.nodename);	if (addr == 0)		return inet_addr(TRIVIAL_LOCAL_ADDR);	else		return addr;}
开发者ID:michaelstorm,项目名称:Tangent,代码行数:22,



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


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