Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit fb71f39

Browse files
author
Konstantina Chremmou
committed
Initial commit.
Signed-off-by: Konstantina Chremmou <[email protected]>
0 parents  commit fb71f39

File tree

120 files changed

+23186
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+23186
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
TAGS
2+
*~
3+
*.orig
4+
*.rej

Bitmaps/BannrBmp.bmp

83.9 KB
Binary file not shown.

Bitmaps/DlgBmp.bmp

451 KB
Binary file not shown.

CONTRIB.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
How to submit changes
2+
---------------------
3+
4+
Please try to follow the guidelines below. They will make things easier
5+
on the maintainers. Not all of these guidelines matter for every trivial
6+
patch so apply some common sense.
7+
8+
If you are unsure about something written here, ask on the mailing list
9+
10+
11+
1. Before starting a big project, discuss it on the list first :-)
12+
13+
2. Always test your changes, however small, by both targetted
14+
manual testing and by running the unit tests.
15+
16+
3. When adding new functionality, include test cases for any new code
17+
that is
18+
* important; or
19+
* difficult to manually test; or
20+
* easy to break.
21+
22+
4. All submissions must be made under the terms of the "Developer's
23+
Certificate of Origin" (DCO) and should include a Signed-off-by:
24+
line.
25+
26+
5. Make your patch(es) available by creating one or more github pull
27+
requests. Each pull request should be separately reviewable and
28+
mergable. Only patches which must be committed together should be
29+
in the same pull request.
30+
31+
6. Each patch should include a descriptive commit comment that helps
32+
understand why the patch is necessary and why it works. This will
33+
be used both for initial review and for new people to understand
34+
how the code works later.
35+
36+
7. For bonus points, ensure the project still builds in between every
37+
patch in a set: this helps hunt down future regressions with 'bisect'.
38+
39+
8. Make sure you have the right to submit any changes you make. If you
40+
do changes at work you may find your employer owns the patches
41+
instead of you.

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1.0.0 (17-Jun-2013)
2+
-------------------
3+
4+
* First public release.

FriendlyErrorNames.resx

Lines changed: 926 additions & 0 deletions
Large diffs are not rendered by default.

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright (c) Citrix Systems, Inc.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
1) Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
2) Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in
13+
the documentation and/or other materials provided with the
14+
distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

