Gary-Hobson commented on code in PR #8012:
URL: https://github.com/apache/nuttx/pull/8012#discussion_r1060093427


##########
libs/libc/stream/lib_syslogstream.c:
##########
@@ -162,6 +192,56 @@ static void syslogstream_putc(FAR struct lib_outstream_s 
*this, int ch)
     }
 }
 
+static int syslogstream_puts(FAR struct lib_outstream_s *this,
+                             FAR const void *buff, int len)
+{
+  FAR struct lib_syslogstream_s *stream =
+                                      (FAR struct lib_syslogstream_s *)this;
+  int ret = 0;
+
+  DEBUGASSERT(stream != NULL);
+  stream->last_ch = ((FAR char *)buff)[len -1];

Review Comment:
   done



##########
libs/libc/stream/lib_syslogstream.c:
##########
@@ -103,6 +102,37 @@ static void syslogstream_addchar(FAR struct 
lib_syslogstream_s *stream,
       syslogstream_flush(stream);
     }
 }
+
+static int syslogstream_addstring(FAR struct lib_syslogstream_s *stream,
+                                  FAR const char *buff, int len)
+{
+  FAR struct iob_s *iob = stream->iob;
+  int ret = 0;
+
+  do
+    {
+      int remain = CONFIG_IOB_BUFSIZE - iob->io_len;
+      remain = remain > len ? len : remain;
+      memcpy(iob->io_data + iob->io_len, buff + ret, remain);
+      iob->io_len += remain;
+      ret += remain;
+
+      /* Is the buffer enough? */
+
+      if (iob->io_len >= CONFIG_IOB_BUFSIZE)
+        {
+          /* No.. then flush the buffer */

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to