/*
* 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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _UTILITY_H
#define _UTILITY_H
#pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.8 */
#include <form.h>
#include <memory.h>
#include <string.h>
#include <ctype.h>
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
#endif
/* miscellaneous #defines */
typedef int BOOLEAN;
#define MIN(x, y) ((x) < (y) ? (x) : (y))
/* form status flags */
/* field status flags */
/* field type status flags */
(t *)0)
/* field type macros */
#define init_field(f) { \
if ((f) -> fieldinit) \
{ \
(*(f) -> fieldinit)(f); \
} \
}
#define term_field(f) { \
if ((f) -> fieldterm) \
{ \
(*(f) -> fieldterm)(f); \
} \
}
#define init_form(f) { \
if ((f) -> forminit) \
{ \
(*(f) -> forminit)(f); \
} \
}
#define term_form(f) { \
if ((f) -> formterm) \
{ \
(*(f) -> formterm)(f); \
} \
}
/* page macros */
#define P(f) ((f) -> curpage)
/* form macros */
#define C(f) ((f) -> current)
#define W(f) ((f) -> w)
#define X(f) ((f) -> curcol)
#define Y(f) ((f) -> currow)
#define T(f) ((f) -> toprow)
#define B(f) ((f) -> begincol)
/* field macros */
/* system externs */
extern int _checkchar(FIELDTYPE *, int, char *);
extern char * _data_beg(char *, int);
extern char * _data_end(char *, int);
extern char * _whsp_beg(char *, int);
extern char * _whsp_end(char *, int);
extern void _adjust_cursor(FORM *, char *);
extern void _sync_buffer(FORM *);
extern int _sync_linked(FIELD *);
extern int _sync_field(FIELD *);
extern int _sync_attrs(FIELD *);
extern int _pos_form_cursor(FORM *);
extern int _update_current(FORM *);
extern int _data_entry(FORM *, int);
extern int __size(char *);
extern int __rpush(char *);
#ifdef __cplusplus
}
#endif
#endif /* _UTILITY_H */