fieldtype.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
199767f8919635c4928607450d9e0abb932109ceToomas Soome * CDDL HEADER START
199767f8919635c4928607450d9e0abb932109ceToomas Soome * The contents of this file are subject to the terms of the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Common Development and Distribution License, Version 1.0 only
199767f8919635c4928607450d9e0abb932109ceToomas Soome * (the "License"). You may not use this file except in compliance
199767f8919635c4928607450d9e0abb932109ceToomas Soome * with the License.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
199767f8919635c4928607450d9e0abb932109ceToomas Soome * See the License for the specific language governing permissions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * and limitations under the License.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * When distributing Covered Code, include this CDDL HEADER in each
199767f8919635c4928607450d9e0abb932109ceToomas Soome * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * If applicable, add the following below this CDDL HEADER, with the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * fields enclosed by brackets "[]" replaced with your own identifying
199767f8919635c4928607450d9e0abb932109ceToomas Soome * information: Portions Copyright [yyyy] [name of copyright owner]
199767f8919635c4928607450d9e0abb932109ceToomas Soome * CDDL HEADER END
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Copyright (c) 1988 AT&T */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* All Rights Reserved */
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 1997, by Sun Microsystems, Inc.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome#pragma ident "%Z%%M% %I% %E% SMI"
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*LINTLIBRARY*/
199767f8919635c4928607450d9e0abb932109ceToomas Soometypedef struct {
199767f8919635c4928607450d9e0abb932109ceToomas Soome * default fieldtype
199767f8919635c4928607450d9e0abb932109ceToomas Soome 0, /* status */
199767f8919635c4928607450d9e0abb932109ceToomas Soome 0, /* ref */
199767f8919635c4928607450d9e0abb932109ceToomas SoomeFIELDTYPE * _DEFAULT_FIELDTYPE = &default_fieldtype;
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* new_fieldtype - field & character validation function */
199767f8919635c4928607450d9e0abb932109ceToomas Soome if ((fcheck || ccheck) && Alloc(t, FIELDTYPE)) {
199767f8919635c4928607450d9e0abb932109ceToomas Soomelink_fieldtype(FIELDTYPE *left, FIELDTYPE *right)
199767f8919635c4928607450d9e0abb932109ceToomas Soome if (Status(left, CHOICE) || Status(right, CHOICE))
199767f8919635c4928607450d9e0abb932109ceToomas Soome IncrType(left); /* increment reference count */
199767f8919635c4928607450d9e0abb932109ceToomas Soome IncrType(right); /* increment reference count */
199767f8919635c4928607450d9e0abb932109ceToomas Soome DecrType(TypeL(t)); /* decrement reference count */
199767f8919635c4928607450d9e0abb932109ceToomas Soome DecrType(TypeR(t)); /* decrement reference count */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeset_fieldtype_arg(FIELDTYPE *t, PTF_charP makearg,
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* set_fieldtype_choice next & prev choice function */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeset_fieldtype_choice(FIELDTYPE *t, PTF_int next, PTF_int prev)
199767f8919635c4928607450d9e0abb932109ceToomas Soome * invoke make_arg function associated with field type t.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * return pointer to argument information or null if none.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * increment err if an error is encountered.
199767f8919635c4928607450d9e0abb932109ceToomas Soome char *p = (char *)0;
199767f8919635c4928607450d9e0abb932109ceToomas Soome p = (char *)n;
199767f8919635c4928607450d9e0abb932109ceToomas Soome * invoke copy_arg function associated with field type t.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * return pointer to argument information or null if none.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * increment err if an error is encountered.
199767f8919635c4928607450d9e0abb932109ceToomas Soome char *p = (char *)0;
199767f8919635c4928607450d9e0abb932109ceToomas Soome p = (char *)n;
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* _freearg - invoke free_arg function associated with field type t. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* _checkfield - invoke check_field function associated with field type t. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome char *v = Buf(f);
199767f8919635c4928607450d9e0abb932109ceToomas Soome while (*v && *v == ' ')
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* _checkchar - invoke check_char function associated with field type t. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* _nextchoice - invoke next_choice function associated with field type t. */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* _prevchoice - invoke prev_choice function associated with field type t. */