octo@casella:~/collectd $ svn merge -r754:800 branches/ntpd trunk
[collectd.git] / src / common.h
index 59984b1..f6a8e19 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/common.h
- * Copyright (C) 2005  Florian octo Forster
+ * Copyright (C) 2005,2006  Florian octo Forster
  *
  * This program is free software; you can redistribute it and/
  * or modify it under the terms of the GNU General Public Li-
@@ -39,6 +39,44 @@ void *smalloc(size_t size);
 
 /*
  * NAME
+ *   sread
+ *
+ * DESCRIPTION
+ *   Reads exactly `n' bytes or failes. Syntax and other behavior is analogous
+ *   to `read(2)'.
+ *
+ * PARAMETERS
+ *   `fd'          File descriptor to write to.
+ *   `buf'         Buffer that is to be written.
+ *   `count'       Numver of bytes in the buffer.
+ *
+ * RETURN VALUE
+ *   Zero upon success or non-zero if an error occured. `errno' is set in this
+ *   case.
+ */
+ssize_t sread (int fd, void *buf, size_t count);
+
+/*
+ * NAME
+ *   swrite
+ *
+ * DESCRIPTION
+ *   Writes exactly `n' bytes or failes. Syntax and other behavior is analogous
+ *   to `write(2)'.
+ *
+ * PARAMETERS
+ *   `fd'          File descriptor to write to.
+ *   `buf'         Buffer that is to be written.
+ *   `count'       Numver of bytes in the buffer.
+ *
+ * RETURN VALUE
+ *   Zero upon success or non-zero if an error occured. `errno' is set in this
+ *   case.
+ */
+ssize_t swrite (int fd, const void *buf, size_t count);
+
+/*
+ * NAME
  *   strsplit
  *
  * DESCRIPTION
@@ -103,8 +141,11 @@ int strjoin (char *dst, size_t dst_len, char **fields, size_t fields_num, const
  */
 int escape_slashes (char *buf, int buf_len);
 
-int rrd_update_file (char *host, char *file, char *values, char **ds_def,
-               int ds_num);
+/* FIXME: `timeval_sub_timespec' needs a description */
+int timeval_sub_timespec (struct timeval *tv0, struct timeval *tv1, struct timespec *ret);
+
+int rrd_update_file (char *host, char *file, char *values,
+               char **ds_def, int ds_num);
 
 #ifdef HAVE_LIBKSTAT
 int get_kstat (kstat_t **ksp_ptr, char *module, int instance, char *name);