File: modstypes.c

package info (click to toggle)
referencer 1.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 4,028 kB
  • ctags: 2,265
  • sloc: ansic: 32,973; cpp: 12,149; python: 1,314; xml: 1,258; sh: 1,154; makefile: 252
file content (48 lines) | stat: -rw-r--r-- 1,258 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
#include <string.h>
#include "modstypes.h"

/* Conversion information for identifier type attributes:
 *
 *       <identifier type="issn">XXXX-XXXX</identifier>
 *
 */
convert identifier_types[] = {
                { "citekey", "REFNUM" },
                { "issn",    "ISSN"   },
                { "isbn",    "ISBN"   },
                { "doi",     "DOI"    },
                { "url",     "URL"    },
                { "uri",     "URL"    },
                { "pubmed",  "PUBMED" },
                { "medline", "MEDLINE" },
                { "pii",     "PII" },
                { "isi",     "ISIREFNUM" },
		{ "lccn",    "LCCN" },
                { "serial number", "SERIALNUMBER" },
                { "accessnum", "ACCESSNUM" }
};

int nidentifier_types = sizeof( identifier_types ) / sizeof( identifier_types[0] );

char *
mods_find_attrib( char *internal_name, convert *data, int ndata )
{
	int i;
	for ( i=0; i<ndata; ++i ) {
		if ( !strcasecmp( data[i].internal, internal_name ) )
			return data[i].mods;
	}
	return NULL;
}

char *
mods_find_internal( char *mods_name, convert *data, int ndata )
{
	int i;
	for ( i=0; i<ndata; ++i ) {
		if ( !strcasecmp( data[i].mods, mods_name ) )
			return data[i].internal;
	}
	return NULL;
}