Subject: stereogram maker (shar version)

From: [email-masked] (Gerald L Jr Reno)
Date: 9 Nov 92 19:55:21 GMT

#!/bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #!/bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	atari.3
#	image.c
#	image.h
#	makefile
#	mon.3
#	squares.3
#	st.c
#	st.doc
#	st.doc.3d
#	textto3.c
# This archive created: Mon Nov  9 14:31:19 1992
export PATH; PATH=/bin:$PATH
echo shar: extracting "'atari.3'" '(170 characters)'
if test -f 'atari.3'
then
	echo shar: over-writing existing file "'atari.3'"
fi
sed 's/^X//' << \SHAR_EOF > 'atari.3'
XSample .3 file
XThe Fuji symbol is copyrighted to Atari Corp. And I don't care.
X##%
X%layers 2
X%begin 0
X  |||
X  |||
X  |||
X /   \
X/     \
X%begin 1
X
X
X
X   |
X%begin 2
X
X
X
X
X   |
SHAR_EOF
if test 170 -ne "`wc -c 'atari.3'`"
then
	echo shar: error transmitting "'atari.3'" '(should have been 170 characters)'
fi
echo shar: extracting "'image.c'" '(2446 characters)'
if test -f 'image.c'
then
	echo shar: over-writing existing file "'image.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'image.c'
X// Create a double-image stereogram from a series of ASCII drawings. 
X//
X// image.c: a class to store an ascii image.
X// Version 1.0
X//
X// Copyright 1992 Gerald Reno. Free for use of public.
X//
X// For those of you who don't know, this is C++ code.
X
X#include "image.h"
X#include <string.h>
X
Xint EOFF; // End of file flag
X
X// concatenate two strings, deleting the first.
Xchar *strdcat(char *a,char*b)
X{
X   char *c;
X
X   if (a) {
X      c=new char[strlen(a)+strlen(b)];
X      strcpy(c,a);
X      delete a;
X      strcat(c,b);
X   } else {
X      c=new char[strlen(b)];
X      strcpy(c,b);
X   }
X   return c;
X}
X
X// Read an image from a file; may not be rectangular
Xchar *image::read(FILE *n,char escape)
X{
X   int e;
X   char c[MAXWIDTH];
X
X   h=w=0;
X   e=1;
X   do {
X      if (fgets(c,MAXWIDTH,n)!=NULL) {
X         if(c[0]==escape)
X            e=0;
X         else {
X            if (strlen(c)>w) w=strlen(c);
X            rows=strdcat(rows,c);
X            h++;
X         }
X      } else {
X         EOFF=1;
X         e=0;
X      }
X   } while(e);
X   return c;
X}
X
X// Create a rectangular image of spaces.
Ximage::image(int a,int b)
X{
X   int i,j;
X
X   h=b;
X   w=a;
X   rows=new char[h*(w+1)];
X   for(i=0;i<h;i++) {
X      for(j=0;j<w;j++) {
X         rows[i*(w+1)+j]=' ';
X      }
X      rows[i*(w+1)+j]='\n';
X   }
X   rows[i*(w+1)]='\0';
X}
X
X// Overlay another image over the current one, with an optional x offset.
X// Current image MUST be rectangular, or wierd things will happen.
X// Spaces are treated as "clear"
Xvoid image::overlay(int offset,image &im)
X{
X   int i,j,k;
X
X   if(im.rows==NULL) return;
X   i=j=0;
X   for(k=0;k<strlen(im.rows);k++) {
X      if(im.rows[k]=='\n') {
X         i++;
X         j=0;
X      }
X      else {
X         if(im.rows[k]!=' ')
X            if ((j+offset>=0)&&(j+offset<w))
X               rows[i*(w+1)+j+offset]=im.rows[k];
X         j++;
X      }
X   }
X}
X
X// Print out this image as the left half of a stereo pair,
X// with the given image as the right half. This image must
X// be rectangular. Both must be the same height.
X
Xchar *image::stereodump(image &right, int gap)
X{
X   int i,j,k,l,m;
X   char *c;
X
X   if (h!=right.h) return NULL;
X   
X   c=new char[(h+1)*(w+gap+right.w+1)];
X   for(i=j=k=l=0;k<h;k++) {
X      while(rows[i]!='\n') {
X         c[l++]=rows[i++];
X      }
X      i++;
X      for(m=0;m<gap;m++)
X         c[l++]=' ';
X      while(right.rows[j]!='\n') {
X         c[l++]=right.rows[j++];
X      }
X      j++;
X      c[l++]='\n';
X   }
X   return c;
X}
SHAR_EOF
if test 2446 -ne "`wc -c 'image.c'`"
then
	echo shar: error transmitting "'image.c'" '(should have been 2446 characters)'
