BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

karray_merge - merge two arrays into one

LIBRARY CALL

<type> *karray_merge(
  <type> *array1,
  <type> *array2,
  int     type,
  size_t  num1,
  size_t  num2,
  int     copy_entries)

INPUT

OUTPUT

none

RETURN VALUE

A pointer to the merged array on success, NULL on failure.

DESCRIPTION

Merges two arrays into a single array by concatenating the second array onto the first.

The array utilities, including karray_merge(), 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

For string arrays ('type' == KSTRING), strings in the merged array are only copied if the 'copy_entries' parameter is passed as TRUE. Otherwise, each entry in the merged array will simply point to the old string.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

Allocates memory for the merged array

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.