NetBSD/dist/ntp/libntp/modetoa.c
drochner d5e6f1b80b resolve conflicts
(in this case, throw away all local modifications; I'll start patching
from scratch)
2003-12-04 16:23:34 +00:00

37 lines
560 B
C

/* $NetBSD: modetoa.c,v 1.2 2003/12/04 16:23:37 drochner Exp $ */
/*
* modetoa - return an asciized mode
*/
#include <stdio.h>
#include "lib_strbuf.h"
#include "ntp_stdlib.h"
const char *
modetoa(
int mode
)
{
char *bp;
static const char *modestrings[] = {
"unspec",
"sym_active",
"sym_passive",
"client",
"server",
"broadcast",
"control",
"private",
"bclient",
};
if (mode < 0 || mode >= (sizeof modestrings)/sizeof(char *)) {
LIB_GETBUF(bp);
(void)sprintf(bp, "mode#%d", mode);
return bp;
}
return modestrings[mode];
}