harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r292550 - in /incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component: ./ vm/ vm/components/ vm/components/TestComponent1Impl/ vm/components/TestComponent2Impl/ vm/core/ vm/core/comp_model/ vm/core/comp_model/interfaces/ vm/test/...
Date Thu, 29 Sep 2005 21:04:57 GMT
Author: geirm
Date: Thu Sep 29 14:04:50 2005
New Revision: 292550

URL: http://svn.apache.org/viewcvs?rev=292550&view=rev
Log:
commit of 

contrib_archive/2005/jira/harmony-5/component-model-c.zip


Added:
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/README
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/LICENSE
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/Makefile.am   (with props)
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/Makefile.am   (with props)
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/Makefile.am   (with props)
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/TestComponent1Impl.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/Makefile.am   (with props)
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/TestComponent2Impl.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.h.in
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.in   (with props)
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/Makefile.am   (with props)
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.c
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/VmComponent.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent1.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent2.h
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/Makefile.am   (with props)
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/Makefile.am   (with props)
    incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/TestComponentModel.c

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/README
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/README?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/README (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/README Thu Sep 29 14:04:50 2005
@@ -0,0 +1,4 @@
+Original source is contribution : 
+
+contrib_archive/2005/jira/harmony-5/component-model-c.zip
+

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/LICENSE
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/LICENSE?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/LICENSE (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/LICENSE Thu Sep 29 14:04:50 2005
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/Makefile.am?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/Makefile.am (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/Makefile.am Thu Sep 29 14:04:50 2005
@@ -0,0 +1,4 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = core test components
+

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/Makefile.am?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/Makefile.am (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/Makefile.am Thu Sep 29 14:04:50 2005
@@ -0,0 +1,4 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = TestComponent1Impl TestComponent2Impl
+

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/Makefile.am?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/Makefile.am (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/Makefile.am Thu Sep 29 14:04:50 2005
@@ -0,0 +1,6 @@
+#TODO: use the real name for the library
+lib_LTLIBRARIES = libvmTestComponent1Impl.la
+
+libvmTestComponent1Impl_la_SOURCES = \
+	TestComponent1Impl.c
+

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/TestComponent1Impl.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/TestComponent1Impl.c?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/TestComponent1Impl.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent1Impl/TestComponent1Impl.c Thu Sep 29 14:04:50 2005
@@ -0,0 +1,86 @@
+/**
+*
+* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+
+/* Authors:
+ * - David Tanzer - struppi@guglhupf.net - http://deltalabs.at
+ */
+#include <core/comp_model/VmComponent.h>
+#include <core/comp_model/interfaces/TestComponent1.h>
+#include <core/comp_model/interfaces/TestComponent2.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+static DependencyInfo *testComp2Dependency=NULL;
+static ComponentInfo *info=NULL;
+static TestComponent1 component;
+static TestComponent2 *testComponent2;
+
+void printMessage(char *message) {
+	char *messageOfComp2 = testComponent2->getMessage();
+	fprintf(stdout, "TestComponent1 [printMessage]: got message from TestComponent2: \"%s\"\n", messageOfComp2);
+}
+
+ComponentInfo *getComponentInfo() {
+	if(info==NULL) {
+		/* We definitely need a logging system. */
+		fprintf(stdout, "TestComponent1 [getComponentInfo]: creating new ComponentInfo\n");
+		component.printMessage = printMessage;
+		
+		info = (ComponentInfo *) calloc(1, sizeof(ComponentInfo));
+		
+		info->componentInterfaceId      = TEST_COMPONENT_1;
+		info->componentInterfaceVersion = TEST_COMPONENT_1_INTERFACE_VERSION;
+		info->implementationName        = "SimpleTestingImplementation";
+		info->implementationVendorName  = "Apache Harmony Project";
+		info->implementationVendorUrl   = "http://incubator.apache.org/harmony";
+		info->implementationVersion     = 1;
+		info->component = &component;
+	}
+	return info;
+}
+
+int getNumDependencies() {
+	return 1;
+}
+
+void setTestComponent2(void *dependency) {
+	fprintf(stdout, "TestComponent1 [setTestComponent2]: setting dependency\n");
+	testComponent2 = (TestComponent2 *) dependency;
+}
+
+DependencyInfo *getDependency(int i) {
+	if(i != 0) {
+		/* TODO report an error or a warning... */
+		return NULL;
+	}
+	
+	if(testComp2Dependency == NULL) {
+		testComp2Dependency = (DependencyInfo *)calloc(1, sizeof(testComp2Dependency));
+		
+		testComp2Dependency->componentInterfaceId      = TEST_COMPONENT_2;
+		testComp2Dependency->componentInterfaceVersion = TEST_COMPONENT_2_INTERFACE_VERSION;
+		testComp2Dependency->setter                    = setTestComponent2;
+	}
+	fprintf(stdout, "TestComponent1 [getDependency]: returning dependency for TestComponent2\n");
+	return testComp2Dependency;
+}
+
+void initialize() {
+	fprintf(stdout, "TestComponent1 [initialize]: initializing...\n");
+}
+

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/Makefile.am?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/Makefile.am (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/Makefile.am Thu Sep 29 14:04:50 2005
@@ -0,0 +1,6 @@
+#TODO: use the real name for the library
+lib_LTLIBRARIES = libvmTestComponent2Impl.la
+
+libvmTestComponent2Impl_la_SOURCES = \
+	TestComponent2Impl.c
+

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/TestComponent2Impl.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/TestComponent2Impl.c?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/TestComponent2Impl.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/components/TestComponent2Impl/TestComponent2Impl.c Thu Sep 29 14:04:50 2005
@@ -0,0 +1,65 @@
+/**
+*
+* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+
+/* Authors:
+ * - David Tanzer - struppi@guglhupf.net - http://deltalabs.at
+ */
+#include <core/comp_model/VmComponent.h>
+#include <core/comp_model/interfaces/TestComponent2.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+
+static ComponentInfo *info=NULL;
+static TestComponent2 component;
+
+char * getMessage() {
+	fprintf(stdout, "TestComponent2 [getMessage]: returning message\n");
+	return "A message from TestComponent2";
+}
+
+ComponentInfo *getComponentInfo() {
+	if(info==NULL) {
+		/* We definitely need a logging system. */
+		fprintf(stdout, "TestComponent2 [getComponentInfo]: creating new ComponentInfo\n");
+		component.getMessage = getMessage;
+		
+		info = (ComponentInfo *) calloc(1, sizeof(ComponentInfo));
+		
+		info->componentInterfaceId      = TEST_COMPONENT_2;
+		info->componentInterfaceVersion = TEST_COMPONENT_2_INTERFACE_VERSION;
+		info->implementationName        = "SimpleTestingImplementation";
+		info->implementationVendorName  = "Apache Harmony Project";
+		info->implementationVendorUrl   = "http://incubator.apache.org/harmony";
+		info->implementationVersion     = 1;
+		info->component = &component;
+	}
+	return info;
+}
+
+int getNumDependencies() {
+	return 0;
+}
+
+DependencyInfo *getDependency(int i) {
+	return NULL;
+}
+
+void initialize() {
+	fprintf(stdout, "TestComponent2 [initialize]: initializing...\n");
+}
+

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.h.in
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.h.in?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.h.in (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.h.in Thu Sep 29 14:04:50 2005
@@ -0,0 +1,61 @@
+/* configure.h.in.  Generated from configure.in by autoheader.  */
+
+/* global debugging switch */
+#undef GLOBAL_DEBUG_ENABLE
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.in
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.in?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.in (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.in Thu Sep 29 14:04:50 2005
@@ -0,0 +1,72 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(test/comp_model/TestComponentModel.c)
+
+AC_CANONICAL_TARGET
+
+AM_INIT_AUTOMAKE(TestComponentModel, 0.0.1)
+AM_CONFIG_HEADER(configure.h)
+
+
+AC_ARG_ENABLE( global-debug,
+[  --enable-global-debug Enable global debugging switch [default=no]],
+		 [GLOBAL_DEBUG_ENABLE=1],[GLOBAL_DEBUG_ENABLE=0])
+AC_SUBST(GLOBAL_DEBUG_ENABLE)
+
+AC_DEFINE_UNQUOTED(GLOBAL_DEBUG_ENABLE, $GLOBAL_DEBUG_ENABLE, [global debugging switch])
+
+BASE_DIR="$PWD"
+
+VM_INCLUDES="-I$BASE_DIR"
+VM_CORE_LIBS="-L$BASE_DIR/core -ldl"
+
+CPPFLAGS="$CPPFLAGS $VM_INCLUDES"
+LIBS="$LIBS $VM_CORE_LIBS"
+
+dnl Only use -Wall if we have gcc
+if test "x$GCC" = "xyes"; then
+  if test -z "`echo "$CPPFLAGS" | grep "\-Wall" 2> /dev/null`" ; then
+    CPPFLAGS="$CPPFLAGS -Wall"
+  fi
+fi
+
+dnl ------------------------------------------
+dnl Checks for programs.
+AC_PROG_CC
+dnl AC_PROG_CPP
+dnl AC_PROG_CXX
+AC_LANG_C
+AM_PROG_LIBTOOL
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+dnl Figure out which math library to use
+case "$target" in
+    *-*-cygwin* | *-*-mingw32*)
+        MATHLIB=""
+        SYS_GL_LIBS="-lopengl32"
+        ;;
+    *)
+        MATHLIB="-lm"
+        AC_PATH_X
+        AC_PATH_XTRA
+        if test x$have_x = xyes; then
+            CFLAGS="$CFLAGS $X_CFLAGS"
+            SYS_GL_LIBS="$X_LIBS -lGL -lGLU"
+        else
+            SYS_GL_LIBS="-lGL -lGLU"
+        fi
+        ;;
+esac
+AC_SUBST(MATHLIB)
+
+AC_OUTPUT(
+	Makefile
+	core/Makefile
+	test/Makefile
+	test/comp_model/Makefile
+	components/Makefile
+	components/TestComponent1Impl/Makefile
+	components/TestComponent2Impl/Makefile
+)
+

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/configure.in
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/Makefile.am?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/Makefile.am (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/Makefile.am Thu Sep 29 14:04:50 2005
@@ -0,0 +1,6 @@
+#TODO: use the real name for the library
+lib_LTLIBRARIES = libvmcore.la
+
+libvmcore_la_SOURCES = \
+	comp_model/ComponentModel.c
+

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.c?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.c Thu Sep 29 14:04:50 2005
@@ -0,0 +1,159 @@
+/**
+*
+* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+
+/* Authors:
+ * - David Tanzer - struppi@guglhupf.net - http://deltalabs.at
+ */
+#include "ComponentModel.h"
+#include "VmComponent.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <sys/types.h>
+#include <dlfcn.h>
+#include <dirent.h>
+
+/** @todo This only allows one implementation of a component at any time and it
+ *        doesn't support loading of arbitrary components, but since this is a
+ *        proof-of-concept I guess this is OK so far.
+ */
+
+ComponentInfo **components;
+
+void loadComponent(char *compName, void *handle, ComponentInfo *componentInfo) {
+	fprintf(stdout, "loadint component: %s\n", compName);
+	char *error;
+	
+	*(void **)(&(componentInfo->getNumDependencies)) = dlsym(handle, "getNumDependencies");
+	if((error = dlerror()) != NULL) {
+		fprintf(stderr, "Could get function getNumDependencies() from component \"%s\": %s\n", compName, error);
+		return;
+	}
+	*(void **)(&(componentInfo->getDependency)) = dlsym(handle, "getDependency");
+	if((error = dlerror()) != NULL) {
+		fprintf(stderr, "Could get function getDependency() from component \"%s\": %s\n", compName, error);
+		return;
+	}
+	*(void **)(&(componentInfo->initialize)) = dlsym(handle, "initialize");
+	if((error = dlerror()) != NULL) {
+		fprintf(stderr, "Could get function initialize() from component \"%s\": %s\n", compName, error);
+		return;
+	}
+
+	if(components[componentInfo->componentInterfaceId] == NULL) {
+		components[componentInfo->componentInterfaceId] = componentInfo;
+	} else {
+		/* FIXME I guess in a later version we won't have this problem when we use
+		 *       a better way for managing / storing the components.
+		 */
+	}
+}
+
+void initializeComponents() {
+	int i, j;
+	
+	/* Ok, I know two-phase construction is generally a bad idea, so if we really
+	 * use this component model we should resolve dependencies while initializing
+	 * components rather than using this simple two-phase approach.
+	 */
+	 for(i=0; i<NUM_COMPONENTS; i++) {
+		 if(components[i] != NULL) {
+			 for(j=0; j<components[i]->getNumDependencies(); j++) {
+				 DependencyInfo *dep = components[i]->getDependency(j);
+				 if(components[dep->componentInterfaceId] != NULL) {
+					 /* TODO check for the component's version and the size of the array too.
+					  */
+					 dep->setter(components[dep->componentInterfaceId]->component);
+				 } else {
+					 fprintf(stderr, "ERROR: could not resolve dependency of component %d to component %d\n", i, dep->componentInterfaceId);
+				 }
+			 }
+		 }
+	 }
+	 for(i=0; i<NUM_COMPONENTS; i++) {
+		 if(components[i] != NULL) {
+			 components[i]->initialize();
+		 }
+	 }
+}
+
+void componentModelInitialize(char **directories, int num) {
+	int i;
+	
+	fprintf(stdout, "Initializing Component Model\n");
+	/* Initialize all entries of the components array with NULL.
+	 */
+	components = (ComponentInfo **) calloc(NUM_COMPONENTS, sizeof(ComponentInfo *));
+	
+	/* Load and initialize all components from all specified component directories.
+	 */
+	for(i=0; i<num; i++) {
+		fprintf(stdout, "Loading components from directory %s\n", directories[i]);
+		DIR *dir;
+		
+		dir = opendir(directories[i]);
+		if(dir == NULL) {
+			/* FIXME report a warning or an error. should we exit the vm here? */
+			fprintf(stderr, "Could not open directory %s\n", directories[i]);
+		} else {
+			unsigned int fd;
+			struct dirent *entry;
+			
+			while((entry = readdir(dir)) != NULL) {
+				/* FIXME use OS-given length. */
+				char fileName[2048];
+				void *handle;
+				char *error;
+				
+				/* FIXME use OS dependent directory separator. */
+				sprintf(fileName, "%s/%s", directories[i], entry->d_name);
+				handle = dlopen(fileName, RTLD_NOW);
+				
+				if(handle != NULL) {
+					ComponentInfo *(*getComponentInfo)();
+					
+					dlerror(); /* We should call this function here according to the man page*/
+					*(void **)(&getComponentInfo) = dlsym(handle, "getComponentInfo");
+					if((error = dlerror()) == NULL) {
+						loadComponent(entry->d_name, handle, getComponentInfo());
+					} else {
+						/* FIXME should this stop the vm? */
+						fprintf(stderr, "Could not initialize component \"%s\": %s (component info function not found)\n", entry->d_name, error);
+					}
+				} else {
+					/* FIXME we should add additional logic when dlopen fails to determine if it was
+					 *       an error or just something like a subdirectory or a readme file.
+					 */
+					error = dlerror();
+					fprintf(stderr, "Could not initialize component \"%s\": %s (not a dl library)\n", entry->d_name, error);
+				}
+			}
+			
+			closedir(dir);
+		}
+	}
+	
+	initializeComponents();
+}
+
+void *componentModelGetComponent(int interfaceId, int interfaceVersion) {
+	/* TODO check for the array size and the component's version.
+	 */
+	return components[interfaceId]->component;
+}

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.h?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/ComponentModel.h Thu Sep 29 14:04:50 2005
@@ -0,0 +1,44 @@
+/**
+*
+* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+
+/* Authors:
+ * - David Tanzer - struppi@guglhupf.net - http://deltalabs.at
+ */
+#ifndef __HARMONY_VM_CORE_COMP_MODEL_COMPONENT_MODEL_H_
+#define __HARMONY_VM_CORE_COMP_MODEL_COMPONENT_MODEL_H_
+
+/********
+ * The component interface IDs for the component interfaces known at compile time. 
+ ********/
+ 
+/** TestComponent1 defined in "interfaces/TestComponent1.h".
+ * @note Just for testing in the proof-of-concept implementation.
+ */
+#define TEST_COMPONENT_1 0
+
+/** TestComponent1 defined in "interfaces/TestComponent1.h". 
+ * @note Just for testing in the proof-of-concept implementation.
+ */
+#define TEST_COMPONENT_2 1
+
+#define NUM_COMPONENTS 2
+
+void componentModelInitialize(char **directories, int num);
+
+void *componentModelGetComponent(int interfaceId, int interfaceVersion);
+
+#endif /* __HARMONY_VM_CORE_COMP_MODEL_COMPONENT_MODEL_H_ */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/VmComponent.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/VmComponent.h?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/VmComponent.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/VmComponent.h Thu Sep 29 14:04:50 2005
@@ -0,0 +1,112 @@
+/**
+*
+* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+
+/* Authors:
+ * - David Tanzer - struppi@guglhupf.net - http://deltalabs.at
+ */
+#ifndef __HARMONY_VM_CORE_COMP_MODEL_VM_COMPONENT_H_
+#define __HARMONY_VM_CORE_COMP_MODEL_VM_COMPONENT_H_
+
+/* All components will export these functions and provide a ComponentInfo
+ * data object.
+ */
+
+
+/** Data structure which identifies a dependency of a component. 
+ * The component can only specify an interface ID and version for dependencies. If there are more
+ * loaded components which satisfy these requirements, the configuration of the component model
+ * determines which dependencies will be injected. 
+ */
+typedef struct DependencyInfo {
+	/** The component interface ID of the dependency which will be injected. 
+	 */
+	int componentInterfaceId;
+	
+	/** The component interface version of the dependency which will be injected. 
+	 */
+	int componentInterfaceVersion;
+	
+	/** A function provided by the component to set the dependency identified by this data object. 
+	 */
+	void (*setter)(void *dependency);
+} DependencyInfo;
+
+/** Data structure which provides general informations about a component implementation. 
+ * @todo Do we need a licence identifier here?
+ * @todo We might need an extra field here to prevent cyclic initialization...
+ */
+typedef struct ComponentInfo {
+	/** This ID determines which component interface this component implements. 
+	 * This ID is one of the component interface IDs defined in "ComponentModel.h".
+	 * If we allow arbitrary components to be loaded (i.e. components where the interface
+	 * is not known at compile time) we need a different mechanism for identifying which
+	 * component interface the component implements.
+	 */
+	int componentInterfaceId;
+	
+	/** This ID determines which version of the component interface is implemented. 
+	 */
+	int componentInterfaceVersion;
+	
+	/** A unique name for the implementation of the component. 
+	 */
+	char *implementationName;
+	
+	/** The name of the vendor who created this implementation (i.e. "Apache Harmony"). 
+	 */
+	char *implementationVendorName;
+	
+	/** The url of the vendor who created this implementation (i.e. "http://incubator.apache.org/harmony/"). 
+	 */
+	char *implementationVendorUrl;
+	
+	/** A version identifier for the implementation of the component. 
+	 * This version identifier is requiered to be non decreasing, i.e. later versions
+	 * have equal or higher implementationVersion values then earlier ones.
+	 */
+	int implementationVersion;
+	
+	/** The component object (i.e. the function pointer talbe). 
+	 * For example, for TestComponent1 this a pointer to a struct TestComponent1
+	 * as defined in "core/comp_model/interfaces/TestComponent1.h".
+	 */
+	void *component;
+	
+	/* The following fields will be set by the component model when the component is loaded. */
+	int (*getNumDependencies)();
+	DependencyInfo * (*getDependency)(int i);
+	void (*initialize)();
+} ComponentInfo;
+
+/** Get the ComponentInfo object for this component. 
+ */
+ComponentInfo *getComponentInfo();
+
+/** Get the number of dependencies of this component. 
+ */
+int getNumDependencies();
+
+/** Get a dependency of this component. 
+ */
+DependencyInfo *getDependency(int i);
+
+/** Initialize the component (will not be called before all dependencies have been set). 
+ */
+void initialize();
+
+#endif /* __HARMONY_VM_CORE_COMP_MODEL_VM_COMPONENT_H_ */
+

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent1.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent1.h?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent1.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent1.h Thu Sep 29 14:04:50 2005
@@ -0,0 +1,34 @@
+/**
+*
+* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+
+/* Authors:
+ * - David Tanzer - struppi@guglhupf.net - http://deltalabs.at
+ */
+#ifndef __HARMONY_VM_CORE_COMP_MODEL_INTERFACES_TEST_COMPONENT_1_H_
+#define __HARMONY_VM_CORE_COMP_MODEL_INTERFACES_TEST_COMPONENT_1_H_
+
+#include <core/comp_model/ComponentModel.h>
+
+/** The interface version of this component interface. 
+ */
+#define TEST_COMPONENT_1_INTERFACE_VERSION 1
+
+typedef struct TestComponent1 {
+	void (*printMessage)();
+} TestComponent1;
+
+#endif /* __HARMONY_VM_CORE_COMP_MODEL_INTERFACES_TEST_COMPONENT_1_H_ */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent2.h
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent2.h?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent2.h (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/core/comp_model/interfaces/TestComponent2.h Thu Sep 29 14:04:50 2005
@@ -0,0 +1,35 @@
+/**
+*
+* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+
+/* Authors:
+ * - David Tanzer - struppi@guglhupf.net - http://deltalabs.at
+ */
+#ifndef __HARMONY_VM_CORE_COMP_MODEL_INTERFACES_TEST_COMPONENT_2_H_
+#define __HARMONY_VM_CORE_COMP_MODEL_INTERFACES_TEST_COMPONENT_2_H_
+
+#include <core/comp_model/ComponentModel.h>
+
+/** The interface version of this component interface. 
+ */
+#define TEST_COMPONENT_2_INTERFACE_VERSION 1
+
+typedef struct TestComponent2 {
+	char * (*getMessage)();
+} TestComponent2;
+
+
+#endif /* __HARMONY_VM_CORE_COMP_MODEL_INTERFACES_TEST_COMPONENT_2_H_ */

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/Makefile.am?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/Makefile.am (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/Makefile.am Thu Sep 29 14:04:50 2005
@@ -0,0 +1,4 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = comp_model
+

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/Makefile.am
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/Makefile.am?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/Makefile.am (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/Makefile.am Thu Sep 29 14:04:50 2005
@@ -0,0 +1,12 @@
+## Process this file with automake to produce Makefile.in
+
+bin_PROGRAMS = TestComponentModel
+
+TestComponentModel_SOURCES = \
+	TestComponentModel.c
+	
+noinst_HEADERS =
+
+TestComponentModel_LDFLAGS = \
+	-lvmcore
+

Propchange: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Added: incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/TestComponentModel.c
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/TestComponentModel.c?rev=292550&view=auto
==============================================================================
--- incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/TestComponentModel.c (added)
+++ incubator/harmony/enhanced/trunk/sandbox/contribs/tanzer_component/vm/test/comp_model/TestComponentModel.c Thu Sep 29 14:04:50 2005
@@ -0,0 +1,40 @@
+/**
+*
+* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+*
+*  Licensed under the Apache License, Version 2.0 (the "License");
+*  you may not use this file except in compliance with the License.
+*  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+*  Unless required by applicable law or agreed to in writing, software
+*  distributed under the License is distributed on an "AS IS" BASIS,
+*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+*  See the License for the specific language governing permissions and
+*  limitations under the License.
+*/
+
+/* Authors:
+ * - David Tanzer - struppi@guglhupf.net - http://deltalabs.at
+ */
+#include <core/comp_model/ComponentModel.h>
+#include <core/comp_model/VmComponent.h>
+#include <core/comp_model/interfaces/TestComponent1.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv) {
+	char **directories;
+	
+	directories = (char **)calloc(2, sizeof(char *));
+	directories[0] = "components/TestComponent1Impl/.libs";
+	directories[1] = "components/TestComponent2Impl/.libs";
+	
+	fprintf(stdout, "Starting test case: component model\n");
+	componentModelInitialize(directories, 2);
+	
+	TestComponent1 *comp = (TestComponent1 *)componentModelGetComponent(TEST_COMPONENT_1, 1);
+	comp->printMessage();
+}



Mime
View raw message