refer5.c revision 11a8fa6cb17403e630122ac19b39a323c6e64142
/*
* 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"
#define SAME 0
static char stbuff[50];
static int prevsig;
extern void addch();
extern void append();
extern void err();
extern void flout();
extern int prefix();
char keylet(char *, int);
static void initadd(char *, char *, char *);
static void mycpy(char *, char *);
static void mycpy2(char *, char *, int);
void tokeytab(char *, int);
/* choose signal style */
void
{
int i;
char tag;
if (labels) {
if (nf == 0) /* old */
else {
*t = 0;
if (keywant)
if (science && t[0] == 0) {
1, 0) != 0) {
strcat(t, ", ");
}
}
} else if (t[0] == 0) {
nmlen);
/* format is %s%s for default labels */
/* or %.3s%s eg if wanted */
if (dtlen > 0) {
if (n > 0)
sd += n;
}
} else {
sd = "";
}
t1[0] = 0;
}
if (keywant) {
addon = 0;
;
if (*--sd == '-') {
addon = 1;
*sd = 0;
}
}
} else {
}
}
} else {
if (sort)
else
}
"File %s line %d: punctuation ignored from: %s"),
#if EBUG
#endif
if (prevsig == 0) {
prevsig = 1;
}
stline += 2;
endline += 2;
} else {
stline = "\\*([.";
endline = "\\*(.]";
}
if (science) {
stline = " (";
endline = ")";
}
if (bare == 0) {
if (!another) {
flout();
sig[0] = 0;
prevsig = 0;
int ch;
}
} else {
if (labels) {
} else {
/*
* Seperate reference numbers with AFLAG
* for later sorting and condensing.
*/
}
#if EBUG
#endif
"Can't get scratch file %s"),
hidenam);
}
}
}
if (bare < 2)
if (bare > 0)
flout();
#if EBUG
#endif
}
char *
{
char *p, *s;
int i, fnd = 0;
for (i = 0; i < nf; i++)
/* for titles use first word otherwise last */
if (c == 'T' || c == 'J') {
p = flds[i]+3;
if (prefix("A ", p))
p += 2;
if (prefix("An ", p))
p += 3;
if (prefix("The ", p))
p += 4;
return (out);
}
/* if its not 'L' then use just the last word */
s = p = flds[i]+2;
if (c != 'L') {
for (; *p; p++)
;
while (p > s && *p != ' ')
p--;
}
/* special wart for authors */
if (c == 'A' && (p[-1] == ',' || p[1] == '(')) {
p--;
while (p > s && *p != ' ')
p--;
} else
if (c == 'A' && prepend)
return (out);
}
return (0);
}
void
{
if (nf <= 0)
else {
if (*keystr == '+')
count = 999;
if (count <= 0)
count = 1;
for (i = 1; i <= count; i++) {
if (sf == 0)
break;
}
}
}
}
void
{
while (*lbp++)
;
}
char
{
int i;
int x = 'a' - 1;
for (i = 1; i < nref; i++) {
x = labc[i];
}
#if EBUG
#endif
}
static void
mycpy(char *s, char *t)
{
while (*t && *t != ',' && *t != ' ')
*s++ = *t++;
*s = 0;
}
static void
mycpy2(char *s, char *t, int n)
{
int c;
while (n-- && (c = *t++) > 0) {
if (c == ' ')
c = '-';
*s++ = c;
}
*s = 0;
}
static void
{
int c, nalph = 1;
while (*to)
to++;
c = *from++;
if (!isalpha(c)) {
if (nalph)
*to++ = '.';
nalph = 0;
continue;
}
if (nalph++ == 0)
*to++ = c;
}
*to = 0;
}
static char *articles[] = {
"the ", "an ", "a ", 0
};
char *
artskp(s) /* skips over initial "a ", "an ", "the " in s */
char *s;
{
for (p = articles; *p; p++) {
r2 = s;
r2++;
return (r2);
}
return (s);
}