Beispiel #1
0
void hpdf_doc::text_goto(int px, int py, et_controls &cp)
{
	int n_TX = (cp.TX > 0) ? cp.TX : cp.T,
		n_TY = (cp.TY > 0) ? cp.TY : cp.T;

	HPDF_REAL space = MMTEXT2PTY(cp.Z * n_TY + cp.L);
	//if (space > f_linespace) f_linespace = space;
	f_linespace = 0;// HPDF_Page_GetCurrentFontSize(h_current_page);

	HPDF_REAL fpx = ((HPDF_REAL)px * 72.0 / n_log_X);
	HPDF_REAL fpy = ((HPDF_REAL)py * 72.0 / n_log_Y);
	f_xpos = fpx;
	f_ypos = f_length - fpy;

	if (f_ypos < 0)
	{
		HPDF_REAL fy = f_ypos;

		end_page();
		new_page(); // xpos and ypos are reset in the function

		// Move to next page
		f_ypos = fy + f_length;
	}

}
Beispiel #2
0
item_p get_unmatched_item() {
    if (unmatched == NULL)
        new_page();
    item_p res = unmatched;
    if (res == NULL)
        return NULL;
    unmatched = unmatched->next;
    res->next = NULL;
    return res;
}
Beispiel #3
0
void hpdf_doc::begin_doc_and_page()
{
	init_font_table();

	init(300); //default P300
	new_page(); // the first page added

	h_current_font = HPDF_GetFont(h_pdf, PDF_STD_CHT, PDF_ENCODE_CHT_H);

	set_font_handle(h_current_page, h_current_font, true);

}
Beispiel #4
0
void hpdf_doc::new_line()
{
	int n_TX = (et_cp.TX > 0) ? et_cp.TX : et_cp.T,
		n_TY = (et_cp.TY > 0) ? et_cp.TY : et_cp.T;

	HPDF_REAL space = MMTEXT2PTY(et_cp.Z * n_TY + et_cp.L);
	if (f_ypos - f_linespace < 0)
	{
		end_page();
		new_page(); // xpos and ypos are reset in the function
	}

	f_xpos = f_margin_x;
	f_ypos -= f_linespace;

	f_linespace = space;
}
Beispiel #5
0
static int pref__setup_wbuffer(struct pref__obj *const p, struct pref__buffer *const buf)
{
    buf->refs_index = 0;
    buf->global_index = -1;
    buf->refs = ( (signed long long *) malloc(sizeof(signed long long [SIZE_OF_ARRAY])) );

    int error = 0;
    if (p->mode=='w')
    {
        char *new_page_p;
        buf->first_page_offset = new_page(p, &new_page_p);
        buf->refs = (signed long long *) new_page_p;
        buf->current_page_offset = buf->first_page_offset;
    }
    else
    {
        error = -1;
    }
    return error;    // zero on success else positive error code.
}
Beispiel #6
0
int init_queue()
{
	int i;
	struct _shm_queue *sq;
	
	sem_init(&mutex,0,1);
	sem_init(&empty,0,MAX_QUEUE_NUM);		 
	sem_init(&full,0,0);
	INIT_LIST_HEAD(&queue_head);
	
	for(i=0;i<MAX_QUEUE_NUM;i++)
	{
		sq=(struct _shm_queue*)new_page(sizeof(struct _shm_queue));
		if(!sq)
			return -1;
		la_list_add_tail(&(sq->list), &queue_head);
		if(i==0)
			front=rear=sq;
	}
	return 0;
}
Beispiel #7
0
static int flush_buffer(struct pref__obj *p, struct pref__buffer *buf)
{
    if (buf->refs_index < 0)
        return 1;
    
    if (buf->refs_index<NUM_REF_PER_PAGE)
    {
        for (int i=buf->refs_index; i<NUM_REF_PER_PAGE; ++i)
        {
            buf->refs[i] = -1;
        }
    }
    
    char *new_page_p;
    signed long long new_offset = new_page(p, &new_page_p);
    
    buf->refs[NEXT_PAGE_INDEX] = new_offset;
    buf->refs = (signed long long *) new_page_p;
    buf->current_page_offset = new_offset;
    buf->refs_index = 0;
    return 0;
}
Beispiel #8
0
static void
show_current_field(WINDOW *win, FORM * form)
{
    FIELD *field;
    FIELDTYPE *type;
    char *buffer;
    int nbuf;
    int field_rows, field_cols, field_max;
    int currow, curcol;

    if (has_colors()) {
	wbkgd(win, (chtype) COLOR_PAIR(1));
    }
    werase(win);
    form_getyx(form, currow, curcol);
    wprintw(win, "Cursor: %d,%d", currow, curcol);
    if (data_ahead(form))
	waddstr(win, " ahead");
    if (data_behind(form))
	waddstr(win, " behind");
    waddch(win, '\n');
    if ((field = current_field(form)) != 0) {
	wprintw(win, "Page %d%s, Field %d/%d%s:",
		form_page(form),
		new_page(field) ? "*" : "",
		field_index(field), field_count(form),
		field_arg(field) ? "(arg)" : "");
	if ((type = field_type(field)) != 0) {
	    if (type == TYPE_ALNUM)
		waddstr(win, "ALNUM");
	    else if (type == TYPE_ALPHA)
		waddstr(win, "ALPHA");
	    else if (type == TYPE_ENUM)
		waddstr(win, "ENUM");
	    else if (type == TYPE_INTEGER)
		waddstr(win, "INTEGER");
#ifdef NCURSES_VERSION
	    else if (type == TYPE_IPV4)
		waddstr(win, "IPV4");
#endif
	    else if (type == TYPE_NUMERIC)
		waddstr(win, "NUMERIC");
	    else if (type == TYPE_REGEXP)
		waddstr(win, "REGEXP");
	    else
		waddstr(win, "other");
	}

	if ((unsigned) field_opts(field) & O_EDIT)
	    waddstr(win, " editable");
	else
	    waddstr(win, " readonly");

	if (field_status(field))
	    waddstr(win, " modified");

	if (dynamic_field_info(field, &field_rows, &field_cols, &field_max)
	    != ERR) {
	    wprintw(win, " size %dx%d (max %d)",
		    field_rows, field_cols, field_max);
	}

	waddch(win, ' ');
	(void) wattrset(win, (int) field_fore(field));
	waddstr(win, "fore");
	wattroff(win, (int) field_fore(field));

	waddch(win, '/');

	(void) wattrset(win, (int) field_back(field));
	waddstr(win, "back");
	wattroff(win, (int) field_back(field));

	wprintw(win, ", pad '%c'",
		field_pad(field));

	waddstr(win, "\n");
	for (nbuf = 0; nbuf <= 2; ++nbuf) {
	    if ((buffer = field_buffer(field, nbuf)) != 0) {
		wprintw(win, "buffer %d:", nbuf);
		(void) wattrset(win, A_REVERSE);
		waddstr(win, buffer);
		wattroff(win, A_REVERSE);
		waddstr(win, "\n");
	    }
	}
    }
    wrefresh(win);
}
Beispiel #9
0
int	insert_key(BTREE *bt, long page, KEY *key, ITEM *u, KEY **hkey)
{
PAGE_ADDRESS *p, *b;
KEY *pk, *pkk, *vkey;
long	nx;
int	k, l, r, n;
ITEM	v;

   *hkey = NULL;
   if (page == BTREE_NULL)
   {
	u->next = page;
	u->child = 0;
	*hkey = (KEY *) malloc(bt->keysize);
	memcpy(*hkey, key, bt->realkeysize);
        return 0;
   }

   p = (PAGE_ADDRESS *) get_page(bt, page);
   pk = (KEY *) (p + 1);

   l = 0; r = p->nkeys-1;
   do {
	k = (l + r) / 2;
	pkk = nth_key(bt, p, k);

	if (bt->compare_key((void *) key, pkk) < 0) r = k - 1;
	else

	if (bt->compare_key((void *) key, pkk) > 0) l = k + 1;
	else
	   break;
   } while (r >= l);

   if (r >= l)
   {
	if (p->s[k].size < 0) /* chave foi deletada */
	{
	   p->s[k].size = u->size;
	   p->s[k].address = u->address;
	   memcpy(nth_key(bt, p, k), key, bt->realkeysize);
	   return 0;
	} 
	btree_errno = DUP_KEY;
	return -1;	/* chave jah existe */
   }

   if (r < 0)
      	nx = p->next0;
   else
	nx = p->s[r].next;

   v = *u;
   if ((k = insert_key(bt, nx, key, &v, &vkey)) < 0)
	return k;

   if (vkey == NULL)
   {
     if ( r < 0)
     {
	p->child0 += v.child;
     }
     else
     {
	p->s[r].child += v.child;
     }
     *u = v;
     write_page(bt, p);
     return 0;
   }	

   p->s[r].child -= v.child;

   if (p->nkeys < bt->order)
   {
	for (k = p->nkeys; k > r+1; k--)
	{
	   p->s[k] = p->s[k-1];
	   pkk = nth_key(bt, p, k);
	   pk = nth_key(bt, p, k-1);
	   memcpy(pkk, pk, bt->realkeysize);
	}
	memcpy(nth_key(bt, p, k), vkey, bt->realkeysize);
	p->s[k] = v;
	p->nkeys++;
	u->child = 1;
	free(vkey);
	write_page(bt, p);
	return 0;
   }

   b = (PAGE_ADDRESS *) new_page(bt);
   b->label = BTREE_LABEL;
   n = bt->order / 2 - 1;
   if (r <= n)
   {
	if (r != n)
	{
	   *u = p->s[n];
	   *hkey = (KEY *) malloc(bt->keysize);
	   memcpy(*hkey, nth_key(bt, p, n), bt->realkeysize);
	   for (k = n ; k > r+1; k--)
	   {
	   	p->s[k] = p->s[k-1];
	   	pkk = nth_key(bt, p, k);
	   	pk = nth_key(bt, p, k-1);
	   	memcpy(pkk, pk, bt->realkeysize);
	   }
	   memcpy(nth_key(bt, p, k), vkey, bt->realkeysize);
	   p->s[k] = v;
	   free(vkey);
	}
	else
	{
	   *u = v;
	   *hkey = vkey;
	}
	n++;
	
	for (k = 0; k < n; k++)
	{
	   b->s[k] = p->s[k+n];
	   memcpy(nth_key(bt, b, k), nth_key(bt, p, k+n), bt->realkeysize);
	}
   }
   else
   {
	r = r - n - 1;
	*u = p->s[n+1];
	*hkey = (KEY *) malloc(bt->keysize);
	memcpy(*hkey, nth_key(bt, p, n+1), bt->realkeysize);
	for (k = 0; k < r; k++)
	{
	   
	   b->s[k] = p->s[k+n+2];
	   memcpy(nth_key(bt, b, k), nth_key(bt, p, k+n+2), bt->realkeysize);
	}
	memcpy(nth_key(bt, b, k), vkey, bt->realkeysize);
	b->s[k] = v;
	free(vkey);
	n++;
	for (k = r+1; k < n; k++)
	{
	   
	   b->s[k] = p->s[k+n];
	   memcpy(nth_key(bt, b, k), nth_key(bt, p, k+n), bt->realkeysize);
	}
   }
   p->nkeys = b->nkeys = n;
   b->next0 = u->next;
   b->child0 = u->child;
   u->next = address_of(bt, b);
   u->child = n + b->child0;
   for (k = 0; k < n; k++)
      u->child += b->s[k].child;
   write_page(bt, p);
   write_page(bt, b); 
   return 0;
}
Beispiel #10
0
void show_about_box(GtkWidget *widget)
{
	const char *license = {
"Copyright \xc2\xa9 2009-2015, Albertas Vyšniauskas\n"
"\n"
"All rights reserved.\n"
"\n"
"Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n"
"\n"
"   * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n"
"   * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n"
"   * Neither the name of the software author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n"
"\n"
"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
	};
	const char *expat_license = {
"Copyright \xc2\xa9 1998, 1999, 2000 Thai Open Source Software Center Ltd and Clark Cooper\n"
"Copyright \xc2\xa9 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.\n"
"\n"
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n"
"\n"
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n"
"\n"
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
	};
	const char *lua_license = {
"Copyright \xc2\xa9 1994-2008 Lua.org, PUC-Rio.\n"
"\n"
"Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n"
"\n"
"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n"
"\n"
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
	};
	const char *program_authors = {
"Albertas Vyšniauskas <*****@*****.**>\n"
/* Add yourself here if you helped Gpick project in any way (patch, translation, etc).
 * Everything is optional, if you do not want, you do not have to disclose your e-mail
 * address, real name or any other information.
 * Please keep this list sorted alphabetically.
 */
	};
	GtkWidget* dialog = gtk_dialog_new_with_buttons(_("About Gpick"), GTK_WINDOW(gtk_widget_get_toplevel(widget)), GtkDialogFlags(GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT), GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL);
	gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
	GtkWidget *vbox = gtk_vbox_new(false, 5);
	GtkWidget *align_box = gtk_hbox_new(false, 5);
	gtk_box_pack_start(GTK_BOX(vbox), align_box, false, false, 0);
	gtk_box_pack_start(GTK_BOX(align_box), gtk_vbox_new(false, 0), true, true, 0);
	gtk_box_pack_end(GTK_BOX(align_box), gtk_vbox_new(false, 0), true, true, 0);
	GtkWidget *hbox = gtk_hbox_new(false, 5);
	gtk_box_pack_start(GTK_BOX(align_box), hbox, false, false, 0);
	GtkWidget *image = gtk_image_new();
	gtk_image_set_from_icon_name(GTK_IMAGE(image), "gpick", GTK_ICON_SIZE_DIALOG);
	gtk_box_pack_start(GTK_BOX(hbox), image, false, false, 0);
	GtkWidget *vbox2 = gtk_vbox_new(false, 0);
	gtk_box_pack_start(GTK_BOX(hbox), vbox2, false, false, 0);
	gchar *tmp_string = g_markup_printf_escaped("<span size=\"xx-large\" weight=\"bold\">%s %s</span>", program_name, gpick_build_version);
	GtkWidget *name = gtk_label_new(0);
	gtk_label_set_selectable(GTK_LABEL(name), true);
	gtk_label_set_justify(GTK_LABEL(name), GTK_JUSTIFY_CENTER);
	gtk_label_set_markup(GTK_LABEL(name), tmp_string);
	gtk_box_pack_start(GTK_BOX(vbox2), name, false, false, 0);
	g_free(tmp_string);
	GtkWidget *comments = gtk_label_new(_("Advanced color picker"));
	gtk_label_set_selectable(GTK_LABEL(comments), true);
	gtk_label_set_justify(GTK_LABEL(comments), GTK_JUSTIFY_CENTER);
	gtk_box_pack_start(GTK_BOX(vbox2), comments, false, false, 0);
	tmp_string = g_markup_printf_escaped ("<span size=\"small\">%s</span>", _("Copyrights © 2009-2015, Albertas Vyšniauskas and Gpick development team"));
	GtkWidget *copyright = gtk_label_new(0);
	gtk_label_set_selectable(GTK_LABEL(copyright), true);
	gtk_label_set_justify(GTK_LABEL(copyright), GTK_JUSTIFY_CENTER);
	gtk_label_set_line_wrap(GTK_LABEL(copyright), true);
	gtk_label_set_markup(GTK_LABEL(copyright), tmp_string);
	gtk_box_pack_start(GTK_BOX(vbox2), copyright, false, false, 0);
	g_free(tmp_string);
	GtkWidget *website = gtk_link_button_new("http://www.gpick.org/");
	gtk_box_pack_start(GTK_BOX(vbox2), website, false, false, 0);
	GtkWidget *notebook = gtk_notebook_new();
	gtk_notebook_set_scrollable(GTK_NOTEBOOK(notebook), true);
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), new_page(license), gtk_label_new(_("License")));
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), new_page(program_authors), gtk_label_new(_("Credits")));
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), new_page(expat_license), gtk_label_new(_("Expat License")));
	gtk_notebook_append_page(GTK_NOTEBOOK(notebook), new_page(lua_license), gtk_label_new(_("Lua License")));
	gtk_box_pack_start(GTK_BOX(vbox), notebook, true, true, 0);
	gtk_widget_show_all(vbox);
	gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), vbox, true, true, 5);
	gtk_window_set_default_size(GTK_WINDOW(dialog), 400, 300);
	gtk_dialog_run(GTK_DIALOG(dialog));
	gtk_widget_destroy(dialog);
	return;
}
Beispiel #11
0
static void
conv(FILE *fp)

    /* FILE    *fp;			/ * next input file */

