BibTeXq
query a bibtex file
Data Structures | Functions
bibtex_entry.h File Reference

Declarations for a BIBTEX entry data type. More...

#include <config.h>
#include <stdlib.h>
#include <inttypes.h>

Go to the source code of this file.

Data Structures

struct  Bibtex_field
 Field in a BIBTEX entry. More...
struct  Bibtex_entry
 BIBTEX entry. More...

Functions

void create_bibtex_entry (Bibtex_entry **entry_out, const char *type, const char *key)
 Creates a Bibtex_entry.
void free_bibtex_entry (Bibtex_entry *entry)
 Frees a Bibtex_entry.
void add_field_to_bibtex_entry (Bibtex_entry *entry, const char *name, const char *value)
 Adds a field to a Bibtex_entry.
void write_bibtex_entry (Bibtex_entry *entry, FILE *fp)
 Writes a Bibtex_entry to a file stream.

Detailed Description

Declarations for a BIBTEX entry data type.

Author:
Joseph Schlecht
License:
Creative Commons BY-NC-SA 3.0

Definition in file bibtex_entry.h.


Function Documentation

void create_bibtex_entry ( Bibtex_entry **  entry_out,
const char *  type,
const char *  key 
)

Creates a Bibtex_entry.

If *entry_out is not NULL, then the Bibtex_entry::num_used_fields is set to 0.

Parameters:
entry_outResult parameter. If *entry_out is NULL, a Bibtex_entry is allocated; otherwise its space is re-used.
typeType of entry.
keyUnique entry key.

Definition at line 199 of file bibtex_entry.c.

void free_bibtex_entry ( Bibtex_entry entry)

Frees a Bibtex_entry.

Parameters:
entryBibtex_entry to free.

Definition at line 232 of file bibtex_entry.c.

void add_field_to_bibtex_entry ( Bibtex_entry entry,
const char *  name,
const char *  value 
)

Adds a field to a Bibtex_entry.

Parameters:
entryBibtex_entry to add the field to.
nameField name.
valueField value.

Definition at line 251 of file bibtex_entry.c.

void write_bibtex_entry ( Bibtex_entry entry,
FILE *  fp 
)

Writes a Bibtex_entry to a file stream.

Parameters:
entryBibtex_entry to write.
fpFile string to write to.

Definition at line 281 of file bibtex_entry.c.