1
1
/****************************************************************************
2
- * libs/libc/stream/lib_syslogstream .c
2
+ * libs/libc/stream/lib_syslograwstream .c
3
3
*
4
4
* Licensed to the Apache Software Foundation (ASF) under one or more
5
5
* contributor license agreements. See the NOTICE file distributed with
36
36
37
37
#ifdef CONFIG_SYSLOG_BUFFER
38
38
/****************************************************************************
39
- * Name: syslogstream_flush
39
+ * Name: syslograwstream_flush
40
40
****************************************************************************/
41
41
42
- static int syslogstream_flush (FAR struct lib_outstream_s * ostream )
42
+ static int syslograwstream_flush (FAR struct lib_outstream_s * ostream )
43
43
{
44
- FAR struct lib_syslogstream_s * stream = (FAR void * )ostream ;
44
+ FAR struct lib_syslograwstream_s * stream = (FAR void * )ostream ;
45
45
int ret = OK ;
46
46
47
47
DEBUGASSERT (stream != NULL );
@@ -72,11 +72,11 @@ static int syslogstream_flush(FAR struct lib_outstream_s *ostream)
72
72
}
73
73
74
74
/****************************************************************************
75
- * Name: syslogstream_addchar
75
+ * Name: syslograwstream_addchar
76
76
****************************************************************************/
77
77
78
- static void syslogstream_addchar (FAR struct lib_syslogstream_s * stream ,
79
- int ch )
78
+ static void syslograwstream_addchar (FAR struct lib_syslograwstream_s * stream ,
79
+ int ch )
80
80
{
81
81
/* Add the incoming character to the buffer */
82
82
@@ -93,16 +93,17 @@ static void syslogstream_addchar(FAR struct lib_syslogstream_s *stream,
93
93
{
94
94
/* Yes.. then flush the buffer */
95
95
96
- syslogstream_flush (& stream -> public );
96
+ syslograwstream_flush (& stream -> public );
97
97
}
98
98
}
99
99
100
100
/****************************************************************************
101
- * Name: syslogstream_addstring
101
+ * Name: syslograwstream_addstring
102
102
****************************************************************************/
103
103
104
- static int syslogstream_addstring (FAR struct lib_syslogstream_s * stream ,
105
- FAR const char * buff , int len )
104
+ static int
105
+ syslograwstream_addstring (FAR struct lib_syslograwstream_s * stream ,
106
+ FAR const char * buff , int len )
106
107
{
107
108
int ret = 0 ;
108
109
@@ -120,7 +121,7 @@ static int syslogstream_addstring(FAR struct lib_syslogstream_s *stream,
120
121
{
121
122
/* Yes.. then flush the buffer */
122
123
123
- syslogstream_flush (& stream -> public );
124
+ syslograwstream_flush (& stream -> public );
124
125
}
125
126
}
126
127
while (ret < len );
@@ -133,13 +134,13 @@ static int syslogstream_addstring(FAR struct lib_syslogstream_s *stream,
133
134
#endif
134
135
135
136
/****************************************************************************
136
- * Name: syslogstream_putc
137
+ * Name: syslograwstream_putc
137
138
****************************************************************************/
138
139
139
- static void syslogstream_putc (FAR struct lib_outstream_s * this , int ch )
140
+ static void syslograwstream_putc (FAR struct lib_outstream_s * this , int ch )
140
141
{
141
- FAR struct lib_syslogstream_s * stream =
142
- (FAR struct lib_syslogstream_s * )this ;
142
+ FAR struct lib_syslograwstream_s * stream =
143
+ (FAR struct lib_syslograwstream_s * )this ;
143
144
144
145
DEBUGASSERT (stream != NULL );
145
146
stream -> last_ch = ch ;
@@ -155,7 +156,7 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
155
156
{
156
157
/* Add the incoming character to the buffer */
157
158
158
- syslogstream_addchar (stream , ch );
159
+ syslograwstream_addchar (stream , ch );
159
160
}
160
161
else
161
162
# endif
@@ -189,11 +190,11 @@ static void syslogstream_putc(FAR struct lib_outstream_s *this, int ch)
189
190
}
190
191
}
191
192
192
- static int syslogstream_puts (FAR struct lib_outstream_s * this ,
193
- FAR const void * buff , int len )
193
+ static int syslograwstream_puts (FAR struct lib_outstream_s * this ,
194
+ FAR const void * buff , int len )
194
195
{
195
- FAR struct lib_syslogstream_s * stream =
196
- (FAR struct lib_syslogstream_s * )this ;
196
+ FAR struct lib_syslograwstream_s * stream =
197
+ (FAR struct lib_syslograwstream_s * )this ;
197
198
int ret ;
198
199
199
200
DEBUGASSERT (stream != NULL );
@@ -212,7 +213,7 @@ static int syslogstream_puts(FAR struct lib_outstream_s *this,
212
213
{
213
214
/* Add the incoming string to the buffer */
214
215
215
- ret = syslogstream_addstring (stream , buff , len );
216
+ ret = syslograwstream_addstring (stream , buff , len );
216
217
}
217
218
else
218
219
#endif
@@ -250,33 +251,33 @@ static int syslogstream_puts(FAR struct lib_outstream_s *this,
250
251
****************************************************************************/
251
252
252
253
/****************************************************************************
253
- * Name: lib_syslogstream_open
254
+ * Name: lib_syslograwstream_open
254
255
*
255
256
* Description:
256
257
* Initializes a stream for use with the configured syslog interface.
257
258
* Only accessible from with the OS SYSLOG logic.
258
259
*
259
260
* Input Parameters:
260
261
* stream - User allocated, uninitialized instance of struct
261
- * lib_syslogstream_s to be initialized.
262
+ * lib_syslograwstream_s to be initialized.
262
263
*
263
264
* Returned Value:
264
265
* None (User allocated instance initialized).
265
266
*
266
267
****************************************************************************/
267
268
268
- void lib_syslogstream_open (FAR struct lib_syslogstream_s * stream )
269
+ void lib_syslograwstream_open (FAR struct lib_syslograwstream_s * stream )
269
270
{
270
271
DEBUGASSERT (stream != NULL );
271
272
272
273
/* Initialize the common fields */
273
274
274
- stream -> public .putc = syslogstream_putc ;
275
- stream -> public .puts = syslogstream_puts ;
275
+ stream -> public .putc = syslograwstream_putc ;
276
+ stream -> public .puts = syslograwstream_puts ;
276
277
stream -> public .nput = 0 ;
277
278
278
279
#ifdef CONFIG_SYSLOG_BUFFER
279
- stream -> public .flush = syslogstream_flush ;
280
+ stream -> public .flush = syslograwstream_flush ;
280
281
281
282
/* Allocate an IOB */
282
283
@@ -298,22 +299,22 @@ void lib_syslogstream_open(FAR struct lib_syslogstream_s *stream)
298
299
}
299
300
300
301
/****************************************************************************
301
- * Name: lib_syslogstream_close
302
+ * Name: lib_syslograwstream_close
302
303
*
303
304
* Description:
304
305
* Free resources held by the syslog stream.
305
306
*
306
307
* Input Parameters:
307
308
* stream - User allocated, uninitialized instance of struct
308
- * lib_syslogstream_s to be initialized.
309
+ * lib_syslograwstream_s to be initialized.
309
310
*
310
311
* Returned Value:
311
312
* None (Resources freed).
312
313
*
313
314
****************************************************************************/
314
315
315
316
#ifdef CONFIG_SYSLOG_BUFFER
316
- void lib_syslogstream_close (FAR struct lib_syslogstream_s * stream )
317
+ void lib_syslograwstream_close (FAR struct lib_syslograwstream_s * stream )
317
318
{
318
319
DEBUGASSERT (stream != NULL );
319
320
@@ -324,15 +325,15 @@ void lib_syslogstream_close(FAR struct lib_syslogstream_s *stream)
324
325
{
325
326
/* Flush the output buffered in the IOB */
326
327
327
- syslogstream_flush (& stream -> public );
328
+ syslograwstream_flush (& stream -> public );
328
329
329
330
/* Free the IOB */
330
331
331
332
iob_free (stream -> iob );
332
333
stream -> iob = NULL ;
333
334
}
334
335
# else
335
- syslogstream_flush (& stream -> public );
336
+ syslograwstream_flush (& stream -> public );
336
337
# endif
337
338
}
338
339
#endif
0 commit comments