BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kfile_seddata - string edit from one transport to another

LIBRARY CALL

int kfile_seddata(
   int id1,
   int id2,
   kvalist)

INPUT

OUTPUT

none

RETURN VALUE

TRUE (1) on success, FALSE (0) otherwise

DESCRIPTION

This routine takes two transport id's, and copies the data from the source file to the destination file. It also uses a variable argument list of strings pairs, where each pair indication a search pattern and a replacement pattern. This list will be used to replace strings in pattern strings in the input transport with the corresponding replacement pattern. Note, the variable argument list MUST be terminated with a NULL in one of the search pattern slots

For example, the following is a correct termination:

kfile_seddata(id1, id2, "t1", "t2", FALSE, NULL);

And this is an incorrect termination:

kfile_seddata(id1, id2, "t1", NULL);

And this is an incorrect termination:

kfile_seddata(id1, id2, "t1", NULL, FALSE);

The reason the NULL must be on the search pattern, is so that NULL can be sent in as the replacement string. The replacement mechanism is kstring_replace, and its documentation explains restrictions on search strings and replace strings.

The regex parameter is used to indicate whether the search and replacement parameters are specified in regular expression form, or are just simply string replacement patterns. For more information about regular expressions please see the khoros string parsing section of the Khoros Programmers Manual.

kfile_seddata does not support the "mode" operation as used by ksedfile(). The mode operation is used to how the data should be updated, but it relies on the ability to read as well as write to the destination id (id2).

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

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

SEE ALSO

kutils(3)

COPYRIGHT

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