summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/cwebdir/twinx.w
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/cwebdir/twinx.w')
-rw-r--r--Build/source/texk/web2c/cwebdir/twinx.w29
1 files changed, 13 insertions, 16 deletions
diff --git a/Build/source/texk/web2c/cwebdir/twinx.w b/Build/source/texk/web2c/cwebdir/twinx.w
index ecfce0c8da8..735a5d7d07e 100644
--- a/Build/source/texk/web2c/cwebdir/twinx.w
+++ b/Build/source/texk/web2c/cwebdir/twinx.w
@@ -8,16 +8,13 @@ the form `\.{\\def\\title\{NAME\}}'.
@c
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
@<Type definitions@>@;
@<Global variables@>@;
@<Procedures@>@;
@#
-int main(
- int argc,
- char *argv[])
+main(argc,argv)
+ int argc;
+ char *argv[];
{ @<Local variables@>;
@<Initialize the data structures@>;
while (--argc) {
@@ -102,7 +99,7 @@ typedef union {
struct node_struct *n;
} mixed;
typedef struct node_struct {
- const char *id;
+ char *id;
mixed data;
struct node_struct *next;
} node;
@@ -115,8 +112,8 @@ if the input is all screwed up.
@d string_block_size 8192 /* number of bytes per string block */
@<Proc...@>=
-char *save_string(
- char *s)
+char *save_string(s)
+ char *s;
{
register char *p,*q; register int l;
for (p=s;*p;p++) ;
@@ -145,7 +142,7 @@ char *save_string(
@d nodes_per_block 340
@<Proc...@>=
-node *new_node(void)
+node *new_node()
{
if (next_node==bad_node) {
next_node=(node*)calloc(nodes_per_block,sizeof(node));
@@ -347,8 +344,8 @@ If they are still equal, we look at the format characters (the first
two characters of the |id| field).
@<Proc...@>=
-int compare(
- node *p, node *q)
+int compare(p,q)
+ node *p,*q;
{@+register unsigned char *pp,*qq;
for (pp=(unsigned char*)p->id+3,qq=(unsigned char*)q->id+3;
*pp&&ord[*pp]==ord[*qq];pp++,qq++) ;
@@ -379,7 +376,7 @@ collate[0]=0; strcpy(collate+1,"} \1\2\3\4\5\6\7\10\11\12\13\14\15\16\17\
!\42#$%&'()*+,-./:;<=>?@@[\\]^`{|~_\
abcdefghijklmnopqrstuvwxyz0123456789");
{@+register int j;
- for (j=1;collate[j];j++) ord[(int)collate[j]]=j;
+ for (j=1;collate[j];j++) ord[collate[j]]=j;
ord[128]=j; /* this affects the ordering of |sentinel.id| */
for (j='A';j<='Z';j++) ord[j]=ord[tolower(j)];
}
@@ -390,8 +387,8 @@ the order when printing. After this procedure has acted, the field
|q->data.n| should not be considered an active pointer.
@<Proc...@>=
-void collapse(
- node *p, node *q)
+collapse(p,q)
+ node *p,*q;
{@+register node *x;
for (x=q->data.n;x->next;x=x->next) ;
x->next=p->data.n;
@@ -414,7 +411,7 @@ properly, especially in the ``custom'' format when they must become
}
@ @<Output |x->id|...@>=
-{@+register const char *p=x->id;
+{@+register char *p=x->id;
if (*p==' ') {
if (*(p+1)!=' ') goto unknown;
goto known;