BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

karray_insert - insert an entry into an array

LIBRARY CALL

<type> *karray_insert(
  <type> *array,
   int    type,
  <type>  entry,
   size_t num,
   int    position,
   int    duplicates)

INPUT

OUTPUT

none

RETURN VALUE

The head of the modified array

DESCRIPTION

Inserts an entry into the array at the specified position, and returns the modified array to the calling routine.

The array utilities, including karray_insert(), support arrays of a variety of data types. The data type of the array being used is specified with the 'type' parameter; supported data types include:

KBYTE - array of characters KUBYTE - array of unsigned characters KSHORT - array of short integers KUSHORT - array of unsigned short integers KINT - array of integers KUINT - array of unsigned integers KLONG - array of long integers KULONG - array of unsigned long integers KFLOAT - array of floating point numbers KDOUBLE - array of double precision numbers KSTRING - array of strings KSTRUCT - array of pointers to structures KLOGICAL - array of TRUE/FALSE values

Note that the array and the entry passed in MUST both be of the type specified by the type parameter, or the results of this routine are unpredictable.

The position parameter indicates where in the array an entry should be inserted. Supported positions include:

KLIST_HEAD - insert entry at the head of the array KLIST_PREV - insert entry just before current position KLIST_NEXT - insert entry just after current position KLIST_TAIL - insert entry at the end of the array

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$BOOTSTRAP/objects/library/kutils/src/array.c

SEE ALSO

kutils(3)

COPYRIGHT

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