1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1999 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 /*
28  * Utils.xs contains XS wrappers for utility functions needed initially by
29  * Sun::Solaris::Kstat, but that should prove generally useful as well.
30  */
31 
32 /* Solaris includes */
33 #include <libgen.h>
34 #include <libintl.h>
35 
36 /* Perl XS includes */
37 #include "EXTERN.h"
38 #include "perl.h"
39 #include "XSUB.h"
40 
41 /*
42  * The XS code exported to perl is below here.  Note that the XS preprocessor
43  * has its own commenting syntax, so all comments from this point on are in
44  * that form.
45  */
46 
47 MODULE = Sun::Solaris::Utils PACKAGE = Sun::Solaris::Utils
48 PROTOTYPES: ENABLE
49 
50  #
51  # See gmatch(3GEN)
52  #
53 
54 int
55 gmatch(str, pattern)
56 	char *str;
57 	char *pattern;
58 
59  #
60  # See gettext(3C)
61  #
62 
63 char *
64 gettext(msgid)
65 	char *msgid
66 
67  #
68  # See dcgettext(3C)
69  #
70 
71 char *
72 dcgettext(domainname, msgid, category)
73 	char *domainname
74 	char *msgid
75 	int  category
76 
77  #
78  # See dgettext(3C)
79  #
80 
81 char *
82 dgettext(domainname, msgid)
83 	char *domainname
84 	char *msgid
85 
86  #
87  # See textdomain(3C)
88  #
89 
90 char *
91 textdomain(domain)
92 	char *domain
93 
94  #
95  # See bindtextdomain(3C)
96  #
97 
98 char *
99 bindtextdomain(domain, dirname)
100 	char *domain
101 	char *dirname
102