#include <t_stddef.h>
#include <t_syslog.h>
マクロ定義 | |
#define | CONVERT_BUFLEN ((sizeof(uintptr_t) * CHAR_BIT + 2) / 3) |
関数 | |
static void | convert (uintptr_t val, uint_t radix, const char *radchar, uint_t width, bool_t minus, bool_t padzero, void(*putc)(char_t)) |
void | syslog_printf (const char *format, intptr_t *p_args, void(*putc)(char_t)) |
void | syslog_print (SYSLOG *p_syslog, void(*putc)(char_t)) |
void | syslog_lostmsg (uint_t lost, void(*putc)(char_t)) |
変数 | |
static const char | raddec [] = "0123456789" |
static const char | radhex [] = "0123456789abcdef" |
static const char | radHEX [] = "0123456789ABCDEF" |
#define CONVERT_BUFLEN ((sizeof(uintptr_t) * CHAR_BIT + 2) / 3) |
static void convert | ( | uintptr_t | val, | |
uint_t | radix, | |||
const char * | radchar, | |||
uint_t | width, | |||
bool_t | minus, | |||
bool_t | padzero, | |||
void(*)(char_t) | putc | |||
) | [static] |
log_output.c の 55 行で定義されています。
参照先 CONVERT_BUFLEN.
参照元 syslog_printf().
00057 { 00058 char buf[CONVERT_BUFLEN]; 00059 uint_t i, j; 00060 00061 i = 0U; 00062 do { 00063 buf[i++] = radchar[val % radix]; 00064 val /= radix; 00065 } while (i < CONVERT_BUFLEN && val != 0); 00066 00067 if (minus && width > 0) { 00068 width -= 1; 00069 } 00070 if (minus && padzero) { 00071 (*putc)('-'); 00072 } 00073 for (j = i; j < width; j++) { 00074 (*putc)((char_t)(padzero ? '0' : ' ')); 00075 } 00076 if (minus && !padzero) { 00077 (*putc)('-'); 00078 } 00079 while (i > 0U) { 00080 (*putc)(buf[--i]); 00081 } 00082 }
log_output.c の 187 行で定義されています。
参照先 syslog_printf().
参照元 logtask_main(), と logtask_terminate().
00188 { 00189 intptr_t lostinfo[1]; 00190 00191 lostinfo[0] = (intptr_t) lost; 00192 syslog_printf("%d messages are lost.", lostinfo, putc); 00193 (*putc)('\n'); 00194 }
log_output.c の 169 行で定義されています。
参照先 LOG_TYPE_ASSERT, LOG_TYPE_COMMENT, SYSLOG::loginfo, SYSLOG::logtype, と syslog_printf().
参照元 logtask_main(), logtask_terminate(), と syslog_wri_log().
00170 { 00171 switch (p_syslog->logtype) { 00172 case LOG_TYPE_COMMENT: 00173 syslog_printf((const char *)(p_syslog->loginfo[0]), 00174 &(p_syslog->loginfo[1]), putc); 00175 break; 00176 case LOG_TYPE_ASSERT: 00177 syslog_printf("%s:%u: Assertion `%s' failed.", 00178 &(p_syslog->loginfo[0]), putc); 00179 break; 00180 } 00181 }
void syslog_printf | ( | const char * | format, | |
intptr_t * | p_args, | |||
void(*)(char_t) | putc | |||
) |
log_output.c の 92 行で定義されています。
参照先 convert().
参照元 syslog_lostmsg(), syslog_print(), と trace_print().
00093 { 00094 char c; 00095 uint_t width; 00096 bool_t padzero; 00097 intptr_t val; 00098 const char *str; 00099 00100 while ((c = *format++) != '\0') { 00101 if (c != '%') { 00102 (*putc)(c); 00103 continue; 00104 } 00105 00106 width = 0U; 00107 padzero = false; 00108 if ((c = *format++) == '0') { 00109 padzero = true; 00110 c = *format++; 00111 } 00112 while ('0' <= c && c <= '9') { 00113 width = width * 10U + c - '0'; 00114 c = *format++; 00115 } 00116 if (c == 'l') { 00117 c = *format++; 00118 } 00119 switch (c) { 00120 case 'd': 00121 val = (intptr_t)(*p_args++); 00122 if (val >= 0) { 00123 convert((uintptr_t) val, 10U, raddec, 00124 width, false, padzero, putc); 00125 } 00126 else { 00127 convert((uintptr_t)(-val), 10U, raddec, 00128 width, true, padzero, putc); 00129 } 00130 break; 00131 case 'u': 00132 val = (intptr_t)(*p_args++); 00133 convert((uintptr_t) val, 10U, raddec, width, false, padzero, putc); 00134 break; 00135 case 'x': 00136 case 'p': 00137 val = (intptr_t)(*p_args++); 00138 convert((uintptr_t) val, 16U, radhex, width, false, padzero, putc); 00139 break; 00140 case 'X': 00141 val = (intptr_t)(*p_args++); 00142 convert((uintptr_t) val, 16U, radHEX, width, false, padzero, putc); 00143 break; 00144 case 'c': 00145 (*putc)((char_t)(intptr_t)(*p_args++)); 00146 break; 00147 case 's': 00148 str = (const char *)(*p_args++); 00149 while ((c = *str++) != '\0') { 00150 (*putc)(c); 00151 } 00152 break; 00153 case '%': 00154 (*putc)('%'); 00155 break; 00156 case '\0': 00157 format--; 00158 break; 00159 default: 00160 break; 00161 } 00162 } 00163 }
const char raddec[] = "0123456789" [static] |
log_output.c の 87 行で定義されています。
const char radHEX[] = "0123456789ABCDEF" [static] |
log_output.c の 89 行で定義されています。
const char radhex[] = "0123456789abcdef" [static] |
log_output.c の 88 行で定義されています。
Copyright © 2008 by Kijineko Inc.