fi
echo shar: extracting "'image.h'" '(611 characters)'
if test -f 'image.h'
then
	echo shar: over-writing existing file "'image.h'"
fi
sed 's/^X//' << \SHAR_EOF > 'image.h'
X// Create a double-image stereogram from a series of ASCII drawings. 
X//
X// image.h: a class to store an ascii image.
X// Version 1.0
X//
X// Copyright 1992 Gerald Reno. Free for use of public.
X//
X// This is a C++ header file, if you didn't already know that.
X
X#include <stdio.h>
X#include <stream.h>
X
Xconst int MAXWIDTH=128;
Xextern int EOFF;
X
Xclass image {
X	private:
X	char *rows;
X
X	public:
X	int h,w;
X	~image() {delete rows;}
X	char *dump() {return rows;}
X	char *stereodump(image &right,int gap=3);
X	char *read(FILE *n,char escape);
X	image(void) {h=w=0;}
X	image(int a,int b);
X	void overlay(int offset,image &im);
X};
SHAR_EOF
if test 611 -ne "`wc -c 'image.h'`"
then
	echo shar: error transmitting "'image.h'" '(should have been 611 characters)'
fi
echo shar: extracting "'makefile'" '(111 characters)'
if test -f 'makefile'
then
	echo shar: over-writing existing file "'makefile'"
fi
sed 's/^X//' << \SHAR_EOF > 'makefile'
Xst: st.o image.o
X	CC -o st st.o image.o
Xst.o: st.c image.h
X	CC -c st.c
Ximage.o: image.c image.h
X	CC -c image.c
SHAR_EOF
if test 111 -ne "`wc -c 'makefile'`"
then
	echo shar: error transmitting "'makefile'" '(should have been 111 characters)'
fi
echo shar: extracting "'mon.3'" '(407 characters)'
if test -f 'mon.3'
then
	echo shar: over-writing existing file "'mon.3'"
