/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1988 AT&T */
/* All Rights Reserved */
/*
* Copyright (c) 1997, by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.8 */
/*LINTLIBRARY*/
#include <stdlib.h>
#include "utility.h"
/* default form */
{
0, /* status */
0, /* rows */
0, /* cols */
0, /* currow */
0, /* curcol */
0, /* toprow */
0, /* begincol */
-1, /* maxfield */
-1, /* maxpage */
-1, /* curpage */
O_BS_OVERLOAD, /* opts */
(WINDOW *) 0, /* win */
(WINDOW *) 0, /* sub */
(WINDOW *) 0, /* w */
(FIELD **) 0, /* field */
(FIELD *) 0, /* current */
(_PAGE *) 0, /* page */
(char *) 0, /* usrptr */
(PTF_void) 0, /* forminit */
(PTF_void) 0, /* formterm */
(PTF_void) 0, /* fieldinit */
(PTF_void) 0, /* fieldterm */
};
/*
* insert - insert field f into sorted list pointed
* to by head. return (possibly new) head of list.
*/
static FIELD *
{
FIELD *p;
if (head) {
p = p->snext;
if (p == head) {
break;
}
}
f->snext = p;
if (p == head)
newhead = f; /* insert at head of list */
} else
return (newhead);
}
/* sort_form - sort fields on form(per page) */
static void
{
FIELD *p;
p = (FIELD *) 0;
}
}
}
static void
{
}
/* disconnect_fields - disconnect fields from form */
static void
{
if (f)
while (*f) {
++f;
}
}
/* connect_fields - connect fields to form */
static int
{
int i;
f->field = x;
f->maxfield = 0;
f->maxpage = 0;
if (!x)
return (E_OK); /* null field array */
++np; /* count pages */
return (E_CONNECTED);
else
}
if (nf == 0)
return (E_BAD_ARGUMENT); /* no fields */
for (i = 0; i < nf; ++i) {
if (i == 0)
++page;
}
merge(x[i], f);
}
sort_form(f);
return (E_OK);
}
return (E_SYSTEM_ERROR);
}
FORM *
{
FORM *f;
*f = *_DEFAULT_FORM;
if (f->maxpage) {
P(f) = 0;
C(f) = _first_active(f);
} else {
P(f) = -1;
C(f) = (FIELD *) 0;
}
return (f);
}
}
(void) free_form(f);
return ((FORM *) 0);
}
int
{
if (!f)
return (E_BAD_ARGUMENT);
return (E_POSTED);
Free(f);
return (E_OK);
}
int
{
FIELD **p;
int v;
if (!f)
return (E_BAD_ARGUMENT);
return (E_POSTED);
p = f->field;
if (f->maxpage) {
P(f) = 0;
C(f) = _first_active(f);
} else {
P(f) = -1;
C(f) = (FIELD *) 0;
}
} else
(void) connect_fields(f, p); /* reconnect original fields */
return (v);
}
FIELD **
{
}
int
{
}
int
{
if (!f)
return (E_BAD_ARGUMENT);
if (!f->field)
return (E_NOT_CONNECTED);
return (E_OK);
}
{
return (OneRow(C(f)) ? B(f) != 0 : T(f) != 0);
}
/* _data_ahead - return ptr to last non-pad char in v[n] (v on failure) */
static char *
{
char *vend = v + n;
return (vend);
}
{
WINDOW *w = W(f);
FIELD *c = C(f);
int dcols;
int drows;
int start;
int chunk;
if (flag)
if (OneRow(c)) {
break;
}
}
} else { /* else multi-line field */
break;
}
}
}
if (flag)
(void) wmove(w, Y(f), X(f));
return (ret);
}