llconf  0.0.2
Functions
lines.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "lines.h"

Functions

struct conflinecreate_confline (const char *line)
 Create a confline representing the given line of text.
void destroy_confline (struct confline *cl)
 Destroy a confline and its copy of the contained text.
void destroy_confline_list (struct confline *cl_list)
 Destroy a list of confline nodes.
struct conflineappend_confline (struct confline *cl_list, struct confline *cl)
 Append a confline to an existing confline list.
struct conflineread_conflines (FILE *fptr)
 Read the contents of a stream into a confline list.

Function Documentation

struct confline* append_confline ( struct confline cl_list,
struct confline cl 
) [read]

Append a confline to an existing confline list.

Parameters:
[in]cl_listThe existing list to which the given line is to be appended. May be NULL if creating a new list.
[in]clThe confline to append.
Returns:
The new head of the confline list. This will be the same as cl_list unless cl_list is NULL, in which case cl becomes the head of a new list.
struct confline* create_confline ( const char *  line) [read]

Create a confline representing the given line of text.

Parameters:
[in]lineThe line of text.
Returns:
A new confline containing a copy of the given text.
void destroy_confline ( struct confline cl)

Destroy a confline and its copy of the contained text.

Parameters:
[in]clThe confline to free.
void destroy_confline_list ( struct confline cl_list)

Destroy a list of confline nodes.

destroy_confline will be called on each node in the list.

Parameters:
[in]cl_listThe head of the list of confline entries to free.
struct confline* read_conflines ( FILE *  fptr) [read]

Read the contents of a stream into a confline list.

Parameters:
[in]fptrThe stream to read.
Returns:
The head of the confline list representing all of the lines of the file.