{

    int	    ch;
    int	    c;

/*
 *
 * Reads a troff output file and echoes most everything to *fp_out. Tracks a few
 * things, like the current font, so the state can be restored at the start of
 * each section.
 * 
 */

    file_init();			/* get ready for the next file */

    while ( (ch = getc(fp)) != EOF )  {

	if ( ch != 'p' )
	    put_char(ch, fp_out);

	switch ( ch )  {

	    case 'w':			/* ignore these */
	    case ' ':
	    case '\n':
	    case 0:
			break;

	    case '0':			/* two digits and a character */
	    case '1':
	    case '2':
	    case '3':
	    case '4':
	    case '5':
	    case '6':
	    case '7':
	    case '8':
	    case '9':
			if ( ! isdigit(c = getc(fp)) )
			    error(FATAL, "digit missing");
			put_char(c, fp_out);

		/* fall through */

	    case 'c':			/* ASCII character */
			put_char(getc(fp), fp_out);
			break;

	    case 'h':			/* relative horizontal */
	    case 'H':			/* absolute horizontal */
	    case 'v':			/* relative vertical */
	    case 'V':			/* and absolute vertical motion */
			get_int(fp);
			break;

	    case 'C':			/* special character */
			put_char(getc(fp), fp_out);
			put_char(getc(fp), fp_out);
			break;

	    case 'D':			/* drawing command */
	    case 't':			/* text string */
	    case 'n':			/* end of line */
	    case '#':			/* comment */
			do
			    put_char(c = getc(fp), fp_out);
			while ( c != '\n'  &&  c != EOF );
			break;

	    case 'x':			/* device control */
			devcntrl(fp);
			break;

	    case 'p':			/* new page */
			new_page();
			put_char(ch, fp_out);
			get_int(fp);
			break;

	    case 's':			/* point size */
			size = get_int(fp);
			break;

	    case 'f':			/* font */
			font = get_int(fp);
			break;

	    default:			/* something's wrong */
			error(FATAL, "unknown input character 0%o %c", ch, ch);
			break;

	}   /* End switch */

    }	/* End while */

    if ( fp_out != stdout && do_report == ON )
	fprintf(stdout, "%s\n", filename);

}   /* End of conv */
Beispiel #12
0
void prt (char fnp[], FILE *lp)
{
      FILE *inp_file;
      int col;
      char line [256], *st, *et, *sp;
      time_t now;
      struct tm *tnow;

      inp_file = fopen(fnp, "r");
      if (!inp_file)
      {
            fprintf(stderr, "pr: unable to open %s\n", fnp);
            return;
      }
      else
            fprintf(stderr, "pr: printing %s\n", fnp);

      pn = 0;
      ln = 999;
      now  = time(&now);
      tnow = localtime(&now);
      strftime(Date, 19, "%a %d %b %Y", tnow);
      strftime(Time, 19, "%I:%M %PM", tnow);
      *title = '\0';

      while (fgets(line, 256, inp_file))
      {
            if (strncmp(line, "PAGE", 4) == 0)
            {
                  if (NULL != (st = strchr(line, '(')))
                  {
                        et = strchr(line, ')');
                        strncpy(title, st + 1, (et) ? et - st - 1 : 160);
                  }
                  ln = 999;
            }

            if (ln > page_length)
                  new_page(fnp, lp);

            if (page_offset)
                  indent(lp);

            for (col = (page_offset) ? page_offset : 1, sp = &line[0];
                   *sp; sp++)
            {
                  switch (*sp)
                  {
                  case '\t':  /* tab character */
                        do
                        {
                              fputc(' ', lp);
                              col++;
                              if (col > page_width)
                              {
                                    fputc('\n', lp);
                                    col = (page_offset) ? page_offset : 1;
                                    ln++;
                                    if (ln > page_length)
                                          new_page(fnp, lp);
                                    if (page_offset)
                                          indent(lp);
                                    break;
                              }
                        } while ((col - 1) % tab_width);
                        break;

                  case '\f':  /* form feed character */
                        new_page(fnp, lp);
                        break;

                  default:
                        fputc(*sp, lp);
                        ++col;
                        if (col > page_width)
                        {
                              fputc('\n', lp);
                              col = (page_offset) ? page_offset - 1 : 0;
                              ln++;
                              if (ln > page_length)
                                    new_page(fnp, lp);
                              if (page_offset)
                                    indent(lp);
                        }
                  }
            } /* of line print (for) */
            ++ln;
      } /* of while not eof */
      fclose(inp_file);
      fputc(014, lp);
} /* of print */