00050 {
00051 SYSLOG log;
00052 va_list ap;
00053 int i;
00054 int c;
00055
00056 log.logtype = LOG_TYPE_COMMENT;
00057 log.loginfo[0] = (VP_INT) format;
00058 i = 1;
00059 va_start(ap, format);
00060
00061 while ((c = *format++) != '\0' && i < TMAX_LOGINFO) {
00062 if (c != '%') {
00063 continue;
00064 }
00065
00066 c = *format++;
00067 while ('0' <= c && c <= '9') {
00068 c = *format++;
00069 }
00070 switch (c) {
00071 case 'd':
00072 log.loginfo[i++] = (VP_INT) va_arg(ap, int);
00073 break;
00074 case 'u':
00075 case 'x':
00076 case 'X':
00077 log.loginfo[i++] = (VP_INT) va_arg(ap, unsigned int);
00078 break;
00079 case 'p':
00080 log.loginfo[i++] = (VP_INT) va_arg(ap, void *);
00081 break;
00082 case 'c':
00083 log.loginfo[i++] = (VP_INT) va_arg(ap, int);
00084 break;
00085 case 's':
00086 log.loginfo[i++] = (VP_INT) va_arg(ap, const char *);
00087 break;
00088 case '\0':
00089 format--;
00090 break;
00091 default:
00092 break;
00093 }
00094 }
00095 va_end(ap);
00096 return(vwri_log(prio, &log));
00097 }