DATASERV (kdataman) functions


LIBRARY ROUTINE

kdms_define_segment - define a segment

LIBRARY CALL

int kdms_define_segment(
      char        *segment,
      kfunc_int   *create,
      kfunc_int   *destroy,
      kfunc_int   *query,
      kfunc_kaddr *get_data,
      kfunc_int   *put_data,
      kfunc_int   *get_atr,
      kfunc_int   *set_atr,
      kfunc_int   *match_atr_atrnn,
      kfunc_int   *copy,_atr
      kfunc_int   *query,
      kfunc_int   *print)

INPUT

OUTPUT

none

RETURN VALUE

TRUE on success, FALSE otherwise

DESCRIPTION

This routine is used to define alternate segment handler functions for a session. A segment definition is used to provide alternate functions for creating, destroying, querying, and referencing, segments. Alternate functions can also be provided for getting and putting data, as well as getting, setting, matching, copying, querying, and printing that segment's attributes. Segments do not need to be defined. This function just provides a convenient method for encapsulating alternate functionality for a segment name beneath the existing data services api.

While in one of these alternate functions, the definition is "locked" so that further kdms calls which access the defined segment will _not_ go through the defined segment handler functions. Once out of the handler function, the definition will be "unlocked".

This provides the ability to imbed any needed initialization steps into the creation of a given segment. For example, the create handler for the "value" segment will be called on a kdms_create_segment(obj, "value") call. Within this handler, another kdms_create_segment(obj, "value") call will not call the create handler becuse the definition is locked, but instead will create the "value" segment, just as it would have done had the "value" segment not been defined. Additional initialization steps, for example, setting the dimensionality of the "value" segment, can be easily added to the handler after the internal create call.

If a handler function for a particular action is not provided, then data services will behave as if the segment has never been defined.

This segment definition can be undefined with the kdms_undefine_segment call.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$DATASERV/objects/library/kdataman/src/segue.c

SEE ALSO

kdataman(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.