Files
haiku-beta6/src/tests/kits/net/ufunc.c
T
ejakowatz 52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00

37 lines
678 B
C

/* Utility functions for the test apps */
#include <stdio.h>
#include <kernel/OS.h>
#include <string.h>
#include <sys/time.h>
#include <malloc.h>
#include "sys/socket.h"
#include "netinet/in.h"
#include "arpa/inet.h"
#include "sys/select.h"
#include "ufunc.h"
void err(int error, char *msg)
{
printf("Error: %s\n", msg);
printf("Code: %d\n", error);
printf("Desc: %s\n", strerror(error));
exit(-1);
}
void test_banner(char *msg)
{
int sl = strlen(msg);
char *buf = (char*)malloc(sl + 5);
memset(buf, '=', sl + 4);
printf("%s\n", buf);
buf[1] = buf[sl + 2] = ' ';
memcpy(&buf[2], msg, sl);
printf("%s\n", buf);
memset(buf, '=', sl + 4);
printf("%s\n", buf);
}