diff options
Diffstat (limited to 'support/texlab/crates/bibutils_sys/src/serialno.c')
-rw-r--r-- | support/texlab/crates/bibutils_sys/src/serialno.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/support/texlab/crates/bibutils_sys/src/serialno.c b/support/texlab/crates/bibutils_sys/src/serialno.c deleted file mode 100644 index 77e09b456d..0000000000 --- a/support/texlab/crates/bibutils_sys/src/serialno.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * serialno.c - * - * Copyright (c) Chris Putnam 2005-2019 - * - * Source code released under the GPL version 2 - * - */ -#include <string.h> -#include "serialno.h" -#include "msvc_fix.h" - -int -addsn( fields *info, char *buf, int level ) -{ - int ndigits, issn=0, isbn=0, isbn10=0, isbn13=0, status; - char *p = buf, *tag; - - if ( !strncasecmp( p, "ISSN", 4 ) ) issn=1; - else if ( !strncasecmp( p, "ISBN", 4 ) ) isbn=1; - - if ( isbn ) { - ndigits = 0; - while ( *p && !(ndigits && (*p==';'||*p==':')) ) { - if ( ( *p>='0' && *p<='9' ) || *p=='x' || *p=='X' ) - ndigits++; - p++; - } - if ( ndigits==13 ) isbn13 = 1; - else /* ( ndigits==10) */ isbn10 = 1; - } - - if ( !issn && !isbn ) { - /* a lot have semicolons between multiple ISBN's for - paperbacks and hardbacks with different numbers */ - ndigits = 0; - while ( *p && !(ndigits && (*p==';'||*p==':')) ) { - if ( ( *p>='0' && *p<='9' ) || *p=='x' || *p=='X' ) - ndigits++; - p++; - } - if ( ndigits==8 ) issn = 1; - else if ( ndigits==10 ) isbn10 = 1; - else if ( ndigits==13 ) isbn13 = 1; - } - - if ( issn ) tag = "ISSN"; - else if ( isbn10 ) tag = "ISBN"; - else if ( isbn13 ) tag = "ISBN13"; - else tag = "SERIALNUMBER"; - - status = fields_add( info, tag, buf, level ); - - if ( status==FIELDS_OK ) return 1; - else return 0; -} |