Permalink
Browse files

Remove some outdated and unused files in ocaml/idl

Signed-off-by: Rob Hoes <rob.hoes@citrix.com>
  • Loading branch information...
1 parent 1518b8c commit 94a5fd2616ddc5c6ad89a480c059b0aa3a995c88 @robhoes robhoes committed Nov 22, 2011

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-.SUBDIRS: ocaml_backend lua js_backend
+.SUBDIRS: ocaml_backend js_backend
PSTOPDF = $(shell bash -c "which pstopdf 2>/dev/null || which ps2pdf 2>/dev/null || which ps2pdf14 2>/dev/null || echo false")
View
@@ -1,19 +0,0 @@
- <vdi>
- <name>
- <label>debianroot</label>
- <shortDescription>Debian unstable root filesystem</shortDescription>
- <longDescription>The root filesystem for a vanilla debian unstable (etch?) install</longDescription>
- <detail>I could write a long description here, including versions of all the software
- installed, all the licenses, everything I can think of.</detail>
- </name>
- <sr>uuid-1234-5678-1234-5678</sr>
- <vbds></vbds>
- <!-- filesystem is a runtime property -->
- <virtual_size>5G</virtual_size>
- <!-- guaranteed_size is a runtime property -->
- <!-- filesystem_size is a runtime property -->
- <type>system</type>
- <parent></parent> <!-- no parent; should this be an option type? -->
- <sharable>false</sharable>
- <!-- creator is a runtime property -->
- </vdi>
View
@@ -1,23 +0,0 @@
- <vif>
- <name = "virtual interface 0">
- <type = "paravirtualised">
- <device = "eth0">
-
- <!-- The virtual machine to which the vif is attached -->
- <vm = "uuid-1579-1324-1597-2911">
-
- <!-- The virtual network the vif is attached to
- (This tells the host on which the guest is running
- how packets to/from this vif should be dealt with) -->
- <network = "uuid-1234-5678-1234-5678">
-
- <!-- VIF parameters -->
- <mac = "00:11:22:33:44:55">
- <mtu = "1500">
-
- <!-- Specify leaky bucket qos and give parameters -->
- <qos>
- <algorithm_type = "leaky_bucket">
- <algorithm_params = "r=0.15, b=3">
- </qos>
- </vif>
View
@@ -1,79 +0,0 @@
- <vm>
- <name>
- <label>debian</label>
- <shortDescription>Debian etch unstable</shortDescription>
- <longDescription>A completely vanilla install of Debian etch unstable</longDescription>
- <detail>I could write a long description here, including versions of all the software
- installed, all the licenses, everything I can think of.</detail>
- </name>
- <memory>
- <staticmax>1G</staticmax>
- <staticmin>128M</staticmin>
- <!-- actual is a runtime property -->
- <dynamicmax>512M</dynamicmax>
- <dynamicmin>128M</dynamicmin>
- </memory>
- <vcpus>
-
- <policy="variable_within_range">
- <params="range=(0,5)">
-
- <features>
- <required> FPU, P4 </required>
- <canuse> SSE, 3DNow! </canuse>
- <force_on> SSE </force_on>
- <force_off> 3DNow! </force_off>
- </features>
- </vcpus>
-
- <!-- set how guest behaves on poweroff, reboot, crash, standby -->
- <actions>
- <poweroff> destroy </poweroff>
- <reboot> restart </reboot>
- <crash> preserve </crash>
- <standby> rename-restart </standby>
- </actions>
-
- <!-- generate coredump on poweroff, reboot, crash, standby -->
- <coredump> true </coredump>
-
- <!-- attach following vifs and vdis to guest on startup -->
- <vifs> uuid-1234-5678-1234-5678, uuid-2345-6789-2345-6789 </vifs>
- <vdis> uuid-1234-5678-1234-5678, uuid-2345-6789-2345-6789 </vdis>
-
- <tpm>
- <instance>0</instance>
- <backend>0</backend>
- </tpm>
-
- <bios>
- <cdrom>/dev/cdrom</cdrom>
- <boot>cdrom</boot>
- </bios>
-
- <platform>
- <stdvga>false</stdvga>
- <sdl>false</sdl>
- <vnc>true</vnc>
- <serial>/dev/pty1</serial>
- <localtime>true</localtime>
- <enable_audio>true</enable_audio>
- </platform>
-
- <builder> /domain/builder/part/of/virtual/bios </builder>
-
- <console_port>1234</console_port>
-
- <boot_method>kernel_internal</boot_method>
- <kernel>
- <kernel>/boot/vmlinuz</kernel>
- <initrd>/boot/initrd.img</initrd>
- <args>root=/dev/nfs ... </args>
- </kernel>
-
- <grub>
- <cmdline></cmdline> <!-- not used by this boot_method -->
- </grub>
- <pci_bus></pci_bus> <!-- no devices to pass-through -->
- <!-- toolsVersion is a runtime property -->
- </vm>
@@ -1,73 +0,0 @@
-(*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *)
-open Dm_api
-open Datamodel_utils
-open Stringext
-
-module DT=Datamodel_types
-
-let escape_rules = ['<', "&lt;";'>', "&gt;"]
-
-let escape s =
- String.escaped ~rules:escape_rules s
-
-let friendly_names = Hashtbl.create 10
-
-let rec friendly_names_all errors =
- Hashtbl.iter update_entries errors;
- let keys = Hashtbl.fold get_keys friendly_names [] in
- let keys' = List.sort String.compare keys in
- let values = List.map get_value keys' in
- List.combine keys' values;
-
-and update_entries _ error =
- let name = escape error.DT.err_name in
- let desc = escape error.DT.err_doc in
- if not (Hashtbl.mem friendly_names name) then
- Hashtbl.add friendly_names name desc
- else
- ()
-
-and get_keys key _ tail =
- key :: tail
-
-and get_value key =
- Hashtbl.find friendly_names key
-
-let parse_resx filename =
- let rec get_value_node = function
- | Xml.Element("value", _, [Xml.PCData v]) :: _ -> v
- | _ :: xs -> get_value_node xs
- | [] -> ""
- in
-
- let update_entry attrs children =
- let key = List.assoc "name" attrs in
- let value = get_value_node children in
- Hashtbl.replace friendly_names key value
- in
-
- let rec parse_xml = function
- | Xml.Element("root", _, children) ->
- List.iter parse_xml children
- | Xml.Element("data", attrs, children) ->
- update_entry attrs children
- | _ -> ()
- in
- try
- parse_xml (Xml.parse_file filename)
- with
- Xml.Error e as exn ->
- Printf.eprintf "%s\n%!" (Xml.error e);
- raise exn
View
@@ -1,115 +0,0 @@
-(*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *)
-open Dm_api
-open Dm_api
-open Datamodel_utils
-open Stringext
-
-module DT=Datamodel_types
-
-let escape_rules = ['<', "&lt;";'>', "&gt;"]
-
-(* Non-autogen things that are found in the FriendlyNames resx *)
-let others : (string * string) list ref = ref []
-
-let escape s =
- String.escaped ~rules:escape_rules s
-
-(* The hashtable where keys are the 'name' attribute of data tags, and values are the contents of their single child 'value' tag *)
-let friendly_names = Hashtbl.create 10
-
-
-let startswith str prefix =
- String.length str >= String.length prefix && String.compare (String.sub str 0 (String.length prefix)) prefix = 0
-
-
-let trim x =
- if (startswith x "Label-") then String.sub x 5 (String.length x - 5)
- else if (startswith x "Description-") then String.sub x 12 (String.length x - 12)
- else x
-
-
-(* A custom sorter for the hashtable. We trim off the Label- and Description- and sort by what's left. *)
-let sorter x y =
- String.compare (trim x) (trim y)
-
-
-(* objects_of_api is defined in dm_api.ml *)
-let rec friendly_names_all api =
- List.iter update_entries (objects_of_api api);
- let keys = Hashtbl.fold get_keys friendly_names [] in
- let keys' = List.sort sorter keys in
- let values = List.map get_value keys' in
- let hashTableContents = List.combine keys' values (* Put the contents of the hash table into (key, value) tuples *) in
- (* Lastly add on the non-autogen things in the order they appeared in the resx *)
- (hashTableContents @ (List.rev !others))
-
-
-and get_keys key _ tail =
- key :: tail
-
-
-and get_value key =
- Hashtbl.find friendly_names key
-
-
-(* Iterates over the fields of the given api class *)
-and update_entries obj =
- List.iter (update_entry obj.DT.name) (fields_of_obj obj)
-
-
-(* Takes a field on an api object and puts default Label- and Description- entries in the hashtable if there aren't already custom ones there *)
-and update_entry classname field =
- let full_name = classname ^ "." ^ (String.concat "_" field.DT.full_name) in
- let label = String.concat "" ["Label-"; full_name] in
- let desc = String.concat "" ["Description-"; full_name] in
- begin
- if not (Hashtbl.mem friendly_names label) then
- Hashtbl.add friendly_names label full_name;
- if not (Hashtbl.mem friendly_names desc) then
- Hashtbl.add friendly_names desc (escape field.DT.field_description)
- end
-
-
-(* Fills the hashtable 'friendly_names' with anything uin the given resx starting Label- or Description- *)
-(* Assumed non-autogen strings with any other prefix are put into (key, value) pair list 'others' *)
-let parse_resx filename =
- let rec get_value_node = function
- | Xml.Element("value", _, [Xml.PCData v]) :: _ -> v
- | _ :: xs -> get_value_node xs
- | [] -> ""
- in
-
- let update_entry attrs children =
- let key = List.assoc "name" attrs in
- let value = get_value_node children in
- if (startswith key "Label-" || startswith key "Description-") then
- Hashtbl.replace friendly_names key (escape value)
- else
- others := (key, (escape value)) :: !others
- in
-
- let rec parse_xml = function
- | Xml.Element("root", _, children) ->
- List.iter parse_xml children
- | Xml.Element("data", attrs, children) ->
- update_entry attrs children
- | _ -> ()
- in
- try
- parse_xml (Xml.parse_file filename)
- with
- Xml.Error e as exn ->
- Printf.eprintf "%s\n%!" (Xml.error e);
- raise exn
View
@@ -1,27 +0,0 @@
-OCAMLPACKS = xml-light2 uuid
-
-# -----------------------------------------------------------------------
-# autogen stuff
-# -----------------------------------------------------------------------
-
-# should move this into global constants file in root and stop using
-# relative paths...
-AUTOGEN_DIR = ../../autogen
-
-# only gen_api requires datamodel library:
-OCAMLINCLUDES += .. ../.. ../../templates
-OCAML_LIBS += ../../templates/template ../datamodel
-
-OCamlProgram(main, main)
-
-# -----------------------------------------------------------------------
-# programs that depend on autogen files
-# -----------------------------------------------------------------------
-
-.PHONY: clean
-clean:
- rm -f *~ *.opt *.run *.a *.cma *.cmxa *.cmo *.cmi *.o *.cmx *.omc *.annot gen_api
-
-.PHONY: lua_error_codes
-lua_error_codes: main
- ./main
View
@@ -1,33 +0,0 @@
-(*
- * Copyright (C) 2006-2009 Citrix Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation; version 2.1 only. with the special
- * exception on linking described in file LICENSE.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *)
-open Pervasiveext
-open Printf
-open Stringext
-open Str
-
-open Datamodel_types
-open Dm_api
-module DT = Datamodel_types
-module DU = Datamodel_utils
-
-let gen_error file name params =
- fprintf file "xenapi_exceptions[\"%s\"] = \"%s\"\n" name params.err_doc
-
-let gen_exception_translation_database () =
- let file = open_out "xenapi_errors.lua" in
- fprintf file "xenapi_exceptions = {}\n";
- Hashtbl.iter (gen_error file) Datamodel.errors
-
-let _ = gen_exception_translation_database ()
-
Oops, something went wrong.

0 comments on commit 94a5fd2

Please sign in to comment.