NAME

catgen_fixservice - split a service-version string

SYNOPSIS

#include <cat/gen.h>

int catgen_fixservice(char *service, char **version);

DESCRIPTION

This function splits a string, with the format service-version, into a service and a version. The split is achieved by pointing the version argument at the first character after the last dash and terminating the service string there.

The function returns the length of the service string.

EXAMPLE

The following call:

  int i;
  char *ver;
  char serv[] = "ora-ps-5.0";
  i = catgen_fixservice(serv, &ver);

will set the ver pointer to ``5.0'' and will NUL-terminate the name, making serv point to ``ora-ps''. The value of i will be 6.

SEE ALSO

cat, catgen, catinfo

catgen_getint, catgen_infopath, catgen_newnode, catgen_servicepath, catgen_set