obus-1.1.5/0000755000000000000000000000000012032535153010653 5ustar0000000000000000obus-1.1.5/obus-api.odocl0000644000000000000000000000320312032535153013412 0ustar0000000000000000# OASIS_START # DO NOT EDIT (digest: f5ebd35d6b64c25e5abd5e83d528e130) src/OBus_address src/OBus_auth src/OBus_bus src/OBus_connection src/OBus_context src/OBus_error src/OBus_info src/OBus_introspect_ext src/OBus_introspect src/OBus_match src/OBus_member src/OBus_message src/OBus_method src/OBus_name src/OBus_object src/OBus_path src/OBus_peer src/OBus_property src/OBus_proxy src/OBus_resolver src/OBus_server src/OBus_signal src/OBus_string src/OBus_transport src/OBus_uuid src/OBus_value src/OBus_wire src/OBus_interfaces bindings/hal/Hal_device bindings/hal/Hal_manager bindings/hal/Hal_interfaces src/OBus_idl bindings/network-manager/Nm_access_point bindings/network-manager/Nm_connection bindings/network-manager/Nm_device bindings/network-manager/Nm_dhcp4_config bindings/network-manager/Nm_ip4_config bindings/network-manager/Nm_ip6_config bindings/network-manager/Nm_manager bindings/network-manager/Nm_ppp bindings/network-manager/Nm_settings bindings/network-manager/Nm_vpn_connection bindings/network-manager/Nm_vpn_plugin bindings/network-manager/Nm_interfaces bindings/network-manager/Nm_monitor bindings/notification/Notification bindings/notification/Notification_interfaces bindings/policykit/Policy_kit bindings/policykit/Policy_kit_interfaces bindings/udisks/UDisks bindings/udisks/UDisks_device bindings/udisks/UDisks_port bindings/udisks/UDisks_adapter bindings/udisks/UDisks_expander bindings/udisks/UDisks_interfaces bindings/udisks/UDisks_monitor bindings/upower/UPower bindings/upower/UPower_device bindings/upower/UPower_policy bindings/upower/UPower_wakeups bindings/upower/UPower_interfaces bindings/upower/UPower_monitor # OASIS_STOP obus-1.1.5/configure0000755000000000000000000000055412032535153012566 0ustar0000000000000000#!/bin/sh # OASIS_START # DO NOT EDIT (digest: 425187ed8bfdbdd207fd76392dd243a7) set -e FST=true for i in "$@"; do if $FST; then set -- FST=false fi case $i in --*=*) ARG=${i%%=*} VAL=${i##*=} set -- "$@" "$ARG" "$VAL" ;; *) set -- "$@" "$i" ;; esac done ocaml setup.ml -configure "$@" # OASIS_STOP obus-1.1.5/Makefile0000644000000000000000000000127612032535153012321 0ustar0000000000000000# OASIS_START # DO NOT EDIT (digest: bc1e05bfc8b39b664f29dae8dbd3ebbb) SETUP = ocaml setup.ml build: setup.data $(SETUP) -build $(BUILDFLAGS) doc: setup.data build $(SETUP) -doc $(DOCFLAGS) test: setup.data build $(SETUP) -test $(TESTFLAGS) all: $(SETUP) -all $(ALLFLAGS) install: setup.data $(SETUP) -install $(INSTALLFLAGS) uninstall: setup.data $(SETUP) -uninstall $(UNINSTALLFLAGS) reinstall: setup.data $(SETUP) -reinstall $(REINSTALLFLAGS) clean: $(SETUP) -clean $(CLEANFLAGS) distclean: $(SETUP) -distclean $(DISTCLEANFLAGS) setup.data: $(SETUP) -configure $(CONFIGUREFLAGS) .PHONY: build doc test all install uninstall reinstall clean distclean configure # OASIS_STOP obus-1.1.5/CHANGES.darcs0000644000000000000000000025006412032535152012747 0ustar0000000000000000Tue Oct 2 11:56:47 CEST 2012 Jeremie Dimino tagged 1.1.5 Tue Oct 2 11:56:33 CEST 2012 Jeremie Dimino * bump version number Tue Oct 2 11:56:21 CEST 2012 Jeremie Dimino * update CHANGES Tue Oct 2 11:48:24 CEST 2012 Jeremie Dimino * remove OBus_top Tue Oct 2 11:38:06 CEST 2012 Jeremie Dimino * follow type-conv incompatible changes Mon Jul 30 20:25:32 CEST 2012 Jeremie Dimino tagged 1.1.4 Mon Jul 30 20:25:25 CEST 2012 Jeremie Dimino * bump version number Mon Jul 30 20:25:14 CEST 2012 Jeremie Dimino * update CHANGES Fri May 11 19:16:54 CEST 2012 Jeremie Dimino * upgrade versions in _oasis to oasis 0.3 Wed Apr 25 08:10:52 CEST 2012 Jeremie Dimino * update setup.ml for oasis 0.3.0 Thu Mar 15 02:28:40 CET 2012 Jeremie Dimino * add OBus_connection.send_message_keep_serial for implementing a D-Bus daemon Thu Mar 15 02:13:03 CET 2012 Jeremie Dimino * do not share OBus_connection.active Wed Mar 14 21:07:36 CET 2012 Jeremie Dimino * fix a double-close of file-descriptor Wed Mar 14 11:16:50 CET 2012 Jeremie Dimino * typos: replace UDisks_monitor by UPower_monitor in upower bindings Wed Mar 14 11:13:38 CET 2012 Jeremie Dimino * compatibility with latest oasis Wed Jan 4 15:15:05 CET 2012 Jeremie Dimino * depend on camlp4 instead of camlp4.lib for the syntax extension Fri Jul 29 21:50:43 CEST 2011 Jeremie Dimino tagged 1.1.3 Fri Jul 29 21:50:38 CEST 2011 Jeremie Dimino * version 1.1.3 Fri Jul 29 21:48:14 CEST 2011 Jeremie Dimino * implement the new eavesdrop match rule key Thu Jul 28 21:36:33 CEST 2011 Jeremie Dimino * add a minimal setup.ml file Sat Jun 18 18:24:16 CEST 2011 Jeremie Dimino * remove oasis files from the repository Thu Jun 16 20:33:28 CEST 2011 Jeremie Dimino * type-conv.syntax -> type-conv Sun May 1 21:44:33 CEST 2011 Jeremie Dimino * read /etc/machine-id if the machine uuid file cannot be read Mon May 30 20:17:06 CEST 2011 Jeremie Dimino * use oasis 0.2.1 Thu Apr 14 13:00:05 CEST 2011 Jeremie Dimino * typo Tue Apr 12 19:20:44 CEST 2011 Jeremie Dimino tagged 1.1.2 Tue Apr 12 19:20:38 CEST 2011 Jeremie Dimino * version 1.1.2 Tue Apr 12 19:20:05 CEST 2011 Jeremie Dimino * update CHANGES Mon Apr 11 22:27:31 CEST 2011 Jeremie Dimino * update argNpath matching and handle argNnamespace Tue Mar 15 17:37:18 CET 2011 Jeremie Dimino * change the network-manager example Mon Mar 14 23:41:49 CET 2011 Jeremie Dimino * allow to monitor signals comming from any objects of a peer Tue Mar 15 17:25:20 CET 2011 Jeremie Dimino * replace Lwt_react.{E,S}.notify* by Lwt_react.{E,S}.keep Thu Mar 10 22:14:40 CET 2011 Jeremie Dimino * use new D-Bus errors Thu Mar 10 16:41:24 CET 2011 Jeremie Dimino * use Lwt_react instead of Lwt_event,Lwt_signal Thu Mar 10 10:20:25 CET 2011 Jeremie Dimino * implements upower and udisks properties monitoring Mon Feb 14 23:30:26 CET 2011 Jeremie Dimino * version 1.1.1 Thu Mar 10 02:09:12 CET 2011 Jeremie Dimino * add an example for network-manager Wed Mar 9 23:58:30 CET 2011 Jeremie Dimino * implement property monitoring for network-manager Mon Feb 14 23:10:54 CET 2011 Jeremie Dimino * add a CHANGES file Mon Feb 14 19:40:42 CET 2011 Jeremie Dimino * try to get the session bus address from launchd when the environment variable is not set Mon Feb 14 16:50:03 CET 2011 Jeremie Dimino * do not call oasis in predist.sh Mon Feb 14 16:47:50 CET 2011 Jeremie Dimino * use listings in the manual Mon Feb 14 13:25:47 CET 2011 Jeremie Dimino * add launchd support Mon Feb 14 11:53:15 CET 2011 Jeremie Dimino * add a boring file Sun Jan 9 12:48:59 CET 2011 Jeremie Dimino * only use read and write during authentication Sun Jan 9 10:32:56 CET 2011 Jeremie Dimino * fix a race condition in servers that may cause end-of-authentication to hang Thu Dec 16 17:31:15 CET 2010 Jeremie Dimino * add a constraint for the ocaml version in _oasis Mon Dec 13 14:48:59 CET 2010 Jeremie Dimino tagged 1.1 Mon Dec 13 14:48:55 CET 2010 Jeremie Dimino * version 1.1 Sat Nov 27 01:40:39 CET 2010 Jeremie Dimino * replace Lwt.set by Lwt.with_value Wed Nov 24 20:57:51 CET 2010 Jeremie Dimino * update to match last version of lwt Thu Nov 18 09:06:55 CET 2010 Jeremie Dimino * use Lwt_unix.getaddrinfo instead of Unix.getaddrinfo Thu Nov 18 04:29:20 CET 2010 Jeremie Dimino * use new lwt async unix calls Wed Nov 17 13:02:11 CET 2010 Jeremie Dimino * Lwt_unix.close now returns a thread Wed Nov 17 12:59:26 CET 2010 Jeremie Dimino * pass the context via local storage to method call handlers Mon Nov 8 17:27:47 CET 2010 Jeremie Dimino * put code examples into boxes in the manual Tue Nov 2 19:31:03 CET 2010 Jeremie Dimino * add files generated by 'oasis setup' Sat Oct 23 02:08:57 CEST 2010 Jeremie Dimino * add darcs info to _oasis Sat Oct 23 01:58:17 CEST 2010 Jeremie Dimino * add oasis files to the repository Sat Oct 23 01:43:58 CEST 2010 Jeremie Dimino * udpate oasis stuff to oasis 0.2 Tue Oct 12 18:34:26 CEST 2010 Jeremie Dimino * add the inputenc package for the manual Wed Oct 6 21:07:11 CEST 2010 Jeremie Dimino * fix behavior in OBus_resolver when the service is initially not present Tue Oct 5 00:41:40 CEST 2010 Jeremie Dimino * remove colors in the manual Tue Oct 5 00:39:50 CEST 2010 Jeremie Dimino * rename Makefile to make-dist.sh Tue Sep 7 16:20:13 CEST 2010 Jeremie Dimino * more doc Tue Sep 7 11:06:48 CEST 2010 Jeremie Dimino * remove code files for the manual Tue Sep 7 11:02:05 CEST 2010 Jeremie Dimino * open the interface module in generated files Tue Sep 7 11:01:54 CEST 2010 Jeremie Dimino * add obus-introspect to _oasis Tue Sep 7 10:51:01 CEST 2010 Jeremie Dimino * changes in the manual Mon Sep 6 19:17:27 CEST 2010 Jeremie Dimino * use meldor for syntax highlighting Mon Sep 6 08:43:38 CEST 2010 Jeremie Dimino * make the manual to depends on code examples Sun Sep 5 18:36:09 CEST 2010 Jeremie Dimino * remove the VERSION file The version is now defined in the _oasis file. Sun Sep 5 18:12:08 CEST 2010 Jeremie Dimino * build the manual when in dev mode Sun Sep 5 18:06:08 CEST 2010 Jeremie Dimino * add tests and examples to _oasis Sun Sep 5 16:20:36 CEST 2010 Jeremie Dimino * make Pa_obus an internal module Sun Sep 5 10:05:37 CEST 2010 Jeremie Dimino * remove manual/_tags Sun Sep 5 09:54:57 CEST 2010 Jeremie Dimino * update the README Sun Sep 5 09:35:19 CEST 2010 Jeremie Dimino * switch to oasis Sat Sep 4 16:19:56 CEST 2010 Jeremie Dimino * install user manual with oasis Sat Sep 4 16:15:45 CEST 2010 Jeremie Dimino * change installation directory for man-pages Sat Sep 4 19:12:22 CEST 2010 Jeremie Dimino * more doc Sat Sep 4 13:15:00 CEST 2010 Jeremie Dimino * use raise_lwt instead of fail Fri Sep 3 21:39:39 CEST 2010 Jeremie Dimino * more doc Fri Sep 3 17:19:54 CEST 2010 Jeremie Dimino * add an _oasis file Fri Sep 3 11:56:34 CEST 2010 Jeremie Dimino * more doc Fri Sep 3 08:37:16 CEST 2010 Jeremie Dimino * better way of colorizing code Thu Sep 2 16:25:21 CEST 2010 Jeremie Dimino * colorize code examples in the manual Thu Sep 2 13:12:29 CEST 2010 Jeremie Dimino * adds sections to the manual Tue Aug 31 18:56:41 CEST 2010 Jeremie Dimino * uncomment code commented by mistake Tue Aug 31 18:50:37 CEST 2010 Jeremie Dimino * update the README Sun Aug 29 19:53:48 CEST 2010 Jeremie Dimino * fix garbage collection of signals, resolves, ... Sun Aug 29 18:26:50 CEST 2010 Jeremie Dimino * typo Sun Aug 29 11:54:41 CEST 2010 Jeremie Dimino * add switches to connections and transports Sun Aug 29 10:57:03 CEST 2010 Jeremie Dimino * update switch uses Sun Aug 29 10:42:19 CEST 2010 Jeremie Dimino * replace OBus_connection.support_unix_fd by OBus_connection.can_send_*_type Sun Aug 29 10:33:06 CEST 2010 Jeremie Dimino * add switches to servers Sat Aug 28 16:36:30 CEST 2010 Jeremie Dimino * better naming of tools output files Sat Aug 28 16:18:41 CEST 2010 Jeremie Dimino * refactoring and better API Sun Aug 15 18:29:36 CEST 2010 Jeremie Dimino * replace string option by string for the type of names Sun Aug 15 13:27:44 CEST 2010 Jeremie Dimino * refactoring in _tags Thu Aug 12 08:33:39 CEST 2010 Jeremie Dimino * put use-ocamlfind in myocamlbuild.ml Wed Aug 11 11:23:33 CEST 2010 Jeremie Dimino * update the compilation process with new ocaml 3.12 features Sun Aug 1 19:59:24 CEST 2010 Jeremie Dimino * replace "running_of_connection connection" by "connection#get" Sun Aug 1 19:51:43 CEST 2010 Jeremie Dimino * add a Makefile for the manual Sat Jun 26 17:06:18 CEST 2010 Jeremie Dimino * fix compiplation with ocaml 3.12 Tue Jun 22 21:40:20 CEST 2010 Jeremie Dimino * doc Sun Jun 20 13:13:19 CEST 2010 Jeremie Dimino * typo Sun Jun 20 00:15:54 CEST 2010 Jeremie Dimino * rename records with shorter field names Thu Jun 17 13:13:01 CEST 2010 Jeremie Dimino * Fix D-Bus error mapping Thu Jun 17 09:48:34 CEST 2010 Jeremie Dimino * uses a private type only for argument filters in OBus_match Thu Jun 17 09:36:23 CEST 2010 Jeremie Dimino * only invalidates the property cache when the owner is present Thu Jun 17 09:34:38 CEST 2010 Jeremie Dimino * make server code a bit more readable Thu Jun 17 09:25:08 CEST 2010 Jeremie Dimino * invalidates the property cache when the owner changes Wed Jun 16 14:39:25 CEST 2010 Jeremie Dimino * remove pa_monad from _tags Wed Jun 16 14:37:17 CEST 2010 Jeremie Dimino * remove pa_monad Not used anymore. Sat Jun 12 15:23:48 CEST 2010 Jeremie Dimino * add syntax/pa_obus.ml Fri Jun 11 11:30:04 CEST 2010 Jeremie Dimino * typo Fri Jun 11 11:23:30 CEST 2010 Jeremie Dimino * rewrite error handling Thu Jun 3 08:59:30 CEST 2010 Jeremie Dimino * simplify D-Bus errors Wed Jun 2 22:30:28 CEST 2010 Jeremie Dimino * small enhancement in OBus_idl Fri May 28 15:37:54 CEST 2010 Jeremie Dimino * add obus_idl.mllib Fri May 28 13:29:52 CEST 2010 Jeremie Dimino * obus.idl depends on camlp4.lib and not camlp4 Fri May 28 13:19:52 CEST 2010 Jeremie Dimino * make the idl available as a sub-library Fri May 28 03:29:33 CEST 2010 Jeremie Dimino * send interfaces annotations in introspection Fri May 28 03:24:09 CEST 2010 Jeremie Dimino * fix annotaions printing in obus-gen-interface Wed May 26 14:59:00 CEST 2010 Jeremie Dimino * typo Wed May 26 08:38:07 CEST 2010 Jeremie Dimino * handle sign in annotations Wed May 26 02:27:13 CEST 2010 Jeremie Dimino * extend D-Bus interface by using annotations Mon May 24 16:32:00 CEST 2010 Jeremie Dimino * typo Sat May 22 13:22:49 CEST 2010 Jeremie Dimino * fix an inversion in an error message Sat May 22 10:26:05 CEST 2010 Jeremie Dimino * add an emacs mode for editing idl files Thu May 20 15:24:16 CEST 2010 Jeremie Dimino * use less quotes in idl files Thu May 20 13:25:40 CEST 2010 Jeremie Dimino * print annotations when converting an xml file to an idl file Thu May 20 13:21:20 CEST 2010 Jeremie Dimino * remove ocaml keywords in the parser of idl files Thu May 20 11:57:31 CEST 2010 Jeremie Dimino * add support for annotations in idl files Thu May 20 09:46:05 CEST 2010 Jeremie Dimino * do not call generate in OBus_object.make Thu May 20 09:34:43 CEST 2010 Jeremie Dimino * fix arguments of obus-gen-interface Thu May 20 08:31:45 CEST 2010 Jeremie Dimino * do not allow methods with the same name and different types Thu May 20 08:22:59 CEST 2010 Jeremie Dimino * fix property notification modes Thu May 20 01:16:09 CEST 2010 Jeremie Dimino * use auto-generated code for common interfaces Wed May 19 23:53:58 CEST 2010 Jeremie Dimino * handle annotations for local objects Wed May 19 13:23:36 CEST 2010 Jeremie Dimino * handle members annotations Wed May 19 12:55:26 CEST 2010 Jeremie Dimino * allow to use another notification system for objects' properties Wed May 19 11:45:40 CEST 2010 Jeremie Dimino * add OBus_property.monitor_custom Wed May 19 11:24:21 CEST 2010 Jeremie Dimino * implement OBus_property.monitor_wiht_stopper Wed May 19 11:20:50 CEST 2010 Jeremie Dimino * better handling of cached properties Tue May 18 15:59:27 CEST 2010 Jeremie Dimino * fix tests Tue May 18 15:55:45 CEST 2010 Jeremie Dimino * change the type of OBus_method.reply This prevent from not repsonding to a message by mistake Tue May 18 10:41:39 CEST 2010 Jeremie Dimino * use the new standard PropertiesChanged signal Sat May 8 13:49:24 CEST 2010 Jeremie Dimino * typo in network-manager: int32 instead of uint32 Fri May 7 19:43:29 CEST 2010 Jeremie Dimino * split the network manager bindings into several modules Fri May 7 18:48:44 CEST 2010 Jeremie Dimino * handle interfaces without method and without property Wed May 5 13:54:12 CEST 2010 Jeremie Dimino * enhancement in rule set computation Now, we compute the minimal set of incomparable most general rules. Tue May 4 10:06:52 CEST 2010 Jeremie Dimino * make the notify_mode argument recquired Tue May 4 09:41:08 CEST 2010 Jeremie Dimino * allow to add/remove several interfaces at the same time Tue May 4 08:36:43 CEST 2010 Jeremie Dimino * do not keep message bodies in contexts Mon May 3 11:17:28 CEST 2010 Jeremie Dimino * change the way of returnig the reply to a method call Mon May 3 09:00:31 CEST 2010 Jeremie Dimino * replace oBus_interfaces.ml* by oBus_interfaces.obus Sun May 2 22:36:10 CEST 2010 Jeremie Dimino * rewrite contexts stuff Thu Apr 29 16:06:09 CEST 2010 Jeremie Dimino * typo Wed Apr 28 14:54:50 CEST 2010 Jeremie Dimino * use more property groups Tue Apr 27 21:16:50 CEST 2010 Jeremie Dimino * add property groups Sat Apr 24 13:26:51 CEST 2010 Jeremie Dimino * sort members in obus-gen-interface Sat Apr 24 13:06:47 CEST 2010 Jeremie Dimino * fix order of methods of the properties interface Sat Apr 24 11:59:36 CEST 2010 Jeremie Dimino * call OBus_object.generate after data has been attached Fri Apr 23 17:28:59 CEST 2010 Jeremie Dimino * add OBus_property.updates Fri Apr 23 09:28:02 CEST 2010 Jeremie Dimino * use records instead of labelled arguments for service code This imporve error messages. Fri Apr 23 02:30:34 CEST 2010 Jeremie Dimino * fix code generated by obus-gen-server Thu Apr 22 13:39:21 CEST 2010 Jeremie Dimino * optimization in OBus_auth Thu Apr 22 13:12:43 CEST 2010 Jeremie Dimino * typo Sun Apr 18 19:34:24 CEST 2010 Jeremie Dimino * switch to melt for the user manual Sun Apr 18 17:12:20 CEST 2010 Jeremie Dimino * adds dynamic value converters Sat Apr 17 22:30:55 CEST 2010 Jeremie Dimino * typo... Sat Apr 17 22:03:52 CEST 2010 Jeremie Dimino * typo Sat Apr 17 18:05:00 CEST 2010 Jeremie Dimino * typo Wed Apr 14 20:58:56 CEST 2010 Jeremie Dimino * fix server code printing Wed Apr 14 16:14:37 CEST 2010 Jeremie Dimino * fix IDL parsing Tue Apr 13 11:32:22 CEST 2010 Jeremie Dimino * do not requires full camlp4 for the idl Tue Apr 13 11:25:24 CEST 2010 Jeremie Dimino * fix installation new tools Tue Apr 13 09:26:23 CEST 2010 Jeremie Dimino * add an IDL language Mon Apr 12 14:23:49 CEST 2010 Jeremie Dimino * simplifications Tue Apr 6 16:18:26 CEST 2010 Jeremie Dimino * better errors on cast failures Mon Apr 5 19:29:11 CEST 2010 Jeremie Dimino * allow to create custom notification modes for local objects Mon Apr 5 19:17:52 CEST 2010 Jeremie Dimino * always close duplicated file descriptors after sending a message Mon Apr 5 19:14:19 CEST 2010 Jeremie Dimino * duplicate file descriptors before sending them Mon Apr 5 18:39:42 CEST 2010 Jeremie Dimino * fix a fd leak in OBus_wire When a message failed to be read, file descriptor removed from the queue were not closed. Mon Apr 5 18:10:54 CEST 2010 Jeremie Dimino * allow to cache properties, even if we are not using property monitoring Mon Apr 5 13:58:43 CEST 2010 Jeremie Dimino * remove OBusPropertiesChanged Mon Apr 5 00:31:35 CEST 2010 Jeremie Dimino * allow to choose the notification mode Sun Apr 4 23:23:56 CEST 2010 Jeremie Dimino * more efficient local objects Methods and properties are not stored in sorted arrays. Sun Apr 4 15:13:22 CEST 2010 Jeremie Dimino * refactoring Sun Apr 4 09:30:23 CEST 2010 Jeremie Dimino * fix automatic introspection Sun Apr 4 09:06:50 CEST 2010 Jeremie Dimino * add property change notifications for local objects Sat Apr 3 15:31:17 CEST 2010 Jeremie Dimino * better control of property change notifications Fri Apr 2 14:36:18 CEST 2010 Jeremie Dimino * allow to unmonitor a proeprty Fri Apr 2 14:23:05 CEST 2010 Jeremie Dimino * add more helpers in OBus_proxy for properties Fri Apr 2 10:06:40 CEST 2010 Jeremie Dimino * smarter update of properties When the notification signal contains update informations, use them instead of calling GetAll. Thu Apr 1 18:17:30 CEST 2010 Jeremie Dimino * filter incomming signals with argument filters Thu Apr 1 17:56:09 CEST 2010 Jeremie Dimino * Refactoring - move helpers of OBus_connection to OBus_{method,signal,property} - keep only basic functions in OBus_connection - OBus_connection do not depdends anymore on OBus_type, so we can define the context type directly in OBus_type and remove the ugly hack with exceptions... Wed Mar 31 15:48:50 CEST 2010 Jeremie Dimino * drops non-standard extensions of introspection documents Wed Mar 31 15:10:11 CEST 2010 Jeremie Dimino * fix a type in tools/print.ml Wed Mar 31 14:41:49 CEST 2010 Jeremie Dimino * fix UDisks bindings Wed Mar 31 14:23:57 CEST 2010 Jeremie Dimino * add UDisks.Permission_denied Wed Mar 31 14:18:24 CEST 2010 Jeremie Dimino * add bindings for udisks Wed Mar 31 10:47:44 CEST 2010 Jeremie Dimino * add the exception Policy_kit.Not_authorized Wed Mar 31 10:41:36 CEST 2010 Jeremie Dimino * add bindings for policykit Wed Mar 31 08:26:20 CEST 2010 Jeremie Dimino * use labelled arguments in generated bindings Wed Mar 31 08:09:42 CEST 2010 Jeremie Dimino * add exceptions for UPower Wed Mar 31 00:24:30 CEST 2010 Jeremie Dimino * enhancements in the UPower binding Tue Mar 30 22:17:07 CEST 2010 Jeremie Dimino * enhancement in OBus_property Tue Mar 30 21:17:41 CEST 2010 Jeremie Dimino * Better handling of properties Automatic use of Changed+GetAll Tue Mar 30 14:22:45 CEST 2010 Jeremie Dimino * add OBus_signal Tue Mar 30 10:49:04 CEST 2010 Jeremie Dimino * start of a binding to upower Tue Mar 30 09:42:47 CEST 2010 Jeremie Dimino * add helpers for private proxies Tue Mar 30 02:41:23 CEST 2010 Jeremie Dimino * add "broken" type combinators Tue Mar 30 01:35:29 CEST 2010 Jeremie Dimino * fix arguments for obus-dump Mon Mar 29 20:25:39 CEST 2010 Jeremie Dimino * add copyright to network-manager files Mon Mar 29 20:23:08 CEST 2010 Jeremie Dimino * do not install pa_obus.cma twice Mon Mar 29 19:58:44 CEST 2010 Jeremie Dimino * fix bindings printing Mon Mar 29 19:40:10 CEST 2010 Jeremie Dimino * do not depends on lwt.text Mon Mar 29 19:30:40 CEST 2010 Jeremie Dimino * install bindings .a files Mon Mar 29 19:06:58 CEST 2010 chambart@crans.org * NetworkManager binding Mon Mar 29 11:33:28 CEST 2010 Jeremie Dimino * allow to enable/disable automatic match rules management Sun Mar 28 12:58:22 CEST 2010 Jeremie Dimino * better tests Sun Mar 28 01:15:04 CET 2010 Jeremie Dimino * start better unit tests Sun Mar 28 00:41:19 CET 2010 Jeremie Dimino * rename SELinux... -> Selinux... Sat Mar 27 10:21:20 CET 2010 Jeremie Dimino * fix validation of bus names Thu Mar 25 21:08:01 CET 2010 Jeremie Dimino * change OBus_bus.session and OBus_bus.system Thu Mar 25 18:30:38 CET 2010 Jeremie Dimino * add bindings to doc Thu Mar 25 16:41:22 CET 2010 Jeremie Dimino * fix css copying Thu Mar 25 16:16:21 CET 2010 Jeremie Dimino * typo Thu Mar 25 16:09:41 CET 2010 Jeremie Dimino * fix the doc rule of the Makefile Thu Mar 25 16:02:13 CET 2010 Jeremie Dimino * better compilation rules It is now possible to compile/install only libraries Thu Mar 25 11:28:03 CET 2010 Jeremie Dimino * Lwt_log.exn -> Lwt_log.error Thu Mar 25 08:01:36 CET 2010 Jeremie Dimino * css: fix color of keyword symbols Thu Mar 25 00:34:50 CET 2010 Jeremie Dimino * css: highlight definitions Wed Mar 24 21:05:53 CET 2010 Jeremie Dimino * minor css changes Wed Mar 24 11:01:03 CET 2010 Jeremie Dimino * copy the css to the doc directory Wed Mar 24 09:43:19 CET 2010 Jeremie Dimino * make documentation more beautiful Tue Mar 23 22:58:23 CET 2010 Jeremie Dimino * do not use camlp4 on .mli, cleanup _tags and fix doc Tue Mar 23 18:57:49 CET 2010 Jeremie Dimino * add categories to documentation Tue Mar 23 16:32:05 CET 2010 Jeremie Dimino * update signal connection Sun Mar 21 18:21:51 CET 2010 Jeremie Dimino * uses new lwt logs Sat Mar 20 15:03:34 CET 2010 Jeremie Dimino * Lwt.select --> Lwt.pick Fri Mar 19 02:20:55 CET 2010 Jeremie Dimino * resolvers enhancements Fri Mar 19 02:09:27 CET 2010 Jeremie Dimino * server enhancement Wed Mar 17 18:51:50 CET 2010 Jeremie Dimino * signal handling enhancement Tue Mar 16 20:23:20 CET 2010 Jeremie Dimino * repalce Lwt_main.fast_yield by Lwt.pause Tue Mar 16 18:50:34 CET 2010 Jeremie Dimino * add finalisers for events and signals Mon Mar 15 21:41:08 CET 2010 Jeremie Dimino * Lwt_stream.push_stream --> Lwt_stream.create Mon Mar 15 17:15:25 CET 2010 Jeremie Dimino * remove the O{P,L}_interface keywords Not needed Mon Mar 15 13:32:39 CET 2010 Jeremie Dimino * add the error "org.freedesktop.Error.InvalidArgs" mapped to Invalid_argument Fri Mar 12 18:10:37 CET 2010 Jeremie Dimino * add a depency to lwt.react Fri Mar 12 00:27:47 CET 2010 Jeremie Dimino * fix a fd leak when passing fds Fri Mar 5 11:28:28 CET 2010 Jeremie Dimino * make name validation faster (~4 times faster) Thu Mar 4 16:30:16 CET 2010 Jeremie Dimino * log message bus openning problems Tue Mar 2 16:46:52 CET 2010 Jeremie Dimino * srting validation a bit more efficient Tue Mar 2 15:25:05 CET 2010 Jeremie Dimino * fix random float generation in tests Tue Mar 2 10:36:52 CET 2010 Jeremie Dimino * allow to not replace the on_disconnect function in OBus_bus.register_connection Mon Mar 1 23:12:57 CET 2010 Jeremie Dimino * fix a serialization bug Mon Mar 1 13:54:28 CET 2010 Jeremie Dimino * add sections in oBus_server.ml Mon Mar 1 11:57:56 CET 2010 Jeremie Dimino * rename OBus_error.unmake to OBus_error.cast Mon Mar 1 11:23:09 CET 2010 Jeremie Dimino * server-side nonce-tcp transport Mon Mar 1 10:26:00 CET 2010 Jeremie Dimino * client-side nonce-tcp transport Mon Mar 1 09:55:25 CET 2010 Jeremie Dimino * better support of server-side tcp transport Mon Mar 1 08:32:40 CET 2010 Jeremie Dimino * change the semantic of server listenning failure If we cannot listen on one of the addresses, we fail. Sun Feb 28 17:24:48 CET 2010 Jeremie Dimino * rename test to tests Sun Feb 28 17:18:41 CET 2010 Jeremie Dimino * fix camlp4 code generation Sun Feb 28 17:09:26 CET 2010 Jeremie Dimino * rewrite syntax tests Sun Feb 28 16:51:39 CET 2010 Jeremie Dimino * fix code generation Sun Feb 28 12:12:26 CET 2010 Jeremie Dimino * add support for custom bus address in obus-dump Sun Feb 28 11:01:45 CET 2010 Jeremie Dimino * add OX_interface keywords Sun Feb 28 01:09:09 CET 2010 Jeremie Dimino * new way of defining interfaces Fri Feb 26 10:49:10 CET 2010 Jeremie Dimino * ensures that argument filter indexes are between 0 and 63 Thu Feb 25 19:11:55 CET 2010 Jeremie Dimino * OBus_signal.t -> OBus_proxy.signal in obus-binder Thu Feb 25 18:47:16 CET 2010 Jeremie Dimino * OBus_object enhancement Thu Feb 25 18:17:05 CET 2010 Jeremie Dimino * typo Thu Feb 25 18:10:39 CET 2010 Jeremie Dimino * allow to sets argument filters Thu Feb 25 16:43:05 CET 2010 Jeremie Dimino * add path-style matching on message arguments Thu Feb 25 15:27:57 CET 2010 Jeremie Dimino * add OBus_object.S Thu Feb 25 15:02:19 CET 2010 Jeremie Dimino * functorize the OBus_proxy module, and remove uneeded modules Thu Feb 25 10:54:08 CET 2010 Jeremie Dimino * add more exception printers Sat Feb 20 18:39:37 CET 2010 Jeremie Dimino * use fast_yield instead of yield in OBus_server Sat Feb 20 12:20:28 CET 2010 Jeremie Dimino * bugfix in address parsing Sat Feb 20 12:01:51 CET 2010 Jeremie Dimino * better handling of transport/server creation errors Fri Feb 19 18:14:23 CET 2010 Jeremie Dimino * Better handling of lexer errors Fri Feb 19 14:19:37 CET 2010 Jeremie Dimino * make OBus_bus.acquired_names a signal Fri Feb 19 14:10:18 CET 2010 Jeremie Dimino * use React.signal for varaibles that may change over the time Fri Feb 19 13:25:20 CET 2010 Jeremie Dimino * renaming of polymorphic variants Fri Feb 19 11:26:15 CET 2010 Jeremie Dimino * update logging instructions Thu Feb 18 20:05:25 CET 2010 Jeremie Dimino * udpate logging instructions Wed Feb 17 21:35:00 CET 2010 Jeremie Dimino * handle Out_of_memory in the dispatcher Wed Feb 17 11:31:38 CET 2010 Jeremie Dimino * bugfix: double wakeup of resolver initialisation thread Wed Feb 17 11:07:13 CET 2010 Jeremie Dimino * do not fail when the sending of a message is canceled Wed Feb 17 10:10:36 CET 2010 Jeremie Dimino * allow to cancel the sending of a message Wed Feb 10 10:04:57 CET 2010 Jeremie Dimino * remove macros from OBus_connection.ml Code with macros is less readable. Mon Feb 8 20:13:36 CET 2010 Jeremie Dimino * allow labelled arguments in obus-types Sun Jan 31 09:34:55 CET 2010 Jeremie Dimino * allow interface with a custom proxy type Thu Jan 28 18:23:26 CET 2010 Jeremie Dimino * do not closes everything on exit Thu Jan 28 11:26:52 CET 2010 Jeremie Dimino * fix a dead-lock when sending several messages in parallel Wed Jan 27 23:18:31 CET 2010 Jeremie Dimino * add OBus_bus.Access_denied Wed Jan 27 16:25:28 CET 2010 Jeremie Dimino * add labels for OBus_{peer,proxy}.make Tue Jan 26 22:09:20 CET 2010 Jeremie Dimino * correspondance table for types Tue Jan 26 22:06:47 CET 2010 Jeremie Dimino * add predist.sh Tue Jan 26 18:31:26 CET 2010 Jeremie Dimino * start of documentation Tue Jan 19 16:33:54 CET 2010 Jeremie Dimino * add support for dynamic objects Tue Jan 19 15:42:43 CET 2010 Jeremie Dimino * fix OBus_path.escape Sun Jan 17 18:42:22 CET 2010 Jeremie Dimino * doc Sat Jan 16 17:36:14 CET 2010 Jeremie Dimino * duplicate file descriptors in the loopback transport Sat Jan 16 17:16:03 CET 2010 Jeremie Dimino * do not creates the loopback connection by default Sat Jan 16 17:09:45 CET 2010 Jeremie Dimino * add arguments to OBus_type.Cast_failure Sat Jan 16 16:31:58 CET 2010 Jeremie Dimino * better handling of exceptions Sat Jan 16 14:59:31 CET 2010 Jeremie Dimino * enhancement for reading/writing messages with fds Sat Jan 16 14:01:57 CET 2010 Jeremie Dimino * do not use buffering for authentication Sat Jan 16 11:58:08 CET 2010 Jeremie Dimino * handle unix fd passing in obus-dump Sat Jan 16 11:52:22 CET 2010 Jeremie Dimino * implementation of external and anonymous authentication mechanisms for server-side Sat Jan 16 00:36:15 CET 2010 Jeremie Dimino * implementation of fd passing over unix socket Fri Jan 15 01:46:34 CET 2010 Jeremie Dimino * style Fri Jan 15 01:35:06 CET 2010 Jeremie Dimino * change build order Build documentation after the lib. Thu Jan 14 21:21:35 CET 2010 Jeremie Dimino * move OBus_type.Pervasives to OBus_pervasives Tue Jan 12 13:22:23 CET 2010 Jeremie Dimino * Lwt_util --> Lwt_list Sun Jan 10 12:26:15 CET 2010 Jeremie Dimino * fix method calls of OBus_bus Tue Dec 22 10:19:30 CET 2009 Jeremie Dimino * remove logs with level notice Sat Dec 19 13:43:29 CET 2009 Jeremie Dimino * yield before dispatching in OBus_server Sat Dec 12 19:47:41 CET 2009 Jeremie Dimino * add the obus_array combinator Fri Dec 11 22:47:11 CET 2009 Jeremie Dimino * rename tests Fri Dec 11 22:44:43 CET 2009 Jeremie Dimino * rename OBus_type.Perv to OBus_type.Pervasives Tue Nov 10 08:46:48 CET 2009 Jeremie Dimino * replace the logging system by the one of Lwt Mon Nov 2 06:37:52 CET 2009 Jeremie Dimino * close file descriptors on exec Tue Oct 20 15:43:45 CEST 2009 Jeremie Dimino * more features for objects Sat Oct 17 16:11:49 CEST 2009 Jeremie Dimino * fix hal bindings Fri Oct 16 16:44:14 CEST 2009 Jeremie Dimino * s/DBus/D-BUS Fri Oct 16 12:40:46 CEST 2009 Jeremie Dimino * use '$(wildcard ...)' in the Makefile so we do not fail on bytecode only architecture since .cmx* are not present. Wed Oct 14 01:38:43 CEST 2009 Jeremie Dimino * add the date to manpages Wed Oct 14 01:38:23 CEST 2009 Jeremie Dimino * s/authentification/authentication/ Tue Oct 13 20:26:17 CEST 2009 Jeremie Dimino * typo Tue Oct 13 19:16:22 CEST 2009 Jeremie Dimino * fix scripts Tue Oct 13 14:46:36 CEST 2009 Jeremie Dimino * make obus depends on lwt.unix instead of lwt Tue Oct 13 08:15:22 CEST 2009 Jeremie Dimino * add manual pages Tue Oct 13 07:24:18 CEST 2009 Jeremie Dimino * fix printing of property signatures Tue Oct 13 01:59:46 CEST 2009 Jeremie Dimino * fix signatures printing Sun Oct 11 21:56:23 CEST 2009 Jeremie Dimino tagged 1.0rc1 Sun Oct 11 21:56:13 CEST 2009 Jeremie Dimino * version 1.0rc1 Sun Oct 11 21:45:13 CEST 2009 Jeremie Dimino * switch to xmlm Sun Oct 11 19:42:21 CEST 2009 Jeremie Dimino * added OBus_proxy.children Sun Oct 11 16:44:00 CEST 2009 Jeremie Dimino * remove OBus_config from documentation Sat Oct 10 19:57:26 CEST 2009 Jeremie Dimino * update README Sat Oct 10 19:45:37 CEST 2009 Jeremie Dimino * license fixes Sat Oct 10 19:44:40 CEST 2009 Jeremie Dimino * enhancement in the build process Sat Oct 10 19:10:56 CEST 2009 Jeremie Dimino * style Sat Oct 10 17:51:40 CEST 2009 Jeremie Dimino * remove benchmark not very use-full and i do not want to maintain it... Sat Oct 10 11:06:00 CEST 2009 Jeremie Dimino * change binder for service code generation Wed Oct 7 16:10:56 CEST 2009 Jeremie Dimino * allow to define methods and property readers/writers directly Wed Oct 7 14:30:49 CEST 2009 Jeremie Dimino * fix tests Wed Oct 7 13:41:16 CEST 2009 Jeremie Dimino * reimplementation of service offering code Sun Oct 4 09:32:46 CEST 2009 Jeremie Dimino * use [Lwt_event.always_notify*] Sat Oct 3 17:11:25 CEST 2009 Jeremie Dimino * rename OBUS_INTERFACE to OBUS_interface Thu Oct 1 19:40:15 CEST 2009 Jeremie Dimino * fix DBUS_COOKIE_SHA1 authentication Thu Oct 1 19:25:34 CEST 2009 Jeremie Dimino * modification of the behaviour of signal creation Thu Oct 1 17:59:55 CEST 2009 Jeremie Dimino * fix UTF-8 checking Wed Sep 30 21:14:25 CEST 2009 Jeremie Dimino * rewrite examples Wed Sep 30 19:20:14 CEST 2009 Jeremie Dimino * more rewriting Tue Sep 29 21:10:18 CEST 2009 Jeremie Dimino * adapt for new lwt + other changes Mon Sep 21 07:42:31 CEST 2009 Jeremie Dimino * make Match_rule public and add rule parsing Sun Sep 20 10:20:00 CEST 2009 Jeremie Dimino * put transport stuff into a separate module Sun Sep 20 08:22:41 CEST 2009 Jeremie Dimino * end of rewrite of serialization code Sat Sep 19 22:12:21 CEST 2009 Jeremie Dimino * start of a more robust serialization code Sat Sep 19 22:09:44 CEST 2009 Jeremie Dimino * changes in OBus_value - rename Structure and Tstructure to Struct and Tstruct - add Byte_array for compact representation of array of bytes - remove functors for signature serialization Thu Feb 19 00:19:32 CET 2009 Jeremie Dimino * fix a race condition in the benchmark Wed Feb 18 23:47:53 CET 2009 Jeremie Dimino * embed pa_monad It is only a build-time dependency. Wed Feb 18 23:38:37 CET 2009 Jeremie Dimino * remove pa_trace Wed Feb 18 23:31:45 CET 2009 Jeremie Dimino * add a benchmark Wed Feb 18 22:59:01 CET 2009 Jeremie Dimino * flush the connection on normal exit Wed Feb 18 22:23:54 CET 2009 Jeremie Dimino * better printing in tests Wed Feb 18 22:21:34 CET 2009 Jeremie Dimino * correctly cleanup everything at exit Tue Feb 17 17:59:42 CET 2009 Jeremie Dimino * rewrite io using custom channels - use a bigger buffer (less system calls) - more control on how to serialize things - enhancement of delayed flushing Tue Feb 17 00:58:02 CET 2009 Jeremie Dimino * minimise syscalls Add a machinery to do as few flush as possible. Sat Feb 14 22:18:45 CET 2009 Jeremie Dimino * use -linkpkg only when linking binaries Fri Feb 6 00:44:10 CET 2009 Jeremie Dimino * renaming Thu Jan 29 22:20:06 CET 2009 Jeremie Dimino * upgrade tests Fri Jan 16 14:00:39 CET 2009 Jeremie Dimino * added syntax pa_constructor Fri Jan 16 13:12:12 CET 2009 Jeremie Dimino * move the code of Types_rw to OBus_value Fri Jan 16 08:23:02 CET 2009 Jeremie Dimino * rewrite of pa_obus + modification of type combinators - pa_obus now fully use type-conv - combinators are renamed from "t..." to "obus_..." Thu Jan 15 14:13:00 CET 2009 Jeremie Dimino * added the pa_projection syntax extension Thu Jan 15 14:02:06 CET 2009 Jeremie Dimino * use the _tags file for finding packages instead of "ocamlfind list" This way, the -package option is added even for missing packages and ocamlfind report the error. Thu Jan 15 12:27:27 CET 2009 Jeremie Dimino * use a variant for message type instead of polymorphics variants Thu Jan 15 02:33:49 CET 2009 Jeremie Dimino * just pack the connection into a object Tue Jan 13 21:13:29 CET 2009 Jeremie Dimino * fix argument order for obus_emit_signal Tue Jan 13 21:07:19 CET 2009 Jeremie Dimino * let ocamlbuild generate the META file Tue Jan 13 17:38:02 CET 2009 Jeremie Dimino * change the semantic of OBus_connection.send_message_with_reply Return an error (OBus_message.error) instead of raising an exception. Tue Jan 13 16:57:15 CET 2009 Jeremie Dimino * building of shared libraries Mon Jan 12 16:45:17 CET 2009 Jeremie Dimino * rename progress samples Mon Jan 12 16:29:38 CET 2009 Jeremie Dimino * cleanup the build process Mon Jan 12 16:25:57 CET 2009 Jeremie Dimino * add usefull scripts Mon Jan 12 14:54:12 CET 2009 Jeremie Dimino * remove avahi bindings To much work to implement because of the lack of a good documentation. Mon Jan 12 14:47:30 CET 2009 Jeremie Dimino * stop support for ocaml < 3.11 Mon Jan 12 14:35:57 CET 2009 Jeremie Dimino * use a private type for hal device udi This is to be sure we do not use accidently arbitrary object path. Mon Jan 12 14:23:05 CET 2009 Jeremie Dimino * allow to use custom proxy types Mon Jan 12 12:03:32 CET 2009 Jeremie Dimino * construct a list of acquired names Mon Jan 12 11:48:15 CET 2009 Jeremie Dimino * fixes in notification - call CloseNotification on the right peer - monitor only peers we have opened notification on Mon Jan 12 01:26:00 CET 2009 Jeremie Dimino * rename notify -> notification Mon Jan 12 01:17:45 CET 2009 Jeremie Dimino * put internal modules in obus/internals This way bindings and samples do not have access to them. Mon Jan 12 00:50:26 CET 2009 Jeremie Dimino * put pervasive definitions in OBus_type.Pervasives and automatically open it Mon Jan 12 00:20:11 CET 2009 Jeremie Dimino * enhancement of the notification binding Handle all possible errors (daemon exit, ...) Mon Jan 12 00:19:30 CET 2009 Jeremie Dimino * use objects for connections instead of records This makes connections comparable. Fri Jan 9 16:17:40 CET 2009 Jeremie Dimino * integration of name resolving/monitoring used internally to corretly route signals and detect when a peer has exited. Fri Jan 9 15:56:04 CET 2009 Jeremie Dimino * module for bus methods used internally Mon Dec 1 03:37:53 CET 2008 Jeremie Dimino * [test/communication] new test Test the communication with another application not using obus. Mon Dec 1 03:29:26 CET 2008 Jeremie Dimino * [obus/name] typo Mon Dec 1 02:51:30 CET 2008 Jeremie Dimino * [test] rewrite several tests Mon Dec 1 02:50:05 CET 2008 Jeremie Dimino * [obus/value] signature validation Mon Dec 1 01:03:45 CET 2008 Jeremie Dimino * [obus/name,obus/string] refactoring Mon Dec 1 00:00:15 CET 2008 Jeremie Dimino * [obus/value] better pretty-printing Sun Nov 30 17:28:28 CET 2008 Jeremie Dimino * [obus/lowlevel] more abstraction for serializer/deserializer Sun Nov 30 14:55:28 CET 2008 Jeremie Dimino * use Filename.temp_dir_name to locate the temporary directory Sat Nov 29 16:44:41 CET 2008 Jeremie Dimino * [obus/name] check that names have at least two elements Sat Nov 29 16:28:36 CET 2008 Jeremie Dimino * make ocaml 3.11 happy about file names replace '-' by '_' in file names Sat Nov 29 16:19:22 CET 2008 Jeremie Dimino * [install] change the behaviour of make uninstall/install Sat Nov 29 16:19:02 CET 2008 Jeremie Dimino * [tags] use only pkg_* tags Sat Nov 29 16:06:26 CET 2008 Jeremie Dimino * [obus/lowlevel] functorize serialization/deserialization Sat Nov 29 16:04:49 CET 2008 Jeremie Dimino * [obus/monad] module for monad signature Sat Nov 29 16:00:24 CET 2008 Jeremie Dimino * [obus/string] new module for all strings validation Thu Nov 13 02:49:49 CET 2008 Jeremie Dimino * [obus/signal] fix enable/disable Fri Oct 31 23:27:44 CET 2008 Jeremie Dimino * [build] modifications due to change in modules Fri Oct 31 23:26:49 CET 2008 Jeremie Dimino * [syntax] adapt pa_obus for the new api Fri Oct 31 23:26:04 CET 2008 Jeremie Dimino * [tags] use the same syntax extensions for all files Fri Oct 31 23:25:42 CET 2008 Jeremie Dimino * [test] rewrite tests with the new api Fri Oct 31 23:25:21 CET 2008 Jeremie Dimino * [tools] rewrite tools with the new api Fri Oct 31 23:25:02 CET 2008 Jeremie Dimino * [samples] rewrite samples with the new api Fri Oct 31 23:24:38 CET 2008 Jeremie Dimino * [bindings] rewrite bindings for the new api Fri Oct 31 23:24:19 CET 2008 Jeremie Dimino * [obus] code cleanup Fri Oct 31 23:22:36 CET 2008 Jeremie Dimino * [obus/error] new errors + better failwith Fri Oct 31 23:21:54 CET 2008 Jeremie Dimino * [obus/message] change fields type according to change in names Fri Oct 31 23:19:23 CET 2008 Jeremie Dimino * [obus/context] remove OBus_context OBus_peer.tt and OBus_connection.tt are enough, there is no need for an additional module . Fri Oct 31 23:17:56 CET 2008 Jeremie Dimino * [obus/mset] allow to deal with nodes, and separate nodes from their sets Fri Oct 31 23:17:17 CET 2008 Jeremie Dimino * [obus/mqueue] simplify message queues Fri Oct 31 23:16:06 CET 2008 Jeremie Dimino * [obus/introspect] verify names in introspection document at parsing time Fri Oct 31 23:14:24 CET 2008 Jeremie Dimino * [obus/connection] remove signal receiver at connection level This is a lowlevel operation which can be done with filter if the user really want to do such a thing. Fri Oct 31 23:09:26 CET 2008 Jeremie Dimino * [obus] unification of diferrent proxy types - there is only one type to represent proxy: OBus_proxy.t which is now a pair of a peer and a path. - facility for creating interfaces dealing with path or connection directly are removed because this brought several problems (like name owner change) and without it the api cleaner. - also it is now possible to register to any signal emited by a peer. Fri Oct 31 23:07:02 CET 2008 Jeremie Dimino * [obus/peer] new module OBus_peer to deal with DBus peer DBus peers are represented by a connection + a name. OBus_peer also implement the "org.freedesktop.DBus.peer" interface. Fri Oct 31 23:05:46 CET 2008 Jeremie Dimino * [obus/name] code cleanup + rename Connection_unique to Unique Fri Oct 31 23:04:01 CET 2008 Jeremie Dimino * [obus/introspect] move OBus_interface in OBus_introspect Sun Oct 26 01:06:29 CEST 2008 Jeremie Dimino * [tools/obus-dump] fix argument order for launching sub-command Thu Oct 23 23:47:56 CEST 2008 Jeremie Dimino * [tools/obus-dump] tools to dump messages sent by an application Thu Oct 23 23:46:29 CEST 2008 Jeremie Dimino * [obus/transport] rewrite transport code launch authentication at creation time Wed Oct 22 06:09:52 CEST 2008 Jeremie Dimino * [obus/lowlevel] fix: calculate padding for structure and dict_entry Wed Oct 22 04:28:49 CEST 2008 Jeremie Dimino * [obus/connection] enhance error handling Wed Oct 22 03:28:39 CEST 2008 Jeremie Dimino * [obus] use lwt for all io operations Wed Oct 22 03:02:33 CEST 2008 Jeremie Dimino * [obus/value] print value without boxing + use formatters Tue Oct 21 20:53:58 CEST 2008 Jeremie Dimino * [obus/mset] rewrite MSet Tue Oct 21 19:50:01 CEST 2008 Jeremie Dimino * [log] print backtrace if ocaml >= 3.11 Sun Oct 19 15:38:42 CEST 2008 Jeremie Dimino * [name_translator] module with translations dbus names -> caml names Sun Oct 19 06:10:30 CEST 2008 Jeremie Dimino * [syntax/pa_obus] add syntax extension for method, signal and properties in client mode Sun Oct 19 00:30:27 CEST 2008 Jeremie Dimino * [syntax/pa_obus] change the syntax of dbus interfaces OBUS_class id iface = object ... end become: class virtual id = OBUS_interface iface ... end Sat Oct 18 21:33:58 CEST 2008 Jeremie Dimino * [obus/server] let the user set the connection up itself Sat Oct 18 08:22:22 CEST 2008 Jeremie Dimino * [samples/progress] new service sample Sat Oct 18 01:36:20 CEST 2008 Jeremie Dimino * [obus/object] type combinator for object Sat Oct 18 01:09:20 CEST 2008 Jeremie Dimino * [obus/object] class for object created for a specific client Sat Oct 18 00:07:15 CEST 2008 Jeremie Dimino * [obus/object] allow signal to be emited to a specific destination Fri Oct 17 23:37:38 CEST 2008 Jeremie Dimino * [obus/connection] fix error handling connections to message buses were not closed correctly when a fatal error happened Fri Oct 17 01:56:06 CEST 2008 Jeremie Dimino tagged 0.3 Fri Oct 17 01:43:12 CEST 2008 Jeremie Dimino * [doc] update README Fri Oct 17 01:15:40 CEST 2008 Jeremie Dimino * [obus/auth] remove server mechanisms which require credentials Fri Oct 17 01:00:16 CEST 2008 Jeremie Dimino * [obus/connection] handle introspection on intermediate undefined objects Fri Oct 17 00:42:47 CEST 2008 Jeremie Dimino * [syntax/pa_obus] define the type "_list" for OBUS_bitwise So we can use it in place where we need both the caml type and the dbus type. Fri Oct 17 00:09:16 CEST 2008 Jeremie Dimino * [obus/objects] set only one path by object instead of having a path by connection, use the same path for all connections an object is exported on. It is easier to handle and more natural. Thu Oct 16 20:16:40 CEST 2008 Jeremie Dimino * [obus/context] let retreive the context of method calls Thu Oct 16 19:16:17 CEST 2008 Jeremie Dimino * [bindings/notify] make the use of actions in notify simplier Thu Oct 16 18:51:01 CEST 2008 Jeremie Dimino * [obus/proxy] add functions for direct access of properties Thu Oct 16 11:51:03 CEST 2008 Jeremie Dimino * [obus/proxy] change argument order the proxy argument is now in first position Thu Oct 16 11:41:45 CEST 2008 Jeremie Dimino * [signals] use sequence types instead of functionnal types for signals this is more natural since signals do not have a reply, this avoid extra anoying "-> unit". Thu Oct 16 10:58:16 CEST 2008 Jeremie Dimino * [obus/connection] remove the message queue from the connection Thu Oct 16 10:30:39 CEST 2008 Jeremie Dimino * [objects] abstract interface definition + syntax extension + code generation Wed Oct 15 20:37:32 CEST 2008 Jeremie Dimino * [obus/connection] use message queue - reading and dispatching is done in separate thread - allow to set a connection up or down Wed Oct 15 20:37:08 CEST 2008 Jeremie Dimino * [obus/mqueue] implementation of message queue Wed Oct 15 19:18:44 CEST 2008 Jeremie Dimino * [obus/server] implementation of dbus server for peer-to-peer communication Wed Oct 15 05:30:51 CEST 2008 Jeremie Dimino * [syntax/pa_log] remove pa_log and use a caml module Log instead Wed Oct 15 05:05:18 CEST 2008 Jeremie Dimino * [syntax/pa_seq] remove old ununsed syntax extension Tue Oct 14 19:05:45 CEST 2008 Jeremie Dimino * [obus/address] implement address -> string Tue Oct 14 13:10:52 CEST 2008 Jeremie Dimino * [obus/auth] use lwt for mechanism handlers Tue Oct 14 13:07:58 CEST 2008 Jeremie Dimino * [syntax/log] enhancement of logging allow use of pa_log in [Util] + uses colors for errors if possible Tue Oct 14 09:37:20 CEST 2008 Jeremie Dimino * [obus/auth] implementation of dbus_cookie_sha1, client + server Tue Oct 14 08:44:21 CEST 2008 Jeremie Dimino * [obus/lowlevel] fix serialization of double Tue Oct 14 05:12:11 CEST 2008 Jeremie Dimino * [obus/auth] rewrite parsing + better handling of errors Mon Oct 13 04:05:10 CEST 2008 Jeremie Dimino * implementation of server-side authentification Sun Oct 12 21:39:26 CEST 2008 Jeremie Dimino * remove the dependency OBus_type -> OBus_internals OBus_type can then be put higher in the depency list and so we can put combinators in various modules Sun Oct 12 20:42:29 CEST 2008 Jeremie Dimino * begin implementation of object exporting Sun Oct 12 20:25:36 CEST 2008 Jeremie Dimino * rewrite transport/serialization stuff - asbtract transport to make it easy to write new custom transport: a transport is now only a pair of functions able to send/receive message - remove by hand bufferization handling and use lwt channels instead, performance cost is too small (=0 ?) compared to advantages: * better error handling * it is simplier to write serializers (in the future: x11 transport) * less memory consumption Tue Sep 16 19:23:14 CEST 2008 Jeremie Dimino * fix installation of syntax extension Tue Sep 16 05:56:46 CEST 2008 Jeremie Dimino * fixes with new path representation Tue Sep 16 03:48:58 CEST 2008 Jeremie Dimino * object path : string -> string list implement object as list of elements instead of just string: - this avoid confusion with normal string - this is usefull for service mode (object tree) Tue Sep 16 01:36:22 CEST 2008 Jeremie Dimino * renaming of name types Tue Sep 9 14:29:29 CEST 2008 Jeremie Dimino * fix hal device computer path Mon Sep 1 17:58:15 CEST 2008 Jeremie Dimino * handle signal with us as destination Tue Aug 26 16:54:18 CEST 2008 Jeremie Dimino * make notify handle replacement of the notifications daemon Tue Aug 26 16:04:53 CEST 2008 Jeremie Dimino * validation of all type of strings Thu Aug 21 06:44:57 CEST 2008 Jeremie Dimino * Always unmarshal the message immediatly Instead of delaying the unmarshaling of messages until we find a specific reader, we directly unmarshal it as a dynamically typed value and then the value is casted. Same thing for writing. - This make the code simplier - This allow more features (like matching on message arguments) - This dooes not any difference it term of cost Mon Aug 18 07:27:07 CEST 2008 Jeremie Dimino tagged 0.2 Mon Aug 18 07:20:25 CEST 2008 Jeremie Dimino * doc Mon Aug 18 06:30:57 CEST 2008 Jeremie Dimino * start of a avahi binding Mon Aug 18 05:05:01 CEST 2008 Jeremie Dimino * enhance the notification binding Mon Aug 18 03:38:06 CEST 2008 Jeremie Dimino * implementation of properties Mon Aug 18 02:17:49 CEST 2008 Jeremie Dimino * handling of signals Sat Aug 16 02:50:58 CEST 2008 Jeremie Dimino * add dependency checking in the build process Fri Aug 15 05:04:11 CEST 2008 Jeremie Dimino * allow to disable sugars in generated by obus-binder Fri Aug 15 04:23:52 CEST 2008 Jeremie Dimino * add support for custom array types Fri Aug 15 03:06:24 CEST 2008 Jeremie Dimino * change parameters order for method call Fri Aug 15 02:02:24 CEST 2008 Jeremie Dimino * fix installation issues Fri Aug 15 01:21:13 CEST 2008 Jeremie Dimino * more syntactic sugars Thu Aug 14 03:20:06 CEST 2008 Jeremie Dimino * use quotations for pa_obus Thu Aug 14 02:03:15 CEST 2008 Jeremie Dimino * allow using of proxy type when casting dynamic values Thu Aug 14 01:46:32 CEST 2008 Jeremie Dimino * use dict_entry instead of dict this simplify the code and it allow to wrap dict_entry combinator Thu Aug 14 00:01:28 CEST 2008 Jeremie Dimino * put all type informations together Fri Aug 8 17:40:57 CEST 2008 Jeremie Dimino * simplify annotations Thu Aug 7 03:36:18 CEST 2008 Jeremie Dimino * implementation of autolaunch Wed Aug 6 05:31:11 CEST 2008 Jeremie Dimino * extend OBus_client + change the type of OBus_bus.{session,system} - Add a functor with every parameters fixed because this happen often - Replace unit -> bus by lazy bus, because this avoid errors when used with [Make_fixed*] Wed Aug 6 05:00:14 CEST 2008 Jeremie Dimino * notifications binding Wed Aug 6 02:53:30 CEST 2008 Jeremie Dimino * handle anonymous mechanism Wed Aug 6 02:53:17 CEST 2008 Jeremie Dimino * handle tcp transport Wed Aug 6 00:15:03 CEST 2008 Jeremie Dimino * various enhancement Wed Aug 6 00:08:29 CEST 2008 Jeremie Dimino * clean up the build process Wed Aug 6 00:07:47 CEST 2008 Jeremie Dimino * rewrite samples Wed Aug 6 00:07:26 CEST 2008 Jeremie Dimino * starting of a hal binding Wed Aug 6 00:06:47 CEST 2008 Jeremie Dimino * finish tools Wed Aug 6 00:03:15 CEST 2008 Jeremie Dimino * simplification of annotations with too many convertion it is becoming confising and generating annotations is not very usefull. Tue Aug 5 23:43:44 CEST 2008 Jeremie Dimino * remove xml interfaces now everything is done directly in caml Tue Aug 5 23:43:08 CEST 2008 Jeremie Dimino * remove all binder modules (not used any more) Tue Jul 29 10:56:21 CEST 2008 Jeremie Dimino * various fixes + recode some samples with lwt Tue Jul 29 10:55:37 CEST 2008 Jeremie Dimino * implementation of the binding library + record the bus module with it Tue Jul 29 05:43:10 CEST 2008 Jeremie Dimino * syntax extension Mon Jul 28 20:02:06 CEST 2008 Jeremie Dimino * various changes Mon Jul 28 19:56:57 CEST 2008 Jeremie Dimino * lwtisation Sun Jul 27 18:12:57 CEST 2008 Jeremie Dimino * finalizing combinators Sun Jul 27 03:56:16 CEST 2008 Jeremie Dimino * implementation of OBus_wire + test Sat Jul 26 16:17:56 CEST 2008 Jeremie Dimino * allow to wrap types maker/caster for dynamic values Sat Jul 26 10:51:36 CEST 2008 Jeremie Dimino * monadic xml parser Fri Jul 25 10:55:07 CEST 2008 Jeremie Dimino * add more information to annotations encode some caml specifics information in annotations so they can be exported in introspections Thu Jul 24 14:07:12 CEST 2008 Jeremie Dimino * implementation of annotations + pervasives combinators Thu Jul 24 12:03:59 CEST 2008 Jeremie Dimino * Monadic reading/writing + start of type combinators Tue Jul 22 23:25:45 CEST 2008 Jeremie Dimino * encode DBus type classes in classes instead of hack with polymorphic variant This avoid some assert false. Tue Jul 22 11:11:46 CEST 2008 Jeremie Dimino * rewrite of the module for dynamically typed values Sun Jul 20 01:15:50 CEST 2008 Jeremie Dimino * add default case to the matching class + make a matching class in the Maker functor Sat Jul 19 23:46:13 CEST 2008 Jeremie Dimino * new way to deal with dynamic values Fri Jun 20 05:10:37 CEST 2008 Jeremie Dimino * merge wireTypes with commonTypes Tue Jun 17 22:15:31 CEST 2008 Jeremie Dimino * enhancement of Types and Values modules Thu Jun 12 23:19:09 CEST 2008 Jeremie Dimino * module Path for manipulation of object path Thu Jun 12 21:29:22 CEST 2008 Jeremie Dimino * remove signature field from user messages As this is just a function of the body it is not needed. Moreover it avoid the creation of invalid message without have to make the type of message private. Thu Jun 12 07:53:39 CEST 2008 Jeremie Dimino * use Values.dtypes for signature in user version of messages Thu Jun 12 05:27:39 CEST 2008 Jeremie Dimino * new sample, using avahi Thu Jun 12 03:55:27 CEST 2008 Jeremie Dimino * fixe a serialization bug make a arithmetic shift instead of a logical one for the last octet of integer, so we get 255 instead of 127... Thu Jun 12 03:19:20 CEST 2008 Jeremie Dimino * fixe a small bug with generation of tuple pattern A Ast.PaTup was missing and the generated code were wrong for methods returning multiple values. Thu Jun 12 01:19:05 CEST 2008 Jeremie Dimino * new module for message Message are now created as only one value of type Message.t. Wed Jun 11 03:12:50 CEST 2008 Jeremie Dimino * do not add exception makers when no exception is defined Wed Jun 11 02:53:19 CEST 2008 Jeremie Dimino * add _no_reply version to generated functions Wed Jun 11 02:05:01 CEST 2008 Jeremie Dimino * allow on_error in generated code + async sample - add the optionnal on_error argument to *_async functions in generated code - add a sample async.ml to illustrate the use of async calls Wed Jun 11 01:33:24 CEST 2008 Jeremie Dimino * suppress method calls filtering in the monitor sample The bus always disconnect us when we try to do it and this make the sample to crash... Tue Jun 10 23:12:11 CEST 2008 Jeremie Dimino tagged 0.1 Tue Jun 10 23:06:46 CEST 2008 Jeremie Dimino * install script and README Tue Jun 10 20:41:17 CEST 2008 Jeremie Dimino * comment samples and add a better examples with threads Tue Jun 10 20:38:56 CEST 2008 Jeremie Dimino * correct a bug with threads There was a bug which let another thread than the dispatcher to dispatch at the openning of the connection. Tue Jun 10 18:02:38 CEST 2008 Jeremie Dimino * change the form of generated code Do not generate all readers/writers in one big module. This generate more code but it is less confusing. Tue Jun 10 16:20:17 CEST 2008 Jeremie Dimino * Lot of work on the api - handle almost all error cases - better Connection interface - simplify annotations in xmls - better thread suppport: it is now possible to send a synchrounous message in an handler or filter in the threaded versions. Also unify the two version, (remove any test of the form if use_threads...) Fri Jun 6 04:10:01 CEST 2008 Jeremie Dimino * allow simplified construction of values and types Fri Jun 6 03:47:57 CEST 2008 Jeremie Dimino * adapt header reading to match the specification we must not fail if we encounter an unknown header fields or message type. Fri Jun 6 01:39:06 CEST 2008 Jeremie Dimino * remove a redundant information for reading array Thu Jun 5 22:53:08 CEST 2008 Jeremie Dimino * generate safer code Thu Jun 5 13:33:45 CEST 2008 Jeremie Dimino * fixe order of instruction in generated code Wed Jun 4 21:12:44 CEST 2008 Jeremie Dimino * cleaner rewrite of code generation Wed Jun 4 21:11:28 CEST 2008 Jeremie Dimino * rewrite of the solver with dynamic rules Wed Jun 4 03:16:15 CEST 2008 Jeremie Dimino * simplify some part and make the library more safe rewrite of the code for marshaling and unmarshaling in a more safe way. + better handling of errors Sat May 31 12:46:02 CEST 2008 Jeremie Dimino * use define_context to get things working corretly Sat May 31 10:19:17 CEST 2008 Jeremie Dimino * fixe a problem with thread when openning connection Sat May 31 08:22:33 CEST 2008 Jeremie Dimino * implement support for signals + samples Sat May 31 06:10:15 CEST 2008 Jeremie Dimino * more extensions + allow documentation in xmls - add extension "convert" to allow conevtion between arbitrary types (see DBus.add_match for an example) - allow defined type to be "external" which means that only serialization functions will be generated - allow documentation in the xml file and write it in the mli file - also define a variant type for signals Sat May 31 00:25:49 CEST 2008 Jeremie Dimino * remove old code Fri May 30 17:34:38 CEST 2008 Jeremie Dimino * rewrite attributes parsing of xml element + errors handling Thu May 29 21:12:11 CEST 2008 Jeremie Dimino * generate documentations Thu May 29 18:04:50 CEST 2008 Jeremie Dimino * remove a typo in the function for writing 64bits integers Thu May 29 17:50:19 CEST 2008 Jeremie Dimino * make the compilation with C stubs to work + a small benchmark Thu May 29 16:45:08 CEST 2008 Jeremie Dimino * new sample : bus-functions a small sample to test the org.freedesktop.DBus interface Thu May 29 16:44:08 CEST 2008 Jeremie Dimino * add proxy and flag annotations support Thu May 29 05:27:33 CEST 2008 Jeremie Dimino * factorize generated code Wed May 28 18:02:27 CEST 2008 Jeremie Dimino * remove old code Wed May 28 17:58:05 CEST 2008 Jeremie Dimino * new binder tool - parsing of xml introspection files - generation of readers/writers - generation of caml modules Wed May 28 05:28:13 CEST 2008 Jeremie Dimino * be sure to use the new buffer after writing message body Wed May 28 05:16:04 CEST 2008 Jeremie Dimino * make every parts work together - adapt code generation to generate valid code, without any warnings - correct some serializations errors - let choose at compile if we want to use C stubs or not (the caml version of intergers serializations is a bit slower but at least it always work) - remove any hand-written serialization stuff and replace with inclusion of auto-generated files Sun May 25 01:51:37 CEST 2008 Jeremie Dimino * auto-generation of functions for reading/writing general dbus values Sat May 24 17:07:18 CEST 2008 Jeremie Dimino * better code for reading/writing dbus signatures Sat May 24 14:12:42 CEST 2008 Jeremie Dimino * automatic generation of module for reading/writing header Sat May 24 12:54:33 CEST 2008 Jeremie Dimino * add a test for the binder Sat May 24 12:53:54 CEST 2008 Jeremie Dimino * various fixes/additions Sat May 24 12:50:34 CEST 2008 Jeremie Dimino * fixes in rules for record make the dependencies more general to let more complicated readers/writers to be generated. Sat May 24 12:47:06 CEST 2008 Jeremie Dimino * rewrite code generation for array instead of unrolling the first loop, just substract a gap size before starting the loop. Sat May 24 12:46:19 CEST 2008 Jeremie Dimino * do not make a difference between original Advance and ones generated by optimization when not needed Sat May 24 12:35:44 CEST 2008 Jeremie Dimino * dynamic rules for inlining tuples before each resolution generate several rules to let all tuples to be inlined. This let the programmer to put parentheses wherever he want in the caml type. Sat May 24 12:30:54 CEST 2008 Jeremie Dimino * choose exceptions that generated code can raise Sat May 24 12:28:57 CEST 2008 Jeremie Dimino * define test tag for library test + clean the _tags file Fri May 23 13:42:15 CEST 2008 Jeremie Dimino * automatically add what needed when using camlp4 quotations Fri May 23 13:41:39 CEST 2008 Jeremie Dimino * use an optionnal argument for the shared flag Fri May 23 13:39:12 CEST 2008 Jeremie Dimino * complete generation of message writing Fri May 23 13:16:57 CEST 2008 Jeremie Dimino * add a rule for writing constant Fri May 23 12:00:15 CEST 2008 Jeremie Dimino * correction of types printing Fri May 23 11:12:54 CEST 2008 Jeremie Dimino * essentially estheticism Fri May 23 11:10:45 CEST 2008 Jeremie Dimino * helpers for caml expressions creation Fri May 23 11:09:52 CEST 2008 Jeremie Dimino * constants in generated code Put in the same place expressions which may change in the future. Fri May 23 10:30:51 CEST 2008 Jeremie Dimino * simplify types and fixes one-length tuples represententation - remove polymorphism for type ids because it is not used here and it ligthen code - hacks for tuples are removed in Generate so internal variables are no longer used - ensures the right invariant on types - remove representation of dbus types as [Types.typ] because it is only used internally by [GenSerializer] Fri May 23 10:29:48 CEST 2008 Jeremie Dimino * remove tuples handling in Generate + add tracing support Thu May 22 14:56:04 CEST 2008 Jeremie Dimino * various fixes Wed May 21 12:37:42 CEST 2008 jeremie@dimino.org * rewrite code generation with optimization try do do a maximum of precalculation of padding/checking on generated code Wed May 21 03:28:12 CEST 2008 jeremie@dimino.org * choose faster byte order for sending messages Wed May 21 03:21:43 CEST 2008 jeremie@dimino.org * use C stubs for marshaling integers Thu May 8 18:52:04 CEST 2008 Jeremie Dimino * some fixes with cookies and threads Thu May 1 00:52:22 CEST 2008 Jeremie Dimino * use weak hash tables for mapping guids to connections Wed Apr 30 23:17:37 CEST 2008 Jeremie Dimino * make typ private to prevent malformed types Wed Apr 30 11:36:12 CEST 2008 Jeremie Dimino * adapt caml code generation Wed Apr 30 11:35:21 CEST 2008 Jeremie Dimino * share code for reading dbus signatures Wed Apr 30 11:32:49 CEST 2008 Jeremie Dimino * split specifics utils functions between binder and obus - Common_util_* contain common utils functions - binder and obus include it plus add some specifics utils functions Wed Apr 30 11:32:14 CEST 2008 Jeremie Dimino * functions for generating a list of names Wed Apr 30 11:29:28 CEST 2008 Jeremie Dimino * partial rewrite of Generate Make it behave correctly when generating expression for reqding/writing tuples Mon Apr 28 20:58:31 CEST 2008 Jeremie Dimino * new module for correctly handle tuples Sat Apr 26 20:28:47 CEST 2008 Jeremie Dimino * compile only what is working Sat Apr 26 20:23:17 CEST 2008 Jeremie Dimino * move samples to subdirectories Sat Apr 26 20:19:39 CEST 2008 Jeremie Dimino * make obus compiling with or without thread support Sat Apr 26 20:19:09 CEST 2008 Jeremie Dimino * module for easy creation of messages Sat Apr 26 20:17:13 CEST 2008 Jeremie Dimino * common code for writing signatures Sat Apr 26 19:42:09 CEST 2008 Jeremie Dimino * basic samples Sat Apr 26 19:42:00 CEST 2008 Jeremie Dimino * finer control of verbosity Sat Apr 26 19:37:57 CEST 2008 Jeremie Dimino * syntax for writing dbus types and values Sat Apr 26 19:04:46 CEST 2008 Jeremie Dimino * print dbus error messages on stderr Sat Apr 26 17:53:27 CEST 2008 Jeremie Dimino * renaming of types and values Sat Apr 26 16:12:23 CEST 2008 Jeremie Dimino * add also length information in received message Sat Apr 26 15:29:53 CEST 2008 Jeremie Dimino * make distinction between sended message and received message No more problems with serials! Sat Apr 26 14:40:13 CEST 2008 Jeremie Dimino * put syntax extension and filters in the same directory Sat Apr 26 14:35:02 CEST 2008 Jeremie Dimino * add filter for tracing code Sat Apr 26 13:09:20 CEST 2008 Jeremie Dimino * serial must not be zero Sat Apr 26 13:08:30 CEST 2008 Jeremie Dimino * module Message for easy creation of messages Sat Apr 26 03:44:25 CEST 2008 Jeremie Dimino * padding and other marshaling errors fixes Sat Apr 26 02:13:04 CEST 2008 Jeremie Dimino * fixes in reading signature Sat Apr 26 00:56:32 CEST 2008 Jeremie Dimino * padding functions were wrong ! Fri Apr 25 23:57:52 CEST 2008 Jeremie Dimino * a transport dumper Very usefull for debugging! Fri Apr 25 23:20:49 CEST 2008 Jeremie Dimino * handling of guids in addresses Fri Apr 25 22:30:20 CEST 2008 Jeremie Dimino * fixes for compiling samples Fri Apr 25 19:55:47 CEST 2008 Jeremie Dimino * add facilities for logging Fri Apr 25 17:06:13 CEST 2008 Jeremie Dimino * simplify transport Fri Apr 25 14:40:54 CEST 2008 Jeremie Dimino * fixes in compilation Fri Apr 25 14:18:26 CEST 2008 Jeremie Dimino * remove unix depency from Address Fri Apr 25 11:54:03 CEST 2008 Jeremie Dimino * no more used Fri Apr 25 05:23:32 CEST 2008 Jeremie Dimino * typo, types errors, ... Fri Apr 25 02:40:44 CEST 2008 Jeremie Dimino * major rewriting Write/rewrite of most of the library and reorganization of module hierarchy Fri Apr 25 00:53:38 CEST 2008 Jeremie Dimino * rewrite of type/value construction Thu Apr 24 18:45:38 CEST 2008 Jeremie Dimino * module Interface for run-time handling of interfaces Thu Apr 24 18:44:58 CEST 2008 Jeremie Dimino * module Cookie for async reception of messages Thu Apr 24 18:26:19 CEST 2008 Jeremie Dimino * total rewrite of the connection module Wed Apr 23 23:08:42 CEST 2008 Jeremie Dimino * lexers for authentification and addresses Wed Apr 23 16:17:33 CEST 2008 Jeremie Dimino * final library interface Mon Apr 21 06:24:58 CEST 2008 Jeremie Dimino * common interface for reading/writing signatures Mon Apr 21 06:22:05 CEST 2008 Jeremie Dimino * constants Mon Apr 21 06:20:50 CEST 2008 Jeremie Dimino * initial import module for handling receiving/sending/dispatching messages Mon Apr 21 04:17:56 CEST 2008 Jeremie Dimino * transparent handling of lock Mon Apr 21 03:49:31 CEST 2008 Jeremie Dimino * rewrite of marshaling module Mon Apr 21 03:49:01 CEST 2008 Jeremie Dimino * cleaner interface Mon Apr 21 03:48:20 CEST 2008 Jeremie Dimino * shared code for reading/writing signature Sun Apr 20 20:58:38 CEST 2008 Jeremie Dimino * script for compilation Sun Apr 20 20:56:38 CEST 2008 Jeremie Dimino * sample added Sun Apr 20 20:39:00 CEST 2008 Jeremie Dimino * move _tags, myocamlbuild, .. to top directory Sun Apr 20 19:12:49 CEST 2008 Jeremie Dimino * module for representation of an interface signature Sun Apr 20 19:12:17 CEST 2008 Jeremie Dimino * interface for code generation for a language Sun Apr 20 19:09:20 CEST 2008 Jeremie Dimino * first working implementation of dbus lowlevel library Sun Apr 20 19:06:11 CEST 2008 Jeremie Dimino * generate working code... Sun Apr 20 17:29:38 CEST 2008 Jeremie Dimino * give a name to unamed argument Sun Apr 20 17:29:07 CEST 2008 Jeremie Dimino * correct handling of default value for params in xml Sun Apr 20 03:20:49 CEST 2008 Jeremie Dimino * initial import Sun Apr 20 03:11:17 CEST 2008 Jeremie Dimino * import initial Sat Apr 19 15:56:00 CEST 2008 Jeremie Dimino * make rules definition easyier Sat Apr 19 13:49:41 CEST 2008 Jeremie Dimino * factorisation Sat Apr 19 11:51:19 CEST 2008 Jeremie Dimino * xml parser enhancement Sat Apr 19 10:29:56 CEST 2008 Jeremie Dimino * fixes in code generated Sat Apr 19 04:49:40 CEST 2008 Jeremie Dimino * generation of caml code Sat Apr 19 03:06:50 CEST 2008 Jeremie Dimino * fixes in caml types parsing Sat Apr 19 01:15:52 CEST 2008 Jeremie Dimino * camlp4 extension for writing value of type Seq.t Sat Apr 19 01:14:06 CEST 2008 Jeremie Dimino * use of module Seq Sat Apr 19 01:12:33 CEST 2008 Jeremie Dimino * module for calling safely a function of arity n on a list of length n Fri Apr 18 22:36:23 CEST 2008 Jeremie Dimino * typo Fri Apr 18 20:04:29 CEST 2008 Jeremie Dimino * Construction of herarchy of modules when loading mappings + mutiple mappings support Fri Apr 18 19:17:33 CEST 2008 Jeremie Dimino * bugfixes Fri Apr 18 10:52:09 CEST 2008 Jeremie Dimino * renaming Xml_parser to Xparser due to conflict with xml-light Fri Apr 18 09:13:02 CEST 2008 Jeremie Dimino * Update of binder for use with Lmap Fri Apr 18 09:10:52 CEST 2008 Jeremie Dimino * Tree deleted (no more used) Fri Apr 18 08:18:08 CEST 2008 Jeremie Dimino * moving language module signature to Language Fri Apr 18 08:15:12 CEST 2008 Jeremie Dimino * moving dbus interfaces to DBus and using new parsers Fri Apr 18 06:59:53 CEST 2008 Jeremie Dimino * module for dealing with the mapping Fri Apr 18 06:59:36 CEST 2008 Jeremie Dimino * typo Fri Apr 18 06:41:23 CEST 2008 Jeremie Dimino * helpers for constructing list of arguments Fri Apr 18 06:40:56 CEST 2008 Jeremie Dimino * parser for structure added Fri Apr 18 05:08:18 CEST 2008 Jeremie Dimino * module for parsing xml Fri Apr 18 00:59:12 CEST 2008 Jeremie Dimino * move filter_map in Util Fri Apr 18 00:58:24 CEST 2008 Jeremie Dimino * generate only intermadiate xml file on the first pass Fri Apr 18 00:41:32 CEST 2008 Jeremie Dimino * adding destination type to intermediate xml Thu Apr 17 22:23:13 CEST 2008 Jeremie Dimino * using xml for intermediate description files Thu Apr 17 22:22:45 CEST 2008 Jeremie Dimino * using existing concat Thu Apr 17 19:42:40 CEST 2008 Jeremie Dimino * make interfaces tree manipulation more general Make it in binder instead of in caml only so it can be used for all languages Thu Apr 17 19:41:52 CEST 2008 Jeremie Dimino * join/split functions for strings Thu Apr 17 07:04:11 CEST 2008 Jeremie Dimino * modules for writing main programs Thu Apr 17 07:03:29 CEST 2008 Jeremie Dimino * xml parsing + interface trees handling Thu Apr 17 07:02:59 CEST 2008 Jeremie Dimino * utils Thu Apr 17 07:00:42 CEST 2008 Jeremie Dimino * Module signature generation + updating of rule definition methods Thu Apr 17 06:59:44 CEST 2008 Jeremie Dimino * Reusing left/right term with polymorphic variant Thu Apr 17 06:56:59 CEST 2008 Jeremie Dimino * Added ocamlbuild files Sat Apr 12 03:10:58 CEST 2008 Jeremie Dimino * Simplification Use of polymorphic variant for all type of term. Sat Apr 12 01:10:53 CEST 2008 Jeremie Dimino * Generation of caml code for writing dbus marshaled values Sun Apr 6 04:37:21 CEST 2008 Jeremie Dimino * License added Sun Apr 6 04:33:07 CEST 2008 Jeremie Dimino * Generation of caml code for loading dbus marshaled values Sun Apr 6 04:32:54 CEST 2008 Jeremie Dimino * DBus types Sun Apr 6 04:30:49 CEST 2008 Jeremie Dimino * Abstract module for building convertor between two types of term obus-1.1.5/setup.ml0000644000000000000000000070406512032535153012361 0ustar0000000000000000(* * setup.ml * -------- * Copyright : (c) 2011, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) (* OASIS_START *) (* DO NOT EDIT (digest: fe2dbb9c8cc093d49d3738532cb96cc5) *) (* Regenerated by OASIS v0.3.0 Visit http://oasis.forge.ocamlcore.org for more information and documentation about functions used in this file. *) module OASISGettext = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISGettext.ml" let ns_ str = str let s_ str = str let f_ (str : ('a, 'b, 'c, 'd) format4) = str let fn_ fmt1 fmt2 n = if n = 1 then fmt1^^"" else fmt2^^"" let init = [] end module OASISContext = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISContext.ml" open OASISGettext type level = [ `Debug | `Info | `Warning | `Error] type t = { quiet: bool; info: bool; debug: bool; ignore_plugins: bool; ignore_unknown_fields: bool; printf: level -> string -> unit; } let printf lvl str = let beg = match lvl with | `Error -> s_ "E: " | `Warning -> s_ "W: " | `Info -> s_ "I: " | `Debug -> s_ "D: " in prerr_endline (beg^str) let default = ref { quiet = false; info = false; debug = false; ignore_plugins = false; ignore_unknown_fields = false; printf = printf; } let quiet = {!default with quiet = true} let args () = ["-quiet", Arg.Unit (fun () -> default := {!default with quiet = true}), (s_ " Run quietly"); "-info", Arg.Unit (fun () -> default := {!default with info = true}), (s_ " Display information message"); "-debug", Arg.Unit (fun () -> default := {!default with debug = true}), (s_ " Output debug message")] end module OASISString = struct # 1 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISString.ml" (** Various string utilities. Mostly inspired by extlib and batteries ExtString and BatString libraries. @author Sylvain Le Gall *) let nsplitf str f = if str = "" then [] else let buf = Buffer.create 13 in let lst = ref [] in let push () = lst := Buffer.contents buf :: !lst; Buffer.clear buf in let str_len = String.length str in for i = 0 to str_len - 1 do if f str.[i] then push () else Buffer.add_char buf str.[i] done; push (); List.rev !lst (** [nsplit c s] Split the string [s] at char [c]. It doesn't include the separator. *) let nsplit str c = nsplitf str ((=) c) let find ~what ?(offset=0) str = let what_idx = ref 0 in let str_idx = ref offset in while !str_idx < String.length str && !what_idx < String.length what do if str.[!str_idx] = what.[!what_idx] then incr what_idx else what_idx := 0; incr str_idx done; if !what_idx <> String.length what then raise Not_found else !str_idx - !what_idx let sub_start str len = let str_len = String.length str in if len >= str_len then "" else String.sub str len (str_len - len) let sub_end ?(offset=0) str len = let str_len = String.length str in if len >= str_len then "" else String.sub str 0 (str_len - len) let starts_with ~what ?(offset=0) str = let what_idx = ref 0 in let str_idx = ref offset in let ok = ref true in while !ok && !str_idx < String.length str && !what_idx < String.length what do if str.[!str_idx] = what.[!what_idx] then incr what_idx else ok := false; incr str_idx done; if !what_idx = String.length what then true else false let strip_starts_with ~what str = if starts_with ~what str then sub_start str (String.length what) else raise Not_found let ends_with ~what ?(offset=0) str = let what_idx = ref ((String.length what) - 1) in let str_idx = ref ((String.length str) - 1) in let ok = ref true in while !ok && offset <= !str_idx && 0 <= !what_idx do if str.[!str_idx] = what.[!what_idx] then decr what_idx else ok := false; decr str_idx done; if !what_idx = -1 then true else false let strip_ends_with ~what str = if ends_with ~what str then sub_end str (String.length what) else raise Not_found let replace_chars f s = let buf = String.make (String.length s) 'X' in for i = 0 to String.length s - 1 do buf.[i] <- f s.[i] done; buf end module OASISUtils = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISUtils.ml" open OASISGettext module MapString = Map.Make(String) let map_string_of_assoc assoc = List.fold_left (fun acc (k, v) -> MapString.add k v acc) MapString.empty assoc module SetString = Set.Make(String) let set_string_add_list st lst = List.fold_left (fun acc e -> SetString.add e acc) st lst let set_string_of_list = set_string_add_list SetString.empty let compare_csl s1 s2 = String.compare (String.lowercase s1) (String.lowercase s2) module HashStringCsl = Hashtbl.Make (struct type t = string let equal s1 s2 = (String.lowercase s1) = (String.lowercase s2) let hash s = Hashtbl.hash (String.lowercase s) end) let varname_of_string ?(hyphen='_') s = if String.length s = 0 then begin invalid_arg "varname_of_string" end else begin let buf = OASISString.replace_chars (fun c -> if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') then c else hyphen) s; in let buf = (* Start with a _ if digit *) if '0' <= s.[0] && s.[0] <= '9' then "_"^buf else buf in String.lowercase buf end let varname_concat ?(hyphen='_') p s = let what = String.make 1 hyphen in let p = try OASISString.strip_ends_with ~what p with Not_found -> p in let s = try OASISString.strip_starts_with ~what s with Not_found -> s in p^what^s let is_varname str = str = varname_of_string str let failwithf fmt = Printf.ksprintf failwith fmt end module PropList = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/PropList.ml" open OASISGettext type name = string exception Not_set of name * string option exception No_printer of name exception Unknown_field of name * name let () = Printexc.register_printer (function | Not_set (nm, Some rsn) -> Some (Printf.sprintf (f_ "Field '%s' is not set: %s") nm rsn) | Not_set (nm, None) -> Some (Printf.sprintf (f_ "Field '%s' is not set") nm) | No_printer nm -> Some (Printf.sprintf (f_ "No default printer for value %s") nm) | Unknown_field (nm, schm) -> Some (Printf.sprintf (f_ "Field %s is not defined in schema %s") nm schm) | _ -> None) module Data = struct type t = (name, unit -> unit) Hashtbl.t let create () = Hashtbl.create 13 let clear t = Hashtbl.clear t # 71 "/home/dim/sources/oasis-0.3.0/src/oasis/PropList.ml" end module Schema = struct type ('ctxt, 'extra) value = { get: Data.t -> string; set: Data.t -> ?context:'ctxt -> string -> unit; help: (unit -> string) option; extra: 'extra; } type ('ctxt, 'extra) t = { name: name; fields: (name, ('ctxt, 'extra) value) Hashtbl.t; order: name Queue.t; name_norm: string -> string; } let create ?(case_insensitive=false) nm = { name = nm; fields = Hashtbl.create 13; order = Queue.create (); name_norm = (if case_insensitive then String.lowercase else fun s -> s); } let add t nm set get extra help = let key = t.name_norm nm in if Hashtbl.mem t.fields key then failwith (Printf.sprintf (f_ "Field '%s' is already defined in schema '%s'") nm t.name); Hashtbl.add t.fields key { set = set; get = get; help = help; extra = extra; }; Queue.add nm t.order let mem t nm = Hashtbl.mem t.fields nm let find t nm = try Hashtbl.find t.fields (t.name_norm nm) with Not_found -> raise (Unknown_field (nm, t.name)) let get t data nm = (find t nm).get data let set t data nm ?context x = (find t nm).set data ?context x let fold f acc t = Queue.fold (fun acc k -> let v = find t k in f acc k v.extra v.help) acc t.order let iter f t = fold (fun () -> f) () t let name t = t.name end module Field = struct type ('ctxt, 'value, 'extra) t = { set: Data.t -> ?context:'ctxt -> 'value -> unit; get: Data.t -> 'value; sets: Data.t -> ?context:'ctxt -> string -> unit; gets: Data.t -> string; help: (unit -> string) option; extra: 'extra; } let new_id = let last_id = ref 0 in fun () -> incr last_id; !last_id let create ?schema ?name ?parse ?print ?default ?update ?help extra = (* Default value container *) let v = ref None in (* If name is not given, create unique one *) let nm = match name with | Some s -> s | None -> Printf.sprintf "_anon_%d" (new_id ()) in (* Last chance to get a value: the default *) let default () = match default with | Some d -> d | None -> raise (Not_set (nm, Some (s_ "no default value"))) in (* Get data *) let get data = (* Get value *) try (Hashtbl.find data nm) (); match !v with | Some x -> x | None -> default () with Not_found -> default () in (* Set data *) let set data ?context x = let x = match update with | Some f -> begin try f ?context (get data) x with Not_set _ -> x end | None -> x in Hashtbl.replace data nm (fun () -> v := Some x) in (* Parse string value, if possible *) let parse = match parse with | Some f -> f | None -> fun ?context s -> failwith (Printf.sprintf (f_ "Cannot parse field '%s' when setting value %S") nm s) in (* Set data, from string *) let sets data ?context s = set ?context data (parse ?context s) in (* Output value as string, if possible *) let print = match print with | Some f -> f | None -> fun _ -> raise (No_printer nm) in (* Get data, as a string *) let gets data = print (get data) in begin match schema with | Some t -> Schema.add t nm sets gets extra help | None -> () end; { set = set; get = get; sets = sets; gets = gets; help = help; extra = extra; } let fset data t ?context x = t.set data ?context x let fget data t = t.get data let fsets data t ?context s = t.sets data ?context s let fgets data t = t.gets data end module FieldRO = struct let create ?schema ?name ?parse ?print ?default ?update ?help extra = let fld = Field.create ?schema ?name ?parse ?print ?default ?update ?help extra in fun data -> Field.fget data fld end end module OASISMessage = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISMessage.ml" open OASISGettext open OASISContext let generic_message ~ctxt lvl fmt = let cond = if ctxt.quiet then false else match lvl with | `Debug -> ctxt.debug | `Info -> ctxt.info | _ -> true in Printf.ksprintf (fun str -> if cond then begin ctxt.printf lvl str end) fmt let debug ~ctxt fmt = generic_message ~ctxt `Debug fmt let info ~ctxt fmt = generic_message ~ctxt `Info fmt let warning ~ctxt fmt = generic_message ~ctxt `Warning fmt let error ~ctxt fmt = generic_message ~ctxt `Error fmt end module OASISVersion = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISVersion.ml" open OASISGettext type s = string type t = string type comparator = | VGreater of t | VGreaterEqual of t | VEqual of t | VLesser of t | VLesserEqual of t | VOr of comparator * comparator | VAnd of comparator * comparator (* Range of allowed characters *) let is_digit c = '0' <= c && c <= '9' let is_alpha c = ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') let is_special = function | '.' | '+' | '-' | '~' -> true | _ -> false let rec version_compare v1 v2 = if v1 <> "" || v2 <> "" then begin (* Compare ascii string, using special meaning for version * related char *) let val_ascii c = if c = '~' then -1 else if is_digit c then 0 else if c = '\000' then 0 else if is_alpha c then Char.code c else (Char.code c) + 256 in let len1 = String.length v1 in let len2 = String.length v2 in let p = ref 0 in (** Compare ascii part *) let compare_vascii () = let cmp = ref 0 in while !cmp = 0 && !p < len1 && !p < len2 && not (is_digit v1.[!p] && is_digit v2.[!p]) do cmp := (val_ascii v1.[!p]) - (val_ascii v2.[!p]); incr p done; if !cmp = 0 && !p < len1 && !p = len2 then val_ascii v1.[!p] else if !cmp = 0 && !p = len1 && !p < len2 then - (val_ascii v2.[!p]) else !cmp in (** Compare digit part *) let compare_digit () = let extract_int v p = let start_p = !p in while !p < String.length v && is_digit v.[!p] do incr p done; let substr = String.sub v !p ((String.length v) - !p) in let res = match String.sub v start_p (!p - start_p) with | "" -> 0 | s -> int_of_string s in res, substr in let i1, tl1 = extract_int v1 (ref !p) in let i2, tl2 = extract_int v2 (ref !p) in i1 - i2, tl1, tl2 in match compare_vascii () with | 0 -> begin match compare_digit () with | 0, tl1, tl2 -> if tl1 <> "" && is_digit tl1.[0] then 1 else if tl2 <> "" && is_digit tl2.[0] then -1 else version_compare tl1 tl2 | n, _, _ -> n end | n -> n end else begin 0 end let version_of_string str = str let string_of_version t = t let chop t = try let pos = String.rindex t '.' in String.sub t 0 pos with Not_found -> t let rec comparator_apply v op = match op with | VGreater cv -> (version_compare v cv) > 0 | VGreaterEqual cv -> (version_compare v cv) >= 0 | VLesser cv -> (version_compare v cv) < 0 | VLesserEqual cv -> (version_compare v cv) <= 0 | VEqual cv -> (version_compare v cv) = 0 | VOr (op1, op2) -> (comparator_apply v op1) || (comparator_apply v op2) | VAnd (op1, op2) -> (comparator_apply v op1) && (comparator_apply v op2) let rec string_of_comparator = function | VGreater v -> "> "^(string_of_version v) | VEqual v -> "= "^(string_of_version v) | VLesser v -> "< "^(string_of_version v) | VGreaterEqual v -> ">= "^(string_of_version v) | VLesserEqual v -> "<= "^(string_of_version v) | VOr (c1, c2) -> (string_of_comparator c1)^" || "^(string_of_comparator c2) | VAnd (c1, c2) -> (string_of_comparator c1)^" && "^(string_of_comparator c2) let rec varname_of_comparator = let concat p v = OASISUtils.varname_concat p (OASISUtils.varname_of_string (string_of_version v)) in function | VGreater v -> concat "gt" v | VLesser v -> concat "lt" v | VEqual v -> concat "eq" v | VGreaterEqual v -> concat "ge" v | VLesserEqual v -> concat "le" v | VOr (c1, c2) -> (varname_of_comparator c1)^"_or_"^(varname_of_comparator c2) | VAnd (c1, c2) -> (varname_of_comparator c1)^"_and_"^(varname_of_comparator c2) let version_0_3_or_after t = comparator_apply t (VGreaterEqual (string_of_version "0.3")) end module OASISLicense = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISLicense.ml" (** License for _oasis fields @author Sylvain Le Gall *) type license = string type license_exception = string type license_version = | Version of OASISVersion.t | VersionOrLater of OASISVersion.t | NoVersion type license_dep_5_unit = { license: license; excption: license_exception option; version: license_version; } type license_dep_5 = | DEP5Unit of license_dep_5_unit | DEP5Or of license_dep_5 list | DEP5And of license_dep_5 list type t = | DEP5License of license_dep_5 | OtherLicense of string (* URL *) end module OASISExpr = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISExpr.ml" open OASISGettext type test = string type flag = string type t = | EBool of bool | ENot of t | EAnd of t * t | EOr of t * t | EFlag of flag | ETest of test * string type 'a choices = (t * 'a) list let eval var_get t = let rec eval' = function | EBool b -> b | ENot e -> not (eval' e) | EAnd (e1, e2) -> (eval' e1) && (eval' e2) | EOr (e1, e2) -> (eval' e1) || (eval' e2) | EFlag nm -> let v = var_get nm in assert(v = "true" || v = "false"); (v = "true") | ETest (nm, vl) -> let v = var_get nm in (v = vl) in eval' t let choose ?printer ?name var_get lst = let rec choose_aux = function | (cond, vl) :: tl -> if eval var_get cond then vl else choose_aux tl | [] -> let str_lst = if lst = [] then s_ "" else String.concat (s_ ", ") (List.map (fun (cond, vl) -> match printer with | Some p -> p vl | None -> s_ "") lst) in match name with | Some nm -> failwith (Printf.sprintf (f_ "No result for the choice list '%s': %s") nm str_lst) | None -> failwith (Printf.sprintf (f_ "No result for a choice list: %s") str_lst) in choose_aux (List.rev lst) end module OASISTypes = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISTypes.ml" type name = string type package_name = string type url = string type unix_dirname = string type unix_filename = string type host_dirname = string type host_filename = string type prog = string type arg = string type args = string list type command_line = (prog * arg list) type findlib_name = string type findlib_full = string type compiled_object = | Byte | Native | Best type dependency = | FindlibPackage of findlib_full * OASISVersion.comparator option | InternalLibrary of name type tool = | ExternalTool of name | InternalExecutable of name type vcs = | Darcs | Git | Svn | Cvs | Hg | Bzr | Arch | Monotone | OtherVCS of url type plugin_kind = [ `Configure | `Build | `Doc | `Test | `Install | `Extra ] type plugin_data_purpose = [ `Configure | `Build | `Install | `Clean | `Distclean | `Install | `Uninstall | `Test | `Doc | `Extra | `Other of string ] type 'a plugin = 'a * name * OASISVersion.t option type all_plugin = plugin_kind plugin type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list # 102 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISTypes.ml" type 'a conditional = 'a OASISExpr.choices type custom = { pre_command: (command_line option) conditional; post_command: (command_line option) conditional; } type common_section = { cs_name: name; cs_data: PropList.Data.t; cs_plugin_data: plugin_data; } type build_section = { bs_build: bool conditional; bs_install: bool conditional; bs_path: unix_dirname; bs_compiled_object: compiled_object; bs_build_depends: dependency list; bs_build_tools: tool list; bs_c_sources: unix_filename list; bs_data_files: (unix_filename * unix_filename option) list; bs_ccopt: args conditional; bs_cclib: args conditional; bs_dlllib: args conditional; bs_dllpath: args conditional; bs_byteopt: args conditional; bs_nativeopt: args conditional; } type library = { lib_modules: string list; lib_pack: bool; lib_internal_modules: string list; lib_findlib_parent: findlib_name option; lib_findlib_name: findlib_name option; lib_findlib_containers: findlib_name list; } type executable = { exec_custom: bool; exec_main_is: unix_filename; } type flag = { flag_description: string option; flag_default: bool conditional; } type source_repository = { src_repo_type: vcs; src_repo_location: url; src_repo_browser: url option; src_repo_module: string option; src_repo_branch: string option; src_repo_tag: string option; src_repo_subdir: unix_filename option; } type test = { test_type: [`Test] plugin; test_command: command_line conditional; test_custom: custom; test_working_directory: unix_filename option; test_run: bool conditional; test_tools: tool list; } type doc_format = | HTML of unix_filename | DocText | PDF | PostScript | Info of unix_filename | DVI | OtherDoc type doc = { doc_type: [`Doc] plugin; doc_custom: custom; doc_build: bool conditional; doc_install: bool conditional; doc_install_dir: unix_filename; doc_title: string; doc_authors: string list; doc_abstract: string option; doc_format: doc_format; doc_data_files: (unix_filename * unix_filename option) list; doc_build_tools: tool list; } type section = | Library of common_section * build_section * library | Executable of common_section * build_section * executable | Flag of common_section * flag | SrcRepo of common_section * source_repository | Test of common_section * test | Doc of common_section * doc type section_kind = [ `Library | `Executable | `Flag | `SrcRepo | `Test | `Doc ] type package = { oasis_version: OASISVersion.t; ocaml_version: OASISVersion.comparator option; findlib_version: OASISVersion.comparator option; name: package_name; version: OASISVersion.t; license: OASISLicense.t; license_file: unix_filename option; copyrights: string list; maintainers: string list; authors: string list; homepage: url option; synopsis: string; description: string option; categories: url list; conf_type: [`Configure] plugin; conf_custom: custom; build_type: [`Build] plugin; build_custom: custom; install_type: [`Install] plugin; install_custom: custom; uninstall_custom: custom; clean_custom: custom; distclean_custom: custom; files_ab: unix_filename list; sections: section list; plugins: [`Extra] plugin list; schema_data: PropList.Data.t; plugin_data: plugin_data; } end module OASISUnixPath = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISUnixPath.ml" type unix_filename = string type unix_dirname = string type host_filename = string type host_dirname = string let current_dir_name = "." let parent_dir_name = ".." let is_current_dir fn = fn = current_dir_name || fn = "" let concat f1 f2 = if is_current_dir f1 then f2 else let f1' = try OASISString.strip_ends_with ~what:"/" f1 with Not_found -> f1 in f1'^"/"^f2 let make = function | hd :: tl -> List.fold_left (fun f p -> concat f p) hd tl | [] -> invalid_arg "OASISUnixPath.make" let dirname f = try String.sub f 0 (String.rindex f '/') with Not_found -> current_dir_name let basename f = try let pos_start = (String.rindex f '/') + 1 in String.sub f pos_start ((String.length f) - pos_start) with Not_found -> f let chop_extension f = try let last_dot = String.rindex f '.' in let sub = String.sub f 0 last_dot in try let last_slash = String.rindex f '/' in if last_slash < last_dot then sub else f with Not_found -> sub with Not_found -> f let capitalize_file f = let dir = dirname f in let base = basename f in concat dir (String.capitalize base) let uncapitalize_file f = let dir = dirname f in let base = basename f in concat dir (String.uncapitalize base) end module OASISHostPath = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISHostPath.ml" open Filename module Unix = OASISUnixPath let make = function | [] -> invalid_arg "OASISHostPath.make" | hd :: tl -> List.fold_left Filename.concat hd tl let of_unix ufn = if Sys.os_type = "Unix" then ufn else make (List.map (fun p -> if p = Unix.current_dir_name then current_dir_name else if p = Unix.parent_dir_name then parent_dir_name else p) (OASISString.nsplit ufn '/')) end module OASISSection = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISSection.ml" open OASISTypes let section_kind_common = function | Library (cs, _, _) -> `Library, cs | Executable (cs, _, _) -> `Executable, cs | Flag (cs, _) -> `Flag, cs | SrcRepo (cs, _) -> `SrcRepo, cs | Test (cs, _) -> `Test, cs | Doc (cs, _) -> `Doc, cs let section_common sct = snd (section_kind_common sct) let section_common_set cs = function | Library (_, bs, lib) -> Library (cs, bs, lib) | Executable (_, bs, exec) -> Executable (cs, bs, exec) | Flag (_, flg) -> Flag (cs, flg) | SrcRepo (_, src_repo) -> SrcRepo (cs, src_repo) | Test (_, tst) -> Test (cs, tst) | Doc (_, doc) -> Doc (cs, doc) (** Key used to identify section *) let section_id sct = let k, cs = section_kind_common sct in k, cs.cs_name let string_of_section sct = let k, nm = section_id sct in (match k with | `Library -> "library" | `Executable -> "executable" | `Flag -> "flag" | `SrcRepo -> "src repository" | `Test -> "test" | `Doc -> "doc") ^" "^nm let section_find id scts = List.find (fun sct -> id = section_id sct) scts module CSection = struct type t = section let id = section_id let compare t1 t2 = compare (id t1) (id t2) let equal t1 t2 = (id t1) = (id t2) let hash t = Hashtbl.hash (id t) end module MapSection = Map.Make(CSection) module SetSection = Set.Make(CSection) end module OASISBuildSection = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISBuildSection.ml" end module OASISExecutable = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISExecutable.ml" open OASISTypes let unix_exec_is (cs, bs, exec) is_native ext_dll suffix_program = let dir = OASISUnixPath.concat bs.bs_path (OASISUnixPath.dirname exec.exec_main_is) in let is_native_exec = match bs.bs_compiled_object with | Native -> true | Best -> is_native () | Byte -> false in OASISUnixPath.concat dir (cs.cs_name^(suffix_program ())), if not is_native_exec && not exec.exec_custom && bs.bs_c_sources <> [] then Some (dir^"/dll"^cs.cs_name^"_stubs"^(ext_dll ())) else None end module OASISLibrary = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISLibrary.ml" open OASISTypes open OASISUtils open OASISGettext open OASISSection type library_name = name type findlib_part_name = name type 'a map_of_findlib_part_name = 'a OASISUtils.MapString.t exception InternalLibraryNotFound of library_name exception FindlibPackageNotFound of findlib_name type group_t = | Container of findlib_name * group_t list | Package of (findlib_name * common_section * build_section * library * group_t list) (* Look for a module file, considering capitalization or not. *) let find_module source_file_exists (cs, bs, lib) modul = let possible_base_fn = List.map (OASISUnixPath.concat bs.bs_path) [modul; OASISUnixPath.uncapitalize_file modul; OASISUnixPath.capitalize_file modul] in (* TODO: we should be able to be able to determine the source for every * files. Hence we should introduce a Module(source: fn) for the fields * Modules and InternalModules *) List.fold_left (fun acc base_fn -> match acc with | `No_sources _ -> begin let file_found = List.fold_left (fun acc ext -> if source_file_exists (base_fn^ext) then (base_fn^ext) :: acc else acc) [] [".ml"; ".mli"; ".mll"; ".mly"] in match file_found with | [] -> acc | lst -> `Sources (base_fn, lst) end | `Sources _ -> acc) (`No_sources possible_base_fn) possible_base_fn let source_unix_files ~ctxt (cs, bs, lib) source_file_exists = List.fold_left (fun acc modul -> match find_module source_file_exists (cs, bs, lib) modul with | `Sources (base_fn, lst) -> (base_fn, lst) :: acc | `No_sources _ -> OASISMessage.warning ~ctxt (f_ "Cannot find source file matching \ module '%s' in library %s") modul cs.cs_name; acc) [] (lib.lib_modules @ lib.lib_internal_modules) let generated_unix_files ~ctxt ~is_native ~has_native_dynlink ~ext_lib ~ext_dll ~source_file_exists (cs, bs, lib) = let find_modules lst ext = let find_module modul = match find_module source_file_exists (cs, bs, lib) modul with | `Sources (base_fn, _) -> [base_fn] | `No_sources lst -> OASISMessage.warning ~ctxt (f_ "Cannot find source file matching \ module '%s' in library %s") modul cs.cs_name; lst in List.map (fun nm -> List.map (fun base_fn -> base_fn ^"."^ext) (find_module nm)) lst in (* The headers that should be compiled along *) let headers = if lib.lib_pack then [] else find_modules lib.lib_modules "cmi" in (* The .cmx that be compiled along *) let cmxs = let should_be_built = (not lib.lib_pack) && (* Do not install .cmx packed submodules *) match bs.bs_compiled_object with | Native -> true | Best -> is_native | Byte -> false in if should_be_built then find_modules (lib.lib_modules @ lib.lib_internal_modules) "cmx" else [] in let acc_nopath = [] in (* Compute what libraries should be built *) let acc_nopath = (* Add the packed header file if required *) let add_pack_header acc = if lib.lib_pack then [cs.cs_name^".cmi"] :: acc else acc in let byte acc = add_pack_header ([cs.cs_name^".cma"] :: acc) in let native acc = let acc = add_pack_header (if has_native_dynlink then [cs.cs_name^".cmxs"] :: acc else acc) in [cs.cs_name^".cmxa"] :: [cs.cs_name^ext_lib] :: acc in match bs.bs_compiled_object with | Native -> byte (native acc_nopath) | Best when is_native -> byte (native acc_nopath) | Byte | Best -> byte acc_nopath in (* Add C library to be built *) let acc_nopath = if bs.bs_c_sources <> [] then begin ["lib"^cs.cs_name^"_stubs"^ext_lib] :: ["dll"^cs.cs_name^"_stubs"^ext_dll] :: acc_nopath end else acc_nopath in (* All the files generated *) List.rev_append (List.rev_map (List.rev_map (OASISUnixPath.concat bs.bs_path)) acc_nopath) (headers @ cmxs) type data = common_section * build_section * library type tree = | Node of (data option) * (tree MapString.t) | Leaf of data let findlib_mapping pkg = (* Map from library name to either full findlib name or parts + parent. *) let fndlb_parts_of_lib_name = let fndlb_parts cs lib = let name = match lib.lib_findlib_name with | Some nm -> nm | None -> cs.cs_name in let name = String.concat "." (lib.lib_findlib_containers @ [name]) in name in List.fold_left (fun mp -> function | Library (cs, _, lib) -> begin let lib_name = cs.cs_name in let fndlb_parts = fndlb_parts cs lib in if MapString.mem lib_name mp then failwithf (f_ "The library name '%s' is used more than once.") lib_name; match lib.lib_findlib_parent with | Some lib_name_parent -> MapString.add lib_name (`Unsolved (lib_name_parent, fndlb_parts)) mp | None -> MapString.add lib_name (`Solved fndlb_parts) mp end | Executable _ | Test _ | Flag _ | SrcRepo _ | Doc _ -> mp) MapString.empty pkg.sections in (* Solve the above graph to be only library name to full findlib name. *) let fndlb_name_of_lib_name = let rec solve visited mp lib_name lib_name_child = if SetString.mem lib_name visited then failwithf (f_ "Library '%s' is involved in a cycle \ with regard to findlib naming.") lib_name; let visited = SetString.add lib_name visited in try match MapString.find lib_name mp with | `Solved fndlb_nm -> fndlb_nm, mp | `Unsolved (lib_nm_parent, post_fndlb_nm) -> let pre_fndlb_nm, mp = solve visited mp lib_nm_parent lib_name in let fndlb_nm = pre_fndlb_nm^"."^post_fndlb_nm in fndlb_nm, MapString.add lib_name (`Solved fndlb_nm) mp with Not_found -> failwithf (f_ "Library '%s', which is defined as the findlib parent of \ library '%s', doesn't exist.") lib_name lib_name_child in let mp = MapString.fold (fun lib_name status mp -> match status with | `Solved _ -> (* Solved initialy, no need to go further *) mp | `Unsolved _ -> let _, mp = solve SetString.empty mp lib_name "" in mp) fndlb_parts_of_lib_name fndlb_parts_of_lib_name in MapString.map (function | `Solved fndlb_nm -> fndlb_nm | `Unsolved _ -> assert false) mp in (* Convert an internal library name to a findlib name. *) let findlib_name_of_library_name lib_nm = try MapString.find lib_nm fndlb_name_of_lib_name with Not_found -> raise (InternalLibraryNotFound lib_nm) in (* Add a library to the tree. *) let add sct mp = let fndlb_fullname = let cs, _, _ = sct in let lib_name = cs.cs_name in findlib_name_of_library_name lib_name in let rec add_children nm_lst (children : tree MapString.t) = match nm_lst with | (hd :: tl) -> begin let node = try add_node tl (MapString.find hd children) with Not_found -> (* New node *) new_node tl in MapString.add hd node children end | [] -> (* Should not have a nameless library. *) assert false and add_node tl node = if tl = [] then begin match node with | Node (None, children) -> Node (Some sct, children) | Leaf (cs', _, _) | Node (Some (cs', _, _), _) -> (* TODO: allow to merge Package, i.e. * archive(byte) = "foo.cma foo_init.cmo" *) let cs, _, _ = sct in failwithf (f_ "Library '%s' and '%s' have the same findlib name '%s'") cs.cs_name cs'.cs_name fndlb_fullname end else begin match node with | Leaf data -> Node (Some data, add_children tl MapString.empty) | Node (data_opt, children) -> Node (data_opt, add_children tl children) end and new_node = function | [] -> Leaf sct | hd :: tl -> Node (None, MapString.add hd (new_node tl) MapString.empty) in add_children (OASISString.nsplit fndlb_fullname '.') mp in let rec group_of_tree mp = MapString.fold (fun nm node acc -> let cur = match node with | Node (Some (cs, bs, lib), children) -> Package (nm, cs, bs, lib, group_of_tree children) | Node (None, children) -> Container (nm, group_of_tree children) | Leaf (cs, bs, lib) -> Package (nm, cs, bs, lib, []) in cur :: acc) mp [] in let group_mp = List.fold_left (fun mp -> function | Library (cs, bs, lib) -> add (cs, bs, lib) mp | _ -> mp) MapString.empty pkg.sections in let groups = group_of_tree group_mp in let library_name_of_findlib_name = Lazy.lazy_from_fun (fun () -> (* Revert findlib_name_of_library_name. *) MapString.fold (fun k v mp -> MapString.add v k mp) fndlb_name_of_lib_name MapString.empty) in let library_name_of_findlib_name fndlb_nm = try MapString.find fndlb_nm (Lazy.force library_name_of_findlib_name) with Not_found -> raise (FindlibPackageNotFound fndlb_nm) in groups, findlib_name_of_library_name, library_name_of_findlib_name let findlib_of_group = function | Container (fndlb_nm, _) | Package (fndlb_nm, _, _, _, _) -> fndlb_nm let root_of_group grp = let rec root_lib_aux = (* We do a DFS in the group. *) function | Container (_, children) -> List.fold_left (fun res grp -> if res = None then root_lib_aux grp else res) None children | Package (_, cs, bs, lib, _) -> Some (cs, bs, lib) in match root_lib_aux grp with | Some res -> res | None -> failwithf (f_ "Unable to determine root library of findlib library '%s'") (findlib_of_group grp) end module OASISFlag = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISFlag.ml" end module OASISPackage = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISPackage.ml" end module OASISSourceRepository = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISSourceRepository.ml" end module OASISTest = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISTest.ml" end module OASISDocument = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISDocument.ml" end module OASISExec = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISExec.ml" open OASISGettext open OASISUtils open OASISMessage (* TODO: I don't like this quote, it is there because $(rm) foo expands to * 'rm -f' foo... *) let run ~ctxt ?f_exit_code ?(quote=true) cmd args = let cmd = if quote then if Sys.os_type = "Win32" then if String.contains cmd ' ' then (* Double the 1st double quote... win32... sigh *) "\""^(Filename.quote cmd) else cmd else Filename.quote cmd else cmd in let cmdline = String.concat " " (cmd :: args) in info ~ctxt (f_ "Running command '%s'") cmdline; match f_exit_code, Sys.command cmdline with | None, 0 -> () | None, i -> failwithf (f_ "Command '%s' terminated with error code %d") cmdline i | Some f, i -> f i let run_read_output ~ctxt ?f_exit_code cmd args = let fn = Filename.temp_file "oasis-" ".txt" in try begin let () = run ~ctxt ?f_exit_code cmd (args @ [">"; Filename.quote fn]) in let chn = open_in fn in let routput = ref [] in begin try while true do routput := (input_line chn) :: !routput done with End_of_file -> () end; close_in chn; Sys.remove fn; List.rev !routput end with e -> (try Sys.remove fn with _ -> ()); raise e let run_read_one_line ~ctxt ?f_exit_code cmd args = match run_read_output ~ctxt ?f_exit_code cmd args with | [fst] -> fst | lst -> failwithf (f_ "Command return unexpected output %S") (String.concat "\n" lst) end module OASISFileUtil = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISFileUtil.ml" open OASISGettext let file_exists_case fn = let dirname = Filename.dirname fn in let basename = Filename.basename fn in if Sys.file_exists dirname then if basename = Filename.current_dir_name then true else List.mem basename (Array.to_list (Sys.readdir dirname)) else false let find_file ?(case_sensitive=true) paths exts = (* Cardinal product of two list *) let ( * ) lst1 lst2 = List.flatten (List.map (fun a -> List.map (fun b -> a,b) lst2) lst1) in let rec combined_paths lst = match lst with | p1 :: p2 :: tl -> let acc = (List.map (fun (a,b) -> Filename.concat a b) (p1 * p2)) in combined_paths (acc :: tl) | [e] -> e | [] -> [] in let alternatives = List.map (fun (p,e) -> if String.length e > 0 && e.[0] <> '.' then p ^ "." ^ e else p ^ e) ((combined_paths paths) * exts) in List.find (if case_sensitive then file_exists_case else Sys.file_exists) alternatives let which ~ctxt prg = let path_sep = match Sys.os_type with | "Win32" -> ';' | _ -> ':' in let path_lst = OASISString.nsplit (Sys.getenv "PATH") path_sep in let exec_ext = match Sys.os_type with | "Win32" -> "" :: (OASISString.nsplit (Sys.getenv "PATHEXT") path_sep) | _ -> [""] in find_file ~case_sensitive:false [path_lst; [prg]] exec_ext (**/**) let rec fix_dir dn = (* Windows hack because Sys.file_exists "src\\" = false when * Sys.file_exists "src" = true *) let ln = String.length dn in if Sys.os_type = "Win32" && ln > 0 && dn.[ln - 1] = '\\' then fix_dir (String.sub dn 0 (ln - 1)) else dn let q = Filename.quote (**/**) let cp ~ctxt ?(recurse=false) src tgt = if recurse then match Sys.os_type with | "Win32" -> OASISExec.run ~ctxt "xcopy" [q src; q tgt; "/E"] | _ -> OASISExec.run ~ctxt "cp" ["-r"; q src; q tgt] else OASISExec.run ~ctxt (match Sys.os_type with | "Win32" -> "copy" | _ -> "cp") [q src; q tgt] let mkdir ~ctxt tgt = OASISExec.run ~ctxt (match Sys.os_type with | "Win32" -> "md" | _ -> "mkdir") [q tgt] let rec mkdir_parent ~ctxt f tgt = let tgt = fix_dir tgt in if Sys.file_exists tgt then begin if not (Sys.is_directory tgt) then OASISUtils.failwithf (f_ "Cannot create directory '%s', a file of the same name already \ exists") tgt end else begin mkdir_parent ~ctxt f (Filename.dirname tgt); if not (Sys.file_exists tgt) then begin f tgt; mkdir ~ctxt tgt end end let rmdir ~ctxt tgt = if Sys.readdir tgt = [||] then begin match Sys.os_type with | "Win32" -> OASISExec.run ~ctxt "rd" [q tgt] | _ -> OASISExec.run ~ctxt "rm" ["-r"; q tgt] end let glob ~ctxt fn = let basename = Filename.basename fn in if String.length basename >= 2 && basename.[0] = '*' && basename.[1] = '.' then begin let ext_len = (String.length basename) - 2 in let ext = String.sub basename 2 ext_len in let dirname = Filename.dirname fn in Array.fold_left (fun acc fn -> try let fn_ext = String.sub fn ((String.length fn) - ext_len) ext_len in if fn_ext = ext then (Filename.concat dirname fn) :: acc else acc with Invalid_argument _ -> acc) [] (Sys.readdir dirname) end else begin if file_exists_case fn then [fn] else [] end end # 2142 "setup.ml" module BaseEnvLight = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseEnvLight.ml" module MapString = Map.Make(String) type t = string MapString.t let default_filename = Filename.concat (Sys.getcwd ()) "setup.data" let load ?(allow_empty=false) ?(filename=default_filename) () = if Sys.file_exists filename then begin let chn = open_in_bin filename in let st = Stream.of_channel chn in let line = ref 1 in let st_line = Stream.from (fun _ -> try match Stream.next st with | '\n' -> incr line; Some '\n' | c -> Some c with Stream.Failure -> None) in let lexer = Genlex.make_lexer ["="] st_line in let rec read_file mp = match Stream.npeek 3 lexer with | [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] -> Stream.junk lexer; Stream.junk lexer; Stream.junk lexer; read_file (MapString.add nm value mp) | [] -> mp | _ -> failwith (Printf.sprintf "Malformed data file '%s' line %d" filename !line) in let mp = read_file MapString.empty in close_in chn; mp end else if allow_empty then begin MapString.empty end else begin failwith (Printf.sprintf "Unable to load environment, the file '%s' doesn't exist." filename) end let var_get name env = let rec var_expand str = let buff = Buffer.create ((String.length str) * 2) in Buffer.add_substitute buff (fun var -> try var_expand (MapString.find var env) with Not_found -> failwith (Printf.sprintf "No variable %s defined when trying to expand %S." var str)) str; Buffer.contents buff in var_expand (MapString.find name env) let var_choose lst env = OASISExpr.choose (fun nm -> var_get nm env) lst end # 2240 "setup.ml" module BaseContext = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseContext.ml" open OASISContext let args = args let default = default end module BaseMessage = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseMessage.ml" (** Message to user, overrid for Base @author Sylvain Le Gall *) open OASISMessage open BaseContext let debug fmt = debug ~ctxt:!default fmt let info fmt = info ~ctxt:!default fmt let warning fmt = warning ~ctxt:!default fmt let error fmt = error ~ctxt:!default fmt end module BaseEnv = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseEnv.ml" open OASISGettext open OASISUtils open PropList module MapString = BaseEnvLight.MapString type origin_t = | ODefault | OGetEnv | OFileLoad | OCommandLine type cli_handle_t = | CLINone | CLIAuto | CLIWith | CLIEnable | CLIUser of (Arg.key * Arg.spec * Arg.doc) list type definition_t = { hide: bool; dump: bool; cli: cli_handle_t; arg_help: string option; group: string option; } let schema = Schema.create "environment" (* Environment data *) let env = Data.create () (* Environment data from file *) let env_from_file = ref MapString.empty (* Lexer for var *) let var_lxr = Genlex.make_lexer [] let rec var_expand str = let buff = Buffer.create ((String.length str) * 2) in Buffer.add_substitute buff (fun var -> try (* TODO: this is a quick hack to allow calling Test.Command * without defining executable name really. I.e. if there is * an exec Executable toto, then $(toto) should be replace * by its real name. It is however useful to have this function * for other variable that depend on the host and should be * written better than that. *) let st = var_lxr (Stream.of_string var) in match Stream.npeek 3 st with | [Genlex.Ident "utoh"; Genlex.Ident nm] -> OASISHostPath.of_unix (var_get nm) | [Genlex.Ident "utoh"; Genlex.String s] -> OASISHostPath.of_unix s | [Genlex.Ident "ocaml_escaped"; Genlex.Ident nm] -> String.escaped (var_get nm) | [Genlex.Ident "ocaml_escaped"; Genlex.String s] -> String.escaped s | [Genlex.Ident nm] -> var_get nm | _ -> failwithf (f_ "Unknown expression '%s' in variable expansion of %s.") var str with | Unknown_field (_, _) -> failwithf (f_ "No variable %s defined when trying to expand %S.") var str | Stream.Error e -> failwithf (f_ "Syntax error when parsing '%s' when trying to \ expand %S: %s") var str e) str; Buffer.contents buff and var_get name = let vl = try Schema.get schema env name with Unknown_field _ as e -> begin try MapString.find name !env_from_file with Not_found -> raise e end in var_expand vl let var_choose ?printer ?name lst = OASISExpr.choose ?printer ?name var_get lst let var_protect vl = let buff = Buffer.create (String.length vl) in String.iter (function | '$' -> Buffer.add_string buff "\\$" | c -> Buffer.add_char buff c) vl; Buffer.contents buff let var_define ?(hide=false) ?(dump=true) ?short_desc ?(cli=CLINone) ?arg_help ?group name (* TODO: type constraint on the fact that name must be a valid OCaml id *) dflt = let default = [ OFileLoad, (fun () -> MapString.find name !env_from_file); ODefault, dflt; OGetEnv, (fun () -> Sys.getenv name); ] in let extra = { hide = hide; dump = dump; cli = cli; arg_help = arg_help; group = group; } in (* Try to find a value that can be defined *) let var_get_low lst = let errors, res = List.fold_left (fun (errors, res) (o, v) -> if res = None then begin try errors, Some (v ()) with | Not_found -> errors, res | Failure rsn -> (rsn :: errors), res | e -> (Printexc.to_string e) :: errors, res end else errors, res) ([], None) (List.sort (fun (o1, _) (o2, _) -> Pervasives.compare o2 o1) lst) in match res, errors with | Some v, _ -> v | None, [] -> raise (Not_set (name, None)) | None, lst -> raise (Not_set (name, Some (String.concat (s_ ", ") lst))) in let help = match short_desc with | Some fs -> Some fs | None -> None in let var_get_lst = FieldRO.create ~schema ~name ~parse:(fun ?(context=ODefault) s -> [context, fun () -> s]) ~print:var_get_low ~default ~update:(fun ?context x old_x -> x @ old_x) ?help extra in fun () -> var_expand (var_get_low (var_get_lst env)) let var_redefine ?hide ?dump ?short_desc ?cli ?arg_help ?group name dflt = if Schema.mem schema name then begin (* TODO: look suspsicious, we want to memorize dflt not dflt () *) Schema.set schema env ~context:ODefault name (dflt ()); fun () -> var_get name end else begin var_define ?hide ?dump ?short_desc ?cli ?arg_help ?group name dflt end let var_ignore (e : unit -> string) = () let print_hidden = var_define ~hide:true ~dump:false ~cli:CLIAuto ~arg_help:"Print even non-printable variable. (debug)" "print_hidden" (fun () -> "false") let var_all () = List.rev (Schema.fold (fun acc nm def _ -> if not def.hide || bool_of_string (print_hidden ()) then nm :: acc else acc) [] schema) let default_filename = BaseEnvLight.default_filename let load ?allow_empty ?filename () = env_from_file := BaseEnvLight.load ?allow_empty ?filename () let unload () = env_from_file := MapString.empty; Data.clear env let dump ?(filename=default_filename) () = let chn = open_out_bin filename in let output nm value = Printf.fprintf chn "%s=%S\n" nm value in let mp_todo = (* Dump data from schema *) Schema.fold (fun mp_todo nm def _ -> if def.dump then begin try let value = Schema.get schema env nm in output nm value with Not_set _ -> () end; MapString.remove nm mp_todo) !env_from_file schema in (* Dump data defined outside of schema *) MapString.iter output mp_todo; (* End of the dump *) close_out chn let print () = let printable_vars = Schema.fold (fun acc nm def short_descr_opt -> if not def.hide || bool_of_string (print_hidden ()) then begin try let value = Schema.get schema env nm in let txt = match short_descr_opt with | Some s -> s () | None -> nm in (txt, value) :: acc with Not_set _ -> acc end else acc) [] schema in let max_length = List.fold_left max 0 (List.rev_map String.length (List.rev_map fst printable_vars)) in let dot_pad str = String.make ((max_length - (String.length str)) + 3) '.' in Printf.printf "\nConfiguration: \n"; List.iter (fun (name,value) -> Printf.printf "%s: %s %s\n" name (dot_pad name) value) (List.rev printable_vars); Printf.printf "\n%!" let args () = let arg_concat = OASISUtils.varname_concat ~hyphen:'-' in [ "--override", Arg.Tuple ( let rvr = ref "" in let rvl = ref "" in [ Arg.Set_string rvr; Arg.Set_string rvl; Arg.Unit (fun () -> Schema.set schema env ~context:OCommandLine !rvr !rvl) ] ), "var+val Override any configuration variable."; ] @ List.flatten (Schema.fold (fun acc name def short_descr_opt -> let var_set s = Schema.set schema env ~context:OCommandLine name s in let arg_name = OASISUtils.varname_of_string ~hyphen:'-' name in let hlp = match short_descr_opt with | Some txt -> txt () | None -> "" in let arg_hlp = match def.arg_help with | Some s -> s | None -> "str" in let default_value = try Printf.sprintf (f_ " [%s]") (Schema.get schema env name) with Not_set _ -> "" in let args = match def.cli with | CLINone -> [] | CLIAuto -> [ arg_concat "--" arg_name, Arg.String var_set, Printf.sprintf (f_ "%s %s%s") arg_hlp hlp default_value ] | CLIWith -> [ arg_concat "--with-" arg_name, Arg.String var_set, Printf.sprintf (f_ "%s %s%s") arg_hlp hlp default_value ] | CLIEnable -> let dflt = if default_value = " [true]" then s_ " [default: enabled]" else s_ " [default: disabled]" in [ arg_concat "--enable-" arg_name, Arg.Unit (fun () -> var_set "true"), Printf.sprintf (f_ " %s%s") hlp dflt; arg_concat "--disable-" arg_name, Arg.Unit (fun () -> var_set "false"), Printf.sprintf (f_ " %s%s") hlp dflt ] | CLIUser lst -> lst in args :: acc) [] schema) end module BaseArgExt = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseArgExt.ml" open OASISUtils open OASISGettext let parse argv args = (* Simulate command line for Arg *) let current = ref 0 in try Arg.parse_argv ~current:current (Array.concat [[|"none"|]; argv]) (Arg.align args) (failwithf (f_ "Don't know what to do with arguments: '%s'")) (s_ "configure options:") with | Arg.Help txt -> print_endline txt; exit 0 | Arg.Bad txt -> prerr_endline txt; exit 1 end module BaseCheck = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseCheck.ml" open BaseEnv open BaseMessage open OASISUtils open OASISGettext let prog_best prg prg_lst = var_redefine prg (fun () -> let alternate = List.fold_left (fun res e -> match res with | Some _ -> res | None -> try Some (OASISFileUtil.which ~ctxt:!BaseContext.default e) with Not_found -> None) None prg_lst in match alternate with | Some prg -> prg | None -> raise Not_found) let prog prg = prog_best prg [prg] let prog_opt prg = prog_best prg [prg^".opt"; prg] let ocamlfind = prog "ocamlfind" let version var_prefix cmp fversion () = (* Really compare version provided *) let var = var_prefix^"_version_"^(OASISVersion.varname_of_comparator cmp) in var_redefine ~hide:true var (fun () -> let version_str = match fversion () with | "[Distributed with OCaml]" -> begin try (var_get "ocaml_version") with Not_found -> warning (f_ "Variable ocaml_version not defined, fallback \ to default"); Sys.ocaml_version end | res -> res in let version = OASISVersion.version_of_string version_str in if OASISVersion.comparator_apply version cmp then version_str else failwithf (f_ "Cannot satisfy version constraint on %s: %s (version: %s)") var_prefix (OASISVersion.string_of_comparator cmp) version_str) () let package_version pkg = OASISExec.run_read_one_line ~ctxt:!BaseContext.default (ocamlfind ()) ["query"; "-format"; "%v"; pkg] let package ?version_comparator pkg () = let var = OASISUtils.varname_concat "pkg_" (OASISUtils.varname_of_string pkg) in let findlib_dir pkg = let dir = OASISExec.run_read_one_line ~ctxt:!BaseContext.default (ocamlfind ()) ["query"; "-format"; "%d"; pkg] in if Sys.file_exists dir && Sys.is_directory dir then dir else failwithf (f_ "When looking for findlib package %s, \ directory %s return doesn't exist") pkg dir in let vl = var_redefine var (fun () -> findlib_dir pkg) () in ( match version_comparator with | Some ver_cmp -> ignore (version var ver_cmp (fun _ -> package_version pkg) ()) | None -> () ); vl end module BaseOCamlcConfig = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseOCamlcConfig.ml" open BaseEnv open OASISUtils open OASISGettext module SMap = Map.Make(String) let ocamlc = BaseCheck.prog_opt "ocamlc" let ocamlc_config_map = (* Map name to value for ocamlc -config output (name ^": "^value) *) let rec split_field mp lst = match lst with | line :: tl -> let mp = try let pos_semicolon = String.index line ':' in if pos_semicolon > 1 then ( let name = String.sub line 0 pos_semicolon in let linelen = String.length line in let value = if linelen > pos_semicolon + 2 then String.sub line (pos_semicolon + 2) (linelen - pos_semicolon - 2) else "" in SMap.add name value mp ) else ( mp ) with Not_found -> ( mp ) in split_field mp tl | [] -> mp in let cache = lazy (var_protect (Marshal.to_string (split_field SMap.empty (OASISExec.run_read_output ~ctxt:!BaseContext.default (ocamlc ()) ["-config"])) [])) in var_redefine "ocamlc_config_map" ~hide:true ~dump:false (fun () -> (* TODO: update if ocamlc change !!! *) Lazy.force cache) let var_define nm = (* Extract data from ocamlc -config *) let avlbl_config_get () = Marshal.from_string (ocamlc_config_map ()) 0 in let chop_version_suffix s = try String.sub s 0 (String.index s '+') with _ -> s in let nm_config, value_config = match nm with | "ocaml_version" -> "version", chop_version_suffix | _ -> nm, (fun x -> x) in var_redefine nm (fun () -> try let map = avlbl_config_get () in let value = SMap.find nm_config map in value_config value with Not_found -> failwithf (f_ "Cannot find field '%s' in '%s -config' output") nm (ocamlc ())) end module BaseStandardVar = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseStandardVar.ml" open OASISGettext open OASISTypes open OASISExpr open BaseCheck open BaseEnv let ocamlfind = BaseCheck.ocamlfind let ocamlc = BaseOCamlcConfig.ocamlc let ocamlopt = prog_opt "ocamlopt" let ocamlbuild = prog "ocamlbuild" (**/**) let rpkg = ref None let pkg_get () = match !rpkg with | Some pkg -> pkg | None -> failwith (s_ "OASIS Package is not set") let var_cond = ref [] let var_define_cond ~since_version f dflt = let holder = ref (fun () -> dflt) in let since_version = OASISVersion.VGreaterEqual (OASISVersion.version_of_string since_version) in var_cond := (fun ver -> if OASISVersion.comparator_apply ver since_version then holder := f ()) :: !var_cond; fun () -> !holder () (**/**) let pkg_name = var_define ~short_desc:(fun () -> s_ "Package name") "pkg_name" (fun () -> (pkg_get ()).name) let pkg_version = var_define ~short_desc:(fun () -> s_ "Package version") "pkg_version" (fun () -> (OASISVersion.string_of_version (pkg_get ()).version)) let c = BaseOCamlcConfig.var_define let os_type = c "os_type" let system = c "system" let architecture = c "architecture" let ccomp_type = c "ccomp_type" let ocaml_version = c "ocaml_version" (* TODO: Check standard variable presence at runtime *) let standard_library_default = c "standard_library_default" let standard_library = c "standard_library" let standard_runtime = c "standard_runtime" let bytecomp_c_compiler = c "bytecomp_c_compiler" let native_c_compiler = c "native_c_compiler" let model = c "model" let ext_obj = c "ext_obj" let ext_asm = c "ext_asm" let ext_lib = c "ext_lib" let ext_dll = c "ext_dll" let default_executable_name = c "default_executable_name" let systhread_supported = c "systhread_supported" let flexlink = BaseCheck.prog "flexlink" let flexdll_version = var_define ~short_desc:(fun () -> "FlexDLL version (Win32)") "flexdll_version" (fun () -> let lst = OASISExec.run_read_output ~ctxt:!BaseContext.default (flexlink ()) ["-help"] in match lst with | line :: _ -> Scanf.sscanf line "FlexDLL version %s" (fun ver -> ver) | [] -> raise Not_found) (**/**) let p name hlp dflt = var_define ~short_desc:hlp ~cli:CLIAuto ~arg_help:"dir" name dflt let (/) a b = if os_type () = Sys.os_type then Filename.concat a b else if os_type () = "Unix" then OASISUnixPath.concat a b else OASISUtils.failwithf (f_ "Cannot handle os_type %s filename concat") (os_type ()) (**/**) let prefix = p "prefix" (fun () -> s_ "Install architecture-independent files dir") (fun () -> match os_type () with | "Win32" -> let program_files = Sys.getenv "PROGRAMFILES" in program_files/(pkg_name ()) | _ -> "/usr/local") let exec_prefix = p "exec_prefix" (fun () -> s_ "Install architecture-dependent files in dir") (fun () -> "$prefix") let bindir = p "bindir" (fun () -> s_ "User executables") (fun () -> "$exec_prefix"/"bin") let sbindir = p "sbindir" (fun () -> s_ "System admin executables") (fun () -> "$exec_prefix"/"sbin") let libexecdir = p "libexecdir" (fun () -> s_ "Program executables") (fun () -> "$exec_prefix"/"libexec") let sysconfdir = p "sysconfdir" (fun () -> s_ "Read-only single-machine data") (fun () -> "$prefix"/"etc") let sharedstatedir = p "sharedstatedir" (fun () -> s_ "Modifiable architecture-independent data") (fun () -> "$prefix"/"com") let localstatedir = p "localstatedir" (fun () -> s_ "Modifiable single-machine data") (fun () -> "$prefix"/"var") let libdir = p "libdir" (fun () -> s_ "Object code libraries") (fun () -> "$exec_prefix"/"lib") let datarootdir = p "datarootdir" (fun () -> s_ "Read-only arch-independent data root") (fun () -> "$prefix"/"share") let datadir = p "datadir" (fun () -> s_ "Read-only architecture-independent data") (fun () -> "$datarootdir") let infodir = p "infodir" (fun () -> s_ "Info documentation") (fun () -> "$datarootdir"/"info") let localedir = p "localedir" (fun () -> s_ "Locale-dependent data") (fun () -> "$datarootdir"/"locale") let mandir = p "mandir" (fun () -> s_ "Man documentation") (fun () -> "$datarootdir"/"man") let docdir = p "docdir" (fun () -> s_ "Documentation root") (fun () -> "$datarootdir"/"doc"/"$pkg_name") let htmldir = p "htmldir" (fun () -> s_ "HTML documentation") (fun () -> "$docdir") let dvidir = p "dvidir" (fun () -> s_ "DVI documentation") (fun () -> "$docdir") let pdfdir = p "pdfdir" (fun () -> s_ "PDF documentation") (fun () -> "$docdir") let psdir = p "psdir" (fun () -> s_ "PS documentation") (fun () -> "$docdir") let destdir = p "destdir" (fun () -> s_ "Prepend a path when installing package") (fun () -> raise (PropList.Not_set ("destdir", Some (s_ "undefined by construct")))) let findlib_version = var_define "findlib_version" (fun () -> BaseCheck.package_version "findlib") let is_native = var_define "is_native" (fun () -> try let _s : string = ocamlopt () in "true" with PropList.Not_set _ -> let _s : string = ocamlc () in "false") let ext_program = var_define "suffix_program" (fun () -> match os_type () with | "Win32" -> ".exe" | _ -> "") let rm = var_define ~short_desc:(fun () -> s_ "Remove a file.") "rm" (fun () -> match os_type () with | "Win32" -> "del" | _ -> "rm -f") let rmdir = var_define ~short_desc:(fun () -> s_ "Remove a directory.") "rmdir" (fun () -> match os_type () with | "Win32" -> "rd" | _ -> "rm -rf") let debug = var_define ~short_desc:(fun () -> s_ "Turn ocaml debug flag on") ~cli:CLIEnable "debug" (fun () -> "true") let profile = var_define ~short_desc:(fun () -> s_ "Turn ocaml profile flag on") ~cli:CLIEnable "profile" (fun () -> "false") let tests = var_define_cond ~since_version:"0.3" (fun () -> var_define ~short_desc:(fun () -> s_ "Compile tests executable and library and run them") ~cli:CLIEnable "tests" (fun () -> "false")) "true" let docs = var_define_cond ~since_version:"0.3" (fun () -> var_define ~short_desc:(fun () -> s_ "Create documentations") ~cli:CLIEnable "docs" (fun () -> "true")) "true" let native_dynlink = var_define ~short_desc:(fun () -> s_ "Compiler support generation of .cmxs.") ~cli:CLINone "native_dynlink" (fun () -> let res = let ocaml_lt_312 () = OASISVersion.comparator_apply (OASISVersion.version_of_string (ocaml_version ())) (OASISVersion.VLesser (OASISVersion.version_of_string "3.12.0")) in let flexdll_lt_030 () = OASISVersion.comparator_apply (OASISVersion.version_of_string (flexdll_version ())) (OASISVersion.VLesser (OASISVersion.version_of_string "0.30")) in let has_native_dynlink = let ocamlfind = ocamlfind () in try let fn = OASISExec.run_read_one_line ~ctxt:!BaseContext.default ocamlfind ["query"; "-predicates"; "native"; "dynlink"; "-format"; "%d/%a"] in Sys.file_exists fn with _ -> false in if not has_native_dynlink then false else if ocaml_lt_312 () then false else if (os_type () = "Win32" || os_type () = "Cygwin") && flexdll_lt_030 () then begin BaseMessage.warning (f_ ".cmxs generation disabled because FlexDLL needs to be \ at least 0.30. Please upgrade FlexDLL from %s to 0.30.") (flexdll_version ()); false end else true in string_of_bool res) let init pkg = rpkg := Some pkg; List.iter (fun f -> f pkg.oasis_version) !var_cond end module BaseFileAB = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseFileAB.ml" open BaseEnv open OASISGettext open BaseMessage let to_filename fn = let fn = OASISHostPath.of_unix fn in if not (Filename.check_suffix fn ".ab") then warning (f_ "File '%s' doesn't have '.ab' extension") fn; Filename.chop_extension fn let replace fn_lst = let buff = Buffer.create 13 in List.iter (fun fn -> let fn = OASISHostPath.of_unix fn in let chn_in = open_in fn in let chn_out = open_out (to_filename fn) in ( try while true do Buffer.add_string buff (var_expand (input_line chn_in)); Buffer.add_char buff '\n' done with End_of_file -> () ); Buffer.output_buffer chn_out buff; Buffer.clear buff; close_in chn_in; close_out chn_out) fn_lst end module BaseLog = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseLog.ml" open OASISUtils let default_filename = Filename.concat (Filename.dirname BaseEnv.default_filename) "setup.log" module SetTupleString = Set.Make (struct type t = string * string let compare (s11, s12) (s21, s22) = match String.compare s11 s21 with | 0 -> String.compare s12 s22 | n -> n end) let load () = if Sys.file_exists default_filename then begin let chn = open_in default_filename in let scbuf = Scanf.Scanning.from_file default_filename in let rec read_aux (st, lst) = if not (Scanf.Scanning.end_of_input scbuf) then begin let acc = try Scanf.bscanf scbuf "%S %S\n" (fun e d -> let t = e, d in if SetTupleString.mem t st then st, lst else SetTupleString.add t st, t :: lst) with Scanf.Scan_failure _ -> failwith (Scanf.bscanf scbuf "%l" (fun line -> Printf.sprintf "Malformed log file '%s' at line %d" default_filename line)) in read_aux acc end else begin close_in chn; List.rev lst end in read_aux (SetTupleString.empty, []) end else begin [] end let register event data = let chn_out = open_out_gen [Open_append; Open_creat; Open_text] 0o644 default_filename in Printf.fprintf chn_out "%S %S\n" event data; close_out chn_out let unregister event data = if Sys.file_exists default_filename then begin let lst = load () in let chn_out = open_out default_filename in let write_something = ref false in List.iter (fun (e, d) -> if e <> event || d <> data then begin write_something := true; Printf.fprintf chn_out "%S %S\n" e d end) lst; close_out chn_out; if not !write_something then Sys.remove default_filename end let filter events = let st_events = List.fold_left (fun st e -> SetString.add e st) SetString.empty events in List.filter (fun (e, _) -> SetString.mem e st_events) (load ()) let exists event data = List.exists (fun v -> (event, data) = v) (load ()) end module BaseBuilt = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseBuilt.ml" open OASISTypes open OASISGettext open BaseStandardVar open BaseMessage type t = | BExec (* Executable *) | BExecLib (* Library coming with executable *) | BLib (* Library *) | BDoc (* Document *) let to_log_event_file t nm = "built_"^ (match t with | BExec -> "exec" | BExecLib -> "exec_lib" | BLib -> "lib" | BDoc -> "doc")^ "_"^nm let to_log_event_done t nm = "is_"^(to_log_event_file t nm) let register t nm lst = BaseLog.register (to_log_event_done t nm) "true"; List.iter (fun alt -> let registered = List.fold_left (fun registered fn -> if OASISFileUtil.file_exists_case fn then begin BaseLog.register (to_log_event_file t nm) (if Filename.is_relative fn then Filename.concat (Sys.getcwd ()) fn else fn); true end else registered) false alt in if not registered then warning (f_ "Cannot find an existing alternative files among: %s") (String.concat (s_ ", ") alt)) lst let unregister t nm = List.iter (fun (e, d) -> BaseLog.unregister e d) (BaseLog.filter [to_log_event_file t nm; to_log_event_done t nm]) let fold t nm f acc = List.fold_left (fun acc (_, fn) -> if OASISFileUtil.file_exists_case fn then begin f acc fn end else begin warning (f_ "File '%s' has been marked as built \ for %s but doesn't exist") fn (Printf.sprintf (match t with | BExec | BExecLib -> (f_ "executable %s") | BLib -> (f_ "library %s") | BDoc -> (f_ "documentation %s")) nm); acc end) acc (BaseLog.filter [to_log_event_file t nm]) let is_built t nm = List.fold_left (fun is_built (_, d) -> (try bool_of_string d with _ -> false)) false (BaseLog.filter [to_log_event_done t nm]) let of_executable ffn (cs, bs, exec) = let unix_exec_is, unix_dll_opt = OASISExecutable.unix_exec_is (cs, bs, exec) (fun () -> bool_of_string (is_native ())) ext_dll ext_program in let evs = (BExec, cs.cs_name, [[ffn unix_exec_is]]) :: (match unix_dll_opt with | Some fn -> [BExecLib, cs.cs_name, [[ffn fn]]] | None -> []) in evs, unix_exec_is, unix_dll_opt let of_library ffn (cs, bs, lib) = let unix_lst = OASISLibrary.generated_unix_files ~ctxt:!BaseContext.default ~source_file_exists:(fun fn -> OASISFileUtil.file_exists_case (OASISHostPath.of_unix fn)) ~is_native:(bool_of_string (is_native ())) ~has_native_dynlink:(bool_of_string (native_dynlink ())) ~ext_lib:(ext_lib ()) ~ext_dll:(ext_dll ()) (cs, bs, lib) in let evs = [BLib, cs.cs_name, List.map (List.map ffn) unix_lst] in evs, unix_lst end module BaseCustom = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseCustom.ml" open BaseEnv open BaseMessage open OASISTypes open OASISGettext let run cmd args extra_args = OASISExec.run ~ctxt:!BaseContext.default ~quote:false (var_expand cmd) (List.map var_expand (args @ (Array.to_list extra_args))) let hook ?(failsafe=false) cstm f e = let optional_command lst = let printer = function | Some (cmd, args) -> String.concat " " (cmd :: args) | None -> s_ "No command" in match var_choose ~name:(s_ "Pre/Post Command") ~printer lst with | Some (cmd, args) -> begin try run cmd args [||] with e when failsafe -> warning (f_ "Command '%s' fail with error: %s") (String.concat " " (cmd :: args)) (match e with | Failure msg -> msg | e -> Printexc.to_string e) end | None -> () in let res = optional_command cstm.pre_command; f e in optional_command cstm.post_command; res end module BaseDynVar = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseDynVar.ml" open OASISTypes open OASISGettext open BaseEnv open BaseBuilt let init pkg = (* TODO: disambiguate exec vs other variable by adding exec_VARNAME. *) (* TODO: provide compile option for library libary_byte_args_VARNAME... *) List.iter (function | Executable (cs, bs, exec) -> if var_choose bs.bs_build then var_ignore (var_redefine (* We don't save this variable *) ~dump:false ~short_desc:(fun () -> Printf.sprintf (f_ "Filename of executable '%s'") cs.cs_name) (OASISUtils.varname_of_string cs.cs_name) (fun () -> let fn_opt = fold BExec cs.cs_name (fun _ fn -> Some fn) None in match fn_opt with | Some fn -> fn | None -> raise (PropList.Not_set (cs.cs_name, Some (Printf.sprintf (f_ "Executable '%s' not yet built.") cs.cs_name))))) | Library _ | Flag _ | Test _ | SrcRepo _ | Doc _ -> ()) pkg.sections end module BaseTest = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseTest.ml" open BaseEnv open BaseMessage open OASISTypes open OASISExpr open OASISGettext let test lst pkg extra_args = let one_test (failure, n) (test_plugin, cs, test) = if var_choose ~name:(Printf.sprintf (f_ "test %s run") cs.cs_name) ~printer:string_of_bool test.test_run then begin let () = info (f_ "Running test '%s'") cs.cs_name in let back_cwd = match test.test_working_directory with | Some dir -> let cwd = Sys.getcwd () in let chdir d = info (f_ "Changing directory to '%s'") d; Sys.chdir d in chdir dir; fun () -> chdir cwd | None -> fun () -> () in try let failure_percent = BaseCustom.hook test.test_custom (test_plugin pkg (cs, test)) extra_args in back_cwd (); (failure_percent +. failure, n + 1) with e -> begin back_cwd (); raise e end end else begin info (f_ "Skipping test '%s'") cs.cs_name; (failure, n) end in let (failed, n) = List.fold_left one_test (0.0, 0) lst in let failure_percent = if n = 0 then 0.0 else failed /. (float_of_int n) in let msg = Printf.sprintf (f_ "Tests had a %.2f%% failure rate") (100. *. failure_percent) in if failure_percent > 0.0 then failwith msg else info "%s" msg; (* Possible explanation why the tests where not run. *) if OASISVersion.version_0_3_or_after pkg.oasis_version && not (bool_of_string (BaseStandardVar.tests ())) && lst <> [] then BaseMessage.warning "Tests are turned off, consider enabling with \ 'ocaml setup.ml -configure --enable-tests'" end module BaseDoc = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseDoc.ml" open BaseEnv open BaseMessage open OASISTypes open OASISGettext let doc lst pkg extra_args = let one_doc (doc_plugin, cs, doc) = if var_choose ~name:(Printf.sprintf (f_ "documentation %s build") cs.cs_name) ~printer:string_of_bool doc.doc_build then begin info (f_ "Building documentation '%s'") cs.cs_name; BaseCustom.hook doc.doc_custom (doc_plugin pkg (cs, doc)) extra_args end in List.iter one_doc lst; if OASISVersion.version_0_3_or_after pkg.oasis_version && not (bool_of_string (BaseStandardVar.docs ())) && lst <> [] then BaseMessage.warning "Docs are turned off, consider enabling with \ 'ocaml setup.ml -configure --enable-docs'" end module BaseSetup = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseSetup.ml" open BaseEnv open BaseMessage open OASISTypes open OASISSection open OASISGettext open OASISUtils type std_args_fun = package -> string array -> unit type ('a, 'b) section_args_fun = name * (package -> (common_section * 'a) -> string array -> 'b) type t = { configure: std_args_fun; build: std_args_fun; doc: ((doc, unit) section_args_fun) list; test: ((test, float) section_args_fun) list; install: std_args_fun; uninstall: std_args_fun; clean: std_args_fun list; clean_doc: (doc, unit) section_args_fun list; clean_test: (test, unit) section_args_fun list; distclean: std_args_fun list; distclean_doc: (doc, unit) section_args_fun list; distclean_test: (test, unit) section_args_fun list; package: package; oasis_fn: string option; oasis_version: string; oasis_digest: Digest.t option; oasis_exec: string option; oasis_setup_args: string list; setup_update: bool; } (* Associate a plugin function with data from package *) let join_plugin_sections filter_map lst = List.rev (List.fold_left (fun acc sct -> match filter_map sct with | Some e -> e :: acc | None -> acc) [] lst) (* Search for plugin data associated with a section name *) let lookup_plugin_section plugin action nm lst = try List.assoc nm lst with Not_found -> failwithf (f_ "Cannot find plugin %s matching section %s for %s action") plugin nm action let configure t args = (* Run configure *) BaseCustom.hook t.package.conf_custom (fun () -> (* Reload if preconf has changed it *) begin try unload (); load (); with _ -> () end; (* Run plugin's configure *) t.configure t.package args; (* Dump to allow postconf to change it *) dump ()) (); (* Reload environment *) unload (); load (); (* Save environment *) print (); (* Replace data in file *) BaseFileAB.replace t.package.files_ab let build t args = BaseCustom.hook t.package.build_custom (t.build t.package) args let doc t args = BaseDoc.doc (join_plugin_sections (function | Doc (cs, e) -> Some (lookup_plugin_section "documentation" (s_ "build") cs.cs_name t.doc, cs, e) | _ -> None) t.package.sections) t.package args let test t args = BaseTest.test (join_plugin_sections (function | Test (cs, e) -> Some (lookup_plugin_section "test" (s_ "run") cs.cs_name t.test, cs, e) | _ -> None) t.package.sections) t.package args let all t args = let rno_doc = ref false in let rno_test = ref false in Arg.parse_argv ~current:(ref 0) (Array.of_list ((Sys.executable_name^" all") :: (Array.to_list args))) [ "-no-doc", Arg.Set rno_doc, s_ "Don't run doc target"; "-no-test", Arg.Set rno_test, s_ "Don't run test target"; ] (failwithf (f_ "Don't know what to do with '%s'")) ""; info "Running configure step"; configure t [||]; info "Running build step"; build t [||]; (* Load setup.log dynamic variables *) BaseDynVar.init t.package; if not !rno_doc then begin info "Running doc step"; doc t [||]; end else begin info "Skipping doc step" end; if not !rno_test then begin info "Running test step"; test t [||] end else begin info "Skipping test step" end let install t args = BaseCustom.hook t.package.install_custom (t.install t.package) args let uninstall t args = BaseCustom.hook t.package.uninstall_custom (t.uninstall t.package) args let reinstall t args = uninstall t args; install t args let clean, distclean = let failsafe f a = try f a with e -> warning (f_ "Action fail with error: %s") (match e with | Failure msg -> msg | e -> Printexc.to_string e) in let generic_clean t cstm mains docs tests args = BaseCustom.hook ~failsafe:true cstm (fun () -> (* Clean section *) List.iter (function | Test (cs, test) -> let f = try List.assoc cs.cs_name tests with Not_found -> fun _ _ _ -> () in failsafe (f t.package (cs, test)) args | Doc (cs, doc) -> let f = try List.assoc cs.cs_name docs with Not_found -> fun _ _ _ -> () in failsafe (f t.package (cs, doc)) args | Library _ | Executable _ | Flag _ | SrcRepo _ -> ()) t.package.sections; (* Clean whole package *) List.iter (fun f -> failsafe (f t.package) args) mains) () in let clean t args = generic_clean t t.package.clean_custom t.clean t.clean_doc t.clean_test args in let distclean t args = (* Call clean *) clean t args; (* Call distclean code *) generic_clean t t.package.distclean_custom t.distclean t.distclean_doc t.distclean_test args; (* Remove generated file *) List.iter (fun fn -> if Sys.file_exists fn then begin info (f_ "Remove '%s'") fn; Sys.remove fn end) (BaseEnv.default_filename :: BaseLog.default_filename :: (List.rev_map BaseFileAB.to_filename t.package.files_ab)) in clean, distclean let version t _ = print_endline t.oasis_version let update_setup_ml, no_update_setup_ml_cli = let b = ref true in b, ("-no-update-setup-ml", Arg.Clear b, s_ " Don't try to update setup.ml, even if _oasis has changed.") let update_setup_ml t = let oasis_fn = match t.oasis_fn with | Some fn -> fn | None -> "_oasis" in let oasis_exec = match t.oasis_exec with | Some fn -> fn | None -> "oasis" in let ocaml = Sys.executable_name in let setup_ml, args = match Array.to_list Sys.argv with | setup_ml :: args -> setup_ml, args | [] -> failwith (s_ "Expecting non-empty command line arguments.") in let ocaml, setup_ml = if Sys.executable_name = Sys.argv.(0) then (* We are not running in standard mode, probably the script * is precompiled. *) "ocaml", "setup.ml" else ocaml, setup_ml in let no_update_setup_ml_cli, _, _ = no_update_setup_ml_cli in let do_update () = let oasis_exec_version = OASISExec.run_read_one_line ~ctxt:!BaseContext.default ~f_exit_code: (function | 0 -> () | 1 -> failwithf (f_ "Executable '%s' is probably an old version \ of oasis (< 0.3.0), please update to version \ v%s.") oasis_exec t.oasis_version | 127 -> failwithf (f_ "Cannot find executable '%s', please install \ oasis v%s.") oasis_exec t.oasis_version | n -> failwithf (f_ "Command '%s version' exited with code %d.") oasis_exec n) oasis_exec ["version"] in if OASISVersion.comparator_apply (OASISVersion.version_of_string oasis_exec_version) (OASISVersion.VGreaterEqual (OASISVersion.version_of_string t.oasis_version)) then begin (* We have a version >= for the executable oasis, proceed with * update. *) (* TODO: delegate this check to 'oasis setup'. *) if Sys.os_type = "Win32" then failwithf (f_ "It is not possible to update the running script \ setup.ml on Windows. Please update setup.ml by \ running '%s'.") (String.concat " " (oasis_exec :: "setup" :: t.oasis_setup_args)) else begin OASISExec.run ~ctxt:!BaseContext.default ~f_exit_code: (function | 0 -> () | n -> failwithf (f_ "Unable to update setup.ml using '%s', \ please fix the problem and retry.") oasis_exec) oasis_exec ("setup" :: t.oasis_setup_args); OASISExec.run ~ctxt:!BaseContext.default ocaml (setup_ml :: args) end end else failwithf (f_ "The version of '%s' (v%s) doesn't match the version of \ oasis used to generate the %s file. Please install at \ least oasis v%s.") oasis_exec oasis_exec_version setup_ml t.oasis_version in if !update_setup_ml then begin try match t.oasis_digest with | Some dgst -> if Sys.file_exists oasis_fn && dgst <> Digest.file "_oasis" then begin do_update (); true end else false | None -> false with e -> error (f_ "Error when updating setup.ml. If you want to avoid this error, \ you can bypass the update of %s by running '%s %s %s %s'") setup_ml ocaml setup_ml no_update_setup_ml_cli (String.concat " " args); raise e end else false let setup t = let catch_exn = ref true in try let act_ref = ref (fun _ -> failwithf (f_ "No action defined, run '%s %s -help'") Sys.executable_name Sys.argv.(0)) in let extra_args_ref = ref [] in let allow_empty_env_ref = ref false in let arg_handle ?(allow_empty_env=false) act = Arg.Tuple [ Arg.Rest (fun str -> extra_args_ref := str :: !extra_args_ref); Arg.Unit (fun () -> allow_empty_env_ref := allow_empty_env; act_ref := act); ] in Arg.parse (Arg.align ([ "-configure", arg_handle ~allow_empty_env:true configure, s_ "[options*] Configure the whole build process."; "-build", arg_handle build, s_ "[options*] Build executables and libraries."; "-doc", arg_handle doc, s_ "[options*] Build documents."; "-test", arg_handle test, s_ "[options*] Run tests."; "-all", arg_handle ~allow_empty_env:true all, s_ "[options*] Run configure, build, doc and test targets."; "-install", arg_handle install, s_ "[options*] Install libraries, data, executables \ and documents."; "-uninstall", arg_handle uninstall, s_ "[options*] Uninstall libraries, data, executables \ and documents."; "-reinstall", arg_handle reinstall, s_ "[options*] Uninstall and install libraries, data, \ executables and documents."; "-clean", arg_handle ~allow_empty_env:true clean, s_ "[options*] Clean files generated by a build."; "-distclean", arg_handle ~allow_empty_env:true distclean, s_ "[options*] Clean files generated by a build and configure."; "-version", arg_handle ~allow_empty_env:true version, s_ " Display version of OASIS used to generate this setup.ml."; "-no-catch-exn", Arg.Clear catch_exn, s_ " Don't catch exception, useful for debugging."; ] @ (if t.setup_update then [no_update_setup_ml_cli] else []) @ (BaseContext.args ()))) (failwithf (f_ "Don't know what to do with '%s'")) (s_ "Setup and run build process current package\n"); (* Build initial environment *) load ~allow_empty:!allow_empty_env_ref (); (** Initialize flags *) List.iter (function | Flag (cs, {flag_description = hlp; flag_default = choices}) -> begin let apply ?short_desc () = var_ignore (var_define ~cli:CLIEnable ?short_desc (OASISUtils.varname_of_string cs.cs_name) (fun () -> string_of_bool (var_choose ~name:(Printf.sprintf (f_ "default value of flag %s") cs.cs_name) ~printer:string_of_bool choices))) in match hlp with | Some hlp -> apply ~short_desc:(fun () -> hlp) () | None -> apply () end | _ -> ()) t.package.sections; BaseStandardVar.init t.package; BaseDynVar.init t.package; if t.setup_update && update_setup_ml t then () else !act_ref t (Array.of_list (List.rev !extra_args_ref)) with e when !catch_exn -> error "%s" (Printexc.to_string e); exit 1 end # 4480 "setup.ml" module InternalConfigurePlugin = struct # 21 "/home/dim/sources/oasis-0.3.0/src/plugins/internal/InternalConfigurePlugin.ml" (** Configure using internal scheme @author Sylvain Le Gall *) open BaseEnv open OASISTypes open OASISUtils open OASISGettext open BaseMessage (** Configure build using provided series of check to be done * and then output corresponding file. *) let configure pkg argv = let var_ignore_eval var = let _s : string = var () in () in let errors = ref SetString.empty in let buff = Buffer.create 13 in let add_errors fmt = Printf.kbprintf (fun b -> errors := SetString.add (Buffer.contents b) !errors; Buffer.clear b) buff fmt in let warn_exception e = warning "%s" (Printexc.to_string e) in (* Check tools *) let check_tools lst = List.iter (function | ExternalTool tool -> begin try var_ignore_eval (BaseCheck.prog tool) with e -> warn_exception e; add_errors (f_ "Cannot find external tool '%s'") tool end | InternalExecutable nm1 -> (* Check that matching tool is built *) List.iter (function | Executable ({cs_name = nm2}, {bs_build = build}, _) when nm1 = nm2 -> if not (var_choose build) then add_errors (f_ "Cannot find buildable internal executable \ '%s' when checking build depends") nm1 | _ -> ()) pkg.sections) lst in let build_checks sct bs = if var_choose bs.bs_build then begin if bs.bs_compiled_object = Native then begin try var_ignore_eval BaseStandardVar.ocamlopt with e -> warn_exception e; add_errors (f_ "Section %s requires native compilation") (OASISSection.string_of_section sct) end; (* Check tools *) check_tools bs.bs_build_tools; (* Check depends *) List.iter (function | FindlibPackage (findlib_pkg, version_comparator) -> begin try var_ignore_eval (BaseCheck.package ?version_comparator findlib_pkg) with e -> warn_exception e; match version_comparator with | None -> add_errors (f_ "Cannot find findlib package %s") findlib_pkg | Some ver_cmp -> add_errors (f_ "Cannot find findlib package %s (%s)") findlib_pkg (OASISVersion.string_of_comparator ver_cmp) end | InternalLibrary nm1 -> (* Check that matching library is built *) List.iter (function | Library ({cs_name = nm2}, {bs_build = build}, _) when nm1 = nm2 -> if not (var_choose build) then add_errors (f_ "Cannot find buildable internal library \ '%s' when checking build depends") nm1 | _ -> ()) pkg.sections) bs.bs_build_depends end in (* Parse command line *) BaseArgExt.parse argv (BaseEnv.args ()); (* OCaml version *) begin match pkg.ocaml_version with | Some ver_cmp -> begin try var_ignore_eval (BaseCheck.version "ocaml" ver_cmp BaseStandardVar.ocaml_version) with e -> warn_exception e; add_errors (f_ "OCaml version %s doesn't match version constraint %s") (BaseStandardVar.ocaml_version ()) (OASISVersion.string_of_comparator ver_cmp) end | None -> () end; (* Findlib version *) begin match pkg.findlib_version with | Some ver_cmp -> begin try var_ignore_eval (BaseCheck.version "findlib" ver_cmp BaseStandardVar.findlib_version) with e -> warn_exception e; add_errors (f_ "Findlib version %s doesn't match version constraint %s") (BaseStandardVar.findlib_version ()) (OASISVersion.string_of_comparator ver_cmp) end | None -> () end; (* FlexDLL *) if BaseStandardVar.os_type () = "Win32" || BaseStandardVar.os_type () = "Cygwin" then begin try var_ignore_eval BaseStandardVar.flexlink with e -> warn_exception e; add_errors (f_ "Cannot find 'flexlink'") end; (* Check build depends *) List.iter (function | Executable (_, bs, _) | Library (_, bs, _) as sct -> build_checks sct bs | Doc (_, doc) -> if var_choose doc.doc_build then check_tools doc.doc_build_tools | Test (_, test) -> if var_choose test.test_run then check_tools test.test_tools | _ -> ()) pkg.sections; (* Check if we need native dynlink (presence of libraries that compile to * native) *) begin let has_cmxa = List.exists (function | Library (_, bs, _) -> var_choose bs.bs_build && (bs.bs_compiled_object = Native || (bs.bs_compiled_object = Best && bool_of_string (BaseStandardVar.is_native ()))) | _ -> false) pkg.sections in if has_cmxa then var_ignore_eval BaseStandardVar.native_dynlink end; (* Check errors *) if SetString.empty != !errors then begin List.iter (fun e -> error "%s" e) (SetString.elements !errors); failwithf (fn_ "%d configuration error" "%d configuration errors" (SetString.cardinal !errors)) (SetString.cardinal !errors) end end module InternalInstallPlugin = struct # 21 "/home/dim/sources/oasis-0.3.0/src/plugins/internal/InternalInstallPlugin.ml" (** Install using internal scheme @author Sylvain Le Gall *) open BaseEnv open BaseStandardVar open BaseMessage open OASISTypes open OASISLibrary open OASISGettext open OASISUtils let exec_hook = ref (fun (cs, bs, exec) -> cs, bs, exec) let lib_hook = ref (fun (cs, bs, lib) -> cs, bs, lib, []) let doc_hook = ref (fun (cs, doc) -> cs, doc) let install_file_ev = "install-file" let install_dir_ev = "install-dir" let install_findlib_ev = "install-findlib" let win32_max_command_line_length = 8000 let split_install_command ocamlfind findlib_name meta files = if Sys.os_type = "Win32" then (* Arguments for the first command: *) let first_args = ["install"; findlib_name; meta] in (* Arguments for remaining commands: *) let other_args = ["install"; findlib_name; "-add"] in (* Extract as much files as possible from [files], [len] is the current command line length: *) let rec get_files len acc files = match files with | [] -> (List.rev acc, []) | file :: rest -> let len = len + 1 + String.length file in if len > win32_max_command_line_length then (List.rev acc, files) else get_files len (file :: acc) rest in (* Split the command into several commands. *) let rec split args files = match files with | [] -> [] | _ -> (* Length of "ocamlfind install [META|-add]" *) let len = List.fold_left (fun len arg -> len + 1 (* for the space *) + String.length arg) (String.length ocamlfind) args in match get_files len [] files with | ([], _) -> failwith (s_ "Command line too long.") | (firsts, others) -> let cmd = args @ firsts in (* Use -add for remaining commands: *) let () = let findlib_ge_132 = OASISVersion.comparator_apply (OASISVersion.version_of_string (BaseStandardVar.findlib_version ())) (OASISVersion.VGreaterEqual (OASISVersion.version_of_string "1.3.2")) in if not findlib_ge_132 then failwithf (f_ "Installing the library %s require to use the flag \ '-add' of ocamlfind because the command line is too \ long. This flag is only available for findlib 1.3.2. \ Please upgrade findlib from %s to 1.3.2") findlib_name (BaseStandardVar.findlib_version ()) in let cmds = split other_args others in cmd :: cmds in (* The first command does not use -add: *) split first_args files else ["install" :: findlib_name :: meta :: files] let install pkg argv = let in_destdir = try let destdir = destdir () in (* Practically speaking destdir is prepended * at the beginning of the target filename *) fun fn -> destdir^fn with PropList.Not_set _ -> fun fn -> fn in let install_file ?tgt_fn src_file envdir = let tgt_dir = in_destdir (envdir ()) in let tgt_file = Filename.concat tgt_dir (match tgt_fn with | Some fn -> fn | None -> Filename.basename src_file) in (* Create target directory if needed *) OASISFileUtil.mkdir_parent ~ctxt:!BaseContext.default (fun dn -> info (f_ "Creating directory '%s'") dn; BaseLog.register install_dir_ev dn) tgt_dir; (* Really install files *) info (f_ "Copying file '%s' to '%s'") src_file tgt_file; OASISFileUtil.cp ~ctxt:!BaseContext.default src_file tgt_file; BaseLog.register install_file_ev tgt_file in (* Install data into defined directory *) let install_data srcdir lst tgtdir = let tgtdir = OASISHostPath.of_unix (var_expand tgtdir) in List.iter (fun (src, tgt_opt) -> let real_srcs = OASISFileUtil.glob ~ctxt:!BaseContext.default (Filename.concat srcdir src) in if real_srcs = [] then failwithf (f_ "Wildcard '%s' doesn't match any files") src; List.iter (fun fn -> install_file fn (fun () -> match tgt_opt with | Some s -> OASISHostPath.of_unix (var_expand s) | None -> tgtdir)) real_srcs) lst in (** Install all libraries *) let install_libs pkg = let files_of_library (f_data, acc) data_lib = let cs, bs, lib, lib_extra = !lib_hook data_lib in if var_choose bs.bs_install && BaseBuilt.is_built BaseBuilt.BLib cs.cs_name then begin let acc = (* Start with acc + lib_extra *) List.rev_append lib_extra acc in let acc = (* Add uncompiled header from the source tree *) let path = OASISHostPath.of_unix bs.bs_path in List.fold_left (fun acc modul -> try List.find OASISFileUtil.file_exists_case (List.map (Filename.concat path) [modul^".mli"; modul^".ml"; String.uncapitalize modul^".mli"; String.capitalize modul^".mli"; String.uncapitalize modul^".ml"; String.capitalize modul^".ml"]) :: acc with Not_found -> begin warning (f_ "Cannot find source header for module %s \ in library %s") modul cs.cs_name; acc end) acc lib.lib_modules in let acc = (* Get generated files *) BaseBuilt.fold BaseBuilt.BLib cs.cs_name (fun acc fn -> fn :: acc) acc in let f_data () = (* Install data associated with the library *) install_data bs.bs_path bs.bs_data_files (Filename.concat (datarootdir ()) pkg.name); f_data () in (f_data, acc) end else begin (f_data, acc) end in (* Install one group of library *) let install_group_lib grp = (* Iterate through all group nodes *) let rec install_group_lib_aux data_and_files grp = let data_and_files, children = match grp with | Container (_, children) -> data_and_files, children | Package (_, cs, bs, lib, children) -> files_of_library data_and_files (cs, bs, lib), children in List.fold_left install_group_lib_aux data_and_files children in (* Findlib name of the root library *) let findlib_name = findlib_of_group grp in (* Determine root library *) let root_lib = root_of_group grp in (* All files to install for this library *) let f_data, files = install_group_lib_aux (ignore, []) grp in (* Really install, if there is something to install *) if files = [] then begin warning (f_ "Nothing to install for findlib library '%s'") findlib_name end else begin let meta = (* Search META file *) let (_, bs, _) = root_lib in let res = Filename.concat bs.bs_path "META" in if not (OASISFileUtil.file_exists_case res) then failwithf (f_ "Cannot find file '%s' for findlib library %s") res findlib_name; res in let files = (* Make filename shorter to avoid hitting command max line length * too early, esp. on Windows. *) let remove_prefix p n = let plen = String.length p in let nlen = String.length n in if plen <= nlen && String.sub n 0 plen = p then begin let fn_sep = if Sys.os_type = "Win32" then '\\' else '/' in let cutpoint = plen + (if plen < nlen && n.[plen] = fn_sep then 1 else 0) in String.sub n cutpoint (nlen - cutpoint) end else n in List.map (remove_prefix (Sys.getcwd ())) files in info (f_ "Installing findlib library '%s'") findlib_name; let ocamlfind = ocamlfind () in let commands = split_install_command ocamlfind findlib_name meta files in List.iter (OASISExec.run ~ctxt:!BaseContext.default ocamlfind) commands; BaseLog.register install_findlib_ev findlib_name end; (* Install data files *) f_data (); in let group_libs, _, _ = findlib_mapping pkg in (* We install libraries in groups *) List.iter install_group_lib group_libs in let install_execs pkg = let install_exec data_exec = let (cs, bs, exec) = !exec_hook data_exec in if var_choose bs.bs_install && BaseBuilt.is_built BaseBuilt.BExec cs.cs_name then begin let exec_libdir () = Filename.concat (libdir ()) pkg.name in BaseBuilt.fold BaseBuilt.BExec cs.cs_name (fun () fn -> install_file ~tgt_fn:(cs.cs_name ^ ext_program ()) fn bindir) (); BaseBuilt.fold BaseBuilt.BExecLib cs.cs_name (fun () fn -> install_file fn exec_libdir) (); install_data bs.bs_path bs.bs_data_files (Filename.concat (datarootdir ()) pkg.name) end in List.iter (function | Executable (cs, bs, exec)-> install_exec (cs, bs, exec) | _ -> ()) pkg.sections in let install_docs pkg = let install_doc data = let (cs, doc) = !doc_hook data in if var_choose doc.doc_install && BaseBuilt.is_built BaseBuilt.BDoc cs.cs_name then begin let tgt_dir = OASISHostPath.of_unix (var_expand doc.doc_install_dir) in BaseBuilt.fold BaseBuilt.BDoc cs.cs_name (fun () fn -> install_file fn (fun () -> tgt_dir)) (); install_data Filename.current_dir_name doc.doc_data_files doc.doc_install_dir end in List.iter (function | Doc (cs, doc) -> install_doc (cs, doc) | _ -> ()) pkg.sections in install_libs pkg; install_execs pkg; install_docs pkg (* Uninstall already installed data *) let uninstall _ argv = List.iter (fun (ev, data) -> if ev = install_file_ev then begin if OASISFileUtil.file_exists_case data then begin info (f_ "Removing file '%s'") data; Sys.remove data end else begin warning (f_ "File '%s' doesn't exist anymore") data end end else if ev = install_dir_ev then begin if Sys.file_exists data && Sys.is_directory data then begin if Sys.readdir data = [||] then begin info (f_ "Removing directory '%s'") data; OASISFileUtil.rmdir ~ctxt:!BaseContext.default data end else begin warning (f_ "Directory '%s' is not empty (%s)") data (String.concat ", " (Array.to_list (Sys.readdir data))) end end else begin warning (f_ "Directory '%s' doesn't exist anymore") data end end else if ev = install_findlib_ev then begin info (f_ "Removing findlib library '%s'") data; OASISExec.run ~ctxt:!BaseContext.default (ocamlfind ()) ["remove"; data] end else failwithf (f_ "Unknown log event '%s'") ev; BaseLog.unregister ev data) (* We process event in reverse order *) (List.rev (BaseLog.filter [install_file_ev; install_dir_ev; install_findlib_ev;])) end # 5233 "setup.ml" module OCamlbuildCommon = struct # 21 "/home/dim/sources/oasis-0.3.0/src/plugins/ocamlbuild/OCamlbuildCommon.ml" (** Functions common to OCamlbuild build and doc plugin *) open OASISGettext open BaseEnv open BaseStandardVar let ocamlbuild_clean_ev = "ocamlbuild-clean" let ocamlbuildflags = var_define ~short_desc:(fun () -> "OCamlbuild additional flags") "ocamlbuildflags" (fun () -> "") (** Fix special arguments depending on environment *) let fix_args args extra_argv = List.flatten [ if (os_type ()) = "Win32" then [ "-classic-display"; "-no-log"; "-no-links"; "-install-lib-dir"; (Filename.concat (standard_library ()) "ocamlbuild") ] else []; if not (bool_of_string (is_native ())) || (os_type ()) = "Win32" then [ "-byte-plugin" ] else []; args; if bool_of_string (debug ()) then ["-tag"; "debug"] else []; if bool_of_string (profile ()) then ["-tag"; "profile"] else []; OASISString.nsplit (ocamlbuildflags ()) ' '; Array.to_list extra_argv; ] (** Run 'ocamlbuild -clean' if not already done *) let run_clean extra_argv = let extra_cli = String.concat " " (Array.to_list extra_argv) in (* Run if never called with these args *) if not (BaseLog.exists ocamlbuild_clean_ev extra_cli) then begin OASISExec.run ~ctxt:!BaseContext.default (ocamlbuild ()) (fix_args ["-clean"] extra_argv); BaseLog.register ocamlbuild_clean_ev extra_cli; at_exit (fun () -> try BaseLog.unregister ocamlbuild_clean_ev extra_cli with _ -> ()) end (** Run ocamlbuild, unregister all clean events *) let run_ocamlbuild args extra_argv = (* TODO: enforce that target in args must be UNIX encoded i.e. toto/index.html *) OASISExec.run ~ctxt:!BaseContext.default (ocamlbuild ()) (fix_args args extra_argv); (* Remove any clean event, we must run it again *) List.iter (fun (e, d) -> BaseLog.unregister e d) (BaseLog.filter [ocamlbuild_clean_ev]) (** Determine real build directory *) let build_dir extra_argv = let rec search_args dir = function | "-build-dir" :: dir :: tl -> search_args dir tl | _ :: tl -> search_args dir tl | [] -> dir in search_args "_build" (fix_args [] extra_argv) end module OCamlbuildPlugin = struct # 21 "/home/dim/sources/oasis-0.3.0/src/plugins/ocamlbuild/OCamlbuildPlugin.ml" (** Build using ocamlbuild @author Sylvain Le Gall *) open OASISTypes open OASISGettext open OASISUtils open BaseEnv open OCamlbuildCommon open BaseStandardVar open BaseMessage let cond_targets_hook = ref (fun lst -> lst) let build pkg argv = (* Return the filename in build directory *) let in_build_dir fn = Filename.concat (build_dir argv) fn in (* Return the unix filename in host build directory *) let in_build_dir_of_unix fn = in_build_dir (OASISHostPath.of_unix fn) in let cond_targets = List.fold_left (fun acc -> function | Library (cs, bs, lib) when var_choose bs.bs_build -> begin let evs, unix_files = BaseBuilt.of_library in_build_dir_of_unix (cs, bs, lib) in let ends_with nd fn = let nd_len = String.length nd in (String.length fn >= nd_len) && (String.sub fn (String.length fn - nd_len) nd_len) = nd in let tgts = List.flatten (List.filter (fun l -> l <> []) (List.map (List.filter (fun fn -> ends_with ".cma" fn || ends_with ".cmxs" fn || ends_with ".cmxa" fn || ends_with (ext_lib ()) fn || ends_with (ext_dll ()) fn)) unix_files)) in match tgts with | _ :: _ -> (evs, tgts) :: acc | [] -> failwithf (f_ "No possible ocamlbuild targets for library %s") cs.cs_name end | Executable (cs, bs, exec) when var_choose bs.bs_build -> begin let evs, unix_exec_is, unix_dll_opt = BaseBuilt.of_executable in_build_dir_of_unix (cs, bs, exec) in let target ext = let unix_tgt = (OASISUnixPath.concat bs.bs_path (OASISUnixPath.chop_extension exec.exec_main_is))^ext in let evs = (* Fix evs, we want to use the unix_tgt, without copying *) List.map (function | BaseBuilt.BExec, nm, lst when nm = cs.cs_name -> BaseBuilt.BExec, nm, [[in_build_dir_of_unix unix_tgt]] | ev -> ev) evs in evs, [unix_tgt] in (* Add executable *) let acc = match bs.bs_compiled_object with | Native -> (target ".native") :: acc | Best when bool_of_string (is_native ()) -> (target ".native") :: acc | Byte | Best -> (target ".byte") :: acc in acc end | Library _ | Executable _ | Test _ | SrcRepo _ | Flag _ | Doc _ -> acc) [] (* Keep the pkg.sections ordered *) (List.rev pkg.sections); in (* Check and register built files *) let check_and_register (bt, bnm, lst) = List.iter (fun fns -> if not (List.exists OASISFileUtil.file_exists_case fns) then failwithf (f_ "No one of expected built files %s exists") (String.concat (s_ ", ") (List.map (Printf.sprintf "'%s'") fns))) lst; (BaseBuilt.register bt bnm lst) in let cond_targets = (* Run the hook *) !cond_targets_hook cond_targets in (* Run a list of target... *) run_ocamlbuild (List.flatten (List.map snd cond_targets)) argv; (* ... and register events *) List.iter check_and_register (List.flatten (List.map fst cond_targets)) let clean pkg extra_args = run_clean extra_args; List.iter (function | Library (cs, _, _) -> BaseBuilt.unregister BaseBuilt.BLib cs.cs_name | Executable (cs, _, _) -> BaseBuilt.unregister BaseBuilt.BExec cs.cs_name; BaseBuilt.unregister BaseBuilt.BExecLib cs.cs_name | _ -> ()) pkg.sections end module OCamlbuildDocPlugin = struct # 21 "/home/dim/sources/oasis-0.3.0/src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml" (* Create documentation using ocamlbuild .odocl files @author Sylvain Le Gall *) open OASISTypes open OASISGettext open OASISMessage open OCamlbuildCommon open BaseStandardVar let doc_build path pkg (cs, doc) argv = let index_html = OASISUnixPath.make [ path; cs.cs_name^".docdir"; "index.html"; ] in let tgt_dir = OASISHostPath.make [ build_dir argv; OASISHostPath.of_unix path; cs.cs_name^".docdir"; ] in run_ocamlbuild [index_html] argv; List.iter (fun glb -> BaseBuilt.register BaseBuilt.BDoc cs.cs_name [OASISFileUtil.glob ~ctxt:!BaseContext.default (Filename.concat tgt_dir glb)]) ["*.html"; "*.css"] let doc_clean t pkg (cs, doc) argv = run_clean argv; BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name end # 5558 "setup.ml" module CustomPlugin = struct # 21 "/home/dim/sources/oasis-0.3.0/src/plugins/custom/CustomPlugin.ml" (** Generate custom configure/build/doc/test/install system @author *) open BaseEnv open OASISGettext open OASISTypes type t = { cmd_main: command_line conditional; cmd_clean: (command_line option) conditional; cmd_distclean: (command_line option) conditional; } let run = BaseCustom.run let main t _ extra_args = let cmd, args = var_choose ~name:(s_ "main command") t.cmd_main in run cmd args extra_args let clean t pkg extra_args = match var_choose t.cmd_clean with | Some (cmd, args) -> run cmd args extra_args | _ -> () let distclean t pkg extra_args = match var_choose t.cmd_distclean with | Some (cmd, args) -> run cmd args extra_args | _ -> () module Build = struct let main t pkg extra_args = main t pkg extra_args; List.iter (fun sct -> let evs = match sct with | Library (cs, bs, lib) when var_choose bs.bs_build -> begin let evs, _ = BaseBuilt.of_library OASISHostPath.of_unix (cs, bs, lib) in evs end | Executable (cs, bs, exec) when var_choose bs.bs_build -> begin let evs, _, _ = BaseBuilt.of_executable OASISHostPath.of_unix (cs, bs, exec) in evs end | _ -> [] in List.iter (fun (bt, bnm, lst) -> BaseBuilt.register bt bnm lst) evs) pkg.sections let clean t pkg extra_args = clean t pkg extra_args; (* TODO: this seems to be pretty generic (at least wrt to ocamlbuild * considering moving this to BaseSetup? *) List.iter (function | Library (cs, _, _) -> BaseBuilt.unregister BaseBuilt.BLib cs.cs_name | Executable (cs, _, _) -> BaseBuilt.unregister BaseBuilt.BExec cs.cs_name; BaseBuilt.unregister BaseBuilt.BExecLib cs.cs_name | _ -> ()) pkg.sections let distclean t pkg extra_args = distclean t pkg extra_args end module Test = struct let main t pkg (cs, test) extra_args = try main t pkg extra_args; 0.0 with Failure s -> BaseMessage.warning (f_ "Test '%s' fails: %s") cs.cs_name s; 1.0 let clean t pkg (cs, test) extra_args = clean t pkg extra_args let distclean t pkg (cs, test) extra_args = distclean t pkg extra_args end module Doc = struct let main t pkg (cs, _) extra_args = main t pkg extra_args; BaseBuilt.register BaseBuilt.BDoc cs.cs_name [] let clean t pkg (cs, _) extra_args = clean t pkg extra_args; BaseBuilt.unregister BaseBuilt.BDoc cs.cs_name let distclean t pkg (cs, _) extra_args = distclean t pkg extra_args end end # 5694 "setup.ml" open OASISTypes;; let setup_t = { BaseSetup.configure = InternalConfigurePlugin.configure; build = OCamlbuildPlugin.build; test = [ ("main", CustomPlugin.Test.main { CustomPlugin.cmd_main = [(OASISExpr.EBool true, ("$tests_exec", []))]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }) ]; doc = [ ("obus-dump-man", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", ["-c"; "man/obus-dump.1"; ">"; "man/obus-dump.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-dump.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-interface-man", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-interface.1"; ">"; "man/obus-gen-interface.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-interface.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-client-man", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-client.1"; ">"; "man/obus-gen-client.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-client.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-server-man", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-server.1"; ">"; "man/obus-gen-server.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-server.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-idl2xml-man", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-idl2xml.1"; ">"; "man/obus-idl2xml.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-idl2xml.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-xml2idl-man", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-xml2idl.1"; ">"; "man/obus-xml2idl.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-xml2idl.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-introspect-man", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-introspect.1"; ">"; "man/obus-introspect.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-introspect.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-manual", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("make", ["-C"; "manual"; "manual.pdf"])) ]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-api", OCamlbuildDocPlugin.doc_build "./"); ("examples", CustomPlugin.Doc.main { CustomPlugin.cmd_main = [(OASISExpr.EBool true, ("true", []))]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }) ]; install = InternalInstallPlugin.install; uninstall = InternalInstallPlugin.uninstall; clean = [OCamlbuildPlugin.clean]; clean_test = [ ("main", CustomPlugin.Test.clean { CustomPlugin.cmd_main = [(OASISExpr.EBool true, ("$tests_exec", []))]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }) ]; clean_doc = [ ("obus-dump-man", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", ["-c"; "man/obus-dump.1"; ">"; "man/obus-dump.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-dump.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-interface-man", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-interface.1"; ">"; "man/obus-gen-interface.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-interface.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-client-man", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-client.1"; ">"; "man/obus-gen-client.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-client.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-server-man", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-server.1"; ">"; "man/obus-gen-server.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-server.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-idl2xml-man", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-idl2xml.1"; ">"; "man/obus-idl2xml.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-idl2xml.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-xml2idl-man", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-xml2idl.1"; ">"; "man/obus-xml2idl.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-xml2idl.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-introspect-man", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-introspect.1"; ">"; "man/obus-introspect.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-introspect.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-manual", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("make", ["-C"; "manual"; "manual.pdf"])) ]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-api", OCamlbuildDocPlugin.doc_clean "./"); ("examples", CustomPlugin.Doc.clean { CustomPlugin.cmd_main = [(OASISExpr.EBool true, ("true", []))]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }) ]; distclean = []; distclean_test = [ ("main", CustomPlugin.Test.distclean { CustomPlugin.cmd_main = [(OASISExpr.EBool true, ("$tests_exec", []))]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }) ]; distclean_doc = [ ("obus-dump-man", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", ["-c"; "man/obus-dump.1"; ">"; "man/obus-dump.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-dump.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-interface-man", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-interface.1"; ">"; "man/obus-gen-interface.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-interface.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-client-man", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-client.1"; ">"; "man/obus-gen-client.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-client.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-gen-server-man", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-gen-server.1"; ">"; "man/obus-gen-server.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-gen-server.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-idl2xml-man", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-idl2xml.1"; ">"; "man/obus-idl2xml.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-idl2xml.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-xml2idl-man", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-xml2idl.1"; ">"; "man/obus-xml2idl.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-xml2idl.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-introspect-man", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("$gzip", [ "-c"; "man/obus-introspect.1"; ">"; "man/obus-introspect.1.gz" ])) ]; cmd_clean = [ (OASISExpr.EBool true, Some (("$rm", ["man/obus-introspect.1.gz"]))) ]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("obus-manual", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [ (OASISExpr.EBool true, ("make", ["-C"; "manual"; "manual.pdf"])) ]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }); ("examples", CustomPlugin.Doc.distclean { CustomPlugin.cmd_main = [(OASISExpr.EBool true, ("true", []))]; cmd_clean = [(OASISExpr.EBool true, None)]; cmd_distclean = [(OASISExpr.EBool true, None)]; }) ]; package = { oasis_version = "0.3"; ocaml_version = Some (OASISVersion.VGreaterEqual "3.12"); findlib_version = None; name = "obus"; version = "1.1.5"; license = OASISLicense.DEP5License (OASISLicense.DEP5Unit { OASISLicense.license = "BSD3"; excption = None; version = OASISLicense.NoVersion; }); license_file = Some "LICENSE"; copyrights = []; maintainers = []; authors = ["J\195\169r\195\169mie Dimino"]; homepage = Some "http://obus.forge.ocamlcore.org/"; synopsis = "obus"; description = Some "Pure OCaml implementation of the D-Bus protocol"; categories = []; conf_type = (`Configure, "internal", Some "0.3"); conf_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; build_type = (`Build, "ocamlbuild", Some "0.3"); build_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; install_type = (`Install, "internal", Some "0.3"); install_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; uninstall_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; clean_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; distclean_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; files_ab = ["src/oBus_config.ml.ab"]; sections = [ Library ({ cs_name = "obus"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "src"; bs_compiled_object = Best; bs_build_depends = [ FindlibPackage ("lwt.unix", None); FindlibPackage ("lwt.react", None); FindlibPackage ("lwt.syntax", None); FindlibPackage ("lwt.syntax.log", None); FindlibPackage ("type_conv", None); FindlibPackage ("xmlm", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = [ "OBus_address"; "OBus_auth"; "OBus_bus"; "OBus_connection"; "OBus_context"; "OBus_error"; "OBus_info"; "OBus_introspect_ext"; "OBus_introspect"; "OBus_match"; "OBus_member"; "OBus_message"; "OBus_method"; "OBus_name"; "OBus_object"; "OBus_path"; "OBus_peer"; "OBus_property"; "OBus_proxy"; "OBus_resolver"; "OBus_server"; "OBus_signal"; "OBus_string"; "OBus_transport"; "OBus_uuid"; "OBus_value"; "OBus_wire"; "OBus_interfaces" ]; lib_pack = false; lib_internal_modules = [ "OBus_address_lexer"; "OBus_match_rule_lexer"; "OBus_protocol"; "OBus_type_ext_lexer"; "OBus_util"; "OBus_xml_parser"; "OBus_config" ]; lib_findlib_parent = None; lib_findlib_name = None; lib_findlib_containers = []; }); Library ({ cs_name = "obus-idl"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "src"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("camlp4.lib", None); FindlibPackage ("camlp4.quotations.o", None); FindlibPackage ("camlp4.extend", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = ["OBus_idl"]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "obus"; lib_findlib_name = Some "idl"; lib_findlib_containers = []; }); Library ({ cs_name = "obus-syntax"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "syntax"; bs_compiled_object = Byte; bs_build_depends = [ FindlibPackage ("type_conv", None); FindlibPackage ("camlp4", None); FindlibPackage ("camlp4.quotations.o", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = []; lib_pack = false; lib_internal_modules = ["Pa_obus"]; lib_findlib_parent = Some "obus"; lib_findlib_name = Some "syntax"; lib_findlib_containers = []; }); Library ({ cs_name = "obus-hal"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "bindings/hal"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = ["Hal_device"; "Hal_manager"; "Hal_interfaces"]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "obus"; lib_findlib_name = Some "hal"; lib_findlib_containers = []; }); Library ({ cs_name = "obus-notification"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "bindings/notification"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = ["Notification"; "Notification_interfaces"]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "obus"; lib_findlib_name = Some "notification"; lib_findlib_containers = []; }); Library ({ cs_name = "obus-network-manager"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "bindings/network-manager"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = [ "Nm_access_point"; "Nm_connection"; "Nm_device"; "Nm_dhcp4_config"; "Nm_ip4_config"; "Nm_ip6_config"; "Nm_manager"; "Nm_ppp"; "Nm_settings"; "Nm_vpn_connection"; "Nm_vpn_plugin"; "Nm_interfaces"; "Nm_monitor" ]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "obus"; lib_findlib_name = Some "network-manager"; lib_findlib_containers = []; }); Library ({ cs_name = "obus-upower"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "bindings/upower"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = [ "UPower"; "UPower_device"; "UPower_policy"; "UPower_wakeups"; "UPower_interfaces"; "UPower_monitor" ]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "obus"; lib_findlib_name = Some "upower"; lib_findlib_containers = []; }); Library ({ cs_name = "obus-udisks"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "bindings/udisks"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = [ "UDisks"; "UDisks_device"; "UDisks_port"; "UDisks_adapter"; "UDisks_expander"; "UDisks_interfaces"; "UDisks_monitor" ]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "obus"; lib_findlib_name = Some "udisks"; lib_findlib_containers = []; }); Library ({ cs_name = "obus-policykit"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "bindings/policykit"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { lib_modules = ["Policy_kit"; "Policy_kit_interfaces"]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "obus"; lib_findlib_name = Some "policykit"; lib_findlib_containers = []; }); Executable ({ cs_name = "obus-gen-interface"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "tools"; bs_compiled_object = Best; bs_build_depends = [ FindlibPackage ("lwt.unix", None); FindlibPackage ("lwt.react", None); FindlibPackage ("lwt.syntax", None); FindlibPackage ("lwt.syntax.log", None); FindlibPackage ("type_conv", None); FindlibPackage ("xmlm", None); FindlibPackage ("camlp4.quotations.o", None); FindlibPackage ("camlp4.extend", None); FindlibPackage ("camlp4.lib", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { exec_custom = false; exec_main_is = "obus_gen_interface.ml"; }); Executable ({ cs_name = "obus-dump"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "tools"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "obus_dump.ml"; }); Executable ({ cs_name = "obus-gen-client"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "tools"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; InternalLibrary "obus-idl"; FindlibPackage ("camlp4.lib", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "obus_gen_client.ml"; }); Executable ({ cs_name = "obus-gen-server"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "tools"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; InternalLibrary "obus-idl"; FindlibPackage ("camlp4.lib", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "obus_gen_server.ml"; }); Executable ({ cs_name = "obus-xml2idl"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "tools"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; InternalLibrary "obus-idl"; FindlibPackage ("camlp4.lib", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "obus_xml2idl.ml"; }); Executable ({ cs_name = "obus-idl2xml"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "tools"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; InternalLibrary "obus-idl"; FindlibPackage ("camlp4.lib", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "obus_idl2xml.ml"; }); Executable ({ cs_name = "obus-introspect"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; bs_path = "tools"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "obus_introspect.ml"; }); Doc ({ cs_name = "obus-dump-man"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$mandir/man1"; doc_title = "Man page for obus-dump"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("man/obus-dump.1.gz", None)]; doc_build_tools = [ExternalTool "ocamlbuild"; ExternalTool "gzip"]; }); Doc ({ cs_name = "obus-gen-interface-man"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$mandir/man1"; doc_title = "Man page for obus-gen-interface"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("man/obus-gen-interface.1.gz", None)]; doc_build_tools = [ExternalTool "ocamlbuild"; ExternalTool "gzip"]; }); Doc ({ cs_name = "obus-gen-client-man"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$mandir/man1"; doc_title = "Man page for obus-gen-client"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("man/obus-gen-client.1.gz", None)]; doc_build_tools = [ExternalTool "ocamlbuild"; ExternalTool "gzip"]; }); Doc ({ cs_name = "obus-gen-server-man"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$mandir/man1"; doc_title = "Man page for obus-gen-server"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("man/obus-gen-server.1.gz", None)]; doc_build_tools = [ExternalTool "ocamlbuild"; ExternalTool "gzip"]; }); Doc ({ cs_name = "obus-idl2xml-man"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$mandir/man1"; doc_title = "Man page for obus-idl2xml"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("man/obus-idl2xml.1.gz", None)]; doc_build_tools = [ExternalTool "ocamlbuild"; ExternalTool "gzip"]; }); Doc ({ cs_name = "obus-xml2idl-man"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$mandir/man1"; doc_title = "Man page for obus-xml2idl"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("man/obus-xml2idl.1.gz", None)]; doc_build_tools = [ ExternalTool "ocamlbuild"; ExternalTool "gzip"; ExternalTool "rm" ]; }); Doc ({ cs_name = "obus-introspect-man"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$mandir/man1"; doc_title = "Man page for obus-introspect"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("man/obus-introspect.1.gz", None)]; doc_build_tools = [ ExternalTool "ocamlbuild"; ExternalTool "gzip"; ExternalTool "rm" ]; }); Doc ({ cs_name = "obus-manual"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$pdfdir"; doc_title = "OBus user manual"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("manual/manual.pdf", None)]; doc_build_tools = [ExternalTool "ocamlbuild"]; }); Doc ({ cs_name = "obus-api"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "ocamlbuild", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$htmldir/api"; doc_title = "API reference for OBus"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("utils/doc/style.css", None)]; doc_build_tools = [ExternalTool "ocamlbuild"; ExternalTool "ocamldoc"]; }); Executable ({ cs_name = "tests_exec"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [ (OASISExpr.EBool true, false); (OASISExpr.EFlag "tests", true) ]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "tests"; bs_compiled_object = Best; bs_build_depends = [InternalLibrary "obus"]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "main.ml"; }); Test ({ cs_name = "main"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { test_type = (`Test, "custom", Some "0.3"); test_command = [(OASISExpr.EBool true, ("$tests_exec", []))]; test_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; test_working_directory = None; test_run = [ (OASISExpr.ENot (OASISExpr.EFlag "tests"), false); (OASISExpr.EFlag "tests", true) ]; test_tools = [ ExternalTool "ocamlbuild"; InternalExecutable "tests_exec" ]; }); Doc ({ cs_name = "examples"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { doc_type = (`Doc, "custom", Some "0.3"); doc_custom = { pre_command = [(OASISExpr.EBool true, None)]; post_command = [(OASISExpr.EBool true, None)]; }; doc_build = [ (OASISExpr.ENot (OASISExpr.EFlag "docs"), false); (OASISExpr.EFlag "docs", true) ]; doc_install = [(OASISExpr.EBool true, true)]; doc_install_dir = "$docdir/examples"; doc_title = "Examples"; doc_authors = []; doc_abstract = None; doc_format = OtherDoc; doc_data_files = [("examples/*.ml", None); ("examples/*.xml", None)]; doc_build_tools = [ExternalTool "ocamlbuild"]; }); Executable ({ cs_name = "bus-functions"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "bus_functions.ml"; }); Executable ({ cs_name = "eject"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None); InternalLibrary "obus-hal" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "eject.ml"; }); Executable ({ cs_name = "hello"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "hello.ml"; }); Executable ({ cs_name = "list-services"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "list_services.ml"; }); Executable ({ cs_name = "monitor"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "monitor.ml"; }); Executable ({ cs_name = "notify"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None); InternalLibrary "obus-notification" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "notify.ml"; }); Executable ({ cs_name = "ping"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "ping.ml"; }); Executable ({ cs_name = "pong"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "pong.ml"; }); Executable ({ cs_name = "signals"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None); InternalLibrary "obus-hal" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "signals.ml"; }); Executable ({ cs_name = "network-manager"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None); InternalLibrary "obus-network-manager" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, {exec_custom = false; exec_main_is = "network_manager.ml"; }); Executable ({ cs_name = "battery-monitoring"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, false)]; bs_path = "examples"; bs_compiled_object = Best; bs_build_depends = [ InternalLibrary "obus"; FindlibPackage ("lwt.syntax", None); InternalLibrary "obus-upower" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = []; bs_data_files = []; bs_ccopt = [(OASISExpr.EBool true, [])]; bs_cclib = [(OASISExpr.EBool true, [])]; bs_dlllib = [(OASISExpr.EBool true, [])]; bs_dllpath = [(OASISExpr.EBool true, [])]; bs_byteopt = [(OASISExpr.EBool true, [])]; bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { exec_custom = false; exec_main_is = "battery_monitoring.ml"; }); SrcRepo ({ cs_name = "head"; cs_data = PropList.Data.create (); cs_plugin_data = []; }, { src_repo_type = Darcs; src_repo_location = "http://darcs.ocamlcore.org/repos/obus"; src_repo_browser = Some "http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=obus;a=summary"; src_repo_module = None; src_repo_branch = None; src_repo_tag = None; src_repo_subdir = None; }) ]; plugins = [(`Extra, "DevFiles", Some "0.3"); (`Extra, "META", Some "0.3")]; schema_data = PropList.Data.create (); plugin_data = []; }; oasis_fn = Some "_oasis"; oasis_version = "0.3.0"; oasis_digest = Some "\028\177\017]\030\162\149\219\202k\003f\025\012\012\028"; oasis_exec = None; oasis_setup_args = []; setup_update = false; };; let setup () = BaseSetup.setup setup_t;; # 7539 "setup.ml" (* OASIS_STOP *) let () = setup ();; obus-1.1.5/myocamlbuild.ml0000644000000000000000000004101112032535153013663 0ustar0000000000000000(* * myocamlbuild.ml * --------------- * Copyright : (c) 2010, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) (* OASIS_START *) (* DO NOT EDIT (digest: ce24d7b6566c3cd588139351285f0819) *) module OASISGettext = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISGettext.ml" let ns_ str = str let s_ str = str let f_ (str : ('a, 'b, 'c, 'd) format4) = str let fn_ fmt1 fmt2 n = if n = 1 then fmt1^^"" else fmt2^^"" let init = [] end module OASISExpr = struct # 21 "/home/dim/sources/oasis-0.3.0/src/oasis/OASISExpr.ml" open OASISGettext type test = string type flag = string type t = | EBool of bool | ENot of t | EAnd of t * t | EOr of t * t | EFlag of flag | ETest of test * string type 'a choices = (t * 'a) list let eval var_get t = let rec eval' = function | EBool b -> b | ENot e -> not (eval' e) | EAnd (e1, e2) -> (eval' e1) && (eval' e2) | EOr (e1, e2) -> (eval' e1) || (eval' e2) | EFlag nm -> let v = var_get nm in assert(v = "true" || v = "false"); (v = "true") | ETest (nm, vl) -> let v = var_get nm in (v = vl) in eval' t let choose ?printer ?name var_get lst = let rec choose_aux = function | (cond, vl) :: tl -> if eval var_get cond then vl else choose_aux tl | [] -> let str_lst = if lst = [] then s_ "" else String.concat (s_ ", ") (List.map (fun (cond, vl) -> match printer with | Some p -> p vl | None -> s_ "") lst) in match name with | Some nm -> failwith (Printf.sprintf (f_ "No result for the choice list '%s': %s") nm str_lst) | None -> failwith (Printf.sprintf (f_ "No result for a choice list: %s") str_lst) in choose_aux (List.rev lst) end # 117 "myocamlbuild.ml" module BaseEnvLight = struct # 21 "/home/dim/sources/oasis-0.3.0/src/base/BaseEnvLight.ml" module MapString = Map.Make(String) type t = string MapString.t let default_filename = Filename.concat (Sys.getcwd ()) "setup.data" let load ?(allow_empty=false) ?(filename=default_filename) () = if Sys.file_exists filename then begin let chn = open_in_bin filename in let st = Stream.of_channel chn in let line = ref 1 in let st_line = Stream.from (fun _ -> try match Stream.next st with | '\n' -> incr line; Some '\n' | c -> Some c with Stream.Failure -> None) in let lexer = Genlex.make_lexer ["="] st_line in let rec read_file mp = match Stream.npeek 3 lexer with | [Genlex.Ident nm; Genlex.Kwd "="; Genlex.String value] -> Stream.junk lexer; Stream.junk lexer; Stream.junk lexer; read_file (MapString.add nm value mp) | [] -> mp | _ -> failwith (Printf.sprintf "Malformed data file '%s' line %d" filename !line) in let mp = read_file MapString.empty in close_in chn; mp end else if allow_empty then begin MapString.empty end else begin failwith (Printf.sprintf "Unable to load environment, the file '%s' doesn't exist." filename) end let var_get name env = let rec var_expand str = let buff = Buffer.create ((String.length str) * 2) in Buffer.add_substitute buff (fun var -> try var_expand (MapString.find var env) with Not_found -> failwith (Printf.sprintf "No variable %s defined when trying to expand %S." var str)) str; Buffer.contents buff in var_expand (MapString.find name env) let var_choose lst env = OASISExpr.choose (fun nm -> var_get nm env) lst end # 215 "myocamlbuild.ml" module MyOCamlbuildFindlib = struct # 21 "/home/dim/sources/oasis-0.3.0/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" (** OCamlbuild extension, copied from * http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild * by N. Pouillard and others * * Updated on 2009/02/28 * * Modified by Sylvain Le Gall *) open Ocamlbuild_plugin (* these functions are not really officially exported *) let run_and_read = Ocamlbuild_pack.My_unix.run_and_read let blank_sep_strings = Ocamlbuild_pack.Lexers.blank_sep_strings let split s ch = let x = ref [] in let rec go s = let pos = String.index s ch in x := (String.before s pos)::!x; go (String.after s (pos + 1)) in try go s with Not_found -> !x let split_nl s = split s '\n' let before_space s = try String.before s (String.index s ' ') with Not_found -> s (* this lists all supported packages *) let find_packages () = List.map before_space (split_nl & run_and_read "ocamlfind list") (* this is supposed to list available syntaxes, but I don't know how to do it. *) let find_syntaxes () = ["camlp4o"; "camlp4r"] (* ocamlfind command *) let ocamlfind x = S[A"ocamlfind"; x] let dispatch = function | Before_options -> (* by using Before_options one let command line options have an higher priority *) (* on the contrary using After_options will guarantee to have the higher priority *) (* override default commands by ocamlfind ones *) Options.ocamlc := ocamlfind & A"ocamlc"; Options.ocamlopt := ocamlfind & A"ocamlopt"; Options.ocamldep := ocamlfind & A"ocamldep"; Options.ocamldoc := ocamlfind & A"ocamldoc"; Options.ocamlmktop := ocamlfind & A"ocamlmktop" | After_rules -> (* When one link an OCaml library/binary/package, one should use -linkpkg *) flag ["ocaml"; "link"; "program"] & A"-linkpkg"; (* For each ocamlfind package one inject the -package option when * compiling, computing dependencies, generating documentation and * linking. *) List.iter begin fun pkg -> flag ["ocaml"; "compile"; "pkg_"^pkg] & S[A"-package"; A pkg]; flag ["ocaml"; "ocamldep"; "pkg_"^pkg] & S[A"-package"; A pkg]; flag ["ocaml"; "doc"; "pkg_"^pkg] & S[A"-package"; A pkg]; flag ["ocaml"; "link"; "pkg_"^pkg] & S[A"-package"; A pkg]; flag ["ocaml"; "infer_interface"; "pkg_"^pkg] & S[A"-package"; A pkg]; end (find_packages ()); (* Like -package but for extensions syntax. Morover -syntax is useless * when linking. *) List.iter begin fun syntax -> flag ["ocaml"; "compile"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; flag ["ocaml"; "ocamldep"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; flag ["ocaml"; "doc"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; flag ["ocaml"; "infer_interface"; "syntax_"^syntax] & S[A"-syntax"; A syntax]; end (find_syntaxes ()); (* The default "thread" tag is not compatible with ocamlfind. * Indeed, the default rules add the "threads.cma" or "threads.cmxa" * options when using this tag. When using the "-linkpkg" option with * ocamlfind, this module will then be added twice on the command line. * * To solve this, one approach is to add the "-thread" option when using * the "threads" package using the previous plugin. *) flag ["ocaml"; "pkg_threads"; "compile"] (S[A "-thread"]); flag ["ocaml"; "pkg_threads"; "doc"] (S[A "-I"; A "+threads"]); flag ["ocaml"; "pkg_threads"; "link"] (S[A "-thread"]); flag ["ocaml"; "pkg_threads"; "infer_interface"] (S[A "-thread"]) | _ -> () end module MyOCamlbuildBase = struct # 21 "/home/dim/sources/oasis-0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" (** Base functions for writing myocamlbuild.ml @author Sylvain Le Gall *) open Ocamlbuild_plugin module OC = Ocamlbuild_pack.Ocaml_compiler type dir = string type file = string type name = string type tag = string # 56 "/home/dim/sources/oasis-0.3.0/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" type t = { lib_ocaml: (name * dir list) list; lib_c: (name * dir * file list) list; flags: (tag list * (spec OASISExpr.choices)) list; (* Replace the 'dir: include' from _tags by a precise interdepends in * directory. *) includes: (dir * dir list) list; } let env_filename = Pathname.basename BaseEnvLight.default_filename let dispatch_combine lst = fun e -> List.iter (fun dispatch -> dispatch e) lst let tag_libstubs nm = "use_lib"^nm^"_stubs" let nm_libstubs nm = nm^"_stubs" let dispatch t e = let env = BaseEnvLight.load ~filename:env_filename ~allow_empty:true () in match e with | Before_options -> let no_trailing_dot s = if String.length s >= 1 && s.[0] = '.' then String.sub s 1 ((String.length s) - 1) else s in List.iter (fun (opt, var) -> try opt := no_trailing_dot (BaseEnvLight.var_get var env) with Not_found -> Printf.eprintf "W: Cannot get variable %s" var) [ Options.ext_obj, "ext_obj"; Options.ext_lib, "ext_lib"; Options.ext_dll, "ext_dll"; ] | After_rules -> (* Declare OCaml libraries *) List.iter (function | nm, [] -> ocaml_lib nm | nm, dir :: tl -> ocaml_lib ~dir:dir (dir^"/"^nm); List.iter (fun dir -> List.iter (fun str -> flag ["ocaml"; "use_"^nm; str] (S[A"-I"; P dir])) ["compile"; "infer_interface"; "doc"]) tl) t.lib_ocaml; (* Declare directories dependencies, replace "include" in _tags. *) List.iter (fun (dir, include_dirs) -> Pathname.define_context dir include_dirs) t.includes; (* Declare C libraries *) List.iter (fun (lib, dir, headers) -> (* Handle C part of library *) flag ["link"; "library"; "ocaml"; "byte"; tag_libstubs lib] (S[A"-dllib"; A("-l"^(nm_libstubs lib)); A"-cclib"; A("-l"^(nm_libstubs lib))]); flag ["link"; "library"; "ocaml"; "native"; tag_libstubs lib] (S[A"-cclib"; A("-l"^(nm_libstubs lib))]); flag ["link"; "program"; "ocaml"; "byte"; tag_libstubs lib] (S[A"-dllib"; A("dll"^(nm_libstubs lib))]); (* When ocaml link something that use the C library, then one need that file to be up to date. *) dep ["link"; "ocaml"; "program"; tag_libstubs lib] [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)]; dep ["compile"; "ocaml"; "program"; tag_libstubs lib] [dir/"lib"^(nm_libstubs lib)^"."^(!Options.ext_lib)]; (* TODO: be more specific about what depends on headers *) (* Depends on .h files *) dep ["compile"; "c"] headers; (* Setup search path for lib *) flag ["link"; "ocaml"; "use_"^lib] (S[A"-I"; P(dir)]); ) t.lib_c; (* Add flags *) List.iter (fun (tags, cond_specs) -> let spec = BaseEnvLight.var_choose cond_specs env in flag tags & spec) t.flags | _ -> () let dispatch_default t = dispatch_combine [ dispatch t; MyOCamlbuildFindlib.dispatch; ] end # 476 "myocamlbuild.ml" open Ocamlbuild_plugin;; let package_default = { MyOCamlbuildBase.lib_ocaml = [ ("obus", ["src"]); ("obus-idl", ["src"]); ("obus-syntax", ["syntax"]); ("obus-hal", ["bindings/hal"]); ("obus-notification", ["bindings/notification"]); ("obus-network-manager", ["bindings/network-manager"]); ("obus-upower", ["bindings/upower"]); ("obus-udisks", ["bindings/udisks"]); ("obus-policykit", ["bindings/policykit"]) ]; lib_c = []; flags = []; includes = [ ("tools", ["src"]); ("tests", ["src"]); ("examples", [ "bindings/hal"; "bindings/network-manager"; "bindings/notification"; "bindings/upower"; "src" ]); ("bindings/upower", ["src"]); ("bindings/udisks", ["src"]); ("bindings/policykit", ["src"]); ("bindings/notification", ["src"]); ("bindings/network-manager", ["src"]); ("bindings/hal", ["src"]) ]; } ;; let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;; # 519 "myocamlbuild.ml" (* OASIS_STOP *) open Ocamlbuild_plugin let () = dispatch (fun hook -> dispatch_default hook; match hook with | Before_options -> Options.make_links := false | After_rules -> (* Internal syntax extension *) flag ["ocaml"; "compile"; "pa_obus"] & S[A"-ppopt"; A"syntax/pa_obus.cmo"]; flag ["ocaml"; "ocamldep"; "pa_obus"] & S[A"-ppopt"; A"syntax/pa_obus.cmo"]; flag ["ocaml"; "doc"; "pa_obus"] & S[A"-ppopt"; A"syntax/pa_obus.cmo"]; dep ["ocaml"; "ocamldep"; "pa_obus"] ["syntax/pa_obus.cmo"]; (* Generation of ocaml modules from .obus files *) rule "IDL to OCaml" ~prods:["%.ml"; "%.mli"] ~deps:["%.obus"; "tools/obus_gen_interface.byte"] (fun env _ -> Cmd(S[P"tools/obus_gen_interface.byte"; A"-keep-common"; A"-o"; A(env "%"); A(env "%.obus")])); (* Generation of ocaml modules from xml introspection files *) rule "XML to OCaml" ~prods:["%.ml"; "%.mli"] ~deps:["%.xml"; "tools/obus_gen_interface.byte"] (fun env _ -> Cmd(S[P"tools/obus_gen_interface.byte"; A"-o"; A(env "%"); A(env "%.xml")])); (* Use an introduction page with categories *) tag_file "obus-api.docdir/index.html" ["apiref"]; dep ["apiref"] ["apiref-intro"]; flag ["apiref"] & S[A "-intro"; P "apiref-intro"; A"-colorize-code"] | _ -> ()) obus-1.1.5/apiref-intro0000644000000000000000000000303412032535151013173 0ustar0000000000000000{1 OBus - API Reference} {2 OBus library} This section describe modules of the core OBus library. OBus is composed of a lot of modules, but you will usually need only a few of them. {3 Connections and message Buses} {!modules: OBus_bus OBus_connection OBus_server } {3 D-Bus objects} {!modules: OBus_proxy OBus_object OBus_method OBus_signal OBus_property OBus_member } {3 Introspection} {!modules: OBus_introspect OBus_introspect_ext } {3 Misc} {!modules: OBus_error OBus_value OBus_resolver OBus_peer OBus_info OBus_name OBus_path OBus_string OBus_uuid OBus_context } {3 OBus low-level API} {!modules: OBus_match OBus_message OBus_address OBus_auth OBus_transport OBus_wire } {2 Service bindings} This section list bindings to D-Bus services shipped with OBus. {3 Notifications} Bindings to the freedesktop popup notification service. {!modules: Notification } {3 PolicyKit} Bindings to the freedesktop popup PolicyKit service. {!modules: Policy_kit } {3 Hal} Bindings to the freedesktop Hal service. {!modules: Hal_manager Hal_device } {3 UPower} Bindings to the freedesktop UPower service. {!modules: UPower UPower_device UPower_policy UPower_wakeups } {3 UPower} Bindings to the freedesktop UDisks service. {!modules: UDisks UDisks_device UDisks_port UDisks_adapter UDisks_expander } {3 NetworkManager} Bindings to the NetworkManager service. {!modules: Nm_access_point Nm_connection Nm_device Nm_dhcp4_config Nm_ip4_config Nm_ip6_config Nm_manager Nm_ppp Nm_settings Nm_vpn_connection Nm_vpn_plugin } {3 Index} {!indexlist} obus-1.1.5/_tags0000644000000000000000000003074412032535153011703 0ustar0000000000000000# -*- conf -*- <**/*.ml>: syntax_camlp4o <**/*.ml>: pa_obus : -pa_obus # OASIS_START # DO NOT EDIT (digest: 76acfb0d7012714187c715526071076d) # Ignore VCS directories, you can use the same kind of rule outside # OASIS_START/STOP if you want to exclude directories that contains # useless stuff for the build process <**/.svn>: -traverse <**/.svn>: not_hygienic ".bzr": -traverse ".bzr": not_hygienic ".hg": -traverse ".hg": not_hygienic ".git": -traverse ".git": not_hygienic "_darcs": -traverse "_darcs": not_hygienic # Library obus "src/obus.cmxs": use_obus # Library obus-idl "src/obus-idl.cmxs": use_obus-idl : use_obus : pkg_lwt.syntax : pkg_camlp4.lib : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : pkg_camlp4.quotations.o : pkg_camlp4.extend # Library obus-syntax "syntax/obus-syntax.cmxs": use_obus-syntax : pkg_type_conv : pkg_camlp4.quotations.o : pkg_camlp4 # Library obus-hal "bindings/hal/obus-hal.cmxs": use_obus-hal : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Library obus-notification "bindings/notification/obus-notification.cmxs": use_obus-notification : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Library obus-network-manager "bindings/network-manager/obus-network-manager.cmxs": use_obus-network-manager : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Library obus-upower "bindings/upower/obus-upower.cmxs": use_obus-upower : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Library obus-udisks "bindings/udisks/obus-udisks.cmxs": use_obus-udisks : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Library obus-policykit "bindings/policykit/obus-policykit.cmxs": use_obus-policykit : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable obus-gen-interface : pkg_lwt.syntax : pkg_camlp4.lib : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : pkg_camlp4.quotations.o : pkg_camlp4.extend # Executable obus-dump : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable obus-gen-client : use_obus-idl : use_obus : pkg_lwt.syntax : pkg_camlp4.lib : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : pkg_camlp4.quotations.o : pkg_camlp4.extend # Executable obus-gen-server : use_obus-idl : use_obus : pkg_lwt.syntax : pkg_camlp4.lib : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : pkg_camlp4.quotations.o : pkg_camlp4.extend # Executable obus-xml2idl : use_obus-idl : use_obus : pkg_lwt.syntax : pkg_camlp4.lib : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : pkg_camlp4.quotations.o : pkg_camlp4.extend # Executable obus-idl2xml : use_obus-idl : use_obus : pkg_lwt.syntax : pkg_camlp4.lib : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : pkg_camlp4.quotations.o : pkg_camlp4.extend : use_obus-idl : pkg_camlp4.lib : pkg_camlp4.quotations.o : pkg_camlp4.extend # Executable obus-introspect : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable tests_exec : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable bus-functions : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable eject : use_obus-hal : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable hello : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable list-services : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable monitor : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable notify : use_obus-notification : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : use_obus-notification # Executable ping : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable pong : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # Executable signals : use_obus-hal : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : use_obus-hal # Executable network-manager : use_obus-network-manager : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : use_obus-network-manager # Executable battery-monitoring : use_obus-upower : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm : use_obus-upower : use_obus : pkg_lwt.syntax : pkg_lwt.unix : pkg_lwt.react : pkg_lwt.syntax.log : pkg_type_conv : pkg_xmlm # OASIS_STOP obus-1.1.5/_oasis0000644000000000000000000002655312032535151012064 0ustar0000000000000000# +-------------------------------------------------------------------+ # | Package parameters | # +-------------------------------------------------------------------+ OASISFormat: 0.3 OCamlVersion: >= 3.12 Name: obus Version: 1.1.5 LicenseFile: LICENSE License: BSD3 Authors: Jérémie Dimino Homepage: http://obus.forge.ocamlcore.org/ BuildTools:ocamlbuild Plugins: DevFiles (0.3), META (0.3) FilesAB: src/oBus_config.ml.ab Synopsis: obus Description: Pure OCaml implementation of the D-Bus protocol # +-------------------------------------------------------------------+ # | The core library | # +-------------------------------------------------------------------+ Library obus Path: src Install: true Modules: OBus_address, OBus_auth, OBus_bus, OBus_connection, OBus_context, OBus_error, OBus_info, OBus_introspect_ext, OBus_introspect, OBus_match, OBus_member, OBus_message, OBus_method, OBus_name, OBus_object, OBus_path, OBus_peer, OBus_property, OBus_proxy, OBus_resolver, OBus_server, OBus_signal, OBus_string, OBus_transport, OBus_uuid, OBus_value, OBus_wire, OBus_interfaces InternalModules: OBus_address_lexer, OBus_match_rule_lexer, OBus_protocol, OBus_type_ext_lexer, OBus_util, OBus_xml_parser, OBus_config BuildDepends: lwt.unix, lwt.react, lwt.syntax, lwt.syntax.log, type_conv, xmlm XMETARequires: lwt.unix, lwt.react, xmlm XMETADescription: Pure OCaml implementation of D-Bus # +-------------------------------------------------------------------+ # | Other libraries | # +-------------------------------------------------------------------+ Library "obus-idl" Path: src Install: true Modules: OBus_idl BuildDepends: obus, camlp4.lib, camlp4.quotations.o, camlp4.extend FindlibName: idl FindlibParent: obus XMETADescription: Intermediate language for writing D-Bus interfaces XMETARequires: obus, camlp4.lib Library "obus-syntax" Path: syntax Install: true InternalModules: Pa_obus FindlibName: syntax FindlibParent: obus BuildDepends: type_conv, camlp4, camlp4.quotations.o CompiledObject: byte XMETAType: syntax XMETARequires: camlp4, type_conv XMETADescription: Syntactic sugars for defining D-Bus errors # +-------------------------------------------------------------------+ # | Interfaces to D-Bus services | # +-------------------------------------------------------------------+ Library "obus-hal" Path: bindings/hal Install: true Modules: Hal_device, Hal_manager, Hal_interfaces BuildDepends: obus FindlibName: hal FindlibParent: obus XMETADescription: Freedesktop Hal service binding Library "obus-notification" Path: bindings/notification Install: true Modules: Notification, Notification_interfaces BuildDepends: obus FindlibName: notification FindlibParent: obus XMETADescription: Freedesktop Notification service binding Library "obus-network-manager" Path: bindings/network-manager Install: true Modules: Nm_access_point, Nm_connection, Nm_device, Nm_dhcp4_config, Nm_ip4_config, Nm_ip6_config, Nm_manager, Nm_ppp, Nm_settings, Nm_vpn_connection, Nm_vpn_plugin, Nm_interfaces, Nm_monitor BuildDepends: obus FindlibName: network-manager FindlibParent: obus XMETADescription: Freedesktop NetworkManager service binding Library "obus-upower" Path: bindings/upower Install: true Modules: UPower, UPower_device, UPower_policy, UPower_wakeups, UPower_interfaces, UPower_monitor BuildDepends: obus FindlibName: upower FindlibParent: obus XMETADescription: Freedesktop UPower service binding Library "obus-udisks" Path: bindings/udisks Install: true Modules: UDisks, UDisks_device, UDisks_port, UDisks_adapter, UDisks_expander, UDisks_interfaces, UDisks_monitor BuildDepends: obus FindlibName: udisks FindlibParent: obus XMETADescription: Freedesktop UDisks service binding Library "obus-policykit" Path: bindings/policykit Install: true Modules: Policy_kit, Policy_kit_interfaces BuildDepends: obus FindlibName: policykit FindlibParent: obus XMETADescription: Freedesktop PolicyKit service binding # +-------------------------------------------------------------------+ # | Tools | # +-------------------------------------------------------------------+ Executable "obus-gen-interface" Path: tools Install: true CompiledObject: best MainIs: obus_gen_interface.ml BuildDepends: lwt.unix, lwt.react, lwt.syntax, lwt.syntax.log, type_conv, xmlm, camlp4.quotations.o, camlp4.extend, camlp4.lib Executable "obus-dump" Path: tools Install: true CompiledObject: best MainIs: obus_dump.ml BuildDepends: obus Executable "obus-gen-client" Path: tools Install: true CompiledObject: best MainIs: obus_gen_client.ml BuildDepends: obus, obus.idl, camlp4.lib Executable "obus-gen-server" Path: tools Install: true CompiledObject: best MainIs: obus_gen_server.ml BuildDepends: obus, obus.idl, camlp4.lib Executable "obus-xml2idl" Path: tools Install: true CompiledObject: best MainIs: obus_xml2idl.ml BuildDepends: obus, obus.idl, camlp4.lib Executable "obus-idl2xml" Path: tools Install: true CompiledObject: best MainIs: obus_idl2xml.ml BuildDepends: obus, obus.idl, camlp4.lib Executable "obus-introspect" Path: tools Install: true CompiledObject: best MainIs: obus_introspect.ml BuildDepends: obus # +-------------------------------------------------------------------+ # | Man pages | # +-------------------------------------------------------------------+ Document "obus-dump-man" Type: custom (0.3) Title: Man page for obus-dump Install: true BuildTools: gzip XCustom: $gzip -c man/obus-dump.1 > man/obus-dump.1.gz XCustomClean: $rm man/obus-dump.1.gz DataFiles: man/obus-dump.1.gz InstallDir: $mandir/man1 Document "obus-gen-interface-man" Type: custom (0.3) Title: Man page for obus-gen-interface Install: true BuildTools: gzip XCustom: $gzip -c man/obus-gen-interface.1 > man/obus-gen-interface.1.gz XCustomClean: $rm man/obus-gen-interface.1.gz DataFiles: man/obus-gen-interface.1.gz InstallDir: $mandir/man1 Document "obus-gen-client-man" Type: custom (0.3) Title: Man page for obus-gen-client Install: true BuildTools: gzip XCustom: $gzip -c man/obus-gen-client.1 > man/obus-gen-client.1.gz XCustomClean: $rm man/obus-gen-client.1.gz DataFiles: man/obus-gen-client.1.gz InstallDir: $mandir/man1 Document "obus-gen-server-man" Type: custom (0.3) Title: Man page for obus-gen-server Install: true BuildTools: gzip XCustom: $gzip -c man/obus-gen-server.1 > man/obus-gen-server.1.gz XCustomClean: $rm man/obus-gen-server.1.gz DataFiles: man/obus-gen-server.1.gz InstallDir: $mandir/man1 Document "obus-idl2xml-man" Type: custom (0.3) Title: Man page for obus-idl2xml Install: true BuildTools: gzip XCustom: $gzip -c man/obus-idl2xml.1 > man/obus-idl2xml.1.gz XCustomClean: $rm man/obus-idl2xml.1.gz DataFiles: man/obus-idl2xml.1.gz InstallDir: $mandir/man1 Document "obus-xml2idl-man" Type: custom (0.3) Title: Man page for obus-xml2idl Install: true BuildTools: gzip, rm XCustom: $gzip -c man/obus-xml2idl.1 > man/obus-xml2idl.1.gz XCustomClean: $rm man/obus-xml2idl.1.gz DataFiles: man/obus-xml2idl.1.gz InstallDir: $mandir/man1 Document "obus-introspect-man" Type: custom (0.3) Title: Man page for obus-introspect Install: true BuildTools: gzip, rm XCustom: $gzip -c man/obus-introspect.1 > man/obus-introspect.1.gz XCustomClean: $rm man/obus-introspect.1.gz DataFiles: man/obus-introspect.1.gz InstallDir: $mandir/man1 # +-------------------------------------------------------------------+ # | Doc | # +-------------------------------------------------------------------+ Document "obus-manual" Title: OBus user manual Type: custom (0.3) Install: true XCustom: make -C manual manual.pdf DataFiles: manual/manual.pdf InstallDir: $pdfdir Document "obus-api" Title: API reference for OBus Type: ocamlbuild (0.3) Install: true InstallDir: $htmldir/api DataFiles: utils/doc/style.css BuildTools: ocamldoc XOCamlbuildPath: ./ XOCamlbuildLibraries: obus, obus.hal, obus.idl, obus.network-manager, obus.notification, obus.policykit, obus.udisks, obus.upower # +-------------------------------------------------------------------+ # | Tests | # +-------------------------------------------------------------------+ Executable tests_exec Path: tests Install: false Build$: flag(tests) CompiledObject: best MainIs: main.ml BuildDepends: obus Test main Command: $tests_exec TestTools: tests_exec # +-------------------------------------------------------------------+ # | Examples | # +-------------------------------------------------------------------+ Document examples Title: Examples Type: custom (0.3) Install: true XCustom: true DataFiles: examples/*.ml, examples/*.xml InstallDir: $docdir/examples Executable "bus-functions" Path: examples Install: false CompiledObject: best MainIs: bus_functions.ml BuildDepends: obus, lwt.syntax Executable eject Path: examples Install: false CompiledObject: best MainIs: eject.ml BuildDepends: obus, lwt.syntax, obus.hal Executable hello Path: examples Install: false CompiledObject: best MainIs: hello.ml BuildDepends: obus, lwt.syntax Executable "list-services" Path: examples Install: false CompiledObject: best MainIs: list_services.ml BuildDepends: obus, lwt.syntax Executable monitor Path: examples Install: false CompiledObject: best MainIs: monitor.ml BuildDepends: obus, lwt.syntax Executable notify Path: examples Install: false CompiledObject: best MainIs: notify.ml BuildDepends: obus, lwt.syntax, obus.notification Executable ping Path: examples Install: false CompiledObject: best MainIs: ping.ml BuildDepends: obus, lwt.syntax Executable pong Path: examples Install: false CompiledObject: best MainIs: pong.ml BuildDepends: obus, lwt.syntax Executable signals Path: examples Install: false CompiledObject: best MainIs: signals.ml BuildDepends: obus, lwt.syntax, obus.hal Executable "network-manager" Path: examples Install: false CompiledObject: best MainIs: network_manager.ml BuildDepends: obus, lwt.syntax, obus.network-manager Executable "battery-monitoring" Path: examples Install: false CompiledObject: best MainIs: battery_monitoring.ml BuildDepends: obus, lwt.syntax, obus.upower # +-------------------------------------------------------------------+ # | Misc | # +-------------------------------------------------------------------+ SourceRepository head Type: darcs Location: http://darcs.ocamlcore.org/repos/obus Browser: http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=obus;a=summary obus-1.1.5/README0000644000000000000000000000464212032535151011537 0ustar0000000000000000OBus is a pure ocaml implementation of D-Bus. url: https://forge.ocamlcore.org/projects/obus/ * Requirements: obus depends on the following packages: lwt: http://www.ocsigen.org/install/lwt type-conv: http://www.ocaml.info/home/ocaml_sources.html#type-conv xmlm: http://erratique.ch/software/xmlm It also requires at least ocaml version 3.12. * Installation: To compile and install OBus just type: $ ocaml setup.ml -configure $ ocaml setup.ml -build $ ocaml setup.ml -install Optionally you can also build the documentation with: $ ocaml setup.ml -doc If you get the development version of obus you must obtain oasis (http://oasis.forge.ocamlcore.org/). * Using the library OBus install the following packages: - obus: the core library, implementing the D-Bus protocol, - obus.notification: interface to the freedesktop Notification service, - obus.hal: interface to the freedesktop Hal service, - obus.upower: interface to the freedesktop UPower service, - obus.udisks: interface to the freedesktop UDisks service, - obus.policykit: interface to the freedesktop PolicyKit servie. * Using tools: There are several tools provided in the obus distribution: - obus-dump, to execute a command and dump all messages that goes throug the session and/or system message bus, - obus-introspect which can recursively introspect a D-Bus service, - obus-gen-interface, to convert D-Bus introspection files into ocaml definition modules, - obus-gen-client and obus-gen-server which can generate template for using or implementing D-Bus servies, - obus-xml2idl and obus-idl2xml to convert xml introspection documents to the obus idl format, and vice versa. There are manual pages for all this tools. The caml files generated by obus-gen-client and obus-gen-server are meant to be edited and adapted. In practice introspections files contains only marshaling informations so it is often not sufficient for creating a usable binding. Here is a simple example of use of the tools: $ obus-introspect org.freedesktop.Notifications /org/freedesktop/Notifications > notif.xml $ obus-gen-interface notif.xml $ obus-gen-client notif.xml * Development: The last development version of obus can always be found in the darcs repository hosted at darcs.ocamlcore.org: $ darcs get http://darcs.ocamlcore.org/repos/obus obus-1.1.5/LICENSE0000644000000000000000000000275612032535151011670 0ustar0000000000000000Copyright (c) 2009, Jeremie Dimino All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Jeremie Dimino nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. obus-1.1.5/CHANGES0000644000000000000000000000140112032535151011640 0ustar0000000000000000===== 1.1.5 (2012-10-02) ===== * compatibility fix for type-conv ===== 1.1.4 (2012-07-30) ===== * update oasis files * minor fixes ===== 1.1.3 (2011-07-29) ===== * depends on type-conv instead of type-conv.syntax * implements version 0.18 of the specification: - add the 'eavesdrop' match keyword ===== 1.1.2 (2011-04-12) ===== * implement property monitoring for upower, udisks and network-manager * implement new D-Bus errors (UnknownObject, UnknownInterface, ...) * update and implement new argument filters (argNpath and argNnamespace) ===== 1.1.1 (2011-02-14) ===== * Fix a race condition in servers that may causes authentication to hang * Add support for launchd addresses ===== 1.1 (2010-12-13) ===== * First stable release obus-1.1.5/.project0000644000000000000000000000004712032535151012321 0ustar0000000000000000obus, an ocaml implementation of D-Bus obus-1.1.5/utils/0000755000000000000000000000000012032535152012012 5ustar0000000000000000obus-1.1.5/utils/obus-mode.el0000644000000000000000000000541512032535152014233 0ustar0000000000000000;; obus-mode.el ;; ------------ ;; Copyright : (c) 2010, Jeremie Dimino ;; Licence : BSD3 (require 'tuareg) (defconst obus-keywords '("interface" "method" "signal" "property_r" "property_w" "property_rw" "annotation" "with" "enum" "flag") "List of keywords for the obus-mode") (defconst obus-member-keywords '("method" "signal" "property_r" "property_w" "property_rw") "List of keywords used for defining D-Bus members") (defvar obus-file nil "Whether the current buffer is an obus idl file") (defun obus-tuareg-mode-hook () "Setup the tuareg mode for obus idl files" (if obus-file (progn (setq obus-file nil) (make-local-variable 'tuareg-governing-phrase-regexp) (make-local-variable 'tuareg-keyword-alist) (make-local-variable 'tuareg-font-lock-keywords) (setq tuareg-governing-phrase-regexp (regexp-opt '("interface" "method" "signal" "property_r" "property_w" "property_rw" "annotation" "enum" "flag") `words)) (setq tuareg-keyword-alist (mapcar (lambda (x) (cons x 2)) obus-keywords)) (setq tuareg-font-lock-keywords (list (list "[(){}:*=,]\\|->" 0 'font-lock-keyword-face nil nil) (list (regexp-opt obus-keywords `words) 0 'font-lock-keyword-face nil nil) (list (concat (regexp-opt obus-member-keywords `words) "[ \t\n]+\\([A-Za-z_][A-Za-z0-9_]*\\)\\>") 2 'font-lock-function-name-face 'keep nil) (list "\\[ \t\n]+\\([A-Za-z_][A-Za-z0-9_]*\\([.][A-Za-z0-9_]+\\)+\\)\\>" 1 'font-lock-constant-face 'keep nil) (list "\\<\\(enum\\|flag\\)\\>[ \t\n]+\\([A-Za-z_][A-Za-z0-9_]*\\)\\>" 2 'font-lock-type-face 'keep nil) (list "\\<\\([A-Za-z_][A-Za-z0-9_.]+\\)[ \t\n]*\\(=\\|:\\)" 1 'font-lock-variable-name-face 'keep nil) (list "\\([0-9][0-9a-zA-Z+-.]*\\|'.'\\|\"[^\"]*\"\\)[ \t\n]*:[ \t\n]*\\([A-Za-z_][A-Za-z0-9_]*\\)\\>" 2 'font-lock-variable-name-face 'keep nil) (list ":[ \t\n]*\\(\\([_--->.* \t]\\|\\w\\|(['~?]*\\([_--->.,* \t]\\|\\w\\)*)\\)*\\)" 1 'font-lock-type-face 'keep nil) (list (regexp-opt obus-keywords `words))))))) (add-hook 'tuareg-mode-hook 'obus-tuareg-mode-hook) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.obus\\'" . obus-mode)) ;;;###autoload (defun obus-mode () "Major mode for editing obus idl files" (interactive) (print "toto") (setq obus-file t) (tuareg-mode)) (provide 'obus-mode) obus-1.1.5/utils/scripts/0000755000000000000000000000000012032535152013501 5ustar0000000000000000obus-1.1.5/utils/scripts/power-suspend0000644000000000000000000000067612032535152016250 0ustar0000000000000000#!/usr/bin/env ocamlscript (* * power-suspend * ------------- * Copyright : (c) 2009, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) Ocaml.packs := ["obus.hal"; "lwt.syntax"] -- (* Make the computer to suspend to ram *) let _ = Lwt_main.run begin lwt computer = Lazy.force Hal_device.computer in Hal_device.System_power_management.suspend computer 0 end obus-1.1.5/utils/scripts/power-shutdown0000644000000000000000000000067112032535152016435 0ustar0000000000000000#!/usr/bin/env ocamlscript (* * power-shutdown * -------------- * Copyright : (c) 2009, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) Ocaml.packs := ["obus.hal"; "lwt.syntax"] -- (* Make the computer to shutdown *) let _ = Lwt_main.run begin lwt computer = Lazy.force Hal_device.computer in Hal_device.System_power_management.shutdown computer end obus-1.1.5/utils/scripts/power-reboot0000644000000000000000000000066112032535152016053 0ustar0000000000000000#!/usr/bin/env ocamlscript (* * power-reboot * ------------ * Copyright : (c) 2009, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) Ocaml.packs := ["obus.hal"; "lwt.syntax"] -- (* Make the computer to reboot *) let _ = Lwt_unix.run begin lwt computer = Lazy.force Hal_device.computer in Hal_device.System_power_management.reboot computer end obus-1.1.5/utils/scripts/power-hibernate0000644000000000000000000000067512032535152016527 0ustar0000000000000000#!/usr/bin/env ocamlscript (* * power-hibernate * --------------- * Copyright : (c) 2009, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) Ocaml.packs := ["obus.hal"; "lwt.syntax"] -- (* Make the computer to hibernate *) let _ = Lwt_main.run begin lwt computer = Lazy.force Hal_device.computer in Hal_device.System_power_management.hibernate computer end obus-1.1.5/utils/scripts/multimedia-keys0000644000000000000000000000355512032535152016537 0ustar0000000000000000#!/usr/bin/env ocamlscript (* * multimedia-keys * --------------- * Copyright : (c) 2009, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) Ocaml.packs := ["lwt.syntax"; "obus.syntax"; "obus"] -- (* Simple script which listen keyboard events emited by hal and run commands *) open Lwt (* Configuration *) let commands = [ ("volume-up", "amixer -q set Master 5%+"); ("volume-down", "amixer -q set Master 5%-"); ] lwt () = lwt bus = Lazy.force OBus_bus.system in (* Tell the message bus we want to receive ButtonPressed events from hal. *) lwt () = OBus_bus.add_match bus (OBus_match.rule ~sender:"org.freedesktop.Hal" ~interface:"org.freedesktop.Hal.Device" ~member:"Condition" ~arguments:[(0, "ButtonPressed")] ()) in (* Add a message filter. We use that instead of adding a signal receiver because we do not care about which object send the event. *) ignore (Lwt_sequence.add_l (function | { OBus_message.typ = OBus_message.Signal(_, "org.freedesktop.Hal.Device", "Condition"); OBus_message.body = OBus_value.V.([Basic(String "ButtonPressed"); Basic(String button)]) } -> begin match try Some(List.assoc button commands) with Not_found -> None with | Some command -> ignore_result (Lwt_unix.system command) | None -> () end; Some msg | msg -> Some msg) (OBus_connection.incoming_filters bus)); (* Wait forever, the program will exit when the connection is closed *) fst (wait ()) obus-1.1.5/utils/scripts/cpufreq-powersave0000644000000000000000000000073412032535152017106 0ustar0000000000000000#!/usr/bin/env ocamlscript (* * cpufreq-powersave * ----------------- * Copyright : (c) 2009, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) Ocaml.packs := ["obus.hal"; "lwt.syntax"] -- (* Set the cpufreq governor to powersave on all cpus *) let () = Lwt_unix.run begin lwt computer = Lazy.force Hal_device.computer in Hal_device.Cpufreq.set_cpufreq_governor computer "powersave" end obus-1.1.5/utils/scripts/cpufreq-performance0000644000000000000000000000074412032535152017375 0ustar0000000000000000#!/usr/bin/env ocamlscript (* * cpufreq-performance * ------------------- * Copyright : (c) 2009, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) Ocaml.packs := ["obus.hal"; "lwt.syntax"] -- (* Set the cpufreq governor to performance on all cpus *) let () = Lwt_unix.run begin lwt computer = Lazy.force Hal_device.computer in Hal_device.Cpufreq.set_cpufreq_governor computer "performance" end obus-1.1.5/utils/doc/0000755000000000000000000000000012032535152012557 5ustar0000000000000000obus-1.1.5/utils/doc/style.css0000644000000000000000000000503612032535152014435 0ustar0000000000000000/* A style for ocamldoc. Daniel C. Buenzli, Jérémie Dimino */ body { padding: 0em; border: 0em; margin: 2em 10% 2em 10%; font-weight: normal; line-height: 130%; text-align: justify; background: white; color : black; min-width: 40ex; } pre, p, div, span, img, table, td, ol, ul, li { padding: 0em; border: 0em; margin: 0em } h1, h2, h3, h4, h5, h6, div.h7, div.h8, div.h9 { fontsize: 100%; margin-bottom: 1em padding: 1ex 0em 0em 0em; border: 0em; margin: 1em 0em 0em 0em; font-weight : bold; text-align: center; } h1 { font-size : 140% } h2, h3, h4, h5, h6, div.h7, div.h8, div.h9 { font-size : 100%; border-top-style : none; margin: 1ex 0em 0em 0em; border: 1px solid #000000; margin-top: 5px; margin-bottom: 2px; text-align: center; padding: 2px; } h2 { font-size : 120%; background-color: #90BDFF ; } h3 { background-color: #90DDFF; } h4 { background-color: #90EDFF; } h5 { background-color: #90FDFF; } h6 { background-color: #C0FFFF; } div.h7 { background-color: #E0FFFF; } div.h8 { background-color: #F0FFFF; } div.h9 { background-color: #FFFFFF; } .navbar { padding-bottom : 1em; margin-bottom: 1em; border-bottom: 1px solid #000000; border-bottom-style: dotted; } p { padding: 1em 0ex 0em 0em } a, a:link, a:visited, a:active, a:hover { color : #009; text-decoration: none } a:hover { color : #009; text-decoration : none; background-color: #5FFF88 } hr { border-style: none; } table { font-size : 100% /* Why ? */ } ul li { padding: 1em 0em 0em 0em; margin:0em 0em 0em 2.5ex } ol li { padding: 1em 0em 0em 0em; margin:0em 0em 0em 2em } pre { margin: 3ex 0em 1ex 0em; background-color: #edf0f9; } .keyword { font-weight: bold; color: #a020f0; } .keywordsign { font-weight: bold; color: #a020f0; } .typefieldcomment { color : #b22222; } .keywordsign { color: #a020f0; } .code { font-size: 120%; color: #5f5f5f; } .info { margin: 0em 0em 0em 2em } .comment { color : #b22222; } .constructor { color : #072 } .type { color : #228b22; } .string { color : #bc8f8f; } .warning { color : Red; font-weight : bold } div.sig_block { margin-left: 2em } .typetable { color : #b8860b; border-style : hidden } .indextable { border-style : hidden } .paramstable { border-style : hidden; padding: 5pt 5pt } .superscript { font-size : 80% } .subscript { font-size : 80% } obus-1.1.5/tools/0000755000000000000000000000000012032535152012012 5ustar0000000000000000obus-1.1.5/tools/utils.mli0000644000000000000000000000314012032535152013653 0ustar0000000000000000(* * utils.mli * --------- * Copyright : (c) 2010, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) (** Utilities for tools *) module IFSet : Set.S with type elt = OBus_introspect_ext.interface (** Set of interfaces *) val parse_xml : string -> IFSet.t (** [parse_xml file_name] parses [file_name] as an XML introspection file *) val parse_idl : string -> IFSet.t (** [parse_xml file_name] parses [file_name] as an obus IDL file *) val parse_file : string -> IFSet.t (** [parse_file file_name] parses [file_name] as an XML introspection file or as an IDL file (according to the file name extension), and returns the set of interfaces it contains. *) val file_name_of_interface_name : OBus_name.interface -> string (** Convert an interface name into a valid module file name *) val convertor_send : bool -> OBus_introspect_ext.term -> string option (** [convertor_send paren typ] returns an expression which convert caml values before they are sent. It returns [None] if no conversion is needed. If [paren] is [true] then no parenthesis will be used, otherwise the expression may be surrounded by parenthesis if needed *) val convertor_recv : bool -> OBus_introspect_ext.term -> string option (** [convertor_recv paren typ] returns an expression which convert caml values after they are received. It returns [None] if no conversion is needed. *) val make_annotation : OBus_introspect.name -> string (** [make_annotation name] returns the code for the given annotation *) obus-1.1.5/tools/utils.ml0000644000000000000000000001105512032535152013506 0ustar0000000000000000(* * utils.ml * -------- * Copyright : (c) 2010, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) open Printf open OBus_value open OBus_introspect_ext module IFSet = Set.Make(struct type t = OBus_introspect_ext.interface let compare (n1, _, _, _) (n2, _, _, _) = String.compare n1 n2 end) let parse_xml fname = let ic = open_in fname in try let interfaces, _ = OBus_introspect.input (Xmlm.make_input ~entity:(fun _ -> Some "") ~strip:true (`Channel ic)) in close_in ic; let interfaces = List.map OBus_introspect_ext.decode interfaces in List.fold_left (fun acc iface -> IFSet.add iface acc) IFSet.empty interfaces with | OBus_introspect.Parse_failure((line, column), msg) -> Printf.eprintf "%s:%d:%d: %s.\n%!" fname line column msg; exit 1 let parse_idl fname = try List.fold_left (fun acc iface -> IFSet.add iface acc) IFSet.empty (OBus_idl.parse_file fname) with exn -> Format.eprintf "@[%a@]@." Camlp4.ErrorHandler.print exn; exit 1 let parse_file fname = if Filename.check_suffix fname ".obus" then parse_idl fname else parse_xml fname let file_name_of_interface_name name = let result = String.create (String.length name) in for i = 0 to String.length name - 1 do if name.[i] = '.' then result.[i] <- '_' else result.[i] <- name.[i] done; result let paren top s = if top then s else sprintf "(%s)" s let make_names l = let rec aux n = function | [] -> [] | _ :: l -> sprintf "x%d" n :: aux (n + 1) l in aux 1 l let rec convertor conv top = function | Term(name, []) -> conv top name | Term("array", [t]) -> begin match convertor conv false t with | Some f -> Some(paren top (sprintf "List.map %s" f)) | None -> None end | Term("dict", [tk; tv]) -> begin match convertor conv true tk, convertor conv true tv with | None, None -> None | Some fk, None -> Some(paren top (sprintf "List.map (fun (k, v) -> (%s k, v))" fk)) | None, Some fv -> Some(paren top (sprintf "List.map (fun (k, v) -> (k, %s v))" fv)) | Some fk, Some fv -> Some(paren top (sprintf "List.map (fun (k, v) -> (%s k, %s v))" fk fv)) end | Term(name, args) -> None | Tuple tl -> let l = List.map (convertor conv true) tl in if List.exists (fun f -> f <> None) l then begin let names = make_names tl in Some(sprintf "(fun (%s) -> (%s))" (String.concat ", " names) (String.concat ", " (List.map2 (fun name conv -> match conv with | Some f -> sprintf "%s %s" f name | None -> name) names l))) end else None let dbus_symbols = [ "byte"; "boolean"; "int16"; "int32"; "int64"; "uint16"; "uint32"; "uint64"; "double"; "string"; "signature"; "object_path"; "unix_fd"; "array"; "dict"; "variant"; ] let convertor_send top typ = convertor (fun top t -> match t with | "int32" | "uint32" -> Some "Int32.of_int" | "object_path" -> Some "OBus_proxy.path" | name when List.mem name dbus_symbols -> None | name -> Some("cast_" ^ name)) top typ let convertor_recv top typ = convertor (fun top t -> match t with | "int32" | "uint32" -> Some "Int32.to_int" | "object_path" -> Some(paren top ("OBus_proxy.make (OBus_context.sender context)")) | name when List.mem name dbus_symbols -> None | name -> Some("make_" ^ name)) top typ let make_annotation = function | "org.freedesktop.DBus.Deprecated" -> "OBus_introspect.deprecated" | "org.freedesktop.DBus.GLib.CSymbol" -> "OBus_introspect.csymbol" | "org.freedesktop.DBus.Method.NoReply" -> "OBus_introspect.no_reply" | "org.freedesktop.DBus.Property.EmitsChangedSignal" -> "OBus_introspect.emits_changed_signal" | "org.ocamlcore.forge.obus.Enum" -> "OBus_introspect_ext.obus_enum" | "org.ocamlcore.forge.obus.Flag" -> "OBus_introspect_ext.obus_flag" | "org.ocamlcore.forge.obus.Type" -> "OBus_introspect_ext.obus_type" | "org.ocamlcore.forge.obus.IType" -> "OBus_introspect_ext.obus_itype" | "org.ocamlcore.forge.obus.OType" -> "OBus_introspect_ext.obus_otype" | name -> Printf.sprintf "%S" name obus-1.1.5/tools/term.ml0000644000000000000000000001014012032535152013307 0ustar0000000000000000(* * term.ml * ------- * Copyright : (c) 2008, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) (* Terms manipulation *) open Printf open OBus_introspect_ext (* +-----------------------------------------------------------------+ | D-Bus types --> term (implementation) | +-----------------------------------------------------------------+ *) let rec impl = function | Term("byte", []) -> term "basic_byte" [] | Term("boolean", []) -> term "basic_boolean" [] | Term("int16", []) -> term "basic_int16" [] | Term("int32", []) -> term "basic_int32" [] | Term("int64", []) -> term "basic_int64" [] | Term("uint16", []) -> term "basic_uint16" [] | Term("uint32", []) -> term "basic_uint32" [] | Term("uint64", []) -> term "basic_uint64" [] | Term("double", []) -> term "basic_double" [] | Term("string", []) -> term "basic_string" [] | Term("signature", []) -> term "basic_signature" [] | Term("object_path", []) -> term "basic_object_path" [] | Term("unix_fd", []) -> term "basic_unix_fd" [] | Term("array", [Term("byte", [])]) -> term "byte_array" [] | Term("dict", [tk; tv]) -> term "dict" [tk; impl tv] | Term(name, tl) -> term name (List.map impl tl) | Tuple tl -> tuple (List.map impl tl) (* +-----------------------------------------------------------------+ | D-Bus types --> term (interface) | +-----------------------------------------------------------------+ *) let rec intf = function | Term("byte", []) -> term "char" [] | Term("boolean", []) -> term "bool" [] | Term("int16", []) -> term "int" [] | Term("int32", []) -> term "int32" [] | Term("int64", []) -> term "int64" [] | Term("uint16", []) -> term "int" [] | Term("uint32", []) -> term "int32" [] | Term("uint64", []) -> term "int64" [] | Term("double", []) -> term "float" [] | Term("string", []) -> term "string" [] | Term("signature", []) -> term "OBus_value.signature" [] | Term("object_path", []) -> term "OBus_path.t" [] | Term("unix_fd", []) -> term "Unix.file_descr" [] | Term("array", [Term("byte", [])]) -> term "string" [] | Term("array", [t]) -> term "list" [intf t] | Term("dict", [tk; tv]) -> term "list" [tuple [intf tk; intf tv]] | Term("variant", []) -> term "OBus_value.V.single" [] | Term(name, tl) -> term name (List.map intf tl) | Tuple tl -> tuple (List.map intf tl) (* +-----------------------------------------------------------------+ | Term printing (implementation) | +-----------------------------------------------------------------+ *) let rec print_impl top oc = function | Term(id, []) -> output_string oc id | Term(id, tl) -> if not top then output_char oc '('; output_string oc id; List.iter (fun t -> output_char oc ' '; print_impl false oc t) tl; if not top then output_char oc ')' | Tuple [] -> if not top then output_char oc '('; output_string oc "structure seq0"; if not top then output_char oc ')' | Tuple tl -> if not top then output_char oc '('; fprintf oc "structure (seq%d" (List.length tl); List.iter (fun t -> output_char oc ' '; print_impl false oc t) tl; output_char oc ')'; if not top then output_char oc ')' (* +-----------------------------------------------------------------+ | Term printing (interface) | +-----------------------------------------------------------------+ *) let rec print_intf top oc = function | Term(id, []) -> output_string oc id | Term(id, [t]) -> fprintf oc "%a %s" (print_intf false) t id | Term(id, tl) -> fprintf oc "(%a) %s" (print_seq true ", ") tl id | Tuple [] -> output_string oc "unit" | Tuple tl -> if top then print_seq false " * " oc tl else fprintf oc "(%a)" (print_seq false " * ") tl and print_seq top sep oc = function | [] -> () | [t] -> print_intf top oc t | t :: tl -> fprintf oc "%a%s%a" (print_intf top) t sep (print_seq top sep) tl obus-1.1.5/tools/obus_xml2idl.ml0000644000000000000000000000213312032535152014746 0ustar0000000000000000(* * obus_xml2idl.ml * --------------- * Copyright : (c) 2010, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) let usage_message = Printf.sprintf "Usage: %s \n\ Generate an obus IDL file from a D-Bus introspection file.\n\ options are:" (Filename.basename Sys.argv.(0)) let output = ref None let args = [ "-o", Arg.String(fun str -> output := Some str), " output file name"; ] let () = let sources = ref [] in Arg.parse args (fun s -> sources := s :: !sources) usage_message; let source = match !sources with | [s] -> s | _ -> Arg.usage args usage_message; exit 1 in let destination = match !output with | None -> (try Filename.chop_extension source with Invalid_argument _ -> source) ^ ".obus" | Some name -> name in OBus_idl.print_file destination (Utils.IFSet.elements (Utils.parse_xml source)); Printf.printf "file \"%s\" written\n" destination obus-1.1.5/tools/obus_introspect.ml0000644000000000000000000000653212032535152015574 0ustar0000000000000000(* * obus_introspect.ml * ------------------ * Copyright : (c) 2008, Jeremie Dimino * Licence : BSD3 * * This file is a part of obus, an ocaml implementation of D-Bus. *) let recursive = ref false let anons = ref [] let session = ref false let system = ref false let address = ref None let obj_mode = ref false let args = [ "-rec", Arg.Set recursive, "introspect recursively all sub-nodes"; "-session", Arg.Set session, "the service is on the session bus (the default)"; "-system", Arg.Set system, "the service is on the system bus"; "-address", Arg.String (fun addr -> address := Some addr), "the service is on the given message bus"; "-objects", Arg.Set obj_mode, "list objects with interfaces they implements instead of interfaces"; ] let usage_msg = Printf.sprintf "Usage: %s