mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
34 lines
484 B
C
34 lines
484 B
C
/*
|
|
* modetoa - return an asciized mode
|
|
*/
|
|
#include <stdio.h>
|
|
|
|
#include "lib_strbuf.h"
|
|
#include "ntp_stdlib.h"
|
|
|
|
char *
|
|
modetoa(mode)
|
|
int mode;
|
|
{
|
|
char *bp;
|
|
static 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];
|
|
}
|