--- a/usr/src/Makefile.env Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/Makefile.env Wed Feb 01 09:22:41 2012 -0500
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
#
@@ -122,7 +122,7 @@
# Consumers must depend on java (or java/adr)
ADRLOC=$(SRC)/java/adr/adr.jar
-ADRGEN=$(JAVA) -classpath $(ADRLOC) org.opensolaris.os.adr.adrgen.ADRGen
+RADADRGEN=$(JAVA) -classpath $(ADRLOC) org.opensolaris.os.adr.adrgen.RadADRGen
# Lint
LINTFLAGS = -s -errtags=yes -errsecurity=core -errwarn=%all
--- a/usr/src/Makefile.targ Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/Makefile.targ Wed Feb 01 09:22:41 2012 -0500
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
#
@@ -91,10 +91,10 @@
$(LINT.c) -mnuvxy -o $(LIBNAME) $(LINTSRCS) > $(LINTOUT) 2>&1
api_%.h api_%_impl.c: $(SRC)/apis/%.xml
- $(ADRGEN) -crm $(ADROPTS) $<
+ $(RADADRGEN) -crm $(ADROPTS) $<
api_%.h api_%_impl.c: %.xml
- $(ADRGEN) -crm $(ADROPTS) $<
+ $(RADADRGEN) -crm $(ADROPTS) $<
.c.o:
$(COMPILE.c) $(OUTPUT_OPTION) $< $(CTFCONVERT_HOOK)
--- a/usr/src/cmd/radcli/Makefile Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/cmd/radcli/Makefile Wed Feb 01 09:22:41 2012 -0500
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
include $(SRC)/Makefile.env
@@ -64,9 +64,9 @@
$(ADR_SRCS): $(ADRLOC)
api_%.h api_%_impl.c: $(SRC)/apis/%.xml
- $(ADRGEN) -c $<
+ $(RADADRGEN) -c $<
api_%.h api_%_impl.c: %.xml
- $(ADRGEN) -c $<
+ $(RADADRGEN) -c $<
include $(SRC)/Makefile.targ
--- a/usr/src/doc/manpage/Makefile Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/manpage/Makefile Wed Feb 01 09:22:41 2012 -0500
@@ -20,12 +20,12 @@
#
#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
include ../Makefile.doc
-MANPAGES_1 = adrgen.1 vp.1
+MANPAGES_1 = radadrgen.1 vp.1
MANPAGES_1m = rad.1m
MANPAGES = $(MANPAGES_1) $(MANPAGES_1m)
CLOBBER_FILES += $(MANPAGES)
--- a/usr/src/doc/manpage/man-adrgen.xml Tue Jan 24 18:01:02 2012 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,155 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<!--
- PDL HEADER START
-
- Public Documentation License Notice
-
- The contents of this Documentation are subject to the Public
- Documentation License Version 1.01 (the "License"); you may only
- use this Documentation if you comply with the terms of this License.
- A copy of the License is available at
- http://www.opensolaris.org/os/community/documentation/license.
-
- PDL HEADER END
-
- Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
--->
-
-<refentry id="man.adrgen">
- <refentryinfo>
- <date>April 12, 2010</date>
- <productname>SunOS</productname>
- <productnumber>5.11</productnumber>
- </refentryinfo>
-
- <refmeta>
- <refentrytitle>adrgen</refentrytitle>
- <manvolnum>1</manvolnum>
- <refmiscinfo class="manual">User Commands</refmiscinfo>
- </refmeta>
-
- <refnamediv>
- <refname>adrgen</refname>
- <refpurpose>ADR code generator</refpurpose>
- </refnamediv>
-
- <refsynopsisdiv>
- <cmdsynopsis>
- <command>/usr/bin/adrgen</command>
- <arg choice="opt">
- <option>-c</option>
- <arg choice="opt">
- <option>-r</option>
- <arg choice="opt"><option>-s</option></arg>
- </arg>
- </arg>
- <arg choice="opt">
- <option>-j</option> <replaceable>dir</replaceable>
- <arg choice="opt"><option>-i</option></arg>
- </arg>
- <arg choice="opt">
- <option>-d</option> <replaceable>baseline.xml</replaceable>
- </arg>
- <arg choice="req"><replaceable>spec.xml</replaceable></arg>
- </cmdsynopsis>
- </refsynopsisdiv>
-
- <refsection><title>Description</title>
- <para>
- <command>adrgen</command> is the <acronym>ADR</acronym>
- <acronym>IDL</acronym> processing tool. Its primary
- purpose is to generate <acronym>API</acronym>-specific
- language bindings for the <command>rad</command> server and
- the various <command>rad</command> client environments.
- It can also audit changes to interfaces for consistency
- with their versions.
- <!--
- It can also generate documentation, and can audit changes
- to interfaces for consistency with their versions.
- -->
- </para>
- </refsection>
-
- <refsection><title>Options</title>
- <para>
- The following options are available for use on the command
- line:
-
- <variablelist>
-
- <varlistentry>
- <term><option>-c</option></term>
- <listitem><para>
- Generate C definitions for the types and APIs defined in
- the input file.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-r</option></term>
- <listitem><para>
- Generate C server-side definitions that reference entry
- points using the prescribed entry-point naming scheme.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-s</option></term>
- <listitem><para>
- Generate C stubs for entry points referenced by the
- defintions created by the <option>-r</option> option.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-j</option> <replaceable>dir</replaceable></term>
- <listitem><para>
- Generate Java interfaces for the types and APIs defined in
- the input file. The Java source tree will be created under
- <replaceable>dir</replaceable>.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-i</option></term>
- <listitem><para>
- Generate concrete implementation classes for all interfaces
- generated by the <option>-j</option> option.
- </para></listitem>
- </varlistentry>
-
- <varlistentry>
- <term><option>-d</option>
- <replaceable>baseline.xml</replaceable></term>
- <listitem><para>
- Compare the interfaces defined by <replaceable>baseline.xml
- </replaceable> and <replaceable>spec.xml</replaceable> and
- verify that the version of the modified interface is consistent
- with the differences found. An error message is displayed if
- the versions are inconsistent.
- </para></listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsection>
-
- <refsection><title>Operands</title>
- <para>
- The following operand must be specified on the command line:
-
- <variablelist>
-
- <varlistentry>
- <term><replaceable>spec.xml</replaceable></term>
- <listitem><para>
- The path to the ADR specification for which type and API
- definitions must be generated.
- </para></listitem>
- </varlistentry>
-
- </variablelist>
- </para>
- </refsection>
-</refentry>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/doc/manpage/man-radadrgen.xml Wed Feb 01 09:22:41 2012 -0500
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!--
+ PDL HEADER START
+
+ Public Documentation License Notice
+
+ The contents of this Documentation are subject to the Public
+ Documentation License Version 1.01 (the "License"); you may only
+ use this Documentation if you comply with the terms of this License.
+ A copy of the License is available at
+ http://www.opensolaris.org/os/community/documentation/license.
+
+ PDL HEADER END
+
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+-->
+
+<refentry id="man.radadrgen">
+ <refentryinfo>
+ <date>April 12, 2010</date>
+ <productname>SunOS</productname>
+ <productnumber>5.11</productnumber>
+ </refentryinfo>
+
+ <refmeta>
+ <refentrytitle>radadrgen</refentrytitle>
+ <manvolnum>1</manvolnum>
+ <refmiscinfo class="manual">User Commands</refmiscinfo>
+ </refmeta>
+
+ <refnamediv>
+ <refname>radadrgen</refname>
+ <refpurpose>ADR code generator</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>/usr/bin/radadrgen</command>
+ <arg choice="opt">
+ <option>-c</option>
+ <arg choice="opt">
+ <option>-r</option>
+ <arg choice="opt"><option>-s</option></arg>
+ </arg>
+ </arg>
+ <arg choice="opt">
+ <option>-j</option> <replaceable>dir</replaceable>
+ <arg choice="opt"><option>-i</option></arg>
+ </arg>
+ <arg choice="opt">
+ <option>-d</option> <replaceable>baseline.xml</replaceable>
+ </arg>
+ <arg choice="req"><replaceable>spec.xml</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <refsection><title>Description</title>
+ <para>
+ <command>radadrgen</command> is the <acronym>ADR</acronym>
+ <acronym>IDL</acronym> processing tool. Its primary
+ purpose is to generate <acronym>API</acronym>-specific
+ language bindings for the <command>rad</command> server and
+ the various <command>rad</command> client environments.
+ It can also audit changes to interfaces for consistency
+ with their versions.
+ <!--
+ It can also generate documentation, and can audit changes
+ to interfaces for consistency with their versions.
+ -->
+ </para>
+ </refsection>
+
+ <refsection><title>Options</title>
+ <para>
+ The following options are available for use on the command
+ line:
+
+ <variablelist>
+
+ <varlistentry>
+ <term><option>-c</option></term>
+ <listitem><para>
+ Generate C definitions for the types and APIs defined in
+ the input file.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-r</option></term>
+ <listitem><para>
+ Generate C server-side definitions that reference entry
+ points using the prescribed entry-point naming scheme.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-s</option></term>
+ <listitem><para>
+ Generate C stubs for entry points referenced by the
+ defintions created by the <option>-r</option> option.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-j</option> <replaceable>dir</replaceable></term>
+ <listitem><para>
+ Generate Java interfaces for the types and APIs defined in
+ the input file. The Java source tree will be created under
+ <replaceable>dir</replaceable>.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-i</option></term>
+ <listitem><para>
+ Generate concrete implementation classes for all interfaces
+ generated by the <option>-j</option> option.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-d</option>
+ <replaceable>baseline.xml</replaceable></term>
+ <listitem><para>
+ Compare the interfaces defined by <replaceable>baseline.xml
+ </replaceable> and <replaceable>spec.xml</replaceable> and
+ verify that the version of the modified interface is consistent
+ with the differences found. An error message is displayed if
+ the versions are inconsistent.
+ </para></listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsection>
+
+ <refsection><title>Operands</title>
+ <para>
+ The following operand must be specified on the command line:
+
+ <variablelist>
+
+ <varlistentry>
+ <term><replaceable>spec.xml</replaceable></term>
+ <listitem><para>
+ The path to the ADR specification for which type and API
+ definitions must be generated.
+ </para></listitem>
+ </varlistentry>
+
+ </variablelist>
+ </para>
+ </refsection>
+</refentry>
--- a/usr/src/doc/rad-dev/Makefile Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/Makefile Wed Feb 01 09:22:41 2012 -0500
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
include ../Makefile.doc
@@ -48,7 +48,7 @@
all: html
examples:
- $(ADRGEN) -c example.xml
+ $(RADADRGEN) -c example.xml
docbook: examples $(PROC)
--- a/usr/src/doc/rad-dev/a-logistics.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/a-logistics.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<appendix><title><command>rad</command> development</title>
@@ -117,8 +117,8 @@
usr/src/java/adr
</filename></term>
<listitem><para>
-The source code for <command>adrgen</command> and a common set of
-<acronym>ADR</acronym> classes used by <command>adrgen</command> and
+The source code for <command>radadrgen</command> and a common set of
+<acronym>ADR</acronym> classes used by <command>radadrgen</command> and
the Java client.
</para></listitem>
</varlistentry>
--- a/usr/src/doc/rad-dev/c-adr-adrgen.xml Tue Jan 24 18:01:02 2012 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<!--
- PDL HEADER START
-
- Public Documentation License Notice
-
- The contents of this Documentation are subject to the Public
- Documentation License Version 1.01 (the "License"); you may only
- use this Documentation if you comply with the terms of this License.
- A copy of the License is available at
- http://www.opensolaris.org/os/community/documentation/license.
-
- PDL HEADER END
-
- Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
--->
-
-<section xmlns:xi="http://www.w3.org/2001/XInclude">
-<title><command>adrgen</command></title>
-
-<para>
-<command>adrgen</command> is the <acronym>ADR</acronym>
-<acronym>IDL</acronym> processing tool. Its primary purpose is to
-generate <acronym>API</acronym>-specific language bindings for the
-<command>rad</command> server and various client environments. It can
-also generate documentation, and can audit changes to interfaces for
-consistency with their versions. See the <command>adrgen</command> man
-page (<xref linkend="man.adrgen" />) for details on all its options.
-</para>
-
- <section><title>Code generation</title>
- <para>
- Generated code is a double-edged sword. On the one hand, it can
- provide an interface to a foreign system that acts like a natural
- part of the consumer's programming environment. On the other it
- can introduce a complex maintenance burden if the generated code is
- flawed, constrains how its consumers are implemented (e.g. if the
- generated code is unsafe to use in a threaded environment), or
- otherwise needs modifications before it can be used in the
- consumer's environment.
- </para>
-
- <para>
- Because the <command>rad</command> server has complete knowledge of
- the <acronym>API</acronym>s and data types used, and that knowledge
- is explicitly shared with clients, it is possible for any client to
- be written to manipulate those data types and communicate with the
- server without the need for generated code. However, the
- convenience of language-native interfaces non-negligibly increases
- developer productivity, their nature improves interoperability, and
- the ability for the compiler to perform additional type checking
- makes the resulting product more robust. For these reasons we
- support generating code for the C and Java environments.
- </para>
-
- <para>
- <command>adrgen</command> needs to generate code for two contexts.
- The first is a generic definitions-only context — perhaps
- easiest to think of as a <quote>client</quote> context —
- where only the code needed to manipulate datatypes and
- <acronym>API</acronym>s is created. The second is a
- <command>rad</command>-specific context that, in addition to the
- definitions generated in the generic context, generates server
- definitions that include references to functions that form the
- <emphasis>implementation</emphasis> of the
- <acronym>API</acronym>s.
- </para>
- </section>
-
- <!--
- <section><title>Interface auditing</title>
- </section>
- -->
-</section>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/doc/rad-dev/c-adr-radadrgen.xml Wed Feb 01 09:22:41 2012 -0500
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!--
+ PDL HEADER START
+
+ Public Documentation License Notice
+
+ The contents of this Documentation are subject to the Public
+ Documentation License Version 1.01 (the "License"); you may only
+ use this Documentation if you comply with the terms of this License.
+ A copy of the License is available at
+ http://www.opensolaris.org/os/community/documentation/license.
+
+ PDL HEADER END
+
+ Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+-->
+
+<section xmlns:xi="http://www.w3.org/2001/XInclude">
+<title><command>radadrgen</command></title>
+
+<para>
+<command>radadrgen</command> is the <acronym>ADR</acronym>
+<acronym>IDL</acronym> processing tool. Its primary purpose is to
+generate <acronym>API</acronym>-specific language bindings for the
+<command>rad</command> server and various client environments. It can
+also generate documentation, and can audit changes to interfaces for
+consistency with their versions. See the <command>radadrgen</command> man
+page (<xref linkend="man.radadrgen" />) for details on all its options.
+</para>
+
+ <section><title>Code generation</title>
+ <para>
+ Generated code is a double-edged sword. On the one hand, it can
+ provide an interface to a foreign system that acts like a natural
+ part of the consumer's programming environment. On the other it
+ can introduce a complex maintenance burden if the generated code is
+ flawed, constrains how its consumers are implemented (e.g. if the
+ generated code is unsafe to use in a threaded environment), or
+ otherwise needs modifications before it can be used in the
+ consumer's environment.
+ </para>
+
+ <para>
+ Because the <command>rad</command> server has complete knowledge of
+ the <acronym>API</acronym>s and data types used, and that knowledge
+ is explicitly shared with clients, it is possible for any client to
+ be written to manipulate those data types and communicate with the
+ server without the need for generated code. However, the
+ convenience of language-native interfaces non-negligibly increases
+ developer productivity, their nature improves interoperability, and
+ the ability for the compiler to perform additional type checking
+ makes the resulting product more robust. For these reasons we
+ support generating code for the C and Java environments.
+ </para>
+
+ <para>
+ <command>radadrgen</command> needs to generate code for two contexts.
+ The first is a generic definitions-only context — perhaps
+ easiest to think of as a <quote>client</quote> context —
+ where only the code needed to manipulate datatypes and
+ <acronym>API</acronym>s is created. The second is a
+ <command>rad</command>-specific context that, in addition to the
+ definitions generated in the generic context, generates server
+ definitions that include references to functions that form the
+ <emphasis>implementation</emphasis> of the
+ <acronym>API</acronym>s.
+ </para>
+ </section>
+
+ <!--
+ <section><title>Interface auditing</title>
+ </section>
+ -->
+</section>
--- a/usr/src/doc/rad-dev/c-adr.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/c-adr.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<chapter xmlns:xi="http://www.w3.org/2001/XInclude">
@@ -31,6 +31,6 @@
</para>
<xi:include href="c-adr-idl.xml" />
-<xi:include href="c-adr-adrgen.xml" />
+<xi:include href="c-adr-radadrgen.xml" />
</chapter>
--- a/usr/src/doc/rad-dev/c-client-java.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/c-client-java.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<section><title>Java/JMX Client</title>
@@ -21,7 +21,7 @@
<!-- Files -->
<!-- Java Packages -->
<!-- JMXServiceURL formats -->
-<!-- adrgen usage -->
+<!-- radadrgen usage -->
<!-- Using interfaces -->
<!-- - Standard usage -->
<!-- - Caveats -->
@@ -38,7 +38,7 @@
<!--
<para>
When generating code for the <acronym>JMX</acronym> client (the
- <option>-j</option> option), <command>adrgen</command> normally
+ <option>-j</option> option), <command>radadrgen</command> normally
produces an MXBean interface for the <acronym>API</acronym>s
defined in the <acronym>ADR</acronym> input, and reconstructable
interfaces for the types referred to by the
--- a/usr/src/doc/rad-dev/c-intro.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/c-intro.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<chapter><title>Introduction</title>
@@ -129,7 +129,7 @@
<listitem><para>
<acronym>XML</acronym>-based <acronym>IDL</acronym>
<acronym>ADR</acronym> supports formally defining interfaces.
- <acronym>IDL</acronym> compiler <command>adrgen</command> generates
+ <acronym>IDL</acronym> compiler <command>radadrgen</command> generates
code and analyzes compatibility of interface changes.
</para></listitem>
</itemizedlist></listitem>
@@ -181,7 +181,7 @@
interfaces as Open MBeans to Java clients.
</para></listitem>
<listitem><para>
- <command>adrgen</command> can auto-generate MXBean interfaces for
+ <command>radadrgen</command> can auto-generate MXBean interfaces for
use by <acronym>JMX</acronym> consumers. Can also generate basic
concrete subclasses.
</para></listitem>
@@ -205,7 +205,7 @@
content.
</para></listitem>
<listitem><para>
- <command>adrgen</command> can generate server-side type definitions
+ <command>radadrgen</command> can generate server-side type definitions
and stubs from <acronym>IDL</acronym> input.
</para></listitem>
<listitem><para>
--- a/usr/src/doc/rad-dev/c-libadr-adrgen.xml Tue Jan 24 18:01:02 2012 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
-<!--
- PDL HEADER START
-
- Public Documentation License Notice
-
- The contents of this Documentation are subject to the Public
- Documentation License Version 1.01 (the "License"); you may only
- use this Documentation if you comply with the terms of this License.
- A copy of the License is available at
- http://www.opensolaris.org/os/community/documentation/license.
-
- PDL HEADER END
-
- Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
--->
-
-<section xmlns:xi="http://www.w3.org/2001/XInclude">
-<title><command>adrgen</command>-generated definitions</title>
-<para>
-Whether you are using <filename class='libraryfile'>libadr</filename>
-in a C-based client or as part of writing a <command>rad</command>
-server module, you will need to understand the data definitions
-generated by <command>adrgen</command>. Fortunately, the definitions
-are the same in both environments.
-</para>
-
- <section><title>Running <command>adrgen</command></title>
- <para>
- <command>adrgen</command> is instructed to produce definitions for
- C/<filename class='libraryfile'>libadr</filename> consumers by
- using its <option>-c</option> option. e.g.
- </para>
-
-<example><title>Invoking <command>adrgen</command></title>
-<programlisting>
-$ adrgen -c example.xml
-</programlisting>
-</example>
-
- <para>
- The <option>-c</option> option produces two files,
- <filename>api_INTERFACE.h</filename> and
- <filename>api_INTERFACE_impl.c</filename>, where INTERFACE is the
- value of the <sgmltag class='attribute'>name</sgmltag> attribute of
- the interface document's <sgmltag
- class='element'>interface</sgmltag> element.
- <filename>api_INTERFACE_impl.c</filename> contains the
- implementation of the <acronym>API</acronym>s and data types
- defined by the interface description. It should be compiled and
- linked with the software needing those definitions.
- <filename>api_INTERFACE.h</filename> externs the specific symbols
- defined by <filename>api_INTERFACE_impl.c</filename> that consumers
- will need to reference, and should be #included by those
- consumers. <filename>api_INTERFACE.h</filename> contains no data
- definitions itself and may be included in as many places as
- necessary. The definitions
- <filename>api_INTERFACE_impl.c</filename> are 100% data and are
- statically initialized. There are no initialization functions to
- be called. Neither file should be modified.
- </para>
-
- <para>
- For each derived type TYPE (be it <type>enumeration</type> or
- <type>structure</type>) defined in the interface description, a
- <type>type_t</type> named <symbol>t__TYPE</symbol> (two
- underscores) representing that type is generated and externed by
- the header file. If an array of that type is used anywhere in the
- interface definition, a <type>type_t</type> named
- <symbol>t_array__TYPE</symbol> (one underscore, two underscores)
- representing that array type is generated and externed. For each
- <acronym>API</acronym> APINAME defined in the file, an
- <type>adr_object_t</type> named <symbol>api_APINAME</symbol> is
- defined and externed.
- </para>
-
- <para>
- For each value VALUE of an <type>enumeration</type> named TYPE, a
- <type>data_t</type> named <symbol>e__TYPE_VALUE</symbol> is defined
- and externed. These <type>data_t</type>s are marked as constants
- and are not affected by <function>data_ref</function> or
- <function>data_free</function>.
- </para>
- </section>
-
- <section><title>Example <command>adrgen</command> output</title>
- <para>
- When we run <command>adrgen</command> on the example given in the
- <acronym>ADR</acronym> chapter (see <xref linkend="adr.idl.example"
- />), we get two files. One,
- <filename>api_example_impl.c</filename>, holds the implementation
- of the GrabBag <acronym>API</acronym> and data types it depends on,
- and should be simply be compiled and linked with the GrabBag
- consumer. The other, <filename>api_example.h</filename>, exposes
- only the relevant symbols defined by
- <filename>api_example_impl.c</filename> and should be included by
- consumers of the <type>GrabBag</type> <acronym>API</acronym> and
- its related types:
- </para>
-
-<example>
-<title>Sample <command>adrgen</command>-generated C header file</title>
-<programlisting>
-<xi:include parse="text" href="api_example.h" />
-</programlisting>
-</example>
-
- <para>
- Though the function of <symbol>api_GrabBag</symbol> won't be
- discussed until the chapters on <command>rad</command> client
- programming and module development, the purpose of the other
- definitions in this file should be clear. A consumer needing to
- create a <type>MoodStatus</type> structure indicating the
- <symbol>mood</symbol> is <constant>IRREVERENT</constant> and has
- changed would do the following:
- </para>
-
-<example>
-<title>Consuming <command>adrgen</command>-generated definitions</title>
-<programlisting><![CDATA[
-status = data_new_struct(&t__MoodStatus);
-struct_set(status, "mood", e__Mood_IRREVERENT);
-/* struct_set(status, "mood", data_new_enum_byname(&t__Mood, "IRREVERENT")); */
-struct_set(status, "changed", data_new_boolean(B_TRUE));
-
-if (!data_verify(struct, NULL, B_TRUE)) {
- ...
-]]></programlisting>
-</example>
-
- <para>
- In addition to showing how to use the type definitions, this also
- illustrates the multiple ways of referencing an enumerated value.
- Using the defined symbols, as implemented above, is faster and can
- be checked by the compiler. The commented out line uses
- <function>data_new_enum_byname</function> which offers flexibility
- that could be useful in some situations but necessarily defers
- error checking until runtime. e.g. if the programmer mistyped the
- value <quote>IRREVERENT</quote> it wouldn't be detected until the
- code was run (if they were fortunate, in testing). Obviously, it
- is preferable to use the enumerated value symbols when possible.
- </para>
- </section>
-
-</section>
--- a/usr/src/doc/rad-dev/c-libadr-data.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/c-libadr-data.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<section><title>Data management</title>
@@ -90,7 +90,7 @@
them from being dynamically allocated, at the moment the only
supported way of defining a <type>type_t</type> is to generate a
definition using the <acronym>ADR</acronym> <acronym>IDL</acronym>
- and <command>adrgen</command>.
+ and <command>radadrgen</command>.
</para>
</section>
@@ -525,7 +525,7 @@
<para>
It is the very nature of an <type>enumeration</type> that all
possible values are known. Enumerated types generated by
- <command>adrgen</command> have singleton <type>data_t</type>s that
+ <command>radadrgen</command> have singleton <type>data_t</type>s that
will be returned by <function>data_new_enum</function> and
<function>data_new_enum_byname</function>. For efficiency and to
reduce the error handling that needs to be performed at run-time,
--- a/usr/src/doc/rad-dev/c-libadr-object.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/c-libadr-object.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<section><title><acronym>API</acronym> management</title>
@@ -24,7 +24,7 @@
<acronym>API</acronym> is a complex task; for the time being the only
supported way to define an <acronym>API</acronym> is to do so in the
<acronym>ADR</acronym> <acronym>IDL</acronym> and to generate the
-definition using <command>adrgen</command>.
+definition using <command>radadrgen</command>.
</para>
<para>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/doc/rad-dev/c-libadr-radadrgen.xml Wed Feb 01 09:22:41 2012 -0500
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+<!--
+ PDL HEADER START
+
+ Public Documentation License Notice
+
+ The contents of this Documentation are subject to the Public
+ Documentation License Version 1.01 (the "License"); you may only
+ use this Documentation if you comply with the terms of this License.
+ A copy of the License is available at
+ http://www.opensolaris.org/os/community/documentation/license.
+
+ PDL HEADER END
+
+ Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+-->
+
+<section xmlns:xi="http://www.w3.org/2001/XInclude">
+<title><command>radadrgen</command>-generated definitions</title>
+<para>
+Whether you are using <filename class='libraryfile'>libadr</filename>
+in a C-based client or as part of writing a <command>rad</command>
+server module, you will need to understand the data definitions
+generated by <command>radadrgen</command>. Fortunately, the definitions
+are the same in both environments.
+</para>
+
+ <section><title>Running <command>radadrgen</command></title>
+ <para>
+ <command>radadrgen</command> is instructed to produce definitions for
+ C/<filename class='libraryfile'>libadr</filename> consumers by
+ using its <option>-c</option> option. e.g.
+ </para>
+
+<example><title>Invoking <command>radadrgen</command></title>
+<programlisting>
+$ radadrgen -c example.xml
+</programlisting>
+</example>
+
+ <para>
+ The <option>-c</option> option produces two files,
+ <filename>api_INTERFACE.h</filename> and
+ <filename>api_INTERFACE_impl.c</filename>, where INTERFACE is the
+ value of the <sgmltag class='attribute'>name</sgmltag> attribute of
+ the interface document's <sgmltag
+ class='element'>interface</sgmltag> element.
+ <filename>api_INTERFACE_impl.c</filename> contains the
+ implementation of the <acronym>API</acronym>s and data types
+ defined by the interface description. It should be compiled and
+ linked with the software needing those definitions.
+ <filename>api_INTERFACE.h</filename> externs the specific symbols
+ defined by <filename>api_INTERFACE_impl.c</filename> that consumers
+ will need to reference, and should be #included by those
+ consumers. <filename>api_INTERFACE.h</filename> contains no data
+ definitions itself and may be included in as many places as
+ necessary. The definitions
+ <filename>api_INTERFACE_impl.c</filename> are 100% data and are
+ statically initialized. There are no initialization functions to
+ be called. Neither file should be modified.
+ </para>
+
+ <para>
+ For each derived type TYPE (be it <type>enumeration</type> or
+ <type>structure</type>) defined in the interface description, a
+ <type>type_t</type> named <symbol>t__TYPE</symbol> (two
+ underscores) representing that type is generated and externed by
+ the header file. If an array of that type is used anywhere in the
+ interface definition, a <type>type_t</type> named
+ <symbol>t_array__TYPE</symbol> (one underscore, two underscores)
+ representing that array type is generated and externed. For each
+ <acronym>API</acronym> APINAME defined in the file, an
+ <type>adr_object_t</type> named <symbol>api_APINAME</symbol> is
+ defined and externed.
+ </para>
+
+ <para>
+ For each value VALUE of an <type>enumeration</type> named TYPE, a
+ <type>data_t</type> named <symbol>e__TYPE_VALUE</symbol> is defined
+ and externed. These <type>data_t</type>s are marked as constants
+ and are not affected by <function>data_ref</function> or
+ <function>data_free</function>.
+ </para>
+ </section>
+
+ <section><title>Example <command>radadrgen</command> output</title>
+ <para>
+ When we run <command>radadrgen</command> on the example given in the
+ <acronym>ADR</acronym> chapter (see <xref linkend="adr.idl.example"
+ />), we get two files. One,
+ <filename>api_example_impl.c</filename>, holds the implementation
+ of the GrabBag <acronym>API</acronym> and data types it depends on,
+ and should be simply be compiled and linked with the GrabBag
+ consumer. The other, <filename>api_example.h</filename>, exposes
+ only the relevant symbols defined by
+ <filename>api_example_impl.c</filename> and should be included by
+ consumers of the <type>GrabBag</type> <acronym>API</acronym> and
+ its related types:
+ </para>
+
+<example>
+<title>Sample <command>radadrgen</command>-generated C header file</title>
+<programlisting>
+<xi:include parse="text" href="api_example.h" />
+</programlisting>
+</example>
+
+ <para>
+ Though the function of <symbol>api_GrabBag</symbol> won't be
+ discussed until the chapters on <command>rad</command> client
+ programming and module development, the purpose of the other
+ definitions in this file should be clear. A consumer needing to
+ create a <type>MoodStatus</type> structure indicating the
+ <symbol>mood</symbol> is <constant>IRREVERENT</constant> and has
+ changed would do the following:
+ </para>
+
+<example>
+<title>Consuming <command>radadrgen</command>-generated definitions</title>
+<programlisting><![CDATA[
+status = data_new_struct(&t__MoodStatus);
+struct_set(status, "mood", e__Mood_IRREVERENT);
+/* struct_set(status, "mood", data_new_enum_byname(&t__Mood, "IRREVERENT")); */
+struct_set(status, "changed", data_new_boolean(B_TRUE));
+
+if (!data_verify(struct, NULL, B_TRUE)) {
+ ...
+]]></programlisting>
+</example>
+
+ <para>
+ In addition to showing how to use the type definitions, this also
+ illustrates the multiple ways of referencing an enumerated value.
+ Using the defined symbols, as implemented above, is faster and can
+ be checked by the compiler. The commented out line uses
+ <function>data_new_enum_byname</function> which offers flexibility
+ that could be useful in some situations but necessarily defers
+ error checking until runtime. e.g. if the programmer mistyped the
+ value <quote>IRREVERENT</quote> it wouldn't be detected until the
+ code was run (if they were fortunate, in testing). Obviously, it
+ is preferable to use the enumerated value symbols when possible.
+ </para>
+ </section>
+
+</section>
--- a/usr/src/doc/rad-dev/c-libadr.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/c-libadr.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<chapter xmlns:xi="http://www.w3.org/2001/XInclude">
@@ -22,7 +22,7 @@
<para>
The library <filename class='libraryfile'>libadr</filename> provides
structure definitions and subroutines essential to C programs using
-<acronym>ADR</acronym>. Code generated by <command>adrgen</command>
+<acronym>ADR</acronym>. Code generated by <command>radadrgen</command>
requires this library, and <command>rad</command> itself is based on
it. <filename class='libraryfile'>libadr</filename> contains three
major areas of functionality: data management, <acronym>API</acronym>
@@ -39,6 +39,6 @@
<xi:include href="c-libadr-data.xml" />
<xi:include href="c-libadr-name.xml" />
<xi:include href="c-libadr-object.xml" />
-<xi:include href="c-libadr-adrgen.xml" />
+<xi:include href="c-libadr-radadrgen.xml" />
</chapter>
--- a/usr/src/doc/rad-dev/c-manpage.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/c-manpage.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<chapter xmlns:xi="http://www.w3.org/2001/XInclude">
@@ -32,5 +32,5 @@
<xi:include href="../manpage/man-rad.xml" />
- <xi:include href="../manpage/man-adrgen.xml" />
+ <xi:include href="../manpage/man-radadrgen.xml" />
</chapter>
--- a/usr/src/doc/rad-dev/c-modules.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/doc/rad-dev/c-modules.xml Wed Feb 01 09:22:41 2012 -0500
@@ -13,7 +13,7 @@
PDL HEADER END
- Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<chapter><title>Module Development</title>
@@ -32,8 +32,8 @@
<section><title>Interface definition and implementation</title>
<para>
Though an interface can be constructed manually, it is much simpler to
-use <command>adrgren</command> to generate the necessary type
-definitions. If requested, <command>adrgen</command> can also generate
+use <command>radadrgen</command> to generate the necessary type
+definitions. If requested, <command>radadrgen</command> can also generate
stubs for the entry points referenced by the generated types.
</para>
--- a/usr/src/java/adr/adrgen.sh Tue Jan 24 18:01:02 2012 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-#!/bin/ksh -p
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-
-#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
-#
-
-ADRLOC=$(dirname $0)/../lib/rad/java/adr.jar
-exec java -classpath ${ADRLOC} org.opensolaris.os.adr.adrgen.ADRGen "$@"
--- a/usr/src/java/adr/build.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/java/adr/build.xml Wed Feb 01 09:22:41 2012 -0500
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<project name="adr" default="jar">
@@ -29,8 +29,8 @@
<install.default targetdir="${proto.rad.java}" />
<copy.remove.cddl
- file="adrgen.sh"
- tofile="${proto.bin}/adrgen" />
+ file="radadrgen.sh"
+ tofile="${proto.bin}/radadrgen" />
<copy.remove.cddl
file="org/opensolaris/os/adr/adrgen/ADR.rng"
@@ -40,6 +40,6 @@
file="org/opensolaris/os/adr/adrgen/ADRdoc.rng"
tofile="${proto.xml}/rng/ADRdoc.rng" />
- <chmod file="${proto.bin}/adrgen" perm="0555" />
+ <chmod file="${proto.bin}/radadrgen" perm="0555" />
</target>
</project>
--- a/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRGen.java Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/java/adr/org/opensolaris/os/adr/adrgen/ADRGen.java Wed Feb 01 09:22:41 2012 -0500
@@ -20,35 +20,23 @@
*/
/*
- * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
*/
package org.opensolaris.os.adr.adrgen;
import org.opensolaris.os.adr.*;
import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
-import java.net.URL;
import java.util.*;
-import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.validation.SchemaFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import org.xml.sax.ErrorHandler;
import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
public class ADRGen {
- private static final String ADRGEN_USAGE = "Usage: adrgen [-N]" +
- " [-c [-r [-m][-s]]] [-j dir [-i]] [-o {docbook | text | none}]" +
- " [-d baseline.xml] spec.xml";
private static final EnumSet<StdType> NULLABLE = EnumSet.of(
StdType.STRING, StdType.NAME, StdType.OPAQUE, StdType.PASSWORD);
@@ -708,233 +696,4 @@
throw new ParseException("Unresolved type references");
}
}
-
- static class Option {
- private char letter_;
- private String arg_;
-
- Option(char letter, String arg) {
- letter_ = letter;
- arg_ = arg;
- }
-
- char getLetter() {
- return letter_;
- }
-
- String getArg() {
- return arg_;
- }
- }
-
- static int getOptions(String[] args, String argspec, List<Option> opts) {
- Map<Character, Boolean> optspecs = new HashMap<Character, Boolean>();
-
- /* Parse argspec */
- int length = argspec.length();
- for (int i = 0; i < length; i++) {
- char l = argspec.charAt(i);
- boolean hasargs = i + 1 < length && argspec.charAt(i + 1) == ':';
- if (hasargs)
- i++;
- optspecs.put(l, hasargs);
- }
-
- /* Parse args */
- boolean inopt = false;
- char pending = '\0';
- int i;
- for (i = 0; i < args.length; i++) {
- if (inopt) {
- opts.add(new Option(pending, args[i]));
- inopt = false;
- continue;
- }
-
- if (args[i].charAt(0) != '-')
- break;
-
- for (int j = 1; j < args[i].length(); j++) {
- char l = args[i].charAt(j);
- if (!optspecs.containsKey(l)) {
- System.err.format("Invalid option \"%c\"\n", l);
- System.exit(2);
- }
-
- if (!optspecs.get(l)) {
- opts.add(new Option(l, null));
- continue;
- }
-
- if (j + 1 < args[i].length()) {
- opts.add(new Option(l, args[i].substring(j + 1)));
- break;
- }
-
- inopt = true;
- pending = l;
- }
- }
-
- if (inopt) {
- System.err.format("Option \"%c\" requires an argument\n", pending);
- System.exit(2);
- }
-
- return i;
- }
-
- /*
- * -c cname -j jname -s sname
- */
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- boolean generate_c = false;
- boolean generate_server = false;
- boolean generate_cstubs = false;
- boolean generate_java = false;
- boolean generate_jimpl = false;
- boolean generate_diff = false;
- boolean generate_common = false;
- boolean check_nullable = true;
- DocGenerator.Format doc_fmt = null;
- String java_dir = "java";
- String baseline = "";
-
- List<Option> opts = new LinkedList<Option>();
- int operands = getOptions(args, "Ncj:mrsid:o:", opts);
- for (Option o : opts) {
- switch (o.getLetter()) {
- case 'N':
- check_nullable = false;
- break;
- case 'c':
- generate_c = true;
- break;
- case 'j':
- generate_java = true;
- java_dir = o.getArg();
- break;
- case 'r':
- generate_server = true;
- break;
- case 's':
- generate_cstubs = true;
- break;
- case 'i':
- generate_jimpl = true;
- break;
- case 'd':
- generate_diff = true;
- baseline = o.getArg();
- break;
- case 'm':
- generate_common = true;
- break;
- case 'o':
- try {
- doc_fmt =
- DocGenerator.Format.valueOf(o.getArg().toUpperCase());
- } catch (IllegalArgumentException ie) {
- System.err.format("Invalid documentation format: %s\n",
- o.getArg());
- System.err.println(ADRGEN_USAGE);
- System.exit(2);
- }
- break;
- }
- }
-
- if (operands == args.length) {
- System.err.println(ADRGEN_USAGE);
- System.exit(2);
- }
-
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
- factory.setNamespaceAware(true);
- try {
- URL schema = ADRGen.class.getResource("adr.xsd");
- if (schema == null) {
- System.err.println("Unable to find schema");
- System.exit(1);
- }
- SchemaFactory schemafactory = SchemaFactory.newInstance(
- XMLConstants.W3C_XML_SCHEMA_NS_URI);
- /* Use SchemaResourceResolver to find included/imported schemas */
- schemafactory.setResourceResolver(new SchemaResourceResolver());
-
- factory.setSchema(schemafactory.newSchema(schema));
- } catch (SAXException e) {
- System.err.println("Error reading ADR schema: " + e.getMessage());
- System.exit(1);
- }
-
- DocumentBuilder builder;
- /* Contrary to the javadoc, the default error handler just drives on */
- ErrorHandler realHandler = new ErrorHandler() {
- public void warning(SAXParseException exception)
- throws SAXException {
- throw exception;
- }
-
- public void error(SAXParseException exception)
- throws SAXException {
- throw exception;
- }
-
- public void fatalError(SAXParseException exception)
- throws SAXException {
- throw exception;
- }
- };
-
- try {
- builder = factory.newDocumentBuilder();
- builder.setErrorHandler(realHandler);
- } catch (ParserConfigurationException ex) {
- System.err.println("Initialization error");
- System.exit(1);
- return;
- }
-
- for (int i = operands; i < args.length; i++) {
- String file = args[i];
- try {
- ADRGen p = new ADRGen(builder, new File(file), check_nullable);
- if (generate_diff) {
- ADRGen pbaseline =
- new ADRGen(builder, new File(baseline), check_nullable);
- APIDiff.diff(pbaseline.iface_.apis_, p.iface_.apis_);
- }
- if (generate_c)
- CGenerator.generate(p, generate_server, generate_cstubs,
- generate_common);
- if (generate_java)
- new JGenerator(p, java_dir).generate(false, generate_jimpl);
- if (doc_fmt != null) {
- DocGenerator.generate(p, doc_fmt);
- }
- } catch (ParseException e) {
- System.err.format("Error parsing file %s: %s\n", file,
- e.getMessage());
- System.exit(1);
- } catch (FileNotFoundException e) {
- System.err.println(e.getMessage());
- System.exit(1);
- } catch (TransformerException e) {
- /* Display an error and continue other operations */
- System.err.format("Error transforming file %s: %s\n", file,
- e.getMessage());
- System.exit(1);
- }
- builder.reset();
- /*
- * Contrary to the javadoc, the post-reset error handler is *not*
- * functionally equal to the pre-reset error handler.
- */
- builder.setErrorHandler(realHandler);
- }
- }
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/org/opensolaris/os/adr/adrgen/RadADRGen.java Wed Feb 01 09:22:41 2012 -0500
@@ -0,0 +1,276 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ */
+
+package org.opensolaris.os.adr.adrgen;
+
+import org.opensolaris.os.adr.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.net.URL;
+import java.util.*;
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.validation.SchemaFactory;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+public class RadADRGen {
+ private static final String RADADRGEN_USAGE = "Usage: radadrgen [-N]" +
+ " [-c [-r [-m][-s]]] [-j dir [-i]] [-o {docbook | text | none}]" +
+ " [-d baseline.xml] spec.xml";
+
+ static class Option {
+ private char letter_;
+ private String arg_;
+
+ Option(char letter, String arg) {
+ letter_ = letter;
+ arg_ = arg;
+ }
+
+ char getLetter() {
+ return letter_;
+ }
+
+ String getArg() {
+ return arg_;
+ }
+ }
+
+ static int getOptions(String[] args, String argspec, List<Option> opts) {
+ Map<Character, Boolean> optspecs = new HashMap<Character, Boolean>();
+
+ /* Parse argspec */
+ int length = argspec.length();
+ for (int i = 0; i < length; i++) {
+ char l = argspec.charAt(i);
+ boolean hasargs = i + 1 < length && argspec.charAt(i + 1) == ':';
+ if (hasargs)
+ i++;
+ optspecs.put(l, hasargs);
+ }
+
+ /* Parse args */
+ boolean inopt = false;
+ char pending = '\0';
+ int i;
+ for (i = 0; i < args.length; i++) {
+ if (inopt) {
+ opts.add(new Option(pending, args[i]));
+ inopt = false;
+ continue;
+ }
+
+ if (args[i].charAt(0) != '-')
+ break;
+
+ for (int j = 1; j < args[i].length(); j++) {
+ char l = args[i].charAt(j);
+ if (!optspecs.containsKey(l)) {
+ System.err.format("Invalid option \"%c\"\n", l);
+ System.exit(2);
+ }
+
+ if (!optspecs.get(l)) {
+ opts.add(new Option(l, null));
+ continue;
+ }
+
+ if (j + 1 < args[i].length()) {
+ opts.add(new Option(l, args[i].substring(j + 1)));
+ break;
+ }
+
+ inopt = true;
+ pending = l;
+ }
+ }
+
+ if (inopt) {
+ System.err.format("Option \"%c\" requires an argument\n", pending);
+ System.exit(2);
+ }
+
+ return i;
+ }
+
+ /*
+ * -c cname -j jname -s sname
+ */
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ boolean generate_c = false;
+ boolean generate_server = false;
+ boolean generate_cstubs = false;
+ boolean generate_java = false;
+ boolean generate_jimpl = false;
+ boolean generate_diff = false;
+ boolean generate_common = false;
+ boolean check_nullable = true;
+ DocGenerator.Format doc_fmt = null;
+ String java_dir = "java";
+ String baseline = "";
+
+ List<Option> opts = new LinkedList<Option>();
+ int operands = getOptions(args, "Ncj:mrsid:o:", opts);
+ for (Option o : opts) {
+ switch (o.getLetter()) {
+ case 'N':
+ check_nullable = false;
+ break;
+ case 'c':
+ generate_c = true;
+ break;
+ case 'j':
+ generate_java = true;
+ java_dir = o.getArg();
+ break;
+ case 'r':
+ generate_server = true;
+ break;
+ case 's':
+ generate_cstubs = true;
+ break;
+ case 'i':
+ generate_jimpl = true;
+ break;
+ case 'd':
+ generate_diff = true;
+ baseline = o.getArg();
+ break;
+ case 'm':
+ generate_common = true;
+ break;
+ case 'o':
+ try {
+ doc_fmt =
+ DocGenerator.Format.valueOf(o.getArg().toUpperCase());
+ } catch (IllegalArgumentException ie) {
+ System.err.format("Invalid documentation format: %s\n",
+ o.getArg());
+ System.err.println(RADADRGEN_USAGE);
+ System.exit(2);
+ }
+ break;
+ }
+ }
+
+ if (operands == args.length) {
+ System.err.println(RADADRGEN_USAGE);
+ System.exit(2);
+ }
+
+ DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ factory.setNamespaceAware(true);
+ try {
+ URL schema = ADRGen.class.getResource("adr.xsd");
+ if (schema == null) {
+ System.err.println("Unable to find schema");
+ System.exit(1);
+ }
+ SchemaFactory schemafactory = SchemaFactory.newInstance(
+ XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ /* Use SchemaResourceResolver to find included/imported schemas */
+ schemafactory.setResourceResolver(new SchemaResourceResolver());
+
+ factory.setSchema(schemafactory.newSchema(schema));
+ } catch (SAXException e) {
+ System.err.println("Error reading ADR schema: " + e.getMessage());
+ System.exit(1);
+ }
+
+ DocumentBuilder builder;
+ /* Contrary to the javadoc, the default error handler just drives on */
+ ErrorHandler realHandler = new ErrorHandler() {
+ public void warning(SAXParseException exception)
+ throws SAXException {
+ throw exception;
+ }
+
+ public void error(SAXParseException exception)
+ throws SAXException {
+ throw exception;
+ }
+
+ public void fatalError(SAXParseException exception)
+ throws SAXException {
+ throw exception;
+ }
+ };
+
+ try {
+ builder = factory.newDocumentBuilder();
+ builder.setErrorHandler(realHandler);
+ } catch (ParserConfigurationException ex) {
+ System.err.println("Initialization error");
+ System.exit(1);
+ return;
+ }
+
+ for (int i = operands; i < args.length; i++) {
+ String file = args[i];
+ try {
+ ADRGen p = new ADRGen(builder, new File(file), check_nullable);
+ if (generate_diff) {
+ ADRGen pbaseline =
+ new ADRGen(builder, new File(baseline), check_nullable);
+ APIDiff.diff(pbaseline.iface_.apis_, p.iface_.apis_);
+ }
+ if (generate_c)
+ CGenerator.generate(p, generate_server, generate_cstubs,
+ generate_common);
+ if (generate_java)
+ new JGenerator(p, java_dir).generate(false, generate_jimpl);
+ if (doc_fmt != null) {
+ DocGenerator.generate(p, doc_fmt);
+ }
+ } catch (ParseException e) {
+ System.err.format("Error parsing file %s: %s\n", file,
+ e.getMessage());
+ System.exit(1);
+ } catch (FileNotFoundException e) {
+ System.err.println(e.getMessage());
+ System.exit(1);
+ } catch (TransformerException e) {
+ /* Display an error and continue other operations */
+ System.err.format("Error transforming file %s: %s\n", file,
+ e.getMessage());
+ System.exit(1);
+ }
+ builder.reset();
+ /*
+ * Contrary to the javadoc, the post-reset error handler is *not*
+ * functionally equal to the pre-reset error handler.
+ */
+ builder.setErrorHandler(realHandler);
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/java/adr/radadrgen.sh Wed Feb 01 09:22:41 2012 -0500
@@ -0,0 +1,28 @@
+#!/bin/ksh -p
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+
+#
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+#
+
+ADRLOC=$(dirname $0)/../lib/rad/java/adr.jar
+exec java -classpath ${ADRLOC} org.opensolaris.os.adr.adrgen.RadADRGen "$@"
--- a/usr/src/java/build-common.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/java/build-common.xml Wed Feb 01 09:22:41 2012 -0500
@@ -19,7 +19,7 @@
CDDL HEADER END
- Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
-->
<project name="commondef">
@@ -72,7 +72,7 @@
<attribute name="api" />
<sequential>
<java fork="yes" classpath="${ws.java}/adr/adr.jar"
- classname="org.opensolaris.os.adr.adrgen.ADRGen">
+ classname="org.opensolaris.os.adr.adrgen.RadADRGen">
<arg value="-j" />
<arg value="${proj.gen}" />
<arg value="${ws.apis}/@{api}" />
@@ -84,7 +84,7 @@
<attribute name="api" />
<sequential>
<java fork="yes" classpath="${ws.java}/adr/adr.jar"
- classname="org.opensolaris.os.adr.adrgen.ADRGen">
+ classname="org.opensolaris.os.adr.adrgen.RadADRGen">
<arg value="-N" />
<arg value="-j" />
<arg value="${proj.gen}" />
@@ -97,7 +97,7 @@
<attribute name="api" />
<sequential>
<java fork="yes" classpath="${ws.java}/adr/adr.jar"
- classname="org.opensolaris.os.adr.adrgen.ADRGen">
+ classname="org.opensolaris.os.adr.adrgen.RadADRGen">
<arg value="-j" />
<arg value="${proj.gen}" />
<arg value="-i" />
--- a/usr/src/pkg/manifests/system-management-rad.p5m Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/pkg/manifests/system-management-rad.p5m Wed Feb 01 09:22:41 2012 -0500
@@ -20,7 +20,7 @@
#
#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
#
license cr_Oracle license=cr_Oracle
@@ -38,7 +38,7 @@
file path=lib/svc/manifest/system/rad.xml group=sys
dir path=usr group=sys
dir path=usr/bin facet.devel=true
-file path=usr/bin/adrgen mode=0555 facet.devel=true
+file path=usr/bin/radadrgen mode=0555 facet.devel=true
dir path=usr/include facet.devel=true
dir path=usr/include/rad facet.devel=true
file path=usr/include/rad/adr.h facet.devel=true
@@ -88,7 +88,7 @@
file path=usr/share/lib/xml/rng/ADRdoc.rng facet.devel=true
dir path=usr/share/man
dir path=usr/share/man/man1 facet.devel=true
-file path=usr/share/man/man1/adrgen.1 facet.devel=true
+file path=usr/share/man/man1/radadrgen.1 facet.devel=true
dir path=usr/share/man/man1m facet.doc.man=true
file path=usr/share/man/man1m/rad.1m facet.doc.man=true
depend fmri=pkg:/runtime/java/jre-6 type=require facet.devel=true
--- a/usr/src/test/java/Makefile Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/test/java/Makefile Wed Feb 01 09:22:41 2012 -0500
@@ -52,7 +52,7 @@
all:
mkdir -p $(GEN)
- $(ADRGEN) -j $(GEN) -i $(APIS)
+ $(RADADRGEN) -j $(GEN) -i $(APIS)
$(JAVAC) $(JAVA_OPTS) `find $(JSRC) $(GEN) -name '*.java'`
test:
--- a/usr/src/test/java/build.xml Tue Jan 24 18:01:02 2012 -0500
+++ b/usr/src/test/java/build.xml Wed Feb 01 09:22:41 2012 -0500
@@ -26,7 +26,8 @@
<property environment="env" />
<property name="path.proto" location="${env.ROOT}" />
- <property name="path.adrgen" location="${path.proto}/usr/bin/adrgen" />
+ <property name="path.radadrgen"
+ location="${path.proto}/usr/bin/radadrgen" />
<property name="path.lib" location="${path.proto}/usr/lib" />
<property name="path.rad.java" location="${path.lib}/rad/java" />
<property name="path.src" location="src" />
@@ -55,7 +56,7 @@
<macrodef name="generate.adr">
<attribute name="api" />
<sequential>
- <exec executable="${path.adrgen}">
+ <exec executable="${path.radadrgen}">
<arg value="-j" />
<arg value="${path.gen}" />
<arg value="-i" />