fi
sed 's/^X//' << \SHAR_EOF > 'mon.3'
XA sample .3 file. It should look something like a monitor.
X#layers 2
X#begin 2
X
X              o
X              o
X
X
X
X
X              o
X#begin 1
X+---------------+
X|+----------+   |
X||          |   |
X||          |   |
X||   3-D    |   |
X||          |   |
X||          |   |
X|+----------+   |
X+---------------+
X
X    -/-----\-
X#begin 0
X
X
X  +--------+
X  |        |
X  |        |
X  |        |
X  +--------+
X
X
X      ]   [
SHAR_EOF
if test 407 -ne "`wc -c 'mon.3'`"
then
	echo shar: error transmitting "'mon.3'" '(should have been 407 characters)'
fi
echo shar: extracting "'squares.3'" '(250 characters)'
if test -f 'squares.3'
then
	echo shar: over-writing existing file "'squares.3'"
fi
sed 's/^X//' << \SHAR_EOF > 'squares.3'
X123456789012345678901234567890
X#layers 5
X#begin 0
X+---+   +---+
X|   |   |   |
X|   |   |   |
X+---+   +---+
X
X+---+   +---+
X|   |   |   |
X|   |   |   |
X+---+   +---+
X#begin 1
X
X
X   +-----+
X   |     |
X   |     |
X   |     |
X   +-----+
X#begin 2
X
X
X
X
X      !
SHAR_EOF
if test 250 -ne "`wc -c 'squares.3'`"
then
	echo shar: error transmitting "'squares.3'" '(should have been 250 characters)'
fi
echo shar: extracting "'st.c'" '(3438 characters)'
if test -f 'st.c'
then
	echo shar: over-writing existing file "'st.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'st.c'
X// Create a double-image stereogram from a series of ASCII drawings. 
X//
X// st.c: the actual work code
X// Version 1.0
X//
X// Copyright 1992 Gerald Reno. Free for use of public.
X//
X// For those of you who don't know, this is C++ code.
X
X#include "image.h"
X#include <string.h>
X
Xmain(int argc,char**argv)
X{
X   FILE *f;      // input file
X   image *i,*right,*left;   // input image array; output images
X   int j,d,l,lf,in;   // l: number of layers in the image
X   int maxw,maxh;      // maximum size of incoming images.
X   int cr,gap;      // crosseyed flag, gap between images
X   char c[MAXWIDTH],*s,escape;
X
X   if (argc<2) {
X      cerr<<"\nst: create a stereogram from ascii drawings\n";
X      cerr<<"usage:\tst [-c] [-gn] file1 [.. filen]\n";
X      exit(0);
X   }
X
X   //
X   // read in the image files
X   //
X
X   maxw=maxh=0;
X   l=0;
X   cr=-1;
X   gap=3;
X   for(j=1;j<argc;j++) {
X      EOFF=0;
X      escape='#';
X      if(argv[j][0]=='-') {
X         if(argv[j][1]=='c') cr=1;
X         if(argv[j][1]=='g') sscanf(argv[j]+2,"%d",&gap);
X      } else {
X         sprintf(c,"%s.3",argv[j]);
X         if(!(f=fopen(c,"r"))) {
X            f=fopen(argv[j],"r");
X         }
X         if(f) {
X            if (!l) do {
X               if(fgets(c,MAXWIDTH,f)==NULL) {
X                  cerr<<"No "<<escape<<"layers command\n";
X                  l=-1;
X               }
X               if(c[0]==escape) {
X                  if(strncmp(c+1,"layers",6)==0) {
X                     sscanf(c+7,"%d",&l);
X                     l++;
X                     i=new image[l];
X                  }
X                  if(c[1]==escape) escape=c[2];
X               }
X            }while(!l);
X            lf=l;
X            in=0;
X            while(lf>=0) {
X               if (!in) if(fgets(c,MAXWIDTH,f)==NULL) {
X                  lf=-1;
X               }
X               if(c[0]==escape) {
X                  if(!strncmp(c+1,"begin",5)) {
X                     sscanf(c+6,"%d",&d);
X                     if(d>=l) {
X                        cerr<<"Layer number "<<d
X                            <<" is too high. Using "
X                            <<l-1<<" instead.\n";
X                        d=l-1;
X                     }
X                     if((i[d].h!=0)&&(i[d].w!=0)) {
X                        cerr<<"Found more than one layer"<<d
X                            <<". This may produce strange results.\n";
X                     }
X                     strcpy(c,i[d].read(f,escape));
X                     in=1;
X                     if (i[d].h>maxh) maxh=i[d].h;
X                     if (i[d].w>maxw) maxw=i[d].w;
X                     if (EOFF) lf=-1;
X                  } else if(c[1]==escape) {
X                     escape=c[2];
X                     in=0;
X                  } else if(c[1]!=' ') {
X                     cerr<<"Erroneous line:"<<c<<"\n";
X                     in=0;
X                  }
X               } else {
X                  cerr<<"Erroneous line:"<<c<<"\n";
X                  in=0;
X               }
X            }
X         } else {
X            cerr<<"Can't open "<<argv[j]<<"\n";
X         }
X      }
X   }
X
X   //
X   // build the images
X   //
X
X   if (l) {
X      left=new image(maxw+l,maxh);
X      for(j=0;j<l;j++)
X         left->overlay(cr*j+l*(cr<0),i[j]);
X      right=new image(maxw,maxh);
X      for(j=0;j<l;j++)
X         right->overlay(0,i[j]);
X      s=left->stereodump(*right,gap);
X      if (s!=NULL) {
X         printf(s);
X         printf("\n");
X         delete s;
X      }
X   }
X}
SHAR_EOF
if test 3438 -ne "`wc -c 'st.c'`"
then
	echo shar: error transmitting "'st.c'" '(should have been 3438 characters)'
fi
echo shar: extracting "'st.doc'" '(3130 characters)'
if test -f 'st.doc'
then
	echo shar: over-writing existing file "'st.doc'"
fi
sed 's/^X//' << \SHAR_EOF > 'st.doc'
X            _ST_
X
X
XA simple ascii _stereogram_ maker
X
X
XCopyright 1992 Gerald L. Reno, Jr. _Free for use of public_.
X
X
X_Associated files:_
X
X_st.doc_: This file.
X
X_st.c_: The C++ program _st_
X
X_image.c_: The C++ code used for storing the text images.
X
X_image.h_: The header file for _image.c_
X
X_textto3.c_: The C program _textto3_
X
X_*.3_: 3-D image input files.
X
X
X_Compiling:_
X
X_st_ is a C++ program, consisting of three files, st.c, image.c, and image.h. You can compile them using either the included makefile (which assumes your C++ compiler is called CC), or simply by using the command _CC st.c image.c_.
X
X_textto3_ is a short, single-file C program. No makefile is necessary, just use _cc textto3.c -o textto3_, or whatever your local C compiler is.
X
XThe code was written on a _Sun_ workstation, using only standard routines, so it should be fully transportable to just about anything.
X
X
X_Usage:_
X
X_textto3_:
XThis program is very simple; simply pipe into it any text file, and it will create a file suitable for using with _st_ on stdout.
X
XLines in the original text files will be wrapped to thirty characters; words will be wrapped, words more than thirty characters long will be split after every thirty characters. All carriage returns in the input file will be retained. Any text between _underscores_ will be moved to the upper level in the _.3_ file.
X
XThe use of the underscore can be replaced by any other character, by sending that character as a command-line argument.  If, for instance, you wanted to use a caret instead, you would use the command _textto3 ^ < infile > outfile_.
X
XIf you are using any hash-marks (#) in your file, you must specify a different character (which is _not_ in your file) to use as an escape in the .3 file. Do this by specifying another command line argument, i.e. _textto3 ^ @ < infile > outfile_.  To print this file in 3-D, the percent sign was used as an escape.
X
X_st_:
X
X _Command Line Options_:
Xst [-c] [-gn] file1 [.. filen]
X
X_-c_: make a wide-eyed, rather than cross-eyed, stereogram
X_-g_: specify the width (in characters) between the two halves of the stereogram.
X      If more than one input file is used, only one should have a #layers command.
X
X _.3 File Commands_
X_#layers n_
XSpecifies that this image contains n z-levels. Each stereogram must begin with a #layers command in the first file. Anything preceding the #layers command (other than a ##X command) will be ignored.
X_#begin n_
XBegins z-level _n_. The text beginning on the next line, up to the next # command, will be used as this level.
X_##X_
XMakes _X_ the new escape character. Useful if you want to have hash marks in your stereograms.
X
X_Hints:_
X
XYour _.3_ file shouldn't be any wider than about thirty characters, if you plan on using an eighty character display; remember: the 3D image will be twice as wide, plus the gap between the files.
X
XUse an escape character that you don't want in an image.
X
X_Questions, Comments, Concerns, and Funny Stories_:
X
XE-mail these, along with any suggestions, bug reports, or good stereograms, to [email-masked] (before 1993) or [email-masked]
X(after 1992).
SHAR_EOF
if test 3130 -ne "`wc -c 'st.doc'`"
then
	echo shar: error transmitting "'st.doc'" '(should have been 3130 characters)'
fi
echo shar: extracting "'st.doc.3d'" '(10813 characters)'
if test -f 'st.doc.3d'
then
	echo shar: over-writing existing file "'st.doc.3d'"
fi
sed 's/^X//' << \SHAR_EOF > 'st.doc.3d'
X             ST                                 ST                 
X                                                                   
X                                                                   
X  A simple asciistereogram          A simple ascii stereogram      
X  maker                             maker                          
X                                                                   
X                                                                   
X  Copyright 1992 Gerald L. Reno,    Copyright 1992 Gerald L. Reno, 
X  Jr.Free for use of public .       Jr. Free for use of public.    
X                                                                   
X                                                                   
X Associated files:                  Associated files:              
X                                                                   
X st.doc : This file.                st.doc: This file.             
X                                                                   
X st.c : The C++ programst           st.c: The C++ program st       
X                                                                   
X image.c : The C++ code used for    image.c: The C++ code used for 
X  storing the text images.          storing the text images.       
X                                                                   
X image.h : The header file for      image.h: The header file for   
X image.c                            image.c                        
X                                                                   
X textto3.c : The C program          textto3.c: The C program       
X textto3                            textto3                        
X                                                                   
X *.3 : 3-D image input files.       *.3: 3-D image input files.    
X                                                                   
X                                                                   
X Compiling:                         Compiling:                     
X                                                                   
X st  is a C++ program,              st is a C++ program,           
X  consisting of three files,        consisting of three files,     
X  st.c, image.c, and image.h.       st.c, image.c, and image.h.    
X  You can compile them using        You can compile them using     
X  either the included makefile      either the included makefile   
X  (which assumes your C++           (which assumes your C++        
X  compiler is called CC), or        compiler is called CC), or     
X  simply by using the command       simply by using the command    
X CC st.c image.c .                  CC st.c image.c.               
X                                                                   
X textto3  is a short,               textto3 is a short,            
X  single-file C program. No         single-file C program. No      
X  makefile is necessary, just       makefile is necessary, just    
X  usecc textto3.c -o textto3 ,      use cc textto3.c -o textto3,   
X  or whatever your local C          or whatever your local C       
X  compiler is.                      compiler is.                   
X                                                                   
X  The code was written on aSun      The code was written on a Sun  
X  workstation, using only           workstation, using only        
X  standard routines, so it          standard routines, so it       
X  should be fully transportable     should be fully transportable  
X  to just about anything.           to just about anything.        
X                                                                   
X                                                                   
X Usage:                             Usage:                         
X                                                                   
X textto3 :                          textto3:                       
X  This program is very simple;      This program is very simple;   
X  simply pipe into it any text      simply pipe into it any text   
X  file, and it will create a        file, and it will create a     
X  file suitable for using with      file suitable for using with   
X st  on stdout.                     st on stdout.                  
X                                                                   
X  Lines in the original text        Lines in the original text     
X  files will be wrapped to          files will be wrapped to       
X  thirty characters; words will     thirty characters; words will  
X  be wrapped, words more than       be wrapped, words more than    
X  thirty characters long will       thirty characters long will    
X  be split after every thirty       be split after every thirty    
X  characters. All carriage          characters. All carriage       
X  returns in the input file         returns in the input file      
X  will be retained. Any text        will be retained. Any text     
X  betweenunderscores  will be       between underscores will be    
X  moved to the upper level in       moved to the upper level in    
X  the.3  file.                      the .3 file.                   
X                                                                   
X  The use of the underscore can     The use of the underscore can  
X  be replaced by any other          be replaced by any other       
X  character, by sending that        character, by sending that     
X  character as a command-line       character as a command-line    
X  argument.  If, for instance,      argument.  If, for instance,   
X  you wanted to use a caret         you wanted to use a caret      
X  instead, you would use the        instead, you would use the     
X  commandtextto3 ^ < infile >       command textto3 ^ < infile >   
X outfile .                          outfile.                       
X                                                                   
X  If you are using any              If you are using any           
X  hash-marks (#) in your file,      hash-marks (#) in your file,   
X  you must specify a different      you must specify a different   
X  character (which isnot  in        character (which is not in     
X  your file) to use as an           your file) to use as an        
X  escape in the .3 file. Do         escape in the .3 file. Do      
X  this by specifying another        this by specifying another     
X  command line argument, i.e.       command line argument, i.e.    
X textto3 ^ @ < infile >             textto3 ^ @ < infile >         
X outfile .  To print this file      outfile.  To print this file   
X  in 3-D, the percent sign was      in 3-D, the percent sign was   
X  used as an escape.                used as an escape.             
X                                                                   
X st :                               st:                            
X                                                                   
X  Command Line Options :             Command Line Options:         
X  st [-c] [-gn] file1 [.. filen]    st [-c] [-gn] file1 [.. filen] 
X                                                                   
X -c : make a wide-eyed, rather      -c: make a wide-eyed, rather   
X  than cross-eyed, stereogram       than cross-eyed, stereogram    
X -g : specify the width (in         -g: specify the width (in      
X  characters) between the two       characters) between the two    
X  halves of the stereogram.         halves of the stereogram.      
X        If more than one input            If more than one input   
X  file is used, only one should     file is used, only one should  
X  have a #layers command.           have a #layers command.        
X                                                                   
X  .3 File Commands                   .3 File Commands              
X #layers n                          #layers n                      
X  Specifies that this image         Specifies that this image      
X  contains n z-levels. Each         contains n z-levels. Each      
X  stereogram must begin with a      stereogram must begin with a   
X  #layers command in the first      #layers command in the first   
X  file. Anything preceding the      file. Anything preceding the   
X  #layers command (other than a     #layers command (other than a  
X  ##X command) will be ignored.     ##X command) will be ignored.  
X #begin n                           #begin n                       
X  Begins z-leveln . The text        Begins z-level n. The text     
X  beginning on the next line,       beginning on the next line,    
X  up to the next # command,         up to the next # command,      
X  will be used as this level.       will be used as this level.    
X ##X                                ##X                            
X  MakesX  the new escape            Makes X the new escape         
X  character. Useful if you want     character. Useful if you want  
X  to have hash marks in your        to have hash marks in your     
X  stereograms.                      stereograms.                   
X                                                                   
X Hints:                             Hints:                         
X                                                                   
X  Your.3  file shouldn't be any     Your .3 file shouldn't be any  
X  wider than about thirty           wider than about thirty        
X  characters, if you plan on        characters, if you plan on     
X  using an eighty character         using an eighty character      
X  display; remember: the 3D         display; remember: the 3D      
X  image will be twice as wide,      image will be twice as wide,   
X  plus the gap between the          plus the gap between the       
X  files.                            files.                         
X                                                                   
X  Use an escape character that      Use an escape character that   
X  you don't want in an image.       you don't want in an image.    
X                                                                   
X Questions, Comments, Concerns,     Questions, Comments, Concerns, 
X and Funny Stories :                and Funny Stories:             
X                                                                   
X  E-mail these, along with any      E-mail these, along with any   
X  suggestions, bug reports, or      suggestions, bug reports, or   
X  good stereograms, to              good stereograms, to           
X [email-masked]  (before          [email-masked] (before       
X  1993) or                          1993) or                       
X [email-masked]          [email-masked]      
X  (after 1992).                     (after 1992).                  
X                                                                   
X
SHAR_EOF
if test 10813 -ne "`wc -c 'st.doc.3d'`"
then
	echo shar: error transmitting "'st.doc.3d'" '(should have been 10813 characters)'
fi
echo shar: extracting "'textto3.c'" '(1347 characters)'
if test -f 'textto3.c'
then
	echo shar: over-writing existing file "'textto3.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'textto3.c'
X/* Convert a text file to something suitable for inserting into st. *
X * Text will be cropped to thirty columns. Anything between to      *
X * underscores will be placed in a higher level.                    */
X
X/* textto3.c                                                        */
X
X/* Copyright 1992 Gerald Reno. Free for use of public.              */
X
X#include <stdio.h>
X#include <string.h>
X#define MAX 32767
X
Xmain(argc,argv)
X	int argc;
X	char **argv;
X{
X	char low[MAX],high[MAX];
X	int l,i,j,c,mode;
X	char underscore='_',escape='#';
X
X	if (argc>1) {
X		underscore=argv[1][0];
X	}
X	if (argc>2) {
X		escape=argv[1][0];
X	}
X
X	i=0;
X	l=0;
X	mode=0;
X	while((c=getchar())!=EOF) {
X		if (c==underscore) {
X				mode=!mode;
X		}
X		else switch(c) {
X			case '\n':
X				low[i]=high[i]='\n';
X				l=0;
X				j=i;
X				i++;
X				break;
X			case ' ':
X				j=i;
X			default:
X 				if (mode) {
X					low[i]=' ';
X					high[i]=c;
X				} else {
X					low[i]=c;
X					high[i]=' ';
X				}
X				i++;
X				if((++l)>30) {
X					low[j]=high[j]='\n';
X					l=i-j;
X					if(l>30) {
X						j+=30;
X						low[j]=high[j]='\n';
X						l=i-j;
X					}
X				}
X		}
X	}
X	printf("Created by textto3\n");
X	if (escape!='#')
X		printf("##%c\n",escape);
X	printf("%clayers 1\n%cbegin 0\n",escape,escape);
X	for(j=0;j<i;j++) {
X		putchar(low[j]);
X	}
X	printf("\n%cbegin 1\n",escape);
X	for(j=0;j<i;j++) {
X		putchar(high[j]);
X	}
X}
SHAR_EOF
if test 1347 -ne "`wc -c 'textto3.c'`"
then
	echo shar: error transmitting "'textto3.c'" '(should have been 1347 characters)'
fi
#	End of shell archive
exit 0