diff options
Diffstat (limited to 'contrib/xntpd/lib/modetoa.c')
| -rw-r--r-- | contrib/xntpd/lib/modetoa.c | 33 | 
1 files changed, 33 insertions, 0 deletions
diff --git a/contrib/xntpd/lib/modetoa.c b/contrib/xntpd/lib/modetoa.c new file mode 100644 index 000000000000..483327186a11 --- /dev/null +++ b/contrib/xntpd/lib/modetoa.c @@ -0,0 +1,33 @@ +/* modetoa.c,v 3.1 1993/07/06 01:08:33 jbj Exp + * 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]; +}  | 
