From 2a8acd07005f2e8cdc43a6cc2a4e6f3d66f9fc4d Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Tue, 6 Oct 2009 16:38:11 +0100 Subject: HACKING file, update (C) messages. --- HACKING | 81 +++++++++++++++++++++++++++++++++++++++++ Make.rules.in | 2 +- Makefile.in | 2 +- README | 2 +- virt-top/Makefile.in | 2 +- virt-top/README | 57 ----------------------------- virt-top/virt_top.ml | 2 +- virt-top/virt_top.mli | 2 +- virt-top/virt_top_calendar1.ml | 2 +- virt-top/virt_top_calendar2.ml | 2 +- virt-top/virt_top_csv.ml | 2 +- virt-top/virt_top_main.ml | 2 +- virt-top/virt_top_utils.ml | 2 +- virt-top/virt_top_utils.mli | 2 +- virt-top/virt_top_version.ml.in | 2 +- virt-top/virt_top_xml.ml | 2 +- 16 files changed, 95 insertions(+), 71 deletions(-) create mode 100644 HACKING delete mode 100755 virt-top/README diff --git a/HACKING b/HACKING new file mode 100644 index 0000000..bce40a9 --- /dev/null +++ b/HACKING @@ -0,0 +1,81 @@ +This file contains some tips for hacking on this code. + +General OCaml advice: + +(1) The *.mli file describes the interface of the module. It's a good + idea to look at this file first, then at *.ml (the implementation). + +(2) Emacs users: use tuareg-mode for editing OCaml. + +(3) http://www.ocaml-tutorial.org/ + +(4) http://camltastic.blogspot.com/2008/08/3-things-that-will-confuse-you-when.html + +The code is structured into these files: + + virt_top_utils.mli / virt_top_utils.ml + + String functions and other small utility functions. This is + included directly into virt_top.ml. + + virt_top_version.ml + + The version number (automatically generated by configure). + + virt_top.mli / virt_top.ml + + This is the virt-top program. + + The two interesting functions are called 'collect' and 'redraw'. + + 'collect' collects all the information about domains, etc. + + 'redraw' updates the display on each frame. + + Another interesting function is 'start_up' which handles all + start-up stuff, eg. command line arguments, connecting to the + hypervisor, enabling curses. + + The function 'main_loop' runs the main loop and has sub-functions + to deal with keypresses, help screens and so on. + + virt_top_xml.ml + + Any code which needs the optional xml-light library goes + in here. Mainly for parsing domain XML descriptions to get + the list of block devices and network interfaces. + + The reason for having it in a separate file is so that we + don't depend on xml-light. + + virt_top_csv.ml + + Any code which needs the optional ocaml-csv library goes + in here. This implements the --csv command line option. + + virt_top_calendar1.ml + virt_top_calendar2.ml + + Any code which needs the optional ocaml-calendar library + goes in here. This implements the --end-time command line + option. Note there are two incompatible versions of the + ocaml-calendar library, which is why we have two + implementations. The Makefile works out which one to use. + + virt_top_gettext.ml + + Gettext interaction (this is generated by ./configure). + + virt_top_main.ml + + This is just a small bit of code to glue the modules above + together. + +The man-page is generated from the single file: + + virt-top.pod + +which generates (using perldoc) the following: + + virt-top.1 + virt-top.txt diff --git a/Make.rules.in b/Make.rules.in index a25d485..35af848 100644 --- a/Make.rules.in +++ b/Make.rules.in @@ -1,5 +1,5 @@ # ocaml-libvirt -# Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones +# Copyright (C) 2007-2009 Red Hat Inc., Richard W.M. Jones # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/Makefile.in b/Makefile.in index c9a6786..ef2eadc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,5 +1,5 @@ # virt-top -# Copyright (C) 2007-2008 Red Hat Inc., Richard W.M. Jones +# Copyright (C) 2007-2009 Red Hat Inc., Richard W.M. Jones # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public diff --git a/README b/README index fc20808..0e56218 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ virt-top ---------------------------------------------------------------------- -Copyright (C) 2007-2008 Richard W.M. Jones, Red Hat Inc. +Copyright (C) 2007-2009 Richard W.M. Jones, Red Hat Inc. http://et.redhat.com/~rjones/virt-top/ http://libvirt.org/ocaml/ http://libvirt.org/ diff --git a/virt-top/Makefile.in b/virt-top/Makefile.in index 6a782cb..34f1ad6 100755 --- a/virt-top/Makefile.in +++ b/virt-top/Makefile.in @@ -1,5 +1,5 @@ # virt-top -# Copyright (C) 2007 Red Hat Inc., Richard W.M. Jones +# Copyright (C) 2007-2009 Red Hat Inc., Richard W.M. Jones # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/virt-top/README b/virt-top/README deleted file mode 100755 index b594f95..0000000 --- a/virt-top/README +++ /dev/null @@ -1,57 +0,0 @@ -The code is structured into these files: - - virt_top_utils.mli / virt_top_utils.ml - - String functions and other small utility functions. This is - included directly into virt_top.ml. - - virt_top.mli / virt_top.ml - - This is the virt-top program. - - The two interesting functions are called 'collect' and 'redraw'. - - 'collect' collects all the information about domains, etc. - - 'redraw' updates the display on each frame. - - Another interesting function is 'start_up' which handles all - start-up stuff, eg. command line arguments, connecting to the - hypervisor, enabling curses. - - The function 'main_loop' runs the main loop and has sub-functions - to deal with keypresses, help screens and so on. - - virt_top_xml.ml - - Any code which needs the optional xml-light library goes - in here. Mainly for parsing domain XML descriptions to get - the list of block devices and network interfaces. - - The reason for having it in a separate file is so that we - don't depend on xml-light. - - virt_top_csv.ml - - Any code which needs the optional ocaml-csv library goes - in here. This implements the --csv command line option. - - virt_top_calendar.ml - - Any code which needs the optional ocaml-calendar library - goes in here. This implements the --end-time command line - option. - - virt_top_main.ml - - This is just a small bit of code to glue the modules together - Virt_top + Virt_top_xml? + Virt_top_csv? + Virt_top_calendar? - -The man-page is generated from the single file: - - virt-top.pod - -which generates (using perldoc) the following: - - virt-top.1 - virt-top.txt diff --git a/virt-top/virt_top.ml b/virt-top/virt_top.ml index 4fb7b47..36b7e17 100644 --- a/virt-top/virt_top.ml +++ b/virt-top/virt_top.ml @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top.mli b/virt-top/virt_top.mli index 790eb31..efa5f56 100755 --- a/virt-top/virt_top.mli +++ b/virt-top/virt_top.mli @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top_calendar1.ml b/virt-top/virt_top_calendar1.ml index 779e62b..beac4ee 100755 --- a/virt-top/virt_top_calendar1.ml +++ b/virt-top/virt_top_calendar1.ml @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top_calendar2.ml b/virt-top/virt_top_calendar2.ml index 3d042e3..184f2b9 100755 --- a/virt-top/virt_top_calendar2.ml +++ b/virt-top/virt_top_calendar2.ml @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top_csv.ml b/virt-top/virt_top_csv.ml index 3393e3a..e048856 100644 --- a/virt-top/virt_top_csv.ml +++ b/virt-top/virt_top_csv.ml @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top_main.ml b/virt-top/virt_top_main.ml index 4ab60ad..4e1c5b7 100644 --- a/virt-top/virt_top_main.ml +++ b/virt-top/virt_top_main.ml @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top_utils.ml b/virt-top/virt_top_utils.ml index 69f442f..f858e0e 100644 --- a/virt-top/virt_top_utils.ml +++ b/virt-top/virt_top_utils.ml @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top_utils.mli b/virt-top/virt_top_utils.mli index 5af26d4..5b71b31 100755 --- a/virt-top/virt_top_utils.mli +++ b/virt-top/virt_top_utils.mli @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top_version.ml.in b/virt-top/virt_top_version.ml.in index 12d72fb..eaa1df1 100644 --- a/virt-top/virt_top_version.ml.in +++ b/virt-top/virt_top_version.ml.in @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify diff --git a/virt-top/virt_top_xml.ml b/virt-top/virt_top_xml.ml index 73a4906..ab291d3 100644 --- a/virt-top/virt_top_xml.ml +++ b/virt-top/virt_top_xml.ml @@ -1,5 +1,5 @@ (* 'top'-like tool for libvirt domains. - (C) Copyright 2007 Richard W.M. Jones, Red Hat Inc. + (C) Copyright 2007-2009 Richard W.M. Jones, Red Hat Inc. http://libvirt.org/ This program is free software; you can redistribute it and/or modify -- cgit