source: UsbWattMeter/trunk/asp_dcre/syssvc/vasyslog.c@ 164

Last change on this file since 164 was 164, checked in by coas-nagasima, 6 years ago

TOPPERS/ECNLサンプルアプリ「USB充電器電力計」を追加

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-csrc
File size: 3.2 KB
Line 
1/*
2 * TOPPERS Software
3 * Toyohashi Open Platform for Embedded Real-Time Systems
4 *
5 * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory
6 * Toyohashi Univ. of Technology, JAPAN
7 * Copyright (C) 2004-2008 by Embedded and Real-Time Systems Laboratory
8 * Graduate School of Information Science, Nagoya Univ., JAPAN
9 *
10 * ã‹L’˜ìŒ ŽÒ‚́CˆÈ‰º‚Ì(1)`(4)‚ÌðŒ‚ð–ž‚½‚·ê‡‚ÉŒÀ‚èC–{ƒ\ƒtƒgƒEƒF
11 * ƒAi–{ƒ\ƒtƒgƒEƒFƒA‚ð‰ü•Ï‚µ‚½‚à‚Ì‚ðŠÜ‚ށDˆÈ‰º“¯‚¶j‚ðŽg—pE•¡»E‰ü
12 * •ÏEÄ”z•ziˆÈ‰ºC—˜—p‚ƌĂԁj‚·‚邱‚Ƃ𖳏ž‚Å‹–‘ø‚·‚éD
13 * (1) –{ƒ\ƒtƒgƒEƒFƒA‚ðƒ\[ƒXƒR[ƒh‚ÌŒ`‚Å—˜—p‚·‚éê‡‚ɂ́Cã‹L‚Ì’˜ì
14 * Œ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’肪C‚»‚Ì‚Ü‚Ü‚ÌŒ`‚Ń\[
15 * ƒXƒR[ƒh’†‚ÉŠÜ‚Ü‚ê‚Ä‚¢‚邱‚ƁD
16 * (2) –{ƒ\ƒtƒgƒEƒFƒA‚ðCƒ‰ƒCƒuƒ‰ƒŠŒ`Ž®‚ȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
17 * —p‚Å‚«‚éŒ`‚ōĔz•z‚·‚éê‡‚ɂ́CÄ”z•z‚É”º‚¤ƒhƒLƒ…
18ƒƒ“ƒgi—˜—p
19 * ŽÒƒ}ƒjƒ…
20ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L
21 * ‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
22 * (3) –{ƒ\ƒtƒgƒEƒFƒA‚ðC‹@Ší‚É‘g‚ݍž‚ނȂǁC‘¼‚̃\ƒtƒgƒEƒFƒAŠJ”­‚ÉŽg
23 * —p‚Å‚«‚È‚¢Œ`‚ōĔz•z‚·‚éê‡‚ɂ́CŽŸ‚Ì‚¢‚¸‚ê‚©‚ÌðŒ‚ð–ž‚½‚·‚±
24 * ‚ƁD
25 * (a) Ä”z•z‚É”º‚¤ƒhƒLƒ…
26ƒƒ“ƒgi—˜—pŽÒƒ}ƒjƒ…
27ƒAƒ‹‚Ȃǁj‚ɁCã‹L‚Ì’˜
28 * ìŒ •\Ž¦C‚±‚Ì—˜—pðŒ‚¨‚æ‚щº‹L‚Ì–³•ÛØ‹K’è‚ðŒfÚ‚·‚邱‚ƁD
29 * (b) Ä”z•z‚ÌŒ`‘Ô‚ðC•Ê‚É’è‚ß‚é•û–@‚É‚æ‚Á‚āCTOPPERSƒvƒƒWƒFƒNƒg‚É
30 * •ñ‚·‚邱‚ƁD
31 * (4) –{ƒ\ƒtƒgƒEƒFƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚é‚¢‚©‚Ȃ鑹
32 * ŠQ‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð–Ɛӂ·‚邱‚ƁD
33 * ‚Ü‚½C–{ƒ\ƒtƒgƒEƒFƒA‚̃†[ƒU‚Ü‚½‚̓Gƒ“ƒhƒ†[ƒU‚©‚ç‚Ì‚¢‚©‚Ȃ闝
34 * —R‚ÉŠî‚­¿‹‚©‚ç‚àCã‹L’˜ìŒ ŽÒ‚¨‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚ð
35 * –Ɛӂ·‚邱‚ƁD
36 *
37 * –{ƒ\ƒtƒgƒEƒFƒA‚́C–³•ÛØ‚Å’ñ‹Ÿ‚³‚ê‚Ä‚¢‚é‚à‚Ì‚Å‚ ‚éDã‹L’˜ìŒ ŽÒ‚¨
38 * ‚æ‚ÑTOPPERSƒvƒƒWƒFƒNƒg‚́C–{ƒ\ƒtƒgƒEƒFƒA‚ÉŠÖ‚µ‚āC“Á’è‚ÌŽg—p–Ú“I
39 * ‚ɑ΂·‚é“K‡«‚àŠÜ‚߂āC‚¢‚©‚È‚é•ÛØ‚às‚í‚È‚¢D‚Ü‚½C–{ƒ\ƒtƒgƒEƒF
40 * ƒA‚Ì—˜—p‚É‚æ‚è’¼Ú“I‚Ü‚½‚͊ԐړI‚ɐ¶‚¶‚½‚¢‚©‚Ȃ鑹ŠQ‚ÉŠÖ‚µ‚Ä‚àC‚»
41 * ‚̐ӔC‚𕉂í‚È‚¢D
42 *
43 * @(#) $Id: vasyslog.c 164 2016-03-07 11:33:50Z coas-nagasima $
44 */
45
46/*
47 * ‰Â•Ï”ˆø”‚̃VƒXƒeƒ€ƒƒOƒ‰ƒCƒuƒ‰ƒŠ
48 */
49
50#include <t_stddef.h>
51#include <t_syslog.h>
52#include <stdarg.h>
53
54void
55syslog(uint_t prio, const char *format, ...)
56{
57 SYSLOG syslog;
58 va_list ap;
59 uint_t i;
60 char c;
61 bool_t lflag;
62
63 syslog.logtype = LOG_TYPE_COMMENT;
64 syslog.loginfo[0] = (intptr_t) format;
65 i = 1U;
66 va_start(ap, format);
67
68 while ((c = *format++) != '\0' && i < TMAX_LOGINFO) {
69 if (c != '%') {
70 continue;
71 }
72
73 lflag = false;
74 c = *format++;
75 while ('0' <= c && c <= '9') {
76 c = *format++;
77 }
78 if (c == 'l') {
79 lflag = true;
80 c = *format++;
81 }
82 switch (c) {
83 case 'd':
84 syslog.loginfo[i++] = lflag ? (intptr_t) va_arg(ap, long_t)
85 : (intptr_t) va_arg(ap, int_t);
86 break;
87 case 'u':
88 case 'x':
89 case 'X':
90 syslog.loginfo[i++] = lflag ? (intptr_t) va_arg(ap, ulong_t)
91 : (intptr_t) va_arg(ap, uint_t);
92 break;
93 case 'p':
94 syslog.loginfo[i++] = (intptr_t) va_arg(ap, void *);
95 break;
96 case 'c':
97 syslog.loginfo[i++] = (intptr_t) va_arg(ap, int);
98 break;
99 case 's':
100 syslog.loginfo[i++] = (intptr_t) va_arg(ap, const char *);
101 break;
102 case '\0':
103 format--;
104 break;
105 default:
106 break;
107 }
108 }
109 va_end(ap);
110 (void) syslog_wri_log(prio, &syslog);
111}
Note: See TracBrowser for help on using the repository browser.