A function should be documented at a single place, preferably in a header file.
Also removed a couple of comments at functions whose usage is perfectly
clear from their name.
return switched;
}
-/* destructor for standard files */
static void
file_close(struct log_stream *ls)
{
xfree(fs->orig_name);
}
-/* handler for standard files */
static int
file_handler(struct log_stream *ls, struct log_msg *m)
{
return 0;
}
-/* assign log to a file descriptor */
-/* initialize with the default formatting, does NOT close the descriptor */
struct log_stream *
log_new_fd(int fd)
{
return ls;
}
-/* open() a file (append mode) */
-/* initialize with the default formatting */
struct log_stream *
log_new_file(const char *path)
{
log_switch_nest--;
}
-/* Emulate the old single-file interface: close the existing log file and open a new one. */
void
log_file(const char *name)
{
log_add_substream(ls, &log_stream_default);
}
-/* Close all open streams, un-initialize the module, free all memory,
- * and fall back to using only log_stream_default. */
void
log_close_all(void)
{
log_initialized = 0;
}
-/* Add a new substream. The parent stream takes a reference on the substream,
- * preventing it from being closed as long as it is linked. */
void
log_add_substream(struct log_stream *where, struct log_stream *what)
{
clist_add_tail(&where->substreams, &n->n);
}
-/* Remove all occurrences of a substream together with the references they
- * keep. If a substream becomes unreferenced, it is closed. If what is NULL,
- * all substreams are removed. Returns the number of deleted entries. */
int
log_rm_substream(struct log_stream *where, struct log_stream *what)
{
return cnt;
}
-/* Return a pointer to a new stream with no handler and an empty substream list. */
struct log_stream *
log_new_stream(size_t size)
{
return log_ref_stream(l);
}
-/* Remove a reference on a stream and close it if it was the last reference.
- * Closing automatically unlinks all substreams and closes them if they are
- * no longer referenced. Returns 1 if the stream has been really closed. */
int
log_close_stream(struct log_stream *ls)
{
int facility;
};
-/* Destructor */
static void
syslog_close(struct log_stream *ls)
{
xfree(ls->name);
}
-/* convert severity level to syslog constants */
+/* Convert severity level to syslog constants */
static int
syslog_level(int level)
{
return 0;
}
-/* assign log to a syslog facility */
-/* initialize with no formatting (syslog adds these inforamtion) */
-/* name is optional prefix (NULL for none) */
struct log_stream *
log_new_syslog(int facility, const char *name)
{
}
/**
- * Link a substream to a stream. The substream gains a reference.
+ * Link a substream to a stream. The substream gains a reference, preventing
+ * it from being freed until it is unlinked.
**/
void log_add_substream(struct log_stream *where, struct log_stream *what);