File: bnwrite.c

package info (click to toggle)
gbatnav 1.0.2-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,716 kB
  • ctags: 2,312
  • sloc: sh: 9,127; ansic: 7,925; makefile: 394; sed: 93
file content (30 lines) | stat: -rw-r--r-- 416 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*	$Id: bnwrite.c,v 1.3 2001/04/05 17:00:40 riq Exp $	*/
/*
 * Funcion bnwrite
 */

#include <stdarg.h>
#include <stdio.h>

#include "protocol.h"
#include "net.h"

int
bnwrite(int fd, char *fmt, ...)
{
	int a;
	char t[1000];
	va_list args;
	va_start( args, fmt );

	if(fd==-1) return -1;

	vsprintf(t,fmt,args);
	va_end(args);
	
	a = net_printf(fd,"%s\n",t);
	if(a<1) {
		perror("bnwrite error:\n");
	}
	return a;
}