/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "refer..c"
extern int control();
extern char *mindex();
int hastype(int, char *[], char);
static char last(char *);
char *class(int, char *[]);
char *caps(char *, char *);
char *revauth(char *, char *);
void
{
char *s, *tx;
for (i = 0; i < n; i++) {
s = tvec[i];
if (*s == 0)
continue;
if (control(s[0])) {
if (control(s[1])) {
cch = s[2];
tx = s+3;
macro = 1;
} else {
cch = s[1];
tx = s+2;
macro = 0;
}
} else {
tx = s;
}
#if EBUG
#endif
#if EBUG
#endif
if (!control(s[0])) { /* append to previous item */
if (lastype != 0) {
if (macro)
else
if (lastype == 'T')
if (lastype == 'A')
}
continue;
}
lastype = 0;
continue;
} else {
if (cch == 'A') {
if (nauth++ == 0)
if (macro)
else
else {
if (la)
" \\s-2AND\\s+2" : " and");
}
} else {
if (macro)
else
}
}
if (cch == 'P')
if (cch == 'T')
if (cch == 'O')
}
}
int
{
char *p;
int n = 0;
for (p = line; *p; p++) {
if (*p == '\n') {
*p = 0;
sv[n++] = p+1;
}
}
return (n-1);
}
char *
{
return ("1 journal-article");
return ("3 article-in-book");
return ("4 tech-report");
return ("4 tech-report");
return ("2 book");
return ("5 bell-tm");
return ("0 other");
}
int
{
int i;
for (i = 0; i < nt; i++)
return (1);
return (0);
}
char *
caps(char *a, char *b)
{
char *p;
p = b;
alph = 0;
while (c = *a++) {
*b++ = '\\';
*b++ = 's';
*b++ = '-';
*b++ = '2';
}
*b++ = '\\';
*b++ = 's';
*b++ = '+';
*b++ = '2';
}
if (this)
c &= (~040);
*b++ = c;
}
if (alph > 1) {
*b++ = '\\';
*b++ = 's';
*b++ = '+';
*b++ = '2';
}
*b = 0;
return (p);
}
char *
revauth(char *s, char *b)
{
bcop = b;
while (*name)
name++;
name--;
name--;
}
p = name;
while (p < jr)
*b++ = *p++;
*b++ = ',';
*b++ = *init++;
if (*jr)
jr++;
while (*jr)
*b++ = *jr++;
*b++ = 0;
return (bcop);
}
static char
last(char *s)
{
while (*s)
s++;
return (*--s);
}