diff options
author | Norbert Preining <norbert@preining.info> | 2019-12-03 03:01:24 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-12-03 03:01:24 +0000 |
commit | b8d4bb76703bcb15578e2b23c5d256532180b894 (patch) | |
tree | bedd1df7a00521a2bd986b3c0289d6556a59e39b /support/texlab/crates/bibutils_sys/src/bu_auth.c | |
parent | 02e4625a78a5029e8b5dc2a4ec70193b232f497e (diff) |
CTAN sync 201912030301
Diffstat (limited to 'support/texlab/crates/bibutils_sys/src/bu_auth.c')
-rw-r--r-- | support/texlab/crates/bibutils_sys/src/bu_auth.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/support/texlab/crates/bibutils_sys/src/bu_auth.c b/support/texlab/crates/bibutils_sys/src/bu_auth.c new file mode 100644 index 0000000000..f0c9194ca6 --- /dev/null +++ b/support/texlab/crates/bibutils_sys/src/bu_auth.c @@ -0,0 +1,63 @@ +/* + * bu_auth.c + * + * Copyright (c) Chris Putnam 2017-2019 + * + * Source code released under the GPL version 2 + */ +#include <string.h> +#include "bu_auth.h" +#include "msvc_fix.h" + +const char *bu_genre[] = { + "academic journal", + "airtel", + "collection", + "communication", + "Diploma thesis", + "Doctoral thesis", + "electronic", + "e-mail communication" + "Habilitation thesis", + "handwritten note", + "hearing", + "journal article", + "Licentiate thesis", + "magazine", + "magazine article", + "manuscript", + "Masters thesis", + "memo", + "miscellaneous", + "newspaper article", + "pamphlet", + "Ph.D. thesis", + "press release", + "teletype", + "television broadcast", + "unpublished" +}; +int nbu_genre = sizeof( bu_genre ) / sizeof( const char *); + +static int +position_in_list( const char *list[], int nlist, const char *query ) +{ + int i; + for ( i=0; i<nlist; ++i ) { + if ( !strcasecmp( query, list[i] ) ) return i; + } + return -1; +} + +int +bu_findgenre( const char *query ) +{ + return position_in_list( bu_genre, nbu_genre, query ); +} + +int +is_bu_genre( const char *query ) +{ + if ( bu_findgenre( query ) != -1 ) return 1; + return 0; +} |