1 /* $XConsortium: utility.c /main/4 1995/11/09 12:54:25 rswiston $ */
3 * (c) Copyright 1993, 1994 Hewlett-Packard Company
4 * (c) Copyright 1993, 1994 International Business Machines Corp.
5 * (c) Copyright 1993, 1994 Novell, Inc.
6 * (c) Copyright 1993, 1994 Sun Microsystems, Inc.
14 #if defined(SunOS) || defined(USL) || defined(__uxp__)
16 #include <sys/systeminfo.h>
22 extern char * strdup(const char *);
25 * calendar_name@host[.domain] -> calendar_name
28 _DtCmsTarget2Name(char *target)
30 return(_DtCmGetPrefix(target, '@'));
34 * calendar_name@host[.domain] -> host[.domain]
37 _DtCmsTarget2Location(char *target)
44 if (ptr = strchr(target, '@')) {
45 return (strdup(++ptr));
51 * calendar_name@host[.domain] -> host
54 _DtCmsTarget2Host(char *target)
56 char *location, *host;
58 if ((location = _DtCmsTarget2Location(target)) != NULL) {
59 host = _DtCmGetPrefix(location, '.');
67 * calendar_name@host[.domain] -> domain
70 _DtCmsTarget2Domain(char *target)
72 char *location, *domain, *ptr;
74 if ((location = _DtCmsTarget2Location(target)) != NULL) {
75 if (ptr = strchr(location, '.'))
76 domain = strdup(++ptr);