BibTeXq
query a bibtex file
|
Queries a BIBTEX file by field name. More...
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <regex.h>
#include <jwsc/base/option.h>
#include <jwsc/base/error.h>
#include "bibtex_entry.h"
Go to the source code of this file.
Defines | |
#define | NUM_OPTS_NO_ARG 2 |
#define | NUM_OPTS_WITH_ARG 8 |
Functions | |
int | yyparse () |
static Error * | init_regex (const char *value, regex_t *preg) |
static void | print_usage (void) |
Prints the program usage to stderr. | |
static Error * | process_help_opt (void) |
Process the 'help' program option. | |
static Error * | process_version_opt (void) |
Process the 'version' program option. | |
static Error * | process_output_opt (Option_arg arg) |
Process the 'output' program option. | |
static Error * | process_type_opt (Option_arg arg) |
Process the 'type' program option. | |
static Error * | process_key_opt (Option_arg arg) |
Process the 'key' program option. | |
static Error * | process_author_opt (Option_arg arg) |
Process the 'author' program option. | |
static Error * | process_title_opt (Option_arg arg) |
Process the 'title' program option. | |
static Error * | process_project_opt (Option_arg arg) |
Process the 'project' program option. | |
static Error * | process_venue_opt (Option_arg arg) |
Process the 'venue' program option. | |
static Error * | process_keyword_opt (Option_arg arg) |
Process the 'keyword' program option. | |
static void | init_options (void) |
Initializes the program options. | |
void | query_bibtex_entry (Bibtex_entry *entry) |
Query a BIBTEX entry against a bibtex file and writes the entry if it matches. | |
int | main (int argc, const char **argv) |
Main function for the haplo_predict program. | |
Variables | |
FILE * | yyin |
Bibtex_entry * | entry = NULL |
BIBTEX entry used by the grammar/parser. | |
static Option_no_arg | opts_no_arg [NUM_OPTS_NO_ARG] |
Program options not taking an argument. | |
static Option_with_arg | opts_with_arg [NUM_OPTS_WITH_ARG] |
Program options taking an argument. | |
static const char * | output_fname |
File name to write matching BIBTEX entries to. | |
static FILE * | output_fp |
File to write matching BIBTEX entries to. | |
static uint8_t | query_type |
Boolean indicating whether to query the BIBTEX entry type. | |
static uint8_t | query_key |
Boolean indicating whether to query the BIBTEX entry type. | |
static uint8_t | query_author |
Boolean indicating whether to query the BIBTEX author field. | |
static uint8_t | query_title |
Boolean indicating whether to query the BIBTEX title field. | |
static uint8_t | query_project |
Boolean indicating whether to query the BIBTEX project field. | |
static uint8_t | query_venue |
Boolean indicating whether to query the BIBTEX venue field. | |
static uint8_t | query_keyword |
Boolean indicating whether to query the BIBTEX keyword field. | |
static regex_t | type_preg |
BIBTEX entry type regular expresion. | |
static regex_t | key_preg |
BIBTEX entry uniue key regular expresion. | |
static regex_t | author_preg |
BIBTEX author field regular expresion. | |
static regex_t | title_preg |
BIBTEX title field regular expresion. | |
static regex_t | project_preg |
BIBTEX project field regular expresion. | |
static regex_t | venue_preg |
BIBTEX venue field regular expresion. | |
static regex_t | keyword_preg |
BIBTEX keyword field regular expresion. |
Queries a BIBTEX file by field name.
Definition in file bibtexq.c.
int yyparse | ( | ) |
static Error* init_regex | ( | const char * | value, |
regex_t * | preg | ||
) | [static] |
static void print_usage | ( | void | ) | [static] |
static Error* process_help_opt | ( | void | ) | [static] |
static Error* process_version_opt | ( | void | ) | [static] |
static Error* process_output_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_type_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_key_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_author_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_title_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_project_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_venue_opt | ( | Option_arg | arg | ) | [static] |
static Error* process_keyword_opt | ( | Option_arg | arg | ) | [static] |
static void init_options | ( | void | ) | [static] |
void query_bibtex_entry | ( | Bibtex_entry * | entry | ) |
int main | ( | int | argc, |
const char ** | argv | ||
) |
FILE* yyin |
Bibtex_entry* entry = NULL |
Option_no_arg opts_no_arg[NUM_OPTS_NO_ARG] [static] |
Option_with_arg opts_with_arg[NUM_OPTS_WITH_ARG] [static] |
const char* output_fname [static] |
FILE* output_fp [static] |
uint8_t query_type [static] |
uint8_t query_key [static] |
uint8_t query_author [static] |
uint8_t query_title [static] |
uint8_t query_project [static] |
uint8_t query_venue [static] |
uint8_t query_keyword [static] |
regex_t type_preg [static] |
regex_t key_preg [static] |
regex_t author_preg [static] |
regex_t title_preg [static] |
regex_t project_preg [static] |
regex_t venue_preg [static] |
regex_t keyword_preg [static] |