OMakefile

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#
2+
# Copyright (c) Citrix Systems, Inc.
3+
# All rights reserved.
4+
#
5+
# Redistribution and use in source and binary forms, with or without
6+
# modification, are permitted provided that the following conditions
7+
# are met:
8+
#
9+
# 1) Redistributions of source code must retain the above copyright
10+
# notice, this list of conditions and the following disclaimer.
11+
#
12+
# 2) Redistributions in binary form must reproduce the above
13+
# copyright notice, this list of conditions and the following
14+
# disclaimer in the documentation and/or other materials
15+
# provided with the distribution.
16+
#
17+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20+
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21+
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22+
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25+
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26+
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27+
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28+
# OF THE POSSIBILITY OF SUCH DAMAGE.
29+
#
30+
31+
USE_OCAMLFIND = true
32+
33+
SUPPORT_CS = csharp/src/*.cs
34+
35+
POWERSHELL_TMP=$(BINDINGS_TMP)/XenServerPSSnapIn
36+
POWERSHELL_GEN=$(BINDINGS_TMP)/powershell_autogen
37+
CSHARP_GEN=$(BINDINGS_TMP)/csharp_gen
38+
CSHARP_SRC_TMP=$(BINDINGS_TMP)/XenServer.NET-src/XenServer.NET
39+
CSHARP_BIN_TMP=$(BINDINGS_TMP)/XenServer.NET-bin/XenServer.NET
40+
CSHARP_GUI_TMP=$(BINDINGS_TMP)/XenCenterBindings/XenServer.NET
41+
CSHARP_SAM_TMP=$(BINDINGS_TMP)/XenServer.NET-sam/XenServer.NET
42+
43+
OCAMLINCLUDES += .. $(DATAMODEL_DIR)
44+
OCAMLFLAGS += -dtypes -I $(DATAMODEL_DIR)
45+
OCAMLPACKS += getopt xmlm xml-light2 uuid stdext log unix
46+
OCAML_LIBS += $(DATAMODEL_DIR)/datamodel
47+
48+
.PHONY: clean dist
49+
.SUBDIRS: powershell csharp c java
50+
51+
.PHONY: csharp_samples csharp_src csharp_gui csharp_bin_readmes powershell_src
52+
csharp_gui: $(BINDINGS_TMP)/XenCenterBindings.zip
53+
54+
dist: powershell_src csharp_samples csharp_src csharp_gui csharp_bin_readmes c_folders java_folders
55+
56+
57+
Flip(dir) =
58+
cd $(dir) && sh $(shell readlink -f $(ROOT))/windows-line-endings.sh
59+
60+
ZipUp(dir, dest) =
61+
d = $(basename $(dest))
62+
cd $(dir)/.. && zip -q -r9 $(d) $(basename $(dir)) && mv $(d) $(dest)
63+
64+
CSharpReadme(dir, specific) =
65+
sed -e 's/@PRODUCT_VERSION@/$(PRODUCT_VERSION)/g' csharp/README-common.txt.dist >$(dir)/README.txt
66+
cat csharp/README-$(specific).txt.dist >>$(dir)/README.txt
67+
$(INSTALL) $(XMLRPCLICENSE) $(dir)/LICENSE.CookComputing.XmlRpcV2
68+
$(INSTALL) LICENSE $(dir)/LICENSE.txt
69+
70+
InstallAndBrand(sourcefile, targetfile) =
71+
$(INSTALL) $(sourcefile) $(targetfile)
72+
sed -i -e 's/@PRODUCT_VERSION@/$(PRODUCT_VERSION)/g' $(targetfile)
73+
74+
csharp_src: gen_gui_csharp_bindings
75+
mkdir -p $(CSHARP_SRC_TMP)/Properties
76+
mv $(CSHARP_GEN)/XenObjectDownloader.cs $(CSHARP_GEN)/XenObjectDownloader.tmp
77+
sh csharp/subst-autogen-csproj.sh $(CSHARP_GEN) csharp/src/XenServer.csproj $(CSHARP_SRC_TMP)/XenServer.csproj
78+
$(INSTALL) $(CSHARP_GEN)/*.cs $(CSHARP_SRC_TMP)
79+
$(INSTALL) $(CSHARP_GEN)/FriendlyErrorNames.resx $(CSHARP_SRC_TMP)
80+
$(INSTALL) $(SUPPORT_CS) $(CSHARP_SRC_TMP)
81+
mv $(CSHARP_SRC_TMP)/AssemblyInfo.cs $(CSHARP_SRC_TMP)/Properties/AssemblyInfo.cs
82+
sed -i -e 's/1\.0\.0\.0/$(PRODUCT_VERSION).0/g' $(CSHARP_SRC_TMP)/Properties/AssemblyInfo.cs
83+
mv $(CSHARP_GEN)/XenObjectDownloader.tmp $(CSHARP_GEN)/XenObjectDownloader.cs
84+
CSharpReadme($(CSHARP_SRC_TMP), src)
85+
Flip($(CSHARP_SRC_TMP))
86+
mkdir -p $(SDK_NET_FOLDER)/src && cp -r $(CSHARP_SRC_TMP)/* $(SDK_NET_FOLDER)/src
87+
cp $(CSHARP_GEN)/callVersions.csv $(MY_OUTPUT_DIR)
88+
89+
csharp_samples:
90+
mkdir -p $(CSHARP_SAM_TMP)
91+
$(INSTALL) csharp/samples/XenSdkSample.sln $(CSHARP_SAM_TMP)
92+
foreach(example, GetVariousRecords GetVmRecords VmPowerStates)
93+
mkdir -p $(CSHARP_SAM_TMP)/$(example)/Properties
94+
$(INSTALL) csharp/samples/$(example)/Properties/AssemblyInfo.cs $(CSHARP_SAM_TMP)/$(example)/Properties
95+
$(INSTALL) csharp/samples/$(example)/$(example).csproj $(CSHARP_SAM_TMP)/$(example)
96+
$(INSTALL) csharp/samples/$(example)/Program.cs $(CSHARP_SAM_TMP)/$(example)
97+
CSharpReadme($(CSHARP_SAM_TMP), samples)
98+
Flip($(CSHARP_SAM_TMP))
99+
mkdir -p $(SDK_NET_FOLDER)/samples && cp -r $(CSHARP_SAM_TMP)/* $(SDK_NET_FOLDER)/samples
100+
101+
$(BINDINGS_TMP)/XenCenterBindings.zip: gen_gui_csharp_bindings
102+
mkdir -p $(CSHARP_GUI_TMP)
103+
$(INSTALL) $(CSHARP_GEN)/*.cs $(CSHARP_GUI_TMP)
104+
$(INSTALL) $(CSHARP_GEN)/FriendlyErrorNames.resx $(CSHARP_GUI_TMP)
105+
$(INSTALL) $(SUPPORT_CS) $(CSHARP_GUI_TMP)
106+
rm $(CSHARP_GUI_TMP)/AssemblyInfo.cs
107+
Flip($(CSHARP_GUI_TMP))
108+
ZipUp($(CSHARP_GUI_TMP), $@)
109+
110+
powershell_src: csharp_src gen_powershell_bindings powershell_samples
111+
mkdir -p $(POWERSHELL_TMP)
112+
$(INSTALL) powershell/src/*.cs $(POWERSHELL_TMP)
113+
sed -i -e 's/1\.0\.0\.0/$(PRODUCT_VERSION)/g' $(POWERSHELL_TMP)/AssemblyInfo.cs
114+
sed -i -e 's/1000/$(PRODUCT_VERSION).0/g' $(POWERSHELL_TMP)/AssemblyInfo.cs
115+
$(INSTALL) $(POWERSHELL_GEN)/* $(POWERSHELL_TMP)
116+
InstallAndBrand(powershell/README.txt.dist, $(POWERSHELL_TMP)/README.txt)
117+
InstallAndBrand(powershell/about_XenServer.help.txt, $(POWERSHELL_TMP)/about_XenServer.help.txt)
118+
$(INSTALL) LICENSE $(POWERSHELL_TMP)/LICENSE.txt
119+
$(INSTALL) $(XMLRPCLICENSE) $(POWERSHELL_TMP)/LICENSE.CookComputing.XmlRpcV2
120+
Flip($(POWERSHELL_TMP))
121+
mkdir -p $(SDK_PS_FOLDER)/src && cp $(POWERSHELL_TMP)/* $(SDK_PS_FOLDER)/src
122+
123+
csharp_bin_readmes:
124+
mkdir -p $(CSHARP_BIN_TMP)
125+
CSharpReadme($(CSHARP_BIN_TMP), bin)
126+
Flip($(CSHARP_BIN_TMP))
127+
128+
clean:
129+
rm -f *.annot *.o *.cmi *.cmx *.cmo *.cma *.cmxa *.run *.opt *.omc *.dll
130+
rm -Rf $(BINDINGS_TMP)

OMakeroot

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
########################################################################
2+
# Permission is hereby granted, free of charge, to any person
3+
# obtaining a copy of this file, to deal in the File without
4+
# restriction, including without limitation the rights to use,
5+
# copy, modify, merge, publish, distribute, sublicense, and/or
6+
# sell copies of the File, and to permit persons to whom the
7+
# File is furnished to do so, subject to the following condition:
8+
#
9+
# THE FILE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
10+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
11+
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
12+
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
13+
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
14+
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE FILE OR
15+
# THE USE OR OTHER DEALINGS IN THE FILE.
16+
17+
########################################################################
18+
# The standard OMakeroot file.
19+
# You will not normally need to modify this file.
20+
# By default, your changes should be placed in the
21+
# OMakefile in this directory.
22+
#
23+
# If you decide to modify this file, note that it uses exactly
24+
# the same syntax as the OMakefile.
25+
#
26+
27+
#
28+
# Include the standard installed configuration files.
29+
# Any of these can be deleted if you are not using them,
30+
# but you probably want to keep the Common file.
31+
#
32+
open build/C
33+
open build/OCaml
34+
open build/LaTeX
35+
36+
# FIXME: Temporary fix to get this tree to build with OCaml 3.09.2
37+
if $(file-exists /usr/lib/libsqlite3.a):
38+
OCAML_LINK_FLAGS+=/usr/lib/libsqlite3.a
39+
export
40+
else:
41+
OCAML_LINK_FLAGS += -cclib -L/opt/xensource/lib
42+
export
43+
44+
# Other C libraries - used when making .cma or .cmxa libraries.
45+
# Should be of the form '-cclib -lpam' or such like
46+
OTHER_CLIBS=
47+
48+
#
49+
# The command-line variables are defined *after* the
50+
# standard configuration has been loaded.
51+
#
52+
DefineCommandVars()
53+
54+
OCamlLibraryClib(name, files, clibs) =
55+
name = $(file $(name))
56+
57+
OFILES = $(addsuffix $(EXT_OBJ), $(files))
58+
CMOFILES = $(addsuffix .cmo, $(files))
59+
CMXFILES = $(addsuffix .cmx, $(files))
60+
61+
CLIB = $(file $(name)$(EXT_LIB))
62+
BYTELIB = $(file $(name).cma)
63+
NATIVELIB = $(file $(name).cmxa)
64+
65+
__BYTE_CLIBS = $(addsuffix $(EXT_LIB), $(clibs))
66+
__NATIVE_CLIBS = $(addsuffix $(EXT_LIB), $(clibs))
67+
_BYTE_CLIBS = $(addprefix $(absname $(CWD))/, $(__BYTE_CLIBS))
68+
_NATIVE_CLIBS = $(addprefix $(absname $(CWD))/, $(__NATIVE_CLIBS))
69+
BYTE_CLIBS = $(mapprefix -cclib, $(_BYTE_CLIBS))
70+
NATIVE_CLIBS = $(mapprefix -cclib, $(_NATIVE_CLIBS))
71+
72+
#
73+
# Link commands
74+
#
75+
$(BYTELIB): $(CMOFILES) $(_BYTE_CLIBS)
76+
$(OCAMLFIND) $(OCAMLLINK) $(LAZY_OCAMLFINDFLAGS) $(OCAMLFLAGS) $(OCAMLCFLAGS) \
77+
$(OCAML_LIB_FLAGS) -a -o $@ $(OCamlLinkSort $(CMOFILES)) -custom $(BYTE_CLIBS) $(OCAML_LINK_FLAGS) $(OTHER_CLIBS)
78+
79+
$(NATIVELIB) $(CLIB): $(CMXFILES) $(OFILES) $(_NATIVE_CLIBS)
80+
$(OCAMLFIND) $(OCAMLOPTLINK) $(LAZY_OCAMLFINDFLAGS) $(OCAMLFLAGS) $(OCAMLOPTFLAGS) \
81+
$(OCAML_LIB_FLAGS) -a -o $(NATIVELIB) $(OCamlLinkSort $(CMXFILES)) $(NATIVE_CLIBS) $(OTHER_CLIBS)
82+
83+
return $(array $(if $(NATIVE_ENABLED), $(NATIVELIB)), $(if $(NATIVE_ENABLED), $(CLIB)), $(if $(BYTE_ENABLED), $(BYTELIB)))
84+
85+
86+
#
87+
# Include the OMakefile in this directory.
88+
#
89+
.SUBDIRS: .

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
XenAPI Software Development Kit
2+
===============================
3+
4+
This repository contains the generation code for the XenAPI Software Development
5+
Kit (SDK) and its associated documentation and examples.
6+
7+
The generated SDK consists of five components, one for each of C, C#, Java,
8+
PowerShell and Python, exposing the individual XenAPI calls as first-class
9+
functions in the target language.
10+
11+
The generation code is mostly written in
12+
[Ocaml](http://caml.inria.fr/ocaml/) 3.12.
13+
14+
Contributions
15+
-------------
16+
17+
The preferable way to contribute patches is to fork the repository on Github
18+
and then submit a pull request. If for some reason you can't use Github to
19+
submit a pull request, then you may send your patch for review to the
20+
<[email protected]> mailing list, with a link to a public git
21+
repository for review. Please see the CONTRIB.md file for some general
22+
guidelines on submitting changes.
23+
24+
Maintainers
25+
-----------
26+
27+
* Konstantina Chremmou <[email protected]>
28+
* Stephen Turner <[email protected]>
29+
30+
License
31+
-------
32+
33+
This code is licensed under the BSD 2-Clause license. Please see the LICENSE
34+
file for more information.

0 commit comments

Comments
 (0)