aboutsummaryrefslogtreecommitdiff
path: root/fref.lex
diff options
context:
space:
mode:
Diffstat (limited to 'fref.lex')
-rw-r--r--fref.lex16
1 files changed, 8 insertions, 8 deletions
diff --git a/fref.lex b/fref.lex
index 6155f3a..b52cce5 100644
--- a/fref.lex
+++ b/fref.lex
@@ -57,8 +57,8 @@
/* Fields of current entry. */
struct entry {
- int a; /* Number of authors. */
char au[MAXFIELD][MAXFIELD]; /* Authors. */
+ int a; /* Number of authors. */
#define DO(s,n,m) char n[MAXFIELD];
FOR_FIELDS
#undef DO
@@ -69,13 +69,13 @@
char *name; /* Program name. */
char *lang; /* Main language (-l). */
- int line; /* Line at which entry begins. */
- int lines; /* Total number of lines. */
- int punct; /* Was punctuation printed? */
struct trans *len; /* English strings. */
struct trans *lru; /* Russian strings. */
struct trans *lsv; /* Swedish strings. */
struct trans *tglob; /* Global (default) strings. */
+ unsigned int line; /* Line at which entry begins. */
+ unsigned int lines; /* Total number of lines. */
+ unsigned int punct; /* Was punctuation printed? */
%%
\n lines++; ECHO;
@@ -158,6 +158,8 @@ entry()
int i;
struct trans *t;
+ #define C(a,b) (punct ? b : a)
+
/* Get translation strings. */
t = *e.lc ? gettrans(e.lc) : tglob;
*e.lc = 0;
@@ -186,13 +188,11 @@ entry()
}
/* Print volume. */
- pf(", *%", punct ? t->Vo : t->vo, e.vo);
+ pf(",\n*%", C(t->vo,t->Vo), e.vo);
/* Print pages, converting hyphens to en dashes. */
if(*e.pg){
- pf(", *", strpbrk(e.pg, ",-") ?
- (punct ? t->Pp :t->pp)
- : (punct ? t->P : t->p));
+ pf(",\n*", strpbrk(e.pg, ",-") ? C(t->pp,t->Pp) : C(t->p,t->P));
for(i = 0; i < strlen(e.pg); i++){
if(e.pg[i] == '-') putchar('\\');
putchar(e.pg[i]);