diff options
author | Paul Phillips <paulp@improving.org> | 2016-03-01 08:07:22 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2016-03-01 08:07:22 -0800 |
commit | c36ef0dfe340f762436c2f661503445ea9ed0c15 (patch) | |
tree | 3e957f4173f8416744db4ed39965b7700e57a31a /src | |
parent | 417b8983c872ea0854b03b53595129ec69236421 (diff) | |
parent | 89ae11631ad336b2edf3e5438dc0415cfbf165e6 (diff) | |
download | unison-c36ef0dfe340f762436c2f661503445ea9ed0c15.zip unison-c36ef0dfe340f762436c2f661503445ea9ed0c15.tar.gz unison-c36ef0dfe340f762436c2f661503445ea9ed0c15.tar.bz2 |
Merge branch 'whitespace'
Diffstat (limited to 'src')
154 files changed, 7187 insertions, 7308 deletions
diff --git a/src/BUGS.txt b/src/BUGS.txt index 0c3fc45..3902f34 100644 --- a/src/BUGS.txt +++ b/src/BUGS.txt @@ -4,11 +4,11 @@ SHOWSTOPPERS ============ -Mac OSX, Windows XP: +Mac OSX, Windows XP: - Unison does not understand extended attributes (OSX) or alternate data - streams (XP) and will not synchronize them properly. + streams (XP) and will not synchronize them properly. -Linux, Solaris: +Linux, Solaris: - None known. --------------------------------------------------------------------------- @@ -28,7 +28,7 @@ SERIOUS I get this message from unison: Fatal error: Internal error: New archives are not identical. Retaining original archives. Please run Unison again to bring them - up to date. + up to date. If you get this message again, please notify unison-help@cis.upenn.edu. and I think that I know what's going wrong. Unison is somehow using a key consisting of the result of `hostname' (and maybe other stuff) to @@ -51,7 +51,7 @@ SERIOUS unique enough. But what, exactly? [APril 2002, Jason Eisner] Recently I found an aliasing problem that may - endanger Unison's semantics. + endanger Unison's semantics. -- The problem is with the "follow" directive, which is documented like this: "Including the preference -follow <pathspec> causes Unison to @@ -131,7 +131,7 @@ The "Diff" window [under Windows] sometimes shows nothing. Does this arise from a missing "Diff" program? We should detect this case! --------------------------------------------------------------------------- -COSMETIC +COSMETIC ======== Interactively adding an ignore pattern for src will not make diff --git a/src/CONTRIB b/src/CONTRIB index 73c7873..a993f4c 100644 --- a/src/CONTRIB +++ b/src/CONTRIB @@ -6,7 +6,7 @@ because we enjoy making something useful for us and for the community, but we all have other jobs to do. If you like Unison and you want to help us make it better, we'd be glad to have you on the team! - + HOW YOU CAN HELP ---------------- @@ -16,7 +16,7 @@ There are lots of ways... smoothly, and what you use it for. * Submitting bug reports (we're always glad to have these...) * Submitting bug FIXES (... especially when accompanied by these! :-) - * Reading the code. One of Unison's main design goals is robustness. + * Reading the code. One of Unison's main design goals is robustness. Help us reach that goal by reading our code and seeing whether you understand and believe it. * Proposing ideas for new functionality. @@ -49,7 +49,7 @@ SUBMITTING CHANGES If you've made a change that you're happy with and think ought to become part of a future release of Unison, you can send it to us like -this: +this: cd <top of your unison directory tree> make submit @@ -64,4 +64,3 @@ FINDING YOUR WAY AROUND See the file ROADMAP.txt for some suggestions on how to start reading the sources. - diff --git a/src/INSTALL b/src/INSTALL index c38a8f3..379c2e9 100644 --- a/src/INSTALL +++ b/src/INSTALL @@ -1,3 +1,2 @@ For installation instructions, see the the INSTALLATION section of the user manual. - diff --git a/src/INSTALL.gtk2 b/src/INSTALL.gtk2 index 94249e2..a1ea808 100644 --- a/src/INSTALL.gtk2 +++ b/src/INSTALL.gtk2 @@ -33,7 +33,7 @@ In order to use gtk2 with unison, for example, export LANG=zh_HK.BIG5-HKSCS otherwise, you will get - Uncaught exception Glib.GError("Invalid byte sequence in conversion input") + Uncaught exception Glib.GError("Invalid byte sequence in conversion input") 5) enjoy unison with i18n! ----------------------------- @@ -53,5 +53,3 @@ this build to work with 'STATIC=true'. WINDOWS: (Anybody want to contribute instructions??) - - diff --git a/src/INSTALL.win32 b/src/INSTALL.win32 index 2246e79..30d6f44 100644 --- a/src/INSTALL.win32 +++ b/src/INSTALL.win32 @@ -5,10 +5,9 @@ options require the Cygwin layer to be able to use a few GNU tools as well as the OCaml distribution version. The options differ in the C compiler employed: MS Visual C++ (MSVC) vs Cygwin GNU C. -Tradeoff? -. Only the MSVC option can produce statically linked Unison executable. +Tradeoff? +. Only the MSVC option can produce statically linked Unison executable. . The Cygwin GNU C option requires only free software. The files "INSTALL.win32-msvc" and "INSTALL.win32-cygwin-gnuc" describe the building procedures for the respective options. - diff --git a/src/INSTALL.win32-cygwin-gnuc b/src/INSTALL.win32-cygwin-gnuc index 6408b38..6a81bc5 100644 --- a/src/INSTALL.win32-cygwin-gnuc +++ b/src/INSTALL.win32-cygwin-gnuc @@ -15,7 +15,7 @@ simple (at least for the text user interface). latest unison sources from the live subversion repository. - - Download the desired version of the Unison source tarball + - Download the desired version of the Unison source tarball from the Unison home page and unpack it, or else grab the sources using svn. Make sure the directory path name has no space in it or the OCaml compiler will get confused later. @@ -33,7 +33,7 @@ simple (at least for the text user interface). - The text-only version can be run on any system that has cygwin installed: - $ cygcheck ./unison.exe + $ cygcheck ./unison.exe C:\cygwin\tmp\unison-2.32.52\unison.exe C:\cygwin\bin\cygwin1.dll C:\WINDOWS\system32\ADVAPI32.DLL @@ -58,7 +58,7 @@ simple (at least for the text user interface). - The graphics version needs many more libraries to run and hence is a lot less portable: - $ cygcheck ./unison.exe + $ cygcheck ./unison.exe C:\cygwin\tmp\unison-2.32.52\unison.exe C:\cygwin\bin\cygwin1.dll C:\WINDOWS\system32\ADVAPI32.DLL @@ -126,7 +126,7 @@ Section 1 - Setting up the Windows system 1.1 General requirements - We will assume your are logged in as a regular user. We will mention cases + We will assume your are logged in as a regular user. We will mention cases when you need to be granted administrator permissions. We will work in your home directory. @@ -137,12 +137,12 @@ when you need to be granted administrator permissions. GNU tools like 'bash', 'make', 'sed', 'patch', etc, and in particular the GNU C compiler. - The CygWin port of OCaml distribution version 3.04 is required. + The CygWin port of OCaml distribution version 3.04 is required. .2 A Unix-like layer: CygWin - Download CygWin from 'http://www.cygwin.com/': + Download CygWin from 'http://www.cygwin.com/': * click "install cygwin now" and follow the instruction to set up cygwin. install the essential packages such as "gcc", "make", "fileutil", "openssh", etc. @@ -159,7 +159,7 @@ the GNU C compiler. compiling under Windows platform using Cygwin GNU C. Remember you can access the whole Windows filesystem with a Unix -path through '/cygdrive/<drive letter>/<path>' (e.g. '/cygdrive/c/winnt' +path through '/cygdrive/<drive letter>/<path>' (e.g. '/cygdrive/c/winnt' stands for 'C:\WinNT') @@ -175,7 +175,7 @@ directory (using, e.g., winzip, or "tar xzvf ocaml-3.04.tar.gz" Enter the ocaml directory, and type: $ ./configure - # or "./configure -prefix <install-prefix>". + # or "./configure -prefix <install-prefix>". # For other options, see INSTALL $ make world $ make opt @@ -183,14 +183,14 @@ directory (using, e.g., winzip, or "tar xzvf ocaml-3.04.tar.gz" To check your installation, use 'bash' and enter 'ocamlc -v' If something goes wrong : -* your path must contain the OCaml 'bin' directory; you may have to enter +* your path must contain the OCaml 'bin' directory; you may have to enter something like 'export PATH=$PATH:/usr/local/ocaml/bin'. * 'ocamlc -v' must report the OCaml 'lib' directory; you may have to enter - something like 'export CAMLLIB=/usr/local/ocaml/lib/ocaml/' + something like 'export CAMLLIB=/usr/local/ocaml/lib/ocaml/' Section 2 - Compiling Unison - + 2.1 Text user interface @@ -201,7 +201,7 @@ Section 2 - Compiling Unison If something goes wrong : * if 'make' reports 'missing separator', be sure the makefiles are in Unix text format (see Appendix A). -* if .depend is not provided, create one using +* if .depend is not provided, create one using 'ocamldep *.mli *.ml > .depend'; you will have to convert this file to Unix text format (see Appendix A). * the minor 'etags' error is reported when 'emacs' is missing; you may @@ -221,15 +221,15 @@ directory of the Unison web site and unpack it. This will create a $ make $ make opt $ make install - - Finally, add the result of running + + Finally, add the result of running echo `ocamlc -where`/lablgtk/dlls to the environment variable PATH.* -* Under Windows menu: Start -> Settings -> Control Panel -> System -> +* Under Windows menu: Start -> Settings -> Control Panel -> System -> Advanced -> Environment Variables. - OPTIONAL: At this stage, you can test the installation of lablgtk by + OPTIONAL: At this stage, you can test the installation of lablgtk by $ cd lablgtk-1.2.3-cygwin/lablgtk-1.2.3/examples $ lablgtk <a program>.ml @@ -250,4 +250,3 @@ to include them in the PATH. * The way to find out which DLL are used under windows: objdump -p <executable name> | grep "DLL Name" - diff --git a/src/INSTALL.win32-msvc b/src/INSTALL.win32-msvc index e519532..1cb0685 100644 --- a/src/INSTALL.win32-msvc +++ b/src/INSTALL.win32-msvc @@ -34,7 +34,7 @@ Section 1 - Setting up the Windows system 1.1 General requirements - We will assume your are logged in as a regular user. We will mention cases + We will assume your are logged in as a regular user. We will mention cases when you need to be granted administrator permissions. We will work in your home directory. @@ -49,7 +49,7 @@ It itself requires Visual C++ 6.0. 1.2 A Unix-like layer: CygWin - Download CygWin from 'http://www.cygwin.com/': + Download CygWin from 'http://www.cygwin.com/': * click "install cygwin now" and follow the instruction to set up cygwin. install the essential packages such as "make", "fileutil", "openssh", etc. set the root directory (e.g. 'd:\cygwin') @@ -65,7 +65,7 @@ It itself requires Visual C++ 6.0. file) to understand that we are compiling under Windows platform. Remember you can access the whole Windows filesystem with a Unix -path through '/cygdrive/<drive letter>/<path>' (e.g. '/cygdrive/c/winnt' +path through '/cygdrive/<drive letter>/<path>' (e.g. '/cygdrive/c/winnt' stands for 'C:\WinNT') @@ -77,23 +77,23 @@ permissions. We only need Visual C++ and MsDN is not required. To check out your installation, use 'bash' to enter 'cl /?'. If something goes wrong : -* your path must contain the Visual C++ 'bin' directory; you may have to - enter something like +* your path must contain the Visual C++ 'bin' directory; you may have to + enter something like 'export PATH=$PATH:/cygdrive/progra~1/micros~1/vc98/bin'. * your path must contain the Visual Studio '.dll' files' directory; you may - have to enter something like + have to enter something like 'export PATH=$PATH:/cygdrive/progra~1/micros~1/common/msdev98/bin'. * the Visual C++ compiler must be able to access the headers; you may have to - enter something like 'export INCLUDE='C:\progra~1\micros~1\vc98\include'' + enter something like 'export INCLUDE='C:\progra~1\micros~1\vc98\include'' (path between single quotes). * the Visual C++ linker must be able to access the libraries; you may have to - enter something like 'export LIB='C:\progra~1\micros~1\vc98\lib'' (path + enter something like 'export LIB='C:\progra~1\micros~1\vc98\lib'' (path between single quotes). 1.4 The OCaml compiler - Download the Native Win32 port of OCaml 3.04 from + Download the Native Win32 port of OCaml 3.04 from 'http://caml.inria.fr/ocaml/distrib.html'. It's a self-extracting binary. Run it with Administrator permissions (only use 8 characters-long @@ -102,10 +102,10 @@ names in the installation directory). To check out your installation, use 'bash' to enter 'ocamlc -v'. If something goes wrong : -* your path must contain the OCaml 'bin' directory; you may have to enter +* your path must contain the OCaml 'bin' directory; you may have to enter something like 'export PATH=$PATH:/cygdrive/c/ocaml/bin'. * 'ocamlc -v' must report the OCaml 'lib' directory; you may have to enter - something like "export CAMLLIB='C:\ocaml\lib'" (path between single + something like "export CAMLLIB='C:\ocaml\lib'" (path between single quotes). 1.5 Microsoft Macro Assembler (MASM32) @@ -126,7 +126,7 @@ Your shell should answer with Section 2 - Compiling Unison - + 2.1 Text user interface @@ -137,7 +137,7 @@ Section 2 - Compiling Unison If something goes wrong : * if 'make' reports 'missing separator', be sure the makefiles are in Unix text format (see Appendix A). -* if .depend is not provided, create one using +* if .depend is not provided, create one using 'ocamldep *.mli *.ml > .depend'; you will have to convert this file to Unix text format (see Appendix A). * the minor 'etags' error is reported when 'emacs' is missing; you may @@ -151,7 +151,7 @@ directory of the Unison web site and unpack it in your Ocaml 'lib' directory. This will create a 'guilib' directory containing the libraries. - Now you need the LablGtk extension to OCaml. + Now you need the LablGtk extension to OCaml. First, the Gtk development package is required. Get the 'wingtk.patched.tar.gz' tarball from the 'resources' directory of the Unison web site and unpack it. This will create a 'wingtk' directory. @@ -197,7 +197,7 @@ to patch them and to build the new static and dynamic libraries. with the .dll's (dynamic version). Using the new version of 'wingtk', recompile LablGtk (see section 2.3). - + 3.2 Patching a new version of LablGtk @@ -206,7 +206,7 @@ with the .dll's (dynamic version). it. Download the 'lablgtk-1.2.3-msvc-static.patch.gz' from the 'resources' -directory of the Unison web site. Apply the patch by typing: +directory of the Unison web site. Apply the patch by typing: 'patch < lablgtk.patch' above the 'lablgtk' directory. @@ -222,52 +222,52 @@ recommand using the provided sources and patches as a base for your further enhancements. To be exhaustive, here are the steps followed to create the provided -sources (hoping it would help when trying to adapt a new version): +sources (hoping it would help when trying to adapt a new version): - WinGtk: + WinGtk: * Download the Gtk win32 sources from 'http://www.gimp.org/~tml/gimp/win32//downloads.html'. We need 'glib-src-yyyymmdd' and 'gtk+-src-yyyymmdd' where 'yyyymmdd' is the - release date. Version 2000/04/16 of these files was used. + release date. Version 2000/04/16 of these files was used. * We will make new Windows Makefiles from the old ones. Here is how to convert a Makefile: - - change all '/MD' to '/MT' to use the same windows system + - change all '/MD' to '/MT' to use the same windows system libraries than ocaml (e.g. 'OPTIMIZE = -Ox -MD' becomes 'OPTIMIZE = -Ox -MT') - turns all '.dll' targets to '.lib' ones using 'MKLIB = lib /nologo /out:' you must remove all references to '.def' files - you must remove all references to other '.lib' and '.res' but + you must remove all references to other '.lib' and '.res' but you will have to provide them when linking an executable later - (e.g. + (e.g. glib-$(GLIB_VER).dll : $(glib_OBJECTS) glib.def - $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) \ + $(CC) $(CFLAGS) -LD -Feglib-$(GLIB_VER).dll $(glib_OBJECTS) \ user32.lib advapi32.lib wsock32.lib $(LDFLAGS) /def:glib.def becomes: glib-$(GLIB_VER).lib : $(glib_OBJECTS) - $(MKLIB)glib-$(GLIB_VER).lib $(glib_OBJECTS) + $(MKLIB)glib-$(GLIB_VER).lib $(glib_OBJECTS) ) - remove all '-GD' compilation flags (e.g. .c.obj : - $(CC) $(CFLAGS) -GD -c -DGLIB_COMPILATION \ + $(CC) $(CFLAGS) -GD -c -DGLIB_COMPILATION \ -DG_LOG_DOMAIN=g_log_domain_glib $< becomes: .c.obj : - $(CC) $(CFLAGS) -c -DGLIB_COMPILATION \ + $(CC) $(CFLAGS) -c -DGLIB_COMPILATION \ -DG_LOG_DOMAIN=g_log_domain_glib $< ) - provides the right libraries when linking executables (e.g. testgtk.exe : gtk-$(GTK_VER).dll testgtk.obj - $(CC) $(CFLAGS) testgtk.obj gtk-$(GTK_VER).lib \ + $(CC) $(CFLAGS) testgtk.obj gtk-$(GTK_VER).lib \ ..\gdk\gdk-$(GTK_VER).lib $(GLIB)\glib-$(GLIB_VER).lib \ $(LDFLAGS) - becomes: + becomes: testgtk.exe : gtk-$(GTK_VER).lib testgtk.obj - $(CC) $(CFLAGS) testgtk.obj gtk-$(GTK_VER).lib \ + $(CC) $(CFLAGS) testgtk.obj gtk-$(GTK_VER).lib \ ..\gdk\gdk-$(GTK_VER).lib ..\gdk\win32\gdk-win32.lib \ $(GLIB)\glib-$(GLIB_VER).lib $(GLIB)\gmodule-$(GLIB_VER).lib \ user32.lib advapi32.lib wsock32.lib gdi32.lib imm32.lib \ @@ -305,7 +305,7 @@ sources (hoping it would help when trying to adapt a new version): * Convert 'gtk+/gdk/makefile.msc' and remove all references to 'WTKIT', 'wntab32x', 'INTL' and 'gnu-intl' from it. Include 'gdk-win32.lib' as an object for the 'gdk' library. - + * You should now be able to compile the 'gdk' library. Remember to provide 'win32/gdk.res' as well as the 'gdk' library when linking programs. @@ -330,7 +330,7 @@ sources (hoping it would help when trying to adapt a new version): finally obtain static/dynamic sources. * Make a patch with 'diff -Nr -C 5 <old dir> <new dir>' (you have to - use the GNU diffutils' 'diff'). You will apply the patch with + use the GNU diffutils' 'diff'). You will apply the patch with 'patch -p1 < <patch file>'. LablGtk: @@ -360,13 +360,13 @@ Windows and Unix use different text file formats. This section explains how to convert a file from a format to another. A.1 Text format conversion - + In order to convert a dos text file to a unix text file, we have to -remove all extra characters that are : -* carriage return or CR or ^M (ctrl-M) or \x0d or \o13 or \r +remove all extra characters that are : +* carriage return or CR or ^M (ctrl-M) or \x0d or \o13 or \r * dos end-of-file or SUB or ^Z (ctrl-Z) or \x1a or \o26 -A.2 Conversion tools +A.2 Conversion tools On a Unix-like top level (e.g any unix system or cygwin), you can use: @@ -1754,5 +1754,3 @@ Changes in Version 2.48.3 around with. * Added a file CONTRIB with some suggestions for how to help us make Unison better. - - @@ -2,7 +2,7 @@ http://www.cis.upenn.edu/~bcpierce/unison -This directory is the source distribution for the unison file synchronizer. +This directory is the source distribution for the unison file synchronizer. Installation instructions are in the file INSTALLATION section of the user manual. @@ -12,8 +12,8 @@ Full documentation can be found on the Unison home page. Contacts: - Bug reports should be sent to unison-help@cis.upenn.edu - - General questions and discussion should be sent to - unison-users@groups.yahoo.com + - General questions and discussion should be sent to + unison-users@groups.yahoo.com - You can subscribe to this list using Yahoo's web interface http://groups.yahoo.com/group/unison-users @@ -21,10 +21,9 @@ Credits: OS X Unison Icon taken from Mac4Lin (LGPL) http://sourceforge.net/projects/mac4lin/ -Some icons in the OSX GUI are directly taken from Matt Ball's developer icons - (Creative Commons Attribution 3.0) +Some icons in the OSX GUI are directly taken from Matt Ball's developer icons + (Creative Commons Attribution 3.0) Others are based on Matt Ball's developer icons (Creative Commons Attribution 3.0) http://www.mattballdesign.com/blog/2009/11/23/developer-icons-are-back-online/ OSX GUI elements from BWToolkit (three-clause BSD license) http://www.brandonwalkin.com/bwtoolkit/ - diff --git a/src/RECENTNEWS b/src/RECENTNEWS index d8a631d..e3228a6 100644 --- a/src/RECENTNEWS +++ b/src/RECENTNEWS @@ -30,7 +30,7 @@ CHANGES FROM VERSION 2.49.6 CHANGES FROM VERSION 2.49.4 * Remove colon from names of files created by the -copyonconflict - flag, to avoid unhappiness with some filesystems. + flag, to avoid unhappiness with some filesystems. ------------------------------- CHANGES FROM VERSION 2.49.3 diff --git a/src/ROADMAP.txt b/src/ROADMAP.txt index 44934e7..4ca198e 100644 --- a/src/ROADMAP.txt +++ b/src/ROADMAP.txt @@ -16,7 +16,7 @@ Next, look at the interface files in this order: update.mli update detection recon.mli reconciliation of updates (i.e. deciding what to do) transport.mli propagation of changes (also files.mi) - + From here, you probably know your way around enough to decide where to look next. Here's a summary of the most interesting modules: pred implements "predicates" (e.g. ignore) based on regexps @@ -39,13 +39,13 @@ to know much about how it works. ________________________________ -In a little more detail, here is the flow of control at startup time: +In a little more detail, here is the flow of control at startup time: - The first code to execute (not counting some small per-module initialization stuff) is the call to Main.init() from Main.Body. This handles a few special preferences like -version, -doc, and -server. If it returns, then Main.Body next calls the start function of whatever UI - module has been provided as an argument to the Main module. + module has been provided as an argument to the Main module. - The start function in each of the UI modules (Uitext, Uigtk2, etc.) behaves slightly differently, but they all have quite a bit of common diff --git a/src/TODO.txt b/src/TODO.txt index 00d89e3..ea9f67c 100644 --- a/src/TODO.txt +++ b/src/TODO.txt @@ -7,7 +7,7 @@ promise that anybody is going to implement it!) See the file BUGS.txt for a list of currently open bugs. ########################################################################### - + * CURRENT * ======= @@ -24,7 +24,7 @@ See the file BUGS.txt for a list of currently open bugs. - It would be better to ignore the exit status of the external merge tool and just look at what files it produced to decide what happened - The function that runs the external program should not grab stdin / - stdout / stderr if Unison is running with the text UI. + stdout / stderr if Unison is running with the text UI. - The confirmation step should offer to display the new merged file. - (There are some older merge issues documented below) @@ -89,13 +89,13 @@ See the file BUGS.txt for a list of currently open bugs. that prevents mutation from outside the module where the preference is defined (by exposing it with a weak type). -**** Remaining problem with merging code: +**** Remaining problem with merging code: - create two directories, each containing a .txt file - sync so they are equal - change the file so that one region is in conflict and another region has changes that can be propagated correctly - sync - - now we should be able to change the second region in just one file, + - now we should be able to change the second region in just one file, sync again, and see the change propagate; instead, it conflicts - diagnosis: the merge stuff is not correctly updating the archive in the event of a partial reconciliation @@ -135,7 +135,7 @@ See the file BUGS.txt for a list of currently open bugs. think this may also explain similar problems I had using the default unison behavior (which treats Cygwin files as read-only or read-write only) -- though there are several possible causes of like failures to - syncrhonize permissions. + syncrhonize permissions. The answer is obvious, following from the basic handling of permissions in Cygwin (in NT permissions mode), but I didn't see it. Users and @@ -146,7 +146,7 @@ See the file BUGS.txt for a list of currently open bugs. when the user and group happen to be the same, the user-permissions and the group-permissions are operating on the same underlying Windows object, and so they cannot be different. I think the user-permissions - prevail. + prevail. For example, if you try to sync a Unix file with permissions rw-r--r-- with a Cygwin file with permissions rw-rw-r-- whose owner happens to be @@ -156,19 +156,19 @@ See the file BUGS.txt for a list of currently open bugs. so that the degenerate permissions under Cygwin will migrate to the Unix system unless you are careful to prevent unison from doing it. (When you are trying to sync some 75,000 email and font files, this all - is more than a little exasperating!) + is more than a little exasperating!) --- Further important advice if you are going to synchronize Cygwin filesystems with unison's full Unix permissions model (and perhaps it - is also important even with unison's default behavior): + is also important even with unison's default behavior): Background: the flags "ntsec" or "ntea" in the CYGWIN environment variable signals Cygwin's libraries to use the richer NT permissions model rather than a simplified Win95-98 model. "ntsec" requires an NTFS filesystem, "ntea" will work with FAT filesystems. I use - "ntsec". + "ntsec". If unison does not have CYGWIN set appropriately in its environment, some chmod calls will not do the expected thing, even though they @@ -177,14 +177,14 @@ See the file BUGS.txt for a list of currently open bugs. (wrong) permissions from the Cygwin file back to the Unix system. (The first chmod apparently succeeded, so unison records the new permissions in its archive; the second time, when the file does not match the - archive, it seems to unison that the Cygwin file has been changed.) + archive, it seems to unison that the Cygwin file has been changed.) If you run unison from the bash command line, you will most likely not have a problem, since CYGWIN is probably set appropriately and exported in the .bat script that launches bash. Likewise, when the Cygwin filesystem is the remote one, Cygwin's sshd is by default set up (by /usr/bin/ssh-host-config) to establish and export an appropriate value - of CYGWIN to ssh clients. + of CYGWIN to ssh clients. If you launch unison directly from a Windows shortcut, however, you must set CYGWIN in your Windows environment variables. This is @@ -192,7 +192,7 @@ See the file BUGS.txt for a list of currently open bugs. profile or generically. The instructions for setting up Cygwin and the discussions of the CYGWIN envariable in the user manual never mention any need to put CYGWIN in the Windows envariables, however. (I'm - writing them to suggest they do.) + writing them to suggest they do.) >From the unison standpoint, the code which chooses to use the full permissions model on Cygwin hosts (right now I have it hacked simply to @@ -210,20 +210,20 @@ See the file BUGS.txt for a list of currently open bugs. * There is no way of selecting files with wildchar. I had to use ignorenot = Name opt/root/.unison/*.prf ignore = Name opt/root/.unison/* - But this is inconvinent, but the worse is that it gets complicated very - fast and I cannot make it for more complicated scenarios. I would expect + But this is inconvinent, but the worse is that it gets complicated very + fast and I cannot make it for more complicated scenarios. I would expect something like (suggestion): Files = opt/root/.unison/*.prf -* If a directory does not exist in one of the host, unison (for - security reasons, which I like) pops up a window and Quit is the only - option. I would expect a message stating mere clearly on which host and - direcory and an option to create that directory. I had recently to make - a lot of reinstalls and new pendrives and it took a long time to create +* If a directory does not exist in one of the host, unison (for + security reasons, which I like) pops up a window and Quit is the only + option. I would expect a message stating mere clearly on which host and + direcory and an option to create that directory. I had recently to make + a lot of reinstalls and new pendrives and it took a long time to create all those dirs. Someone in the list even made a script to do the job!!! -* When synchronizing FAT32, there could be an explicit command for - ignoring attributes. The problem happens when one side is FAT32 but the +* When synchronizing FAT32, there could be an explicit command for + ignoring attributes. The problem happens when one side is FAT32 but the other is not, or when mounting parameters are different. @@ -231,18 +231,18 @@ See the file BUGS.txt for a list of currently open bugs. * ======================= ** 'make install' could be improved (and documented) - 1. Typing "make install' after a "make" should simply install the + 1. Typing "make install' after a "make" should simply install the program that was made, not attempt to do a remake with different options. ===> Doesn't it??? - 2. "make install' should try to install as /usr/local/bin/unison, not - ~/bin/, especially considering that ~/bin is the wrong place to do the + 2. "make install' should try to install as /usr/local/bin/unison, not + ~/bin/, especially considering that ~/bin is the wrong place to do the install under OSX (it should be ~/Apps or ~/Apps/bin) should strip symbols from binary files in 'make exportnative' -* [Joerg von den Hoff, 2009] OS X: make the destination directory for the CL - version selectable (instead of dumping it in the middle of a systems - directory :-)) something like /usr/local/bin or whatever might frequently be +* [Joerg von den Hoff, 2009] OS X: make the destination directory for the CL + version selectable (instead of dumping it in the middle of a systems + directory :-)) something like /usr/local/bin or whatever might frequently be more suitable @@ -272,8 +272,8 @@ should strip symbols from binary files in 'make exportnative' - what happens when files are included whose parent dirs are excluded? (With Regex? With multiple Path and Name?) ===> document - - the documentation is very good, but i couldn't find a description of how - to respond to the prompts in the textual ui. is that explained + - the documentation is very good, but i couldn't find a description of how + to respond to the prompts in the textual ui. is that explained somewhere? a few typos i noticed: "with t fast", "nison", "off of". @@ -309,7 +309,7 @@ should strip symbols from binary files in 'make exportnative' roots and add a call to the rootalias-expanding function. *** Delete old backups mechanism and, instead, extend new one to cover its - functionality + functionality - put backups in same dir as files by default - otherwise, put them in a central place if one is given - Update.incrVersionsOfBackups should not be externally visible @@ -334,8 +334,8 @@ should strip symbols from binary files in 'make exportnative' //cern.ch//afs/cern.ch/user/n/nagya [NAGY Andras <nagya@inf.elte.hu>, March 12] ===> We definitely ought to do something about this problem -- it's - increasingly common. Not sure if this is the right proposal, but - something. + increasingly common. Not sure if this is the right proposal, but + something. *** Currently, if a file changes on either side between the initial update detection and the time when the transport module tries to propagate @@ -394,7 +394,7 @@ should strip symbols from binary files in 'make exportnative' ** small additions to merge functionality: - if the external merge program *deletes* one of the files it is given, Unison should interpret this as "Copy the other file onto this location - (instead of merging)". This will allow some other interesting + (instead of merging)". This will allow some other interesting functionality, e.g. external programs that may decide to keep both versions by moving one of them out of the way (mh-rename). - the invocation of the external 'diff' program should be selectable @@ -402,15 +402,15 @@ should strip symbols from binary files in 'make exportnative' - would be nice to be able to invoke DIFFERENT merge programs depending on paths -** We should document other available merge tools, e.g., - idiff [BCP has a copy of the code for idiff that Norman sent.] +** We should document other available merge tools, e.g., + idiff [BCP has a copy of the code for idiff that Norman sent.] ** Allow 'default.prf' in place of 'default' for profile names ** [dlux@dlux.hu, Feb 2002] For some apps (e.g., some mail readers?), putting temp files in the same directory as the file we're about to overwrite is bad/dangerous. Some alternatives that we could - consider... + consider... - Add a configuration option for temporary directory and notice the user about the volume restrictions in the docs and then if the user does not consider it, then we use a non-atomic (copy + unlink) @@ -428,11 +428,11 @@ should strip symbols from binary files in 'make exportnative' - in the preference file, each value looks like either prefname = string or - prefname = string WHEN Path PPPPP + prefname = string WHEN Path PPPPP prefname = string WHEN Name XXXXX prefname = string WHEN Regex XXXXX - when we look up such a preference, we provide a current path, and it - returns the one that matches the current path, if any + returns the one that matches the current path, if any ** Would be good to (optionally) change the semantics of the "backup" functionality, so that Unison would not insist on making a *full* @@ -494,7 +494,7 @@ should strip symbols from binary files in 'make exportnative' file:////share/subdir (//share/subdir as from the point of view of the local file system) unison://host///share/subdir - -- + -- Should local roots in a profile be canonized? Right now, we can have a relative root in the profile. This is going to be a problem if unison is started in a different @@ -519,7 +519,7 @@ should strip symbols from binary files in 'make exportnative' * The -terse preference should suppress more (in fact, almost all) messages in the text ui. See Dale Worley's message for a detailed - proposal. + proposal. * [Joerg von den Hoff, 2009] I use unison (up to now) only from the command line and it's used from within scripts or Makefiles. it is therefore @@ -530,7 +530,7 @@ should strip symbols from binary files in 'make exportnative' GUI regularly will start it anyway by double clicking the app) Would be nice to have the Unison log file relative to my home directory, - like this + like this logfile = ~/.unision/log or logfile = $HOME/.unision/log @@ -659,7 +659,7 @@ maybe put backup files somewhere other than in the replica (e.g. in Better documentation of the -backups flag, and a way to expire old backups -Add a preference that makes the reconciler ignore prefs-only differences +Add a preference that makes the reconciler ignore prefs-only differences between files (not updating the archive, though -- just suppressing the difference -- will this slow things down too much?? Maybe it needs to happen in the update detector, before things are transmitted across @@ -709,17 +709,17 @@ the local host and which side the remote host is. ** In menu Actions - show Diff applies to the current line, while - - revert to unision's recommandation applies to all lines + - revert to unision's recommandation applies to all lines Should be clearer and/or homogeneous behavior. I would also like to have "revert to unision's recommandation" for the - current line. + current line. ** in gtk ui, display green checkmark next to finished items even if their direction indicates a conflict; do not list such items as "skipped" at the end ** In both UIs, show how many bytes/files were successfully transferred - at the end + at the end ** Should support auto-termination of the graphical UI (switch-controlled) * Unison starts in the usual way and checks for changes @@ -747,10 +747,10 @@ the local host and which side the remote host is. are lots of errors in a subdir, only the first will be reported. Recon.propagateUpdates would be a starting point for changes. -* [Jamey Leifer] +* [Jamey Leifer] Would be nice if both UIs had a "revert to Unison's proposal" button... -* [Jamey Leifer] +* [Jamey Leifer] [graphic ui, wishlist] The documentation topics aren't searchable. As a result "unison -doc running | less" is still indispensable if one wants to find anything. I suggest adding a box @@ -774,7 +774,7 @@ the local host and which side the remote host is. * The unison gui currently displays a percentage completion in the lower right corner. I would find it comforting if it would also display an effective bandwidth there, i.e., how many bits per second are flowing through the - transport layer? I make this request because owing to a hardware + transport layer? I make this request because owing to a hardware catastrophe, I have just started using Unison through the phone lines, and it seems to do nothing for a long period of time. I don't know whether to blame the cheap modem, the cheap ISP, or whether Unison simply isn't @@ -813,10 +813,10 @@ the local host and which side the remote host is. especially attractive if my short names were meaningful on the command line. -* In the GTK user interface, it would be nice to be able to put up a window +* In the GTK user interface, it would be nice to be able to put up a window displaying the contents of the log file (and add log messages to it dynamically as we're working). Be careful, though: the log could get - large and we don't want this to be too slow. + large and we don't want this to be too slow. * Could there be an option between -ui text and -ui graphic that when combine with -batch and -auto would start in text mode, but pop up an interactive @@ -856,7 +856,7 @@ It would be nice to have a command in the GUI that would allow a single The scroll bar is not usable during transport: every time a line changes in the list, the display jumps to that line; if many small files are - transfered, it makes browsing in the list quite impossible... + transfered, it makes browsing in the list quite impossible... [From Manuel Serrano] Would be nice to put the arrows in different directions in different colors, so that, e.g., you could quickly scan the @@ -891,7 +891,7 @@ Make it possible to select a bunch of conflicts at the same time and The UI window should display the current roots somewhere. There should be a -geometry command-line interface, following the usual X - conventions. + conventions. put in a command-line option that makes fatal errors exit right away without displaying anything in the graphical UI (for debugging) @@ -902,7 +902,7 @@ Use the CTree widget to display the list of files it would be nice to give a visual indication of which files are particularly big, so that the user can tell where the transfer operations may get slowed down. Maybe a "size bar" showing the log - of the size (perhaps also color coded). + of the size (perhaps also color coded). ===> less urgent now because we can re-sort the update items by size Would it be hard to allow long-running transfers to be aborted? @@ -919,7 +919,7 @@ It would be nice if the initial 'usage' message were not so long. Maybe the novice ones (with an indication how to obtain the full expert printout). -> Show diff should behave as an emacs view-mode buffer and quit on a single +> Show diff should behave as an emacs view-mode buffer and quit on a single > 'q' in the window, or better quit even without focus be sent to the diff > window... The UI for the diff functionality needs some polishing. (Also, it should @@ -932,22 +932,22 @@ would be nice to be able to "Proceed" just the selected line might be nice if the GUI would beep when finished syncing (needs to be switch-selectable and off by default, naturally). Is this easy with - LablGTK? + LablGTK? It would be nice to be able to STOP the GUI in the middle of propagating - changes. + changes. * TIDYING * ======= * Go through the sources and make all fatal and transient error messages - as informative as possible + as informative as possible More documentation (especially in the interface files) is always nice. In particular, there isn't enough documentation of the big picture. - It isn't clear how to fit together archives, servers, paths, roots, - update detection, reconciliation, conflict resolution, or the user + It isn't clear how to fit together archives, servers, paths, roots, + update detection, reconciliation, conflict resolution, or the user interface... Ocamlexc v1.0, the uncaught exceptions analyzer for Objective Caml is now @@ -959,12 +959,12 @@ Ocamlexc v1.0, the uncaught exceptions analyzer for Objective Caml is now * ================= Fast update checking would be cool... Some resources: - FAM (used in Enlightenment) + FAM (used in Enlightenment) dnotify (linux 2.4) BSD kqueue the "VFS stacking layer" implemented by a guy at Columbia -[From JMS] +[From JMS] Some update detection speed improvement suggestions: - Read the FFS (Fast Filesystem) paper for hints - change the working directory instead of using absolute paths; this @@ -979,7 +979,7 @@ Rewrite recon.ml in a more modular way. Probably, have for each property It would be good to have a graphical interface allowing management and editing of profiles, ignore patterns, etc. Or, less ambitiously, just - have UI options for all command-line options (killServer) + have UI options for all command-line options (killServer) How about a facility so that you can specify more than one pair of file systems for a single invocation of Unison? This would be like @@ -1011,7 +1011,7 @@ It might be nice to implement an (optional) safety check that detects complains if it finds any. This should not be *too* expensive, since we already know all the inode numbers. (Even if it *is* expensive, it might be useful to allow users to do this occasionally, if they are - paranoid.) + paranoid.) * WINDOWS ISSUES @@ -1021,18 +1021,18 @@ Suggestion from Arnaud: I have been using XP for a while and despite all the problems I have, there is a very nice feature: being able to mount remote folders (nothing new), to work with them offline and synchronize them. Really useful. - -- + -- A good way to simulate this with Unison would be to package it as a shell extension. From the desktop by clicking on the right button the user selects "create new Unison mount point" and answers a few trivial question. And the rest is done in the background. There are a lot of examples of shell extensions and there is a really good book for O'Reilly about it. - -- + -- A good project for a student :-) - -- + -- PS: see http://www.simplythebest.net/shellenh.html for some examples. -NTFS seems to have two ways of setting a file read-only! +NTFS seems to have two ways of setting a file read-only! Comments from Karl Moerder: Tonight I made some files read-only on my desktop at home. I did this by setting global read and execute permissions (from the security tab of @@ -1052,6 +1052,6 @@ Comments from Karl Moerder: (added for NTFS file systems). The new way has rwxdpo bits for each group (and there can be several groups). -Local Variables: +Local Variables: mode: outline -End: +End: diff --git a/src/abort.ml b/src/abort.ml index 3388400..dc5fe6b 100644 --- a/src/abort.ml +++ b/src/abort.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/abort.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/bytearray.ml b/src/bytearray.ml index 970dec8..44df2d9 100644 --- a/src/bytearray.ml +++ b/src/bytearray.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/bytearray.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/case.ml b/src/case.ml index ad9a99d..c366d06 100644 --- a/src/case.ml +++ b/src/case.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/case.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/checksum.ml b/src/checksum.ml index 0f82398..ac062c3 100644 --- a/src/checksum.ml +++ b/src/checksum.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/checksum.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -38,7 +38,7 @@ let rec power v n = (* roll: If [init l] => I, then I_n = n * 16381 ^ (l + 1), for 0 <= n < 256 *) (* NB: 256 is the upper-bound of ASCII code returned by Char.code *) -let init l = +let init l = let p = power 16381 (l + 1) in Array.init 256 (fun i -> (i * p) land 0x7fffffff) diff --git a/src/checksum.mli b/src/checksum.mli index 958fb6f..b8f74a9 100644 --- a/src/checksum.mli +++ b/src/checksum.mli @@ -5,7 +5,7 @@ type t = int type u = int array val init : int (* blockSize *) - -> u (* pre-computed table *) + -> u (* pre-computed table *) val substring : string -> int (* offset in string *) diff --git a/src/clroot.ml b/src/clroot.ml index ce477b9..bef2b4a 100644 --- a/src/clroot.ml +++ b/src/clroot.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/clroot.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/common.ml b/src/common.ml index 5860aa2..513e6fd 100644 --- a/src/common.ml +++ b/src/common.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/common.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -215,7 +215,7 @@ let partiallyProblematic ri = match ri.replicas with Problem _ -> true - | Different diff -> + | Different diff -> isConflict diff.direction || diff.errors1 <> [] || diff.errors2 <> [] let isDeletion ri = diff --git a/src/copy.ml b/src/copy.ml index 21b559c..b9e10f6 100644 --- a/src/copy.ml +++ b/src/copy.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/copy.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -50,7 +50,7 @@ let checkForChangesToSourceLocal (* Retrieve attributes of current source file *) let sourceInfo = Fileinfo.get true fspathFrom pathFrom in match newFpOpt with - None -> + None -> (* no newfp provided: so we need to compare the archive with the current source *) let clearlyChanged = @@ -91,7 +91,7 @@ let checkForChangesToSourceLocal "The source file %s\nhas been modified during synchronization. \ Transfer aborted." (Fspath.toPrintString (Fspath.concat fspathFrom pathFrom)))) - | Some newfp -> + | Some newfp -> (* newfp provided means that the archive contains a pseudo-fingerprint... *) assert (Os.isPseudoFingerprint archFp); (* ... so we can't compare the archive with the source; instead we @@ -890,10 +890,10 @@ let transferFileReg = Lwt_util.make_region 440 let bufferSize sz = (* Token queue *) - min 64 ((truncate (Uutil.Filesize.toFloat sz) + 1023) / 1024) + min 64 ((truncate (Uutil.Filesize.toFloat sz) + 1023) / 1024) + (* Read buffer *) - 8 + 8 let transferFile rootFrom pathFrom rootTo fspathTo pathTo realPathTo @@ -965,7 +965,7 @@ let file rootFrom pathFrom rootTo fspathTo pathTo realPathTo debug (fun() -> Util.msg "Archive data for %s is a pseudo-fingerprint: double-checking...\n" (Path.toString realPathTo)); - + checkForChangesToSource rootFrom pathFrom desc fp stamp ress (Some newfp) false >>= (fun () -> @@ -993,7 +993,7 @@ let recursively fspathFrom pathFrom fspathTo pathTo = debug (fun () -> Util.msg " Copying file %s / %s to %s / %s\n" (Fspath.toDebugString fspathFrom) (Path.toString pFrom) (Fspath.toDebugString fspathTo) (Path.toString pTo)); - localFile fspathFrom pFrom fspathTo pTo pTo + localFile fspathFrom pFrom fspathTo pTo pTo `Copy info.Fileinfo.desc (Osx.ressLength info.Fileinfo.osX.Osx.ressInfo) None | `DIRECTORY -> diff --git a/src/external.ml b/src/external.ml index 7c522a7..41a51d9 100644 --- a/src/external.ml +++ b/src/external.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/external.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -69,7 +69,7 @@ let runExternalProgram cmd = "\n\n" ^ Util.process_status_to_string returnValue else "") in - Lwt.return (returnValue,mergeResultLog) + Lwt.return (returnValue,mergeResultLog) end else let (out, ipt, err) as desc = System.open_process_full cmd in let out = Lwt_unix.intern_in_channel out in diff --git a/src/fileinfo.ml b/src/fileinfo.ml index 77e1201..a994de1 100644 --- a/src/fileinfo.ml +++ b/src/fileinfo.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fileinfo.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -52,12 +52,12 @@ type t = { typ : typ; inode : int; desc : Props.t; osX : Osx.info} let statFn fromRoot fspath path = let fullpath = Fspath.concat fspath path in let stats = Fs.lstat fullpath in - if stats.Unix.LargeFile.st_kind = Unix.S_LNK - && fromRoot + if stats.Unix.LargeFile.st_kind = Unix.S_LNK + && fromRoot && Path.followLink path then begin Fswatch.followLink path; - try Fs.stat fullpath + try Fs.stat fullpath with Unix.Unix_error((Unix.ENOENT | Unix.ENOTDIR),_,_) -> raise (Util.Transient (Printf.sprintf "Path %s is marked 'follow' but its target is missing" diff --git a/src/files.ml b/src/files.ml index c09c734..3728c92 100644 --- a/src/files.ml +++ b/src/files.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/files.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -19,14 +19,14 @@ open Common open Lwt open Fileinfo - + let debug = Trace.debug "files" let debugverbose = Trace.debug "files+" - + (* ------------------------------------------------------------ *) - + let commitLogName = Util.fileInHomeDir "DANGER.README" - + let writeCommitLog source target tempname = let sourcename = Fspath.toDebugString source in let targetname = Fspath.toDebugString target in @@ -51,7 +51,7 @@ let clearCommitLog () = Util.convertUnixErrorsToFatal "clearing commit log" (fun () -> System.unlink commitLogName) - + let processCommitLog () = if System.file_exists commitLogName then begin raise(Util.Fatal( @@ -62,10 +62,10 @@ let processCommitLog () = (System.fspathToPrintString commitLogName))) end else Lwt.return () - + let processCommitLogOnHost = Remote.registerHostCmd "processCommitLog" processCommitLog - + let processCommitLogs() = Lwt_unix.run (Globals.allHostsIter (fun h -> processCommitLogOnHost h ())) @@ -238,7 +238,7 @@ let performRename fspathTo localPathTo workingDir pathFrom pathTo prevArch = Util.msg "back from Fileinfo.get from renameLocal\n"); if filetypeFrom = `ABSENT then raise (Util.Transient (Printf.sprintf "Error while renaming %s to %s -- source file has disappeared!" - (Fspath.toPrintString source) (Fspath.toPrintString target))); + (Fspath.toPrintString source) (Fspath.toPrintString target))); let filetypeTo = (Fileinfo.get false target Path.empty).Fileinfo.typ in (* Windows and Unix operate differently if the target path of a @@ -289,11 +289,11 @@ let performRename fspathTo localPathTo workingDir pathFrom pathTo prevArch = Stasher.backup fspathTo localPathTo `ByCopying prevArch; Os.rename "renameLocal(3)" source Path.empty target Path.empty; debug (fun() -> - if filetypeFrom = `FILE then + if filetypeFrom = `FILE then Util.msg "Contents of %s after renaming = %s\n" (Fspath.toDebugString target) - (Fingerprint.toString (Fingerprint.file target Path.empty))); + (Fingerprint.toString (Fingerprint.file target Path.empty))); end) (* FIX: maybe we should rename the destination before making any check ? *) @@ -657,7 +657,7 @@ let rec diff root1 path1 ui1 root2 path2 ui2 showDiff id = "CURRENT2", Fspath.quotes fspath2] in let c = System.open_process_in (if Util.osType = `Win32 && not Util.isCygwin then - (* BCP: Proposed by Karl M. to deal with the standard windows + (* BCP: Proposed by Karl M. to deal with the standard windows command processor's weird treatment of spaces and quotes: *) "\"" ^ cmd ^ "\"" else @@ -690,7 +690,7 @@ let rec diff root1 path1 ui1 root2 path2 ui2 showDiff id = fp2 None ress2 id) >>= fun info -> Lwt.return ()); displayDiff - (Fspath.concat workingDir realPath) + (Fspath.concat workingDir realPath) (Fspath.concat workingDir tmppath); Os.delete workingDir tmppath) | (Remote host1,fspath1),(Local,fspath2) -> @@ -710,7 +710,7 @@ let rec diff root1 path1 ui1 root2 path2 ui2 showDiff id = Lwt.return ())); displayDiff (Fspath.concat workingDir tmppath) - (Fspath.concat workingDir realPath); + (Fspath.concat workingDir realPath); Os.delete workingDir tmppath) | (Remote host1,fspath1),(Remote host2,fspath2) -> assert false @@ -764,27 +764,27 @@ let formatMergeCmd p f1 f2 backup out1 out2 outarch = let cooked = match backup with None -> begin - let cooked = Util.replacesubstring cooked "CURRENTARCHOPT" "" in - match Util.findsubstring "CURRENTARCH" cooked with - None -> cooked - | Some _ -> raise (Util.Transient + let cooked = Util.replacesubstring cooked "CURRENTARCHOPT" "" in + match Util.findsubstring "CURRENTARCH" cooked with + None -> cooked + | Some _ -> raise (Util.Transient ("No archive found, but the 'merge' command " ^ "template expects one. (Consider enabling " ^ "'backupcurrent' for this file or using CURRENTARCHOPT " ^ "instead of CURRENTARCH.)")) end | Some(s) -> - let cooked = Util.replacesubstring cooked "CURRENTARCHOPT" s in - let cooked = Util.replacesubstring cooked "CURRENTARCH" s in + let cooked = Util.replacesubstring cooked "CURRENTARCHOPT" s in + let cooked = Util.replacesubstring cooked "CURRENTARCH" s in cooked in let cooked = Util.replacesubstring cooked "NEW1" out1 in let cooked = Util.replacesubstring cooked "NEW2" out2 in let cooked = Util.replacesubstring cooked "NEWARCH" outarch in let cooked = Util.replacesubstring cooked "NEW" out1 in let cooked = Util.replacesubstring cooked "PATH" - (Uutil.quotes (Path.toString p)) in + (Uutil.quotes (Path.toString p)) in cooked - + let copyBack fspathFrom pathFrom rootTo pathTo propsTo uiTo id = setupTargetPaths rootTo pathTo >>= (fun (workingDirForCopy, realPathTo, tempPathTo, localPathTo) -> @@ -798,8 +798,8 @@ let copyBack fspathFrom pathFrom rootTo pathTo propsTo uiTo id = debugverbose (fun () -> Util.msg "rename from copyBack\n"); rename rootTo localPathTo workingDirForCopy tempPathTo realPathTo uiTo None false) - -let keeptempfilesaftermerge = + +let keeptempfilesaftermerge = Prefs.createBool "keeptempfilesaftermerge" false "*" "" @@ -813,7 +813,7 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = (Path.toString path1) (root2string root1) (root2string root2)); (* The following assumes root1 is always local: switch them if needed to make this so *) - let (root1,path1,ui1,root2,path2,ui2) = + let (root1,path1,ui1,root2,path2,ui2) = match root1 with (Local,fspath1) -> (root1,path1,ui1,root2,path2,ui2) | _ -> (root2,path2,ui2,root1,path1,ui1) in @@ -824,7 +824,7 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = let localPath1 = Update.translatePathLocal fspath1 path1 in (localPath1, Fspath.findWorkingDir fspath1 localPath1, fspath1) | _ -> assert false in - + (* We're going to be doing a lot of copying, so let's define a shorthand that fixes most of the arguments to Copy.localfile *) let copy l = @@ -839,71 +839,71 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = `Copy info.Fileinfo.desc (Osx.ressLength info.Fileinfo.osX.Osx.ressInfo) (Some id)) l in - + let working1 = Path.addPrefixToFinalName basep (tempName "merge1-") in let working2 = Path.addPrefixToFinalName basep (tempName "merge2-") in let workingarch = Path.addPrefixToFinalName basep (tempName "mergearch-") in let new1 = Path.addPrefixToFinalName basep (tempName "mergenew1-") in let new2 = Path.addPrefixToFinalName basep (tempName "mergenew2-") in let newarch = Path.addPrefixToFinalName basep (tempName "mergenewarch-") in - + let (desc1, fp1, ress1, desc2, fp2, ress2) = Common.fileInfos ui1 ui2 in - + Util.convertUnixErrorsToTransient "merging files" (fun () -> (* Install finalizer (below) in case we unwind the stack *) Util.finalize (fun () -> - + (* Make local copies of the two replicas *) Os.delete workingDirForMerge working1; Os.delete workingDirForMerge working2; Os.delete workingDirForMerge workingarch; Lwt_unix.run - (Copy.file + (Copy.file root1 localPath1 root1 workingDirForMerge working1 basep `Copy desc1 fp1 None ress1 id >>= fun info -> Lwt.return ()); Lwt_unix.run - (Update.translatePath root2 path2 >>= (fun path2 -> - Copy.file - root2 path2 root1 workingDirForMerge working2 basep - `Copy desc2 fp2 None ress2 id) >>= fun info -> + (Update.translatePath root2 path2 >>= (fun path2 -> + Copy.file + root2 path2 root1 workingDirForMerge working2 basep + `Copy desc2 fp2 None ress2 id) >>= fun info -> Lwt.return ()); - + (* retrieve the archive for this file, if any *) let arch = - match ui1, ui2 with - | Updates (_, Previous (_,_,fp,_)), Updates (_, Previous (_,_,fp2,_)) -> - if fp = fp2 then - Stasher.getRecentVersion fspath1 localPath1 fp - else - assert false - | NoUpdates, Updates(_, Previous (_,_,fp,_)) - | Updates(_, Previous (_,_,fp,_)), NoUpdates -> - Stasher.getRecentVersion fspath1 localPath1 fp - | Updates (_, New), Updates(_, New) - | Updates (_, New), NoUpdates - | NoUpdates, Updates (_, New) -> - debug (fun () -> Util.msg "File is new, no current version will be searched"); - None - | _ -> assert false in - - (* Make a local copy of the archive file (in case the merge program + match ui1, ui2 with + | Updates (_, Previous (_,_,fp,_)), Updates (_, Previous (_,_,fp2,_)) -> + if fp = fp2 then + Stasher.getRecentVersion fspath1 localPath1 fp + else + assert false + | NoUpdates, Updates(_, Previous (_,_,fp,_)) + | Updates(_, Previous (_,_,fp,_)), NoUpdates -> + Stasher.getRecentVersion fspath1 localPath1 fp + | Updates (_, New), Updates(_, New) + | Updates (_, New), NoUpdates + | NoUpdates, Updates (_, New) -> + debug (fun () -> Util.msg "File is new, no current version will be searched"); + None + | _ -> assert false in + + (* Make a local copy of the archive file (in case the merge program overwrites it and the program crashes before the call to the Stasher). *) begin - match arch with - Some fspath -> - let info = Fileinfo.get false fspath Path.empty in - Copy.localFile - fspath Path.empty - workingDirForMerge workingarch workingarch - `Copy - info.Fileinfo.desc - (Osx.ressLength info.Fileinfo.osX.Osx.ressInfo) - None - | None -> - () + match arch with + Some fspath -> + let info = Fileinfo.get false fspath Path.empty in + Copy.localFile + fspath Path.empty + workingDirForMerge workingarch workingarch + `Copy + info.Fileinfo.desc + (Osx.ressLength info.Fileinfo.osX.Osx.ressInfo) + None + | None -> + () end; - + (* run the merge command *) Os.delete workingDirForMerge new1; Os.delete workingDirForMerge new2; @@ -922,10 +922,10 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = (Fspath.quotes (Fspath.concat workingDirForMerge new2)) (Fspath.quotes (Fspath.concat workingDirForMerge newarch)) in Trace.log (Printf.sprintf "Merge command: %s\n" cmd); - + let returnValue, mergeResultLog = Lwt_unix.run (External.runExternalProgram cmd) in - + Trace.log (Printf.sprintf "Merge result (%s):\n%s\n" (showStatus returnValue) mergeResultLog); debug (fun () -> Util.msg "Merge result = %s\n" @@ -941,8 +941,8 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = (Printf.sprintf "Results of merging %s" (Path.toString path1)) mergeResultLog) then raise (Util.Transient ("Merge command canceled by the user")); - - (* It's useful for now to be a bit verbose about what we're doing, but let's + + (* It's useful for now to be a bit verbose about what we're doing, but let's keep it easy to switch this to debug-only in some later release... *) let say f = f() in @@ -952,12 +952,12 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = let new1exists = Fs.file_exists (Fspath.concat workingDirForMerge new1) in let new2exists = Fs.file_exists (Fspath.concat workingDirForMerge new2) in let newarchexists = Fs.file_exists (Fspath.concat workingDirForMerge newarch) in - + if new1exists && new2exists then begin - if newarchexists then - say (fun () -> Util.msg "Three outputs detected \n") - else - say (fun () -> Util.msg "Two outputs detected \n"); + if newarchexists then + say (fun () -> Util.msg "Three outputs detected \n") + else + say (fun () -> Util.msg "Two outputs detected \n"); let info1 = Fileinfo.get false workingDirForMerge new1 in let info2 = Fileinfo.get false workingDirForMerge new2 in let fp1' = Os.fingerprint workingDirForMerge new1 info1 in @@ -965,38 +965,38 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = if fp1'=fp2' then begin debug (fun () -> Util.msg "Two outputs equal => update the archive\n"); copy [(new1,working1); (new2,working2); (new1,workingarch)]; - end else - if returnValue = Unix.WEXITED 0 then begin + end else + if returnValue = Unix.WEXITED 0 then begin say (fun () -> (Util.msg "Two outputs not equal but merge command returned 0, so we will\n"; - Util.msg "overwrite the other replica and the archive with the first output\n")); - copy [(new1,working1); (new1,working2); (new1,workingarch)]; - end else begin + Util.msg "overwrite the other replica and the archive with the first output\n")); + copy [(new1,working1); (new1,working2); (new1,workingarch)]; + end else begin say (fun () -> (Util.msg "Two outputs not equal and the merge command exited with nonzero status, \n"; - Util.msg "so we will copy back the new files but not update the archive\n")); - copy [(new1,working1); (new2,working2)]; - - end + Util.msg "so we will copy back the new files but not update the archive\n")); + copy [(new1,working1); (new2,working2)]; + + end end - + else if new1exists && (not new2exists) && (not newarchexists) then begin - if returnValue = Unix.WEXITED 0 then begin + if returnValue = Unix.WEXITED 0 then begin say (fun () -> Util.msg "One output detected \n"); copy [(new1,working1); (new1,working2); (new1,workingarch)]; - end else begin + end else begin say (fun () -> Util.msg "One output detected but merge command returned nonzero exit status\n"); raise (Util.Transient "One output detected but merge command returned nonzero exit status\n") end end - + else if (not new1exists) && new2exists && (not newarchexists) then begin assert false end - + else if (not new1exists) && (not new2exists) && (not newarchexists) then begin say (fun () -> Util.msg "No outputs detected \n"); let working1_still_exists = Fs.file_exists (Fspath.concat workingDirForMerge working1) in let working2_still_exists = Fs.file_exists (Fspath.concat workingDirForMerge working2) in - + if working1_still_exists && working2_still_exists then begin say (fun () -> Util.msg "No output from merge cmd and both original files are still present\n"); let info1' = Fileinfo.get false workingDirForMerge working1 in @@ -1015,29 +1015,29 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = say (fun () -> Util.msg "Merge program changed just second input\n"); copy [(working2,working1);(working2,workingarch)] end else - if returnValue <> Unix.WEXITED 0 then - raise (Util.Transient ("Error: the merge function changed both of " + if returnValue <> Unix.WEXITED 0 then + raise (Util.Transient ("Error: the merge function changed both of " ^ "its inputs but did not make them equal")) - else begin - say (fun () -> (Util.msg "Merge program changed both of its inputs in"; - Util.msg "different ways, but returned zero.\n")); + else begin + say (fun () -> (Util.msg "Merge program changed both of its inputs in"; + Util.msg "different ways, but returned zero.\n")); (* Note that we assume the merge program knew what it was doing when it returned 0 -- i.e., we assume a zero result means that the files are "morally equal" and either can be replaced by the other; we therefore choose one of them (#2) as the unique new result, so that we can update Unison's archive and call the file 'in sync' again. *) copy [(working2,working1);(working2,workingarch)]; - end + end end - - else if working1_still_exists && (not working2_still_exists) - && returnValue = Unix.WEXITED 0 then begin + + else if working1_still_exists && (not working2_still_exists) + && returnValue = Unix.WEXITED 0 then begin say (fun () -> Util.msg "No outputs and second replica has been deleted \n"); copy [(working1,working2); (working1,workingarch)]; end - - else if (not working1_still_exists) && working2_still_exists - && returnValue = Unix.WEXITED 0 then begin + + else if (not working1_still_exists) && working2_still_exists + && returnValue = Unix.WEXITED 0 then begin say (fun () -> Util.msg "No outputs and first replica has been deleted \n"); copy [(working2,working1); (working2,workingarch)]; end @@ -1046,16 +1046,16 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = ^ "inputs and generated no output!")) end else begin say (fun() -> Util.msg "The merge program exited with nonzero status and did not leave"; - Util.msg " both files equal"); - raise (Util.Transient ("Error: the merge program failed and did not leave" - ^ " both files equal")) + Util.msg " both files equal"); + raise (Util.Transient ("Error: the merge program failed and did not leave" + ^ " both files equal")) end end else begin assert false end; Lwt_unix.run - (debug (fun () -> Util.msg "Committing results of merge\n"); + (debug (fun () -> Util.msg "Committing results of merge\n"); copyBack workingDirForMerge working1 root1 path1 desc1 ui1 id >>= (fun () -> copyBack workingDirForMerge working2 root2 path2 desc2 ui2 id >>= (fun () -> let arch_fspath = Fspath.concat workingDirForMerge workingarch in @@ -1076,11 +1076,11 @@ let merge root1 path1 ui1 root2 path2 ui2 id showMergeFn = Update.replaceArchive root1 path1 new_archive_entry >>= fun _ -> Update.replaceArchive root2 path2 new_archive_entry >>= fun _ -> Lwt.return () - end else + end else (Lwt.return ()) )))) ) (fun _ -> Util.ignoreTransientErrors - (fun () -> + (fun () -> if not (Prefs.read keeptempfilesaftermerge) then begin Os.delete workingDirForMerge working1; Os.delete workingDirForMerge working2; diff --git a/src/files.mli b/src/files.mli index b357c98..1f17f92 100644 --- a/src/files.mli +++ b/src/files.mli @@ -78,8 +78,8 @@ val merge : -> Path.t (* path to merge *) -> Common.updateItem (* differences from the archive *) -> Uutil.File.t (* id for showing progress of transfer *) - -> (string->string->bool) (* function to display the (title and) result - and ask user for confirmation (when -batch - is true, the function should not ask any - questions and should always return true) *) + -> (string->string->bool) (* function to display the (title and) result + and ask user for confirmation (when -batch + is true, the function should not ask any + questions and should always return true) *) -> unit diff --git a/src/fileutil.ml b/src/fileutil.ml index 0cd0706..79390aa 100644 --- a/src/fileutil.ml +++ b/src/fileutil.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fileutil.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/fingerprint.ml b/src/fingerprint.ml index c5b5b83..21a9099 100644 --- a/src/fingerprint.ml +++ b/src/fingerprint.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fingerprint.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -19,12 +19,12 @@ (* INCREMENT "UPDATE.ARCHIVEFORMAT" *) type t = string -let pseudo_prefix = "LEN" +let pseudo_prefix = "LEN" let pseudo path len = pseudo_prefix ^ (Uutil.Filesize.toString len) ^ "@" ^ (Digest.string (Path.toString path)) - -let ispseudo f = Util.startswith f pseudo_prefix + +let ispseudo f = Util.startswith f pseudo_prefix (* Assumes that (fspath, path) is a file and gives its ``digest '', that is *) (* a short string of cryptographic quality representing it. *) @@ -82,7 +82,7 @@ let toString md5 = string.[2*i + 1] <- c2; done; string - end + end let string = Digest.string @@ -100,4 +100,3 @@ let hash d = end let equal (d : string) d' = d = d' - diff --git a/src/fpcache.ml b/src/fpcache.ml index 8a73876..7492802 100644 --- a/src/fpcache.ml +++ b/src/fpcache.ml @@ -240,7 +240,7 @@ let fastercheckUNSAFE = false "!skip computing fingerprints for new files (experts only!)" ( "THIS FEATURE IS STILL EXPERIMENTAL AND SHOULD BE USED WITH EXTREME CAUTION. " ^ "\n\n" - ^ "When this flag is set to {\\tt true}, Unison will compute a 'pseudo-" + ^ "When this flag is set to {\\tt true}, Unison will compute a 'pseudo-" ^ "fingerprint' the first time it sees a file (either because the file is " ^ "new or because Unison is running for the first time). This enormously " ^ "speeds update detection, but it must be used with care, as it can cause " @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fs.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/fsmonitor.py b/src/fsmonitor.py index b1daef3..2def7dd 100755 --- a/src/fsmonitor.py +++ b/src/fsmonitor.py @@ -1,10 +1,10 @@ #!/usr/bin/python -# a small program to test the possibilities to monitor the file system and +# a small program to test the possibilities to monitor the file system and # log changes on Windowsm Linux, and OSX # -# Originally written by Christoph Gohle (2010) -# Modified by Gene Horodecki for Windows +# Originally written by Christoph Gohle (2010) +# Modified by Gene Horodecki for Windows # Further modified by Benjamin Pierce # should be distributed under GPL @@ -61,10 +61,10 @@ def update_changes(result): f.close() except IOError: mymesg('failed to open log file %s for writing',op.outfile) - + def update_changes_nomangle(result): # In win32 there are no symlinks, therefore file mangling - # is not required + # is not required # remove root from the path: result = relpath(op.root,result) @@ -77,7 +77,7 @@ def update_changes_nomangle(result): f.close() except IOError: mymesg('failed to open log file %s for writing',op.outfile) - + def mangle_filename(path): """because the FSEvents system returns 'real' paths we have to figure out if they have been aliased by a symlink and a 'follow' directive in the unison @@ -95,7 +95,7 @@ This is done here for path. The return value is the path name using symlinks if path.startswith(key): result = os.path.join(op.root,os.path.join(op.symlinks[key]+path[len(key):])) #print 'Match!', result - + return result def make_symlinks(): @@ -115,8 +115,8 @@ def make_symlinks(): p+='/' op.symlinks[os.path.realpath(os.path.join(op.root,p))]=p mydebug('make_symlinks: symlinks to follow %s',op.symlinks) - - + + def relpath(root,path): """returns the path relative to root (which should be absolute) if it is not a path below root or if root is not absolute it returns None @@ -124,21 +124,21 @@ def relpath(root,path): if not os.path.isabs(root): return None - + abspath = os.path.abspath(path) mydebug('relpath: abspath(%s) = %s', path, abspath) - + # make sure the root and abspath both end with a '/' or '\' if sys.platform == 'win32': slash = '\\' else: slash = '/' - + if not root[-1]==slash: root += slash if not abspath[-1]==slash: abspath += slash - + mydebug('relpath: root = %s', root) #print root, abspath @@ -147,15 +147,15 @@ def relpath(root,path): return None mydebug('relpath: relpath = %s',abspath[len(root):]) return abspath[len(root):] - + def my_abspath(path): - """expand path including shell variables and homedir + """expand path including shell variables and homedir to the absolute path """ - return os.path.abspath(os.path.expanduser(os.path.expandvars(path))) - + return os.path.abspath(os.path.expanduser(os.path.expandvars(path))) + def update_follow(path): - """ tries to find a follow directive that matches path + """ tries to find a follow directive that matches path and if path refers to a symbolic link the real path of the symbolic link is returned. """ try: @@ -167,7 +167,7 @@ def update_follow(path): result = None foll = None for k in op.symlinks: - v = op.symlinks[k] + v = op.symlinks[k] if v==rpath: result = os.path.realpath(os.path.abspath(path)) foll = v @@ -175,36 +175,36 @@ def update_follow(path): break if result: op.symlinks[result] = foll - - return result, foll + + return result, foll def conf_parser(conffilepath, delimiter = '=', dic = {}): - """parse the unison configuration file at conffilename and populate a dictionary + """parse the unison configuration file at conffilename and populate a dictionary with configuration options from there. If dic is a dictionary, these options are added to this one (can be used to recursively call this function for include statements).""" - try: - conffile = open(conffilepath,'r') - except IOError: - mydebug('could not open configuration file at %s',conffilepath) - return None - - res = dic - - for line in conffile: - line = line.strip() - if len(line)<1 or line[0]=='#': - continue - elif line.startswith('include'): - dn = os.path.dirname(conffilepath) - fn = line.split()[1].strip() - conf_parser(os.path.join(dn,fn), dic = res) - else: - k,v=[s.strip() for s in line.split('=',1)] - if res.has_key(k): - res[k].append(v) - else: - res[k]=[v] - return res + try: + conffile = open(conffilepath,'r') + except IOError: + mydebug('could not open configuration file at %s',conffilepath) + return None + + res = dic + + for line in conffile: + line = line.strip() + if len(line)<1 or line[0]=='#': + continue + elif line.startswith('include'): + dn = os.path.dirname(conffilepath) + fn = line.split()[1].strip() + conf_parser(os.path.join(dn,fn), dic = res) + else: + k,v=[s.strip() for s in line.split('=',1)] + if res.has_key(k): + res[k].append(v) + else: + res[k]=[v] + return res ################################################ # Linux specific code here @@ -223,10 +223,10 @@ if sys.platform.startswith('linux'): #def process_IN_MODIFY(self, event): # print "Modifying:", event.pathname - + # def process_IN_MOVED_TO(self, event): # print "Moved to:", event.pathname - + # def process_IN_MOVED_FROM(self, event): # print "Moved from:", event.pathname @@ -249,7 +249,7 @@ if sys.platform.startswith('linux'): # print 'move to', event.pathname, self.add_watch(event.pathname,rec=True) # else: # pass - #handle creation of links that should be followed + #handle creation of links that should be followed if os.path.islink(event.pathname): #special handling for links mydebug('process_default: link %s created/changed. Checking for follows', event.pathname) @@ -281,10 +281,10 @@ if sys.platform.startswith('linux'): mydebug('following symbolic link %s',link) if not self.watches.has_key(link): self.watches.update(self.wm.add_watch(link,self.mask,rec=True,auto_add=True)) - + mydebug('init_watches: added paths %s\n based on paths %s\n and follows %s',self.watches,op.abspaths, op.follow) - - + + def linuxwatcher(): p = HandleEvents() wm = pyinotify.WatchManager() # Watch Manager @@ -295,7 +295,7 @@ if sys.platform.startswith('linux'): p.init_watches(op.abspaths, op.follow) notifier.loop() - + ################################################# # END Linux specific code ################################################# @@ -310,10 +310,10 @@ if sys.platform == 'darwin': def filelevel_approx(path): """in order to avoid scanning the entire directory including sub directories by unison, we have to say which files have changed. Because - this is a stupid program it only checks modification times within the + this is a stupid program it only checks modification times within the update interval. in case there are no files modified in this interval, the entire directory is listed. - A deleted file can not be found like this. Therefore also deletes will + A deleted file can not be found like this. Therefore also deletes will trigger a rescan of the directory (including subdirs) The impact of rescans could be limited if one could make @@ -328,7 +328,7 @@ if sys.platform == 'darwin': mydebug("adding nonexisting path %s for sync",path) result.append(path) names = None - + if names: for nm in names: full_path = os.path.join(path,nm) @@ -336,18 +336,18 @@ if sys.platform == 'darwin': #see if the dir it was modified recently if st.st_mtime>time()-float(op.latency): result.append(full_path) - + if result == []: result.append(path) - + return result - + def fsevents_callback(streamRef, clientInfo, numEvents, eventPaths, eventMasks, eventIDs): mydebug("fsevents_callback(streamRef = %s, clientInfo = %s, numEvents = %s)", streamRef, clientInfo, numEvents) mydebug("fsevents_callback: FSEventStreamGetLatestEventId(streamRef) => %s", FSEventStreamGetLatestEventId(streamRef)) mydebug("fsevents_callback: eventpaths = %s",eventPaths) - + full_path = clientInfo result = [] @@ -390,9 +390,9 @@ if sys.platform == 'darwin': #result.append(path) #try to find out what has changed result.extend(filelevel_approx(path)) - + mydebug('Dirs sent: %s',eventPaths) - #TODO: handle creation/deletion of links that should be followed + #TODO: handle creation/deletion of links that should be followed update_changes(result) try: @@ -407,12 +407,12 @@ if sys.platform == 'darwin': if op.sinceWhen == 'now': op.sinceWhen = kFSEventStreamEventIdSinceNow - + try: op.symlinks except AttributeError: make_symlinks() - + for sl in op.symlinks: #check if that path is already there found=False @@ -422,23 +422,23 @@ if sys.platform == 'darwin': found = True break if not found: - mydebug('my_FSEventStreamCreate: watch followed link %s',ln) + mydebug('my_FSEventStreamCreate: watch followed link %s',ln) paths.append(os.path.join(op.root,ln)) - + streamRef = FSEventStreamCreate(kCFAllocatorDefault, fsevents_callback, paths, #will this pass properly through? yes it does. paths, int(op.sinceWhen), float(op.latency), - int(op.flags)) + int(op.flags)) if streamRef is None: mymesg("ERROR: FSEVentStreamCreate() => NULL") return None if op.verbose: FSEventStreamShow(streamRef) - + #print ('my_FSE', streamRef) return streamRef @@ -451,13 +451,13 @@ if sys.platform == 'darwin': #print di['last_item'][-1] op.sinceWhen = di['last_item'][-1] #print op.sinceWhen - + streamRef = my_FSEventStreamCreate(op.abspaths) #print streamRef if streamRef is None: print('failed to get a Stream') exit(1) - + FSEventStreamScheduleWithRunLoop(streamRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode) startedOK = FSEventStreamStart(streamRef) @@ -469,7 +469,7 @@ if sys.platform == 'darwin': mydebug("CFAbsoluteTimeGetCurrent() => %.3f", CFAbsoluteTimeGetCurrent()) timer = CFRunLoopTimerCreate(None, - CFAbsoluteTimeGetCurrent() + float(op.flush_seconds), + CFAbsoluteTimeGetCurrent() + float(op.flush_seconds), float(op.flush_seconds), 0, 0, timer_callback, streamRef) CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopDefaultMode) @@ -492,172 +492,172 @@ if sys.platform == 'darwin': # Windows specific code ################################################# if sys.platform == 'win32': - import win32file - import win32con - - FILE_LIST_DIRECTORY = 0x0001 - - def win32watcherThread(abspath,file_lock): - dirHandle = win32file.CreateFile ( - abspath, - FILE_LIST_DIRECTORY, - win32con.FILE_SHARE_READ | win32con.FILE_SHARE_WRITE, - None, - win32con.OPEN_EXISTING, - win32con.FILE_FLAG_BACKUP_SEMANTICS, - None - ) - while 1: - results = win32file.ReadDirectoryChangesW ( - dirHandle, - 1024, - True, - win32con.FILE_NOTIFY_CHANGE_FILE_NAME | - win32con.FILE_NOTIFY_CHANGE_DIR_NAME | - win32con.FILE_NOTIFY_CHANGE_ATTRIBUTES | - win32con.FILE_NOTIFY_CHANGE_SIZE | - win32con.FILE_NOTIFY_CHANGE_LAST_WRITE | - win32con.FILE_NOTIFY_CHANGE_SECURITY, - None, - None - ) - for action, file in results: - full_filename = os.path.join (abspath, file) - # This will return 'dir updated' for every file update within dir, but - # we don't want to send unison on a full dir sync in this situation. - if not (os.path.isdir(full_filename) and action == 3): - file_lock.acquire() - update_changes_nomangle(full_filename) - file_lock.release() - - def win32watcher(): - file_lock = threading.Lock() - threads = [ threading.Thread(target=win32watcherThread,args=(abspath,file_lock,)) for abspath in op.abspaths ] - for thread in threads: - thread.setDaemon(True) - thread.start() - - try: - while 1: - sleep(3600) - except KeyboardInterrupt: - print "Cleaning up." + import win32file + import win32con + + FILE_LIST_DIRECTORY = 0x0001 + + def win32watcherThread(abspath,file_lock): + dirHandle = win32file.CreateFile ( + abspath, + FILE_LIST_DIRECTORY, + win32con.FILE_SHARE_READ | win32con.FILE_SHARE_WRITE, + None, + win32con.OPEN_EXISTING, + win32con.FILE_FLAG_BACKUP_SEMANTICS, + None + ) + while 1: + results = win32file.ReadDirectoryChangesW ( + dirHandle, + 1024, + True, + win32con.FILE_NOTIFY_CHANGE_FILE_NAME | + win32con.FILE_NOTIFY_CHANGE_DIR_NAME | + win32con.FILE_NOTIFY_CHANGE_ATTRIBUTES | + win32con.FILE_NOTIFY_CHANGE_SIZE | + win32con.FILE_NOTIFY_CHANGE_LAST_WRITE | + win32con.FILE_NOTIFY_CHANGE_SECURITY, + None, + None + ) + for action, file in results: + full_filename = os.path.join (abspath, file) + # This will return 'dir updated' for every file update within dir, but + # we don't want to send unison on a full dir sync in this situation. + if not (os.path.isdir(full_filename) and action == 3): + file_lock.acquire() + update_changes_nomangle(full_filename) + file_lock.release() + + def win32watcher(): + file_lock = threading.Lock() + threads = [ threading.Thread(target=win32watcherThread,args=(abspath,file_lock,)) for abspath in op.abspaths ] + for thread in threads: + thread.setDaemon(True) + thread.start() + + try: + while 1: + sleep(3600) + except KeyboardInterrupt: + print "Cleaning up." ################################################# # END Windows specific code -################################################# +################################################# if __name__=='__main__': - global op + global op - usage = """usage: %prog [options] root [path] [path]... + usage = """usage: %prog [options] root [path] [path]... This program monitors file system changes on all given (relative to root) paths -and dumps paths (relative to root) files to a file. When launched, this file is +and dumps paths (relative to root) files to a file. When launched, this file is recreated. While running new events are added. This can be read by UNISON to trigger a sync on these files. If root is a valid unison profile, we attempt to read all the settings from there.""" - - parser = OptionParser(usage=usage) - parser.add_option("-w", "--sinceWhen", dest="sinceWhen", + + parser = OptionParser(usage=usage) + parser.add_option("-w", "--sinceWhen", dest="sinceWhen", help="""starting point for filesystem updates to be captured - Defaults to 'now' in the first run - or the last caputured change""",default = 'now', metavar="SINCEWHEN") - parser.add_option("-l", "--latency", dest="latency", + Defaults to 'now' in the first run + or the last caputured change""",default = 'now', metavar="SINCEWHEN") + parser.add_option("-l", "--latency", dest="latency", help="set notification LATENCY in seconds. default 5",default = 5, metavar="LATENCY") - parser.add_option("-f", "--flags", dest="flags", + parser.add_option("-f", "--flags", dest="flags", help="(macosx) set flags (who knows what they mean. defaults to 0",default = 0, metavar="FLAGS") - parser.add_option("-s", "--flushseconds", dest="flush_seconds", + parser.add_option("-s", "--flushseconds", dest="flush_seconds", help="(macosx) TIME interval in second until flush is forced. values < 0 turn it off. ",default = 1, metavar="TIME") - parser.add_option("-o", "--outfile", dest="outfile", + parser.add_option("-o", "--outfile", dest="outfile", help="location of the output file. Defaults to UPATH/changes",default = 'changes', metavar="PATH") - parser.add_option("-t", "--statefile", dest="statefile", + parser.add_option("-t", "--statefile", dest="statefile", help="(macosx) location of the state file (absolute or relative to UPATH). Defaults to UPATH/state",default = 'state', metavar="PATH") - parser.add_option("-u", "--unisonconfig", dest="uconfdir", - help='path to the unison config directory. default ~/.unison', - default = '~/.unison', metavar = 'UPATH') - parser.add_option("-z", "--follow", dest="follow", - help="define a FOLLOW directive. This is equivalent to the -follow option in unison \ - (except that for now only 'Paths' are supported). This option can appear multiple times. \ - if a unison configuration file is loaded, it takes precedence over this option", - action='append',metavar = 'FOLLOW') - parser.add_option("-q", "--quiet", - action="store_false", dest="verbose", default=True, - help="don't print status messages to stdout") - - parser.add_option("-d", "--debug", - action="store_true", dest="debug", default=False, - help="print debug messages to stderr") - - - (op, args) = parser.parse_args() - - - if len(args)<1: - parser.print_usage() - sys.exit() - - #other paths - op.absuconfdir = my_abspath(op.uconfdir) - op.absstatus = os.path.join(op.absuconfdir,op.statefile) - op.absoutfile = os.path.join(op.absuconfdir,op.outfile) - - - #figure out if the root argument is a valid configuration file name - p = args[0] - fn = '' - if os.path.exists(p) and not os.path.isdir(p): - fn = p - elif os.path.exists(os.path.join(op.absuconfdir,p)): - fn = os.path.join(op.absuconfdir,p) - op.unison_conf = conf_parser(fn) - - #now check for the relevant information - root = None - paths = None - if op.unison_conf and op.unison_conf.has_key('root'): - #find the local root - root = None - paths = None - for r in op.unison_conf['root']: - if r[0]=='/': - root = r - if op.unison_conf.has_key('path'): - paths = op.unison_conf['path'] - if op.unison_conf and op.unison_conf.has_key('follow'): - op.follow = op.unison_conf['follow'] - else: - #see if follows were defined - try: - op.follow - except AttributeError: - op.follow = [] - - if not root: - #no root up to here. get it from args - root = args[0] - - if not paths: - paths = args[1:] - - #absolute paths - op.root = my_abspath(root) - op.abspaths = [os.path.join(root,path) for path in paths] - if op.abspaths == []: - #no paths specified -> make root the path to observe - op.abspaths = [op.root] - #print op.root - #print op.abspaths - - mydebug('options: %s',op) - mydebug('arguments: %s',args) - - #cleaning up the change file - try: - f=open(op.absoutfile,'w') - f.close() - except IOError: - mymesg('failed to open output file. STOP.') - exit(1) + parser.add_option("-u", "--unisonconfig", dest="uconfdir", + help='path to the unison config directory. default ~/.unison', + default = '~/.unison', metavar = 'UPATH') + parser.add_option("-z", "--follow", dest="follow", + help="define a FOLLOW directive. This is equivalent to the -follow option in unison \ + (except that for now only 'Paths' are supported). This option can appear multiple times. \ + if a unison configuration file is loaded, it takes precedence over this option", + action='append',metavar = 'FOLLOW') + parser.add_option("-q", "--quiet", + action="store_false", dest="verbose", default=True, + help="don't print status messages to stdout") + + parser.add_option("-d", "--debug", + action="store_true", dest="debug", default=False, + help="print debug messages to stderr") + + + (op, args) = parser.parse_args() + + + if len(args)<1: + parser.print_usage() + sys.exit() + + #other paths + op.absuconfdir = my_abspath(op.uconfdir) + op.absstatus = os.path.join(op.absuconfdir,op.statefile) + op.absoutfile = os.path.join(op.absuconfdir,op.outfile) + + + #figure out if the root argument is a valid configuration file name + p = args[0] + fn = '' + if os.path.exists(p) and not os.path.isdir(p): + fn = p + elif os.path.exists(os.path.join(op.absuconfdir,p)): + fn = os.path.join(op.absuconfdir,p) + op.unison_conf = conf_parser(fn) + + #now check for the relevant information + root = None + paths = None + if op.unison_conf and op.unison_conf.has_key('root'): + #find the local root + root = None + paths = None + for r in op.unison_conf['root']: + if r[0]=='/': + root = r + if op.unison_conf.has_key('path'): + paths = op.unison_conf['path'] + if op.unison_conf and op.unison_conf.has_key('follow'): + op.follow = op.unison_conf['follow'] + else: + #see if follows were defined + try: + op.follow + except AttributeError: + op.follow = [] + + if not root: + #no root up to here. get it from args + root = args[0] + + if not paths: + paths = args[1:] + + #absolute paths + op.root = my_abspath(root) + op.abspaths = [os.path.join(root,path) for path in paths] + if op.abspaths == []: + #no paths specified -> make root the path to observe + op.abspaths = [op.root] + #print op.root + #print op.abspaths + + mydebug('options: %s',op) + mydebug('arguments: %s',args) + + #cleaning up the change file + try: + f=open(op.absoutfile,'w') + f.close() + except IOError: + mymesg('failed to open output file. STOP.') + exit(1) #stop watching when stdin is closed def exitThread(): @@ -667,13 +667,11 @@ to read all the settings from there.""" t.setDaemon(True) t.start() - if sys.platform=='darwin': - macosxwatcher() - elif sys.platform.startswith('linux'): - linuxwatcher() - elif sys.platform.startswith('win32'): - win32watcher() - else: - mymesg('unsupported platform %s',sys.platform) - - + if sys.platform=='darwin': + macosxwatcher() + elif sys.platform.startswith('linux'): + linuxwatcher() + elif sys.platform.startswith('win32'): + win32watcher() + else: + mymesg('unsupported platform %s',sys.platform) diff --git a/src/fsmonitor/linux/inotify.ml b/src/fsmonitor/linux/inotify.ml index 205ed19..9861026 100644 --- a/src/fsmonitor/linux/inotify.ml +++ b/src/fsmonitor/linux/inotify.ml @@ -17,62 +17,62 @@ exception Error of string * int type select_event = - | S_Access - | S_Attrib - | S_Close_write - | S_Close_nowrite - | S_Create - | S_Delete - | S_Delete_self - | S_Modify - | S_Move_self - | S_Moved_from - | S_Moved_to - | S_Open - | S_Dont_follow - | S_Mask_add - | S_Oneshot - | S_Onlydir - (* convenience *) - | S_Move - | S_Close - | S_All + | S_Access + | S_Attrib + | S_Close_write + | S_Close_nowrite + | S_Create + | S_Delete + | S_Delete_self + | S_Modify + | S_Move_self + | S_Moved_from + | S_Moved_to + | S_Open + | S_Dont_follow + | S_Mask_add + | S_Oneshot + | S_Onlydir + (* convenience *) + | S_Move + | S_Close + | S_All type type_event = - | Access - | Attrib - | Close_write - | Close_nowrite - | Create - | Delete - | Delete_self - | Modify - | Move_self - | Moved_from - | Moved_to - | Open - | Ignored - | Isdir - | Q_overflow - | Unmount + | Access + | Attrib + | Close_write + | Close_nowrite + | Create + | Delete + | Delete_self + | Modify + | Move_self + | Moved_from + | Moved_to + | Open + | Ignored + | Isdir + | Q_overflow + | Unmount let string_of_event = function - | Access -> "ACCESS" - | Attrib -> "ATTRIB" - | Close_write -> "CLOSE_WRITE" - | Close_nowrite -> "CLOSE_NOWRITE" - | Create -> "CREATE" - | Delete -> "DELETE" - | Delete_self -> "DELETE_SELF" - | Modify -> "MODIFY" - | Move_self -> "MOVE_SELF" - | Moved_from -> "MOVED_FROM" - | Moved_to -> "MOVED_TO" - | Open -> "OPEN" - | Ignored -> "IGNORED" - | Isdir -> "ISDIR" - | Q_overflow -> "Q_OVERFLOW" - | Unmount -> "UNMOUNT" + | Access -> "ACCESS" + | Attrib -> "ATTRIB" + | Close_write -> "CLOSE_WRITE" + | Close_nowrite -> "CLOSE_NOWRITE" + | Create -> "CREATE" + | Delete -> "DELETE" + | Delete_self -> "DELETE_SELF" + | Modify -> "MODIFY" + | Move_self -> "MOVE_SELF" + | Moved_from -> "MOVED_FROM" + | Moved_to -> "MOVED_TO" + | Open -> "OPEN" + | Ignored -> "IGNORED" + | Isdir -> "ISDIR" + | Q_overflow -> "Q_OVERFLOW" + | Unmount -> "UNMOUNT" let int_of_wd wd = wd @@ -90,30 +90,29 @@ external struct_size : unit -> int = "stub_inotify_struct_size" external to_read : Unix.file_descr -> int = "stub_inotify_ioctl_fionread" let read fd = - let ss = struct_size () in - let toread = to_read fd in + let ss = struct_size () in + let toread = to_read fd in - let ret = ref [] in - let buf = String.make toread '\000' in - let toread = Unix.read fd buf 0 toread in + let ret = ref [] in + let buf = String.make toread '\000' in + let toread = Unix.read fd buf 0 toread in - let read_c_string offset len = - let index = ref 0 in - while !index < len && buf.[offset + !index] <> '\000' do incr index done; - String.sub buf offset !index - in + let read_c_string offset len = + let index = ref 0 in + while !index < len && buf.[offset + !index] <> '\000' do incr index done; + String.sub buf offset !index + in - let i = ref 0 in + let i = ref 0 in - while !i < toread - do - let wd, l, cookie, len = convert (String.sub buf !i ss) in - let s = if len > 0 then Some (read_c_string (!i + ss) len) else None in - ret := (wd, l, cookie, s) :: !ret; - i := !i + (ss + len); - done; + while !i < toread + do + let wd, l, cookie, len = convert (String.sub buf !i ss) in + let s = if len > 0 then Some (read_c_string (!i + ss) len) else None in + ret := (wd, l, cookie, s) :: !ret; + i := !i + (ss + len); + done; - List.rev !ret + List.rev !ret let _ = Callback.register_exception "inotify.error" (Error ("register_callback", 0)) - diff --git a/src/fsmonitor/linux/inotify_stubs.c b/src/fsmonitor/linux/inotify_stubs.c index d432cea..d7f608f 100644 --- a/src/fsmonitor/linux/inotify_stubs.c +++ b/src/fsmonitor/linux/inotify_stubs.c @@ -42,109 +42,109 @@ #endif static int inotify_flag_table[] = { - IN_ACCESS, IN_ATTRIB, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE, - IN_CREATE, IN_DELETE, IN_DELETE_SELF, IN_MODIFY, - IN_MOVE_SELF, IN_MOVED_FROM, IN_MOVED_TO, IN_OPEN, - IN_DONT_FOLLOW, IN_MASK_ADD, IN_ONESHOT, IN_ONLYDIR, - IN_MOVE, IN_CLOSE, IN_ALL_EVENTS, 0 + IN_ACCESS, IN_ATTRIB, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE, + IN_CREATE, IN_DELETE, IN_DELETE_SELF, IN_MODIFY, + IN_MOVE_SELF, IN_MOVED_FROM, IN_MOVED_TO, IN_OPEN, + IN_DONT_FOLLOW, IN_MASK_ADD, IN_ONESHOT, IN_ONLYDIR, + IN_MOVE, IN_CLOSE, IN_ALL_EVENTS, 0 }; static int inotify_return_table[] = { - IN_ACCESS, IN_ATTRIB, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE, - IN_CREATE, IN_DELETE, IN_DELETE_SELF, IN_MODIFY, - IN_MOVE_SELF, IN_MOVED_FROM, IN_MOVED_TO, IN_OPEN, - IN_IGNORED, IN_ISDIR, IN_Q_OVERFLOW, IN_UNMOUNT, 0 + IN_ACCESS, IN_ATTRIB, IN_CLOSE_WRITE, IN_CLOSE_NOWRITE, + IN_CREATE, IN_DELETE, IN_DELETE_SELF, IN_MODIFY, + IN_MOVE_SELF, IN_MOVED_FROM, IN_MOVED_TO, IN_OPEN, + IN_IGNORED, IN_ISDIR, IN_Q_OVERFLOW, IN_UNMOUNT, 0 }; static void raise_inotify_error(char const *msg) { - static value *inotify_err = NULL; - value args[2]; + static value *inotify_err = NULL; + value args[2]; - if (!inotify_err) - inotify_err = caml_named_value("inotify.error"); - args[0] = caml_copy_string(msg); - args[1] = Val_int(errno); + if (!inotify_err) + inotify_err = caml_named_value("inotify.error"); + args[0] = caml_copy_string(msg); + args[1] = Val_int(errno); - caml_raise_with_args(*inotify_err, 2, args); + caml_raise_with_args(*inotify_err, 2, args); } value stub_inotify_init(value unit) { - CAMLparam1(unit); - int fd; + CAMLparam1(unit); + int fd; - fd = inotify_init(); - CAMLreturn(Val_int(fd)); + fd = inotify_init(); + CAMLreturn(Val_int(fd)); } value stub_inotify_ioctl_fionread(value fd) { - CAMLparam1(fd); - int rc, bytes; + CAMLparam1(fd); + int rc, bytes; - rc = ioctl(Int_val(fd), FIONREAD, &bytes); - if (rc == -1) - raise_inotify_error("ioctl fionread"); + rc = ioctl(Int_val(fd), FIONREAD, &bytes); + if (rc == -1) + raise_inotify_error("ioctl fionread"); - CAMLreturn(Val_int(bytes)); + CAMLreturn(Val_int(bytes)); } value stub_inotify_add_watch(value fd, value path, value mask) { - CAMLparam3(fd, path, mask); - int cv_mask, wd; - - cv_mask = caml_convert_flag_list(mask, inotify_flag_table); - wd = inotify_add_watch(Int_val(fd), String_val(path), cv_mask); - if (wd < 0) - raise_inotify_error("add_watch"); - CAMLreturn(Val_int(wd)); + CAMLparam3(fd, path, mask); + int cv_mask, wd; + + cv_mask = caml_convert_flag_list(mask, inotify_flag_table); + wd = inotify_add_watch(Int_val(fd), String_val(path), cv_mask); + if (wd < 0) + raise_inotify_error("add_watch"); + CAMLreturn(Val_int(wd)); } value stub_inotify_rm_watch(value fd, value wd) { - CAMLparam2(fd, wd); - int ret; + CAMLparam2(fd, wd); + int ret; - ret = inotify_rm_watch(Int_val(fd), Int_val(wd)); - if (ret == -1) - raise_inotify_error("rm_watch"); - CAMLreturn(Val_unit); + ret = inotify_rm_watch(Int_val(fd), Int_val(wd)); + if (ret == -1) + raise_inotify_error("rm_watch"); + CAMLreturn(Val_unit); } value stub_inotify_struct_size(void) { - CAMLparam0(); - CAMLreturn(Val_int(sizeof(struct inotify_event))); + CAMLparam0(); + CAMLreturn(Val_int(sizeof(struct inotify_event))); } value stub_inotify_convert(value buf) { - CAMLparam1(buf); - CAMLlocal3(event, l, tmpl); - struct inotify_event ev; - int i; - - l = Val_emptylist; - tmpl = Val_emptylist; - - memcpy(&ev, String_val(buf), sizeof(struct inotify_event)); - - for (i = 0; inotify_return_table[i]; i++) { - if (!(ev.mask & inotify_return_table[i])) - continue; - tmpl = caml_alloc_small(2, Tag_cons); - Field(tmpl, 0) = Val_int(i); - Field(tmpl, 1) = l; - l = tmpl; - } - - event = caml_alloc_tuple(4); - Store_field(event, 0, Val_int(ev.wd)); - Store_field(event, 1, l); - Store_field(event, 2, caml_copy_int32(ev.cookie)); - Store_field(event, 3, Val_int(ev.len)); - - CAMLreturn(event); + CAMLparam1(buf); + CAMLlocal3(event, l, tmpl); + struct inotify_event ev; + int i; + + l = Val_emptylist; + tmpl = Val_emptylist; + + memcpy(&ev, String_val(buf), sizeof(struct inotify_event)); + + for (i = 0; inotify_return_table[i]; i++) { + if (!(ev.mask & inotify_return_table[i])) + continue; + tmpl = caml_alloc_small(2, Tag_cons); + Field(tmpl, 0) = Val_int(i); + Field(tmpl, 1) = l; + l = tmpl; + } + + event = caml_alloc_tuple(4); + Store_field(event, 0, Val_int(ev.wd)); + Store_field(event, 1, l); + Store_field(event, 2, caml_copy_int32(ev.cookie)); + Store_field(event, 3, Val_int(ev.len)); + + CAMLreturn(event); } diff --git a/src/fsmonitor/linux/lwt_inotify.ml b/src/fsmonitor/linux/lwt_inotify.ml index bbe6f78..8184494 100644 --- a/src/fsmonitor/linux/lwt_inotify.ml +++ b/src/fsmonitor/linux/lwt_inotify.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/monitoring-linux/lwt_inotify.ml *) -(* Copyright 1999-2012, Benjamin C. Pierce +(* Copyright 1999-2012, Benjamin C. Pierce 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/src/fsmonitor/linux/watcher.ml b/src/fsmonitor/linux/watcher.ml index fdbbc3b..16efed5 100644 --- a/src/fsmonitor/linux/watcher.ml +++ b/src/fsmonitor/linux/watcher.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fsmonitoring/linux/watcher.ml *) -(* Copyright 2012, Benjamin C. Pierce +(* Copyright 2012, Benjamin C. Pierce 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/src/fsmonitor/watchercommon.ml b/src/fsmonitor/watchercommon.ml index 8c6b3bf..b274a64 100644 --- a/src/fsmonitor/watchercommon.ml +++ b/src/fsmonitor/watchercommon.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fsmonitoring/watchercommon.ml *) -(* Copyright 2012, Benjamin C. Pierce +(* Copyright 2012, Benjamin C. Pierce 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 @@ -397,7 +397,7 @@ let gather_changes hash time = we report that it should be scanned again. On the other hand, this is not reported as a change by the WAIT function, so that Unison does not loop checking this path. *) - if r.changed && r.watch = None then path :: l else + if r.changed && r.watch = None then path :: l else gather_rec path r l) roots []) diff --git a/src/fsmonitor/windows/shortnames.ml b/src/fsmonitor/windows/shortnames.ml index 19897f4..2f15979 100644 --- a/src/fsmonitor/windows/shortnames.ml +++ b/src/fsmonitor/windows/shortnames.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/monitoring-linux/lwt_inotify.ml *) -(* Copyright 2012, Benjamin C. Pierce +(* Copyright 2012, Benjamin C. Pierce 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 @@ -47,4 +47,3 @@ let in_directory d = assert false with End_of_file -> !l - diff --git a/src/fsmonitor/windows/watcher.ml b/src/fsmonitor/windows/watcher.ml index 3604ced..fd04ca1 100644 --- a/src/fsmonitor/windows/watcher.ml +++ b/src/fsmonitor/windows/watcher.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/monitoring/windows/watcher.ml *) -(* Copyright 2012, Benjamin C. Pierce +(* Copyright 2012, Benjamin C. Pierce 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 @@ -52,7 +52,7 @@ let event_is_immediate (_, act) = Lwt_win.FILE_ACTION_ADDED | Lwt_win.FILE_ACTION_MODIFIED -> false | Lwt_win.FILE_ACTION_REMOVED - | Lwt_win.FILE_ACTION_RENAMED_OLD_NAME + | Lwt_win.FILE_ACTION_RENAMED_OLD_NAME | Lwt_win.FILE_ACTION_RENAMED_NEW_NAME -> true let event_kind (_, act) = diff --git a/src/fspath.ml b/src/fspath.ml index 6b62e4b..92ee31c 100644 --- a/src/fspath.ml +++ b/src/fspath.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fspath.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -249,16 +249,16 @@ let canonizeFspath p0 = newp with Sys_error why -> - (* We could not chdir to p. Either *) - (* - *) - (* (1) p does not exist *) - (* (2) p is a file *) - (* (3) p is a dir but we don't have permission *) - (* - *) - (* In any case, we try to cd to the parent of p, and if that *) - (* fails, we just quit. This works nicely for most cases of (1), *) - (* it works for (2), and on (3) it may leave a mess for someone *) - (* else to pick up. *) + (* We could not chdir to p. Either *) + (* - *) + (* (1) p does not exist *) + (* (2) p is a file *) + (* (3) p is a dir but we don't have permission *) + (* - *) + (* In any case, we try to cd to the parent of p, and if that *) + (* fails, we just quit. This works nicely for most cases of (1), *) + (* it works for (2), and on (3) it may leave a mess for someone *) + (* else to pick up. *) let p = if Util.osType = `Win32 then Fileutil.backslashes2forwardslashes p else p in if isRootDir p then raise (Util.Fatal (Printf.sprintf diff --git a/src/fswatch.ml b/src/fswatch.ml index efa86d7..dd8169e 100644 --- a/src/fswatch.ml +++ b/src/fswatch.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fswatch.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -176,7 +176,7 @@ let useWatcher = "Unison uses a file watcher process, when available, to detect filesystem \ changes; this is used to speed up update detection, and for continuous \ synchronization (\\verb|-repeat watch| preference. Setting this flag to \ - false disable the use of this process." + false disable the use of this process." let printf o fmt = Printf.ksprintf @@ -218,7 +218,7 @@ let read_line i = read () in read - + (****) let path = @@ -339,7 +339,7 @@ let emitCmd fmt = with e -> closeConnection (); raise e - + let rec readLine () = let c = currentConnection () in match c.last_line with diff --git a/src/fswatchold.ml b/src/fswatchold.ml index ade16d1..36a1ad7 100644 --- a/src/fswatchold.ml +++ b/src/fswatchold.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/fswatcherold.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -75,10 +75,10 @@ let trim_duplicates l = loop (s2::rest) else s1 :: (loop (s2::rest)) in - loop (Safelist.sort String.compare l) + loop (Safelist.sort String.compare l) let readAvailableLinesFromWatcher wi = - let ch = match wi.ch with Some(c) -> c | None -> assert false in + let ch = match wi.ch with Some(c) -> c | None -> assert false in let rec loop () = match try Some(input_char ch) with End_of_file -> None with None -> diff --git a/src/globals.ml b/src/globals.ml index 4ba2247..231395c 100644 --- a/src/globals.ml +++ b/src/globals.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/globals.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -175,10 +175,10 @@ let globPath lr p = "Path %s ends with *, %s" (Path.toString p) "but first root (after canonizing) is non-local")) - | Some lrfspath -> + | Some lrfspath -> Safelist.map (fun c -> Path.makeGlobal (Path.child parent c)) (Os.childrenOf lrfspath parent) - end + end | _ -> [Path.makeGlobal p] let expandWildcardPaths() = @@ -186,7 +186,7 @@ let expandWildcardPaths() = match rootsInCanonicalOrder() with [(Local, fspath); _] -> Some fspath | _ -> None in - Prefs.set paths + Prefs.set paths (Safelist.flatten_map (globPath lr) (Prefs.read paths)) (*****************************************************************************) @@ -197,7 +197,7 @@ let propagatePrefsTo = Remote.registerHostCmd "installPrefs" (fun prefs -> return (Prefs.load prefs)) - + let propagatePrefs () = let prefs = Prefs.dump() in let toHost root = @@ -238,13 +238,13 @@ let ignorePred = ^ "described in \\sectionref{pathspec}{Path Specification}, and further " ^ "details on ignoring paths is found in" ^ " \\sectionref{ignore}{Ignoring Paths}.") - + let ignorenotPred = Pred.create "ignorenot" - ("This preference overrides the preference \\texttt{ignore}. - It gives a list of patterns - (in the same format as - \\verb|ignore|) for paths that should definitely {\\em not} be ignored, + ("This preference overrides the preference \\texttt{ignore}. + It gives a list of patterns + (in the same format as + \\verb|ignore|) for paths that should definitely {\\em not} be ignored, whether or not they happen to match one of the \\verb|ignore| patterns. \\par Note that the semantics of {\\tt ignore} and {\\tt ignorenot} is a little counter-intuitive. When detecting updates, Unison examines @@ -252,10 +252,10 @@ let ignorenotPred = and working downwards. Before examining each path, it checks whether it matches {\\tt ignore} and does not match {\\tt ignorenot}; in this case it skips this path {\\em and all its descendants}. This means that, - if some parent of a given path matches an {\\tt ignore} pattern, then + if some parent of a given path matches an {\\tt ignore} pattern, then it will be skipped even if the path itself matches an {\\tt ignorenot} pattern. In particular, putting {\\tt ignore = Path *} in your profile - and then using {\\tt ignorenot} to select particular paths to be + and then using {\\tt ignorenot} to select particular paths to be synchronized will not work. Instead, you should use the {\\tt path} preference to choose particular paths to synchronize.") @@ -265,14 +265,14 @@ let atomic = Pred.create "atomic" ~advanced:true let shouldIgnore p = let p = Path.toString p in - (Pred.test ignorePred p) && not (Pred.test ignorenotPred p) + (Pred.test ignorePred p) && not (Pred.test ignorenotPred p) let addRegexpToIgnore re = let oldRE = Pred.extern ignorePred in let newRE = re::oldRE in Pred.intern ignorePred newRE -let merge = +let merge = Pred.create "merge" ~advanced:true ("This preference can be used to run a merge program which will create " ^ "a new version for each of the files and the backup, " @@ -283,7 +283,7 @@ let merge = ^ "described in \\sectionref{pathspec}{Path Specification}, and further " ^ "details on Merging functions are present in " ^ "\\sectionref{merge}{Merging files}.") - + let shouldMerge p = Pred.test merge (Path.toString p) let mergeCmdForPath p = Pred.assoc merge (Path.toString p) diff --git a/src/globals.mli b/src/globals.mli index 80f47e5..3d9a47d 100644 --- a/src/globals.mli +++ b/src/globals.mli @@ -61,17 +61,17 @@ val allHostsIter : (string -> unit Lwt.t) -> unit Lwt.t (* Run a command on all hosts in roots and collect results *) val allHostsMap : (string -> 'a) -> 'a list -(* Make sure that the server has the same settings for its preferences as we - do locally. Should be called whenever the local preferences have - changed. (This isn't conceptually a part of this module, but it can't - live in the Prefs module because that would introduce a circular +(* Make sure that the server has the same settings for its preferences as we + do locally. Should be called whenever the local preferences have + changed. (This isn't conceptually a part of this module, but it can't + live in the Prefs module because that would introduce a circular dependency.) *) val propagatePrefs : unit -> unit Lwt.t (* User preference: when true, don't ask any questions *) val batch : bool Prefs.t -(* User preference: ask for confirmation when propagating a deletion of +(* User preference: ask for confirmation when propagating a deletion of a whole replica or top-level path *) val confirmBigDeletes : bool Prefs.t @@ -87,7 +87,7 @@ val atomic : Pred.t be called again whenever this happens. *) val addRegexpToIgnore : string -> unit -(* Merging commands *) +(* Merging commands *) val mergeCmdForPath : Path.t -> string (* Internal prefs, needed to know whether to do filenames checks *) diff --git a/src/linkgtk.ml b/src/linkgtk.ml index 21d3c2f..c96f2f2 100644 --- a/src/linkgtk.ml +++ b/src/linkgtk.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/linkgtk.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/linkgtk2.ml b/src/linkgtk2.ml index b68e796..5223799 100644 --- a/src/linkgtk2.ml +++ b/src/linkgtk2.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/linkgtk2.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/linktext.ml b/src/linktext.ml index 05ceb10..2a86f92 100644 --- a/src/linktext.ml +++ b/src/linktext.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/linktext.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/lock.ml b/src/lock.ml index 126631d..89a22d8 100644 --- a/src/lock.ml +++ b/src/lock.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/lock.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/lwt/lwt_unix_stubs.c b/src/lwt/lwt_unix_stubs.c index aa85e5b..a32d5f2 100644 --- a/src/lwt/lwt_unix_stubs.c +++ b/src/lwt/lwt_unix_stubs.c @@ -1,687 +1,687 @@ -#include <winsock2.h>
-#include <windows.h>
-#include <errno.h>
-#include <stdio.h>
-
-#include <caml/mlvalues.h>
-#include <caml/alloc.h>
-#include <caml/memory.h>
-#include <caml/fail.h>
-#include <caml/bigarray.h>
-#include <caml/callback.h>
-
-//#define D(x) x
-#define D(x) while(0){}
-
-#define UNIX_BUFFER_SIZE 16384
-#define Nothing ((value) 0)
-
-typedef struct
-{
- OVERLAPPED overlapped;
- long id;
- long action;
-} completionData;
-
-struct filedescr {
- union {
- HANDLE handle;
- SOCKET socket;
- } fd;
- enum { KIND_HANDLE, KIND_SOCKET } kind;
- int crt_fd;
-};
-#define Handle_val(v) (((struct filedescr *) Data_custom_val(v))->fd.handle)
-#define Socket_val(v) (((struct filedescr *) Data_custom_val(v))->fd.socket)
-
-extern void win32_maperr (DWORD errcode);
-extern void uerror (char * cmdname, value arg);
-extern value unix_error_of_code (int errcode);
-extern value win_alloc_handle (HANDLE h);
-extern value win_alloc_socket(SOCKET);
-extern void get_sockaddr (value mladdr,
- struct sockaddr * addr /*out*/,
- int * addr_len /*out*/);
-
-#define Array_data(a, i) (((char *) a->data) + Long_val(i))
-
-CAMLprim value ml_blit_string_to_buffer
-(value s, value i, value a, value j, value l)
-{
- char *src = String_val(s) + Int_val(i);
- char *dest = Array_data(Bigarray_val(a), j);
- memcpy(dest, src, Long_val(l));
- return Val_unit;
-}
-
-CAMLprim value ml_blit_buffer_to_string
-(value a, value i, value s, value j, value l)
-{
- char *src = Array_data(Bigarray_val(a), i);
- char *dest = String_val(s) + Long_val(j);
- memcpy(dest, src, Long_val(l));
- return Val_unit;
-}
-
-/****/
-
-#define READ 0
-#define WRITE 1
-#define READ_OVERLAPPED 2
-#define WRITE_OVERLAPPED 3
-#define READDIRECTORYCHANGES 4
-static char * action_name[5] = {
- "read", "write", "read(overlapped)", "write(overlapped)",
- "ReadDirectoryChangesW"
-};
-
-static value completionCallback;
-
-static void invoke_completion_callback
-(long id, long len, long errCode, long action) {
- CAMLlocal2 (err, name);
- value args[4];
- err = Val_long(0);
- if (errCode != NO_ERROR) {
- len = -1;
- win32_maperr (errCode);
- err = unix_error_of_code(errno);
- }
- name = copy_string (action_name[action]);
- D(printf("Action %s completed: id %ld -> len %ld / err %d (errCode %ld)\n",
- action_name[action], id, len, errno, errCode));
- args[0] = Val_long(id);
- args[1] = Val_long(len);
- args[2] = err;
- args[3] = name;
- caml_callbackN(completionCallback, 4, args);
- D(printf("Callback performed\n"));
-}
-
-typedef struct {
- long id;
- long len;
- long errCode;
- long action; } completionInfo;
-
-int compN = 0;
-int complQueueSize = 0;
-completionInfo * complQueue = NULL;
-
-static void completion (long id, long len, long errCode, long action) {
- D(printf("Queueing action %s: id %ld -> len %ld / err %d (errCode %ld)\n",
- action_name[action], id, len, errno, errCode));
- if (compN + 1 > complQueueSize) {
- completionInfo * queue;
- int n = complQueueSize * 2 + 1;
- D(printf("Resizing queue to %d\n", n));
- queue = (completionInfo *) GlobalAlloc(GPTR, n * sizeof(completionInfo));
- if (complQueue != NULL)
- CopyMemory (queue, complQueue, complQueueSize * sizeof(completionInfo));
- complQueue = queue;
- complQueueSize = n;
- }
- complQueue[compN].id = id;
- complQueue[compN].len = len;
- complQueue[compN].errCode = errCode;
- complQueue[compN].action = action;
- compN++;
-}
-
-CAMLprim value get_queue (value unit) {
- CAMLparam1 (unit);
- int i;
- for (i = 0; i < compN; i++)
- invoke_completion_callback
- (complQueue[i].id, complQueue[i].len,
- complQueue[i].errCode, complQueue[i].action);
- compN = 0;
- CAMLreturn (Val_unit);
-}
-
-/****/
-
-static HANDLE main_thread;
-
-static DWORD CALLBACK helper_thread (void * param) {
- D(printf("Helper thread created\n"));
- while (1) SleepEx(INFINITE, TRUE);
- return 0;
-}
-
-static VOID CALLBACK exit_thread(ULONG_PTR param) {
- D(printf("Helper thread exiting\n"));
- ExitThread(0);
-}
-
-static HANDLE get_helper_thread (value threads, int kind) {
- HANDLE h = (HANDLE) Field(threads, kind);
-
- if (h != INVALID_HANDLE_VALUE) return h;
-
- h = CreateThread (NULL, 0, helper_thread, NULL, 0, NULL);
- if (h == NULL) {
- win32_maperr (GetLastError ());
- uerror("createHelperThread", Nothing);
- }
- Field(threads, kind) = (value) h;
- return h;
-}
-
-static void kill_thread (HANDLE *h) {
- D(printf("Killing thread\n"));
- QueueUserAPC(exit_thread, *h, 0);
- CloseHandle(*h);
- *h = INVALID_HANDLE_VALUE;
-}
-
-CAMLprim value win_kill_threads (value fd) {
- CAMLparam1(fd);
- if (Field(fd, 1) != Val_long(0)) {
- kill_thread((HANDLE *) &Field(Field(fd, 1), READ));
- kill_thread((HANDLE *) &Field(Field(fd, 1), WRITE));
- }
- CAMLreturn(Val_unit);
-}
-
-CAMLprim value win_wrap_fd (value fd) {
- CAMLparam1(fd);
- CAMLlocal2(th, res);
- D(printf("Wrapping file descriptor (sync)\n"));
- res = caml_alloc_tuple(2);
- Store_field(res, 0, fd);
- th = caml_alloc(2, Abstract_tag);
- Field(th, READ) = (value) INVALID_HANDLE_VALUE;
- Field(th, WRITE) = (value) INVALID_HANDLE_VALUE;
- Store_field(res, 1, th);
- CAMLreturn(res);
-}
-
-/****/
-
-typedef struct {
- long action;
- long id;
- HANDLE fd;
- char * buffer;
- long len;
- long error;
-} ioInfo;
-
-
-static VOID CALLBACK thread_completion(ULONG_PTR param) {
- ioInfo * info = (ioInfo *) param;
- completion (info->id, info->len, info->error, info->action);
- GlobalFree (info);
-}
-
-static VOID CALLBACK perform_io_on_thread(ULONG_PTR param) {
- ioInfo * info = (ioInfo *) param;
- DWORD l;
- BOOL res;
-
- D(printf("Starting %s: id %ld, len %ld\n",
- action_name[info->action], info->id, info->len));
-
- res =
- (info->action == READ)?
- ReadFile(info->fd, info->buffer,info->len, &l, NULL):
- WriteFile(info->fd, info->buffer,info->len, &l, NULL);
- if (!res) {
- info->len = -1;
- info->error = GetLastError ();
- } else {
- info->len = l;
- info->error = NO_ERROR;
- }
- D(printf("Action %s done: id %ld -> len %ld / err %d (errCode %ld)\n",
- action_name[info->action],
- info->id, info->len, errno, info->error));
- QueueUserAPC(thread_completion, main_thread, param);
-}
-
-static void thread_io
-(long action, long id, value threads, HANDLE h, char * buf, long len) {
- struct caml_bigarray *buf_arr = Bigarray_val(buf);
- ioInfo * info = GlobalAlloc(GPTR, sizeof(ioInfo));
- if (info == NULL) {
- errno = ENOMEM;
- uerror(action_name[action], Nothing);
- }
-
- info->action = action;
- info->id = id;
- info->fd = h;
- info->buffer = buf;
- info->len = len;
-
- h = get_helper_thread(threads, action);
- QueueUserAPC(perform_io_on_thread, h, (ULONG_PTR) info);
-}
-
-/****/
-
-static void CALLBACK overlapped_completion
-(DWORD errCode, DWORD len, LPOVERLAPPED overlapped) {
- completionData * d = (completionData * )overlapped;
- completion (d->id, len, errCode, d->action);
- GlobalFree (d);
-}
-
-static void overlapped_action(long action, long id,
- HANDLE fd, char *buf, long len) {
- BOOL res;
- long err;
- completionData * d = GlobalAlloc(GPTR, sizeof(completionData));
- if (d == NULL) {
- errno = ENOMEM;
- uerror(action_name[action], Nothing);
- }
- d->id = id;
- d->action = action;
-
- D(printf("Starting %s: id %ld, len %ld\n", action_name[action], id, len));
- res =
- (action == READ_OVERLAPPED)?
- ReadFileEx(fd, buf, len, &(d->overlapped), overlapped_completion):
- WriteFileEx(fd, buf, len, &(d->overlapped), overlapped_completion);
-
- if (!res) {
- err = GetLastError ();
- if (err != ERROR_IO_PENDING) {
- win32_maperr (err);
- D(printf("Action %s failed: id %ld -> err %d (errCode %ld)\n",
- action_name[action], id, errno, err));
- uerror("ReadFileEx", Nothing);
- }
- }
-}
-
-CAMLprim value win_wrap_overlapped (value fd) {
- CAMLparam1(fd);
- CAMLlocal1(res);
- D(printf("Wrapping file descriptor (async)\n"));
- res = caml_alloc_tuple(2);
- Store_field(res, 0, fd);
- Store_field(res, 1, Val_long(0));
- CAMLreturn(res);
-}
-
-/****/
-
-#define Handle(fd) Handle_val(Field(fd, 0))
-
-CAMLprim value win_read
-(value fd, value buf, value ofs, value len, value id) {
- CAMLparam4(fd, buf, ofs, len);
- struct caml_bigarray *buf_arr = Bigarray_val(buf);
-
- if (Field(fd, 1) == Val_long(0))
- overlapped_action (READ_OVERLAPPED, Long_val(id), Handle(fd),
- Array_data (buf_arr, ofs), Long_val(len));
- else
- thread_io (READ, Long_val(id), Field(fd, 1), Handle(fd),
- Array_data (buf_arr, ofs), Long_val(len));
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_write
-(value fd, value buf, value ofs, value len, value id) {
- CAMLparam4(fd, buf, ofs, len);
- struct caml_bigarray *buf_arr = Bigarray_val(buf);
-
- if (Field(fd, 1) == Val_long(0))
- overlapped_action (WRITE_OVERLAPPED, Long_val(id), Handle(fd),
- Array_data (buf_arr, ofs), Long_val(len));
- else
- thread_io (WRITE, Long_val(id), Field(fd, 1), Handle(fd),
- Array_data (buf_arr, ofs), Long_val(len));
- CAMLreturn (Val_unit);
-}
-
-/*
-#ifndef SO_UPDATE_CONNECT_CONTEXT
-#define SO_UPDATE_CONNECT_CONTEXT 0x7010
-#endif
-
-static void after_connect (SOCKET s) {
- if (!setsockopt(s, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0)) {
- win32_maperr (GetLastError ());
- uerror("after_connect", Nothing);
- }
-}
-*/
-
-static HANDLE events[MAXIMUM_WAIT_OBJECTS];
-//static OVERLAPPED oData[MAXIMUM_WAIT_OBJECTS];
-
-CAMLprim value win_register_wait (value socket, value kind, value idx) {
- CAMLparam3(socket, kind, idx);
- long i = Long_val(idx);
- long mask;
-
- D(printf("Register: i %ld, kind %ld\n", Long_val(i), Long_val(kind)));
- events[i] = CreateEvent(NULL, TRUE, FALSE, NULL);
- mask = (Long_val(kind) == 0) ? FD_CONNECT : FD_ACCEPT;
- if (WSAEventSelect(Socket_val(socket), events[i], mask) == SOCKET_ERROR) {
- win32_maperr(WSAGetLastError ());
- uerror("WSAEventSelect", Nothing);
- }
-
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_check_connection (value socket, value kind, value idx) {
- CAMLparam3 (socket, kind, idx);
- WSANETWORKEVENTS evs;
- int res, err, i = Long_val(idx);
-
- D(printf("Check connection... %d\n", i));
- if (WSAEnumNetworkEvents(Socket_val(socket), NULL, &evs)) {
- win32_maperr(WSAGetLastError ());
- uerror("WSAEnumNetworkEvents", Nothing);
- }
- if (WSAEventSelect(Socket_val(socket), NULL, 0) == SOCKET_ERROR) {
- win32_maperr(WSAGetLastError ());
- uerror("WSAEventSelect", Nothing);
- }
- if (!CloseHandle(events[i])) {
- win32_maperr(GetLastError ());
- uerror("CloseHandle", Nothing);
- }
- err =
- evs.iErrorCode[(Long_val(kind) == 0) ? FD_CONNECT_BIT : FD_ACCEPT_BIT];
- D(printf("Check connection: %ld, err %d\n", evs.lNetworkEvents, err));
- if (err != 0) {
- win32_maperr(err);
- uerror("check_connection", Nothing);
- }
- CAMLreturn (Val_unit);
-}
-
-static HANDLE dummyEvent;
-
-CAMLprim value init_lwt (value callback) {
- CAMLparam1 (callback);
- // GUID GuidConnectEx = WSAID_CONNECTEX;
- // SOCKET s;
- // DWORD l;
- int i;
-
- D(printf("Init...\n"));
- register_global_root (&completionCallback);
- completionCallback = callback;
-
- dummyEvent = CreateEvent(NULL, TRUE, FALSE, NULL); // Dummy event
-
- DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
- GetCurrentProcess (), &main_thread,
- 0, FALSE, DUPLICATE_SAME_ACCESS);
-
- /*
- s = socket(AF_INET, SOCK_STREAM, 0);
- if (s == INVALID_SOCKET) return Val_unit;
- WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER,
- &GuidConnectEx, sizeof(GuidConnectEx),
- &ConnectEx, sizeof(ConnectExPtr),
- &l, NULL, NULL);
- closesocket(s);
- */
-
- D(printf("Init done\n"));
- CAMLreturn (Val_long (MAXIMUM_WAIT_OBJECTS));
-}
-
-CAMLprim value win_wait (value timeout, value event_count) {
- CAMLparam2(timeout, event_count);
- DWORD t, t2;
- DWORD res;
- long ret, n = Long_val(event_count);
- t = Long_val(timeout);
- if (t < 0) t = INFINITE;
- t2 = (compN > 0) ? 0 : t;
- D(printf("Waiting: %ld events, timeout %ldms -> %ldms\n", n, t, t2));
- res =
- (n > 0) ?
- WaitForMultipleObjectsEx(n, events, FALSE, t, TRUE) :
- WaitForMultipleObjectsEx(1, &dummyEvent, FALSE, t, TRUE);
- D(printf("Done waiting\n"));
- if ((t != t2) && (res == WAIT_TIMEOUT)) res = WAIT_IO_COMPLETION;
- switch (res) {
- case WAIT_TIMEOUT:
- D(printf("Timeout\n"));
- ret = -1;
- break;
- case WAIT_IO_COMPLETION:
- D(printf("I/O completion\n"));
- ret = -2;
- break;
- case WAIT_FAILED:
- D(printf("Wait failed\n"));
- ret = 0;
- win32_maperr (GetLastError ());
- uerror("WaitForMultipleObjectsEx", Nothing);
- break;
- default:
- ret = res;
- D(printf("Event: %ld\n", res));
- break;
- }
- get_queue (Val_unit);
- CAMLreturn (Val_long(ret));
-}
-
-static long pipeSerial;
-
-value win_pipe(long readMode, long writeMode) {
- CAMLparam0();
- SECURITY_ATTRIBUTES attr;
- HANDLE readh, writeh;
- CHAR name[MAX_PATH];
- CAMLlocal3(readfd, writefd, res);
-
- attr.nLength = sizeof(attr);
- attr.lpSecurityDescriptor = NULL;
- attr.bInheritHandle = TRUE;
-
- sprintf(name, "\\\\.\\Pipe\\UnisonAnonPipe.%08lx.%08lx",
- GetCurrentProcessId(), pipeSerial++);
-
- readh =
- CreateNamedPipeA
- (name, PIPE_ACCESS_INBOUND | readMode, PIPE_TYPE_BYTE | PIPE_WAIT,
- 1, UNIX_BUFFER_SIZE, UNIX_BUFFER_SIZE, 0, &attr);
-
- if (readh == INVALID_HANDLE_VALUE) {
- win32_maperr(GetLastError());
- uerror("CreateNamedPipe", Nothing);
- return FALSE;
- }
-
- writeh =
- CreateFileA
- (name, GENERIC_WRITE, 0, &attr, OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL | writeMode, NULL);
-
- if (writeh == INVALID_HANDLE_VALUE) {
- win32_maperr(GetLastError());
- CloseHandle(readh);
- uerror("CreateFile", Nothing);
- return FALSE;
- }
-
- readfd = win_alloc_handle(readh);
- writefd = win_alloc_handle(writeh);
- res = alloc_small(2, 0);
- Store_field(res, 0, readfd);
- Store_field(res, 1, writefd);
- CAMLreturn (res);
-}
-
-CAMLprim value win_pipe_in (value unit) {
- CAMLparam0();
- CAMLreturn (win_pipe (FILE_FLAG_OVERLAPPED, 0));
-}
-
-CAMLprim value win_pipe_out (value unit) {
- CAMLparam0();
- CAMLreturn (win_pipe (0, FILE_FLAG_OVERLAPPED));
-}
-
-static int socket_domain_table[] = {
- PF_UNIX, PF_INET
-};
-
-static int socket_type_table[] = {
- SOCK_STREAM, SOCK_DGRAM, SOCK_RAW, SOCK_SEQPACKET
-};
-
-CAMLprim value win_socket (value domain, value type, value proto) {
- CAMLparam3(domain, type, proto);
- SOCKET s;
-
- s = WSASocket(socket_domain_table[Int_val(domain)],
- socket_type_table[Int_val(type)],
- Int_val(proto),
- NULL, 0, WSA_FLAG_OVERLAPPED);
- D(printf("Created socket %lx\n", (long)s));
- if (s == INVALID_SOCKET) {
- win32_maperr(WSAGetLastError ());
- uerror("WSASocket", Nothing);
- }
- CAMLreturn(win_alloc_socket(s));
-}
-
-/*
-#ifndef WSAID_CONNECTEX
-#define WSAID_CONNECTEX \
- {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
-#endif
-
-typedef BOOL (WINAPI *ConnectExPtr)(SOCKET, const struct sockaddr *, int, PVOID, DWORD, LPDWORD, LPOVERLAPPED);
-
-static ConnectExPtr ConnectEx = NULL;
-
-CAMLprim value win_connect (value socket, value address, value id) {
- CAMLparam3(socket, address, id);
- SOCKET s = Socket_val (socket);
- struct sockaddr addr;
- int addr_len;
- DWORD err;
- int i;
-
- if (ConnectEx == NULL) {
- errno = ENOSYS;
- uerror("ConnectEx", Nothing);
- }
- if (eventCount == MAXIMUM_WAIT_OBJECTS) {
- errno = EAGAIN;
- uerror("ConnectEx", Nothing);
- }
- i = free_list[eventCount];
- eventCount++;
-
- ZeroMemory(&(oData[i]), sizeof(OVERLAPPED));
- oData[i].hEvent = events[i];
- ids[i] = Long_val(id);
- sockets[i] = s;
-
- get_sockaddr(address, &addr, &addr_len);
- if (!ConnectEx(s, &addr, addr_len, NULL, 0, 0, &(oData[i]))) {
- err = WSAGetLastError ();
- if (err != ERROR_IO_PENDING) {
- win32_maperr(err);
- uerror("ConnectEx", Nothing);
- }
- } else
- after_connect(s);
- CAMLreturn (Val_unit);
-}
-*/
-
-static int notify_filter_flags[8] = {
- FILE_NOTIFY_CHANGE_FILE_NAME, FILE_NOTIFY_CHANGE_DIR_NAME,
- FILE_NOTIFY_CHANGE_ATTRIBUTES, FILE_NOTIFY_CHANGE_SIZE,
- FILE_NOTIFY_CHANGE_LAST_WRITE, FILE_NOTIFY_CHANGE_LAST_ACCESS,
- FILE_NOTIFY_CHANGE_CREATION, FILE_NOTIFY_CHANGE_SECURITY
-};
-
-CAMLprim value win_readdirtorychanges
-(value fd_val, value buf_val, value recursive, value flags, value id_val) {
- CAMLparam5(fd_val, buf_val, recursive, flags, id_val);
- struct caml_bigarray *buf_arr = Bigarray_val(buf_val);
- long id = Long_val(id_val);
- HANDLE fd = Handle_val(fd_val);
- char * buf = Array_data (buf_arr, 0);
- long len = buf_arr->dim[0];
- long action = READDIRECTORYCHANGES;
- BOOL res;
- long err;
- int notify_filter = convert_flag_list(flags, notify_filter_flags);
- completionData * d = GlobalAlloc(GPTR, sizeof(completionData));
- if (d == NULL) {
- errno = ENOMEM;
- uerror(action_name[action], Nothing);
- }
- d->id = id;
- d->action = action;
-
- D(printf("Starting %s: id %ld, len %ld\n", action_name[action], id, len));
-
- res = ReadDirectoryChangesW (fd, buf, len, Bool_val(recursive),
- notify_filter, NULL, &(d->overlapped),
- overlapped_completion);
-
- if (!res) {
- err = GetLastError ();
- if (err != ERROR_IO_PENDING) {
- win32_maperr (err);
- D(printf("Action %s failed: id %ld -> err %d (errCode %ld)\n",
- action_name[action], id, errno, err));
- uerror("ReadDirectoryChangesW", Nothing);
- }
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_parse_directory_changes (value buf_val) {
- CAMLparam1(buf_val);
- CAMLlocal4(lst, tmp, elt, filename);
- struct caml_bigarray *buf_arr = Bigarray_val(buf_val);
- char * pos = Array_data (buf_arr, 0);
- FILE_NOTIFY_INFORMATION * entry;
-
- lst = Val_long(0);
- while (1) {
- entry = (FILE_NOTIFY_INFORMATION *)pos;
- elt = caml_alloc_tuple(2);
- filename = caml_alloc_string(entry->FileNameLength);
- memmove(String_val(filename), entry->FileName, entry->FileNameLength);
- Store_field (elt, 0, filename);
- Store_field (elt, 1, Val_long(entry->Action - 1));
- tmp = caml_alloc_tuple(2);
- Store_field (tmp, 0, elt);
- Store_field (tmp, 1, lst);
- lst = tmp;
- if (entry->NextEntryOffset == 0) break;
- pos += entry->NextEntryOffset;
- }
- CAMLreturn(lst);
-}
-
-CAMLprim value win_open_directory (value path, value wpath) {
- CAMLparam2 (path, wpath);
- HANDLE h;
- h = CreateFileW((LPCWSTR) String_val(wpath),
- FILE_LIST_DIRECTORY,
- FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
- NULL,
- OPEN_EXISTING,
- FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED,
- NULL);
- if (h == INVALID_HANDLE_VALUE) {
- win32_maperr (GetLastError ());
- uerror("open", path);
- }
- CAMLreturn(win_alloc_handle(h));
-}
+#include <winsock2.h> +#include <windows.h> +#include <errno.h> +#include <stdio.h> + +#include <caml/mlvalues.h> +#include <caml/alloc.h> +#include <caml/memory.h> +#include <caml/fail.h> +#include <caml/bigarray.h> +#include <caml/callback.h> + +//#define D(x) x +#define D(x) while(0){} + +#define UNIX_BUFFER_SIZE 16384 +#define Nothing ((value) 0) + +typedef struct +{ + OVERLAPPED overlapped; + long id; + long action; +} completionData; + +struct filedescr { + union { + HANDLE handle; + SOCKET socket; + } fd; + enum { KIND_HANDLE, KIND_SOCKET } kind; + int crt_fd; +}; +#define Handle_val(v) (((struct filedescr *) Data_custom_val(v))->fd.handle) +#define Socket_val(v) (((struct filedescr *) Data_custom_val(v))->fd.socket) + +extern void win32_maperr (DWORD errcode); +extern void uerror (char * cmdname, value arg); +extern value unix_error_of_code (int errcode); +extern value win_alloc_handle (HANDLE h); +extern value win_alloc_socket(SOCKET); +extern void get_sockaddr (value mladdr, + struct sockaddr * addr /*out*/, + int * addr_len /*out*/); + +#define Array_data(a, i) (((char *) a->data) + Long_val(i)) + +CAMLprim value ml_blit_string_to_buffer +(value s, value i, value a, value j, value l) +{ + char *src = String_val(s) + Int_val(i); + char *dest = Array_data(Bigarray_val(a), j); + memcpy(dest, src, Long_val(l)); + return Val_unit; +} + +CAMLprim value ml_blit_buffer_to_string +(value a, value i, value s, value j, value l) +{ + char *src = Array_data(Bigarray_val(a), i); + char *dest = String_val(s) + Long_val(j); + memcpy(dest, src, Long_val(l)); + return Val_unit; +} + +/****/ + +#define READ 0 +#define WRITE 1 +#define READ_OVERLAPPED 2 +#define WRITE_OVERLAPPED 3 +#define READDIRECTORYCHANGES 4 +static char * action_name[5] = { + "read", "write", "read(overlapped)", "write(overlapped)", + "ReadDirectoryChangesW" +}; + +static value completionCallback; + +static void invoke_completion_callback +(long id, long len, long errCode, long action) { + CAMLlocal2 (err, name); + value args[4]; + err = Val_long(0); + if (errCode != NO_ERROR) { + len = -1; + win32_maperr (errCode); + err = unix_error_of_code(errno); + } + name = copy_string (action_name[action]); + D(printf("Action %s completed: id %ld -> len %ld / err %d (errCode %ld)\n", + action_name[action], id, len, errno, errCode)); + args[0] = Val_long(id); + args[1] = Val_long(len); + args[2] = err; + args[3] = name; + caml_callbackN(completionCallback, 4, args); + D(printf("Callback performed\n")); +} + +typedef struct { + long id; + long len; + long errCode; + long action; } completionInfo; + +int compN = 0; +int complQueueSize = 0; +completionInfo * complQueue = NULL; + +static void completion (long id, long len, long errCode, long action) { + D(printf("Queueing action %s: id %ld -> len %ld / err %d (errCode %ld)\n", + action_name[action], id, len, errno, errCode)); + if (compN + 1 > complQueueSize) { + completionInfo * queue; + int n = complQueueSize * 2 + 1; + D(printf("Resizing queue to %d\n", n)); + queue = (completionInfo *) GlobalAlloc(GPTR, n * sizeof(completionInfo)); + if (complQueue != NULL) + CopyMemory (queue, complQueue, complQueueSize * sizeof(completionInfo)); + complQueue = queue; + complQueueSize = n; + } + complQueue[compN].id = id; + complQueue[compN].len = len; + complQueue[compN].errCode = errCode; + complQueue[compN].action = action; + compN++; +} + +CAMLprim value get_queue (value unit) { + CAMLparam1 (unit); + int i; + for (i = 0; i < compN; i++) + invoke_completion_callback + (complQueue[i].id, complQueue[i].len, + complQueue[i].errCode, complQueue[i].action); + compN = 0; + CAMLreturn (Val_unit); +} + +/****/ + +static HANDLE main_thread; + +static DWORD CALLBACK helper_thread (void * param) { + D(printf("Helper thread created\n")); + while (1) SleepEx(INFINITE, TRUE); + return 0; +} + +static VOID CALLBACK exit_thread(ULONG_PTR param) { + D(printf("Helper thread exiting\n")); + ExitThread(0); +} + +static HANDLE get_helper_thread (value threads, int kind) { + HANDLE h = (HANDLE) Field(threads, kind); + + if (h != INVALID_HANDLE_VALUE) return h; + + h = CreateThread (NULL, 0, helper_thread, NULL, 0, NULL); + if (h == NULL) { + win32_maperr (GetLastError ()); + uerror("createHelperThread", Nothing); + } + Field(threads, kind) = (value) h; + return h; +} + +static void kill_thread (HANDLE *h) { + D(printf("Killing thread\n")); + QueueUserAPC(exit_thread, *h, 0); + CloseHandle(*h); + *h = INVALID_HANDLE_VALUE; +} + +CAMLprim value win_kill_threads (value fd) { + CAMLparam1(fd); + if (Field(fd, 1) != Val_long(0)) { + kill_thread((HANDLE *) &Field(Field(fd, 1), READ)); + kill_thread((HANDLE *) &Field(Field(fd, 1), WRITE)); + } + CAMLreturn(Val_unit); +} + +CAMLprim value win_wrap_fd (value fd) { + CAMLparam1(fd); + CAMLlocal2(th, res); + D(printf("Wrapping file descriptor (sync)\n")); + res = caml_alloc_tuple(2); + Store_field(res, 0, fd); + th = caml_alloc(2, Abstract_tag); + Field(th, READ) = (value) INVALID_HANDLE_VALUE; + Field(th, WRITE) = (value) INVALID_HANDLE_VALUE; + Store_field(res, 1, th); + CAMLreturn(res); +} + +/****/ + +typedef struct { + long action; + long id; + HANDLE fd; + char * buffer; + long len; + long error; +} ioInfo; + + +static VOID CALLBACK thread_completion(ULONG_PTR param) { + ioInfo * info = (ioInfo *) param; + completion (info->id, info->len, info->error, info->action); + GlobalFree (info); +} + +static VOID CALLBACK perform_io_on_thread(ULONG_PTR param) { + ioInfo * info = (ioInfo *) param; + DWORD l; + BOOL res; + + D(printf("Starting %s: id %ld, len %ld\n", + action_name[info->action], info->id, info->len)); + + res = + (info->action == READ)? + ReadFile(info->fd, info->buffer,info->len, &l, NULL): + WriteFile(info->fd, info->buffer,info->len, &l, NULL); + if (!res) { + info->len = -1; + info->error = GetLastError (); + } else { + info->len = l; + info->error = NO_ERROR; + } + D(printf("Action %s done: id %ld -> len %ld / err %d (errCode %ld)\n", + action_name[info->action], + info->id, info->len, errno, info->error)); + QueueUserAPC(thread_completion, main_thread, param); +} + +static void thread_io +(long action, long id, value threads, HANDLE h, char * buf, long len) { + struct caml_bigarray *buf_arr = Bigarray_val(buf); + ioInfo * info = GlobalAlloc(GPTR, sizeof(ioInfo)); + if (info == NULL) { + errno = ENOMEM; + uerror(action_name[action], Nothing); + } + + info->action = action; + info->id = id; + info->fd = h; + info->buffer = buf; + info->len = len; + + h = get_helper_thread(threads, action); + QueueUserAPC(perform_io_on_thread, h, (ULONG_PTR) info); +} + +/****/ + +static void CALLBACK overlapped_completion +(DWORD errCode, DWORD len, LPOVERLAPPED overlapped) { + completionData * d = (completionData * )overlapped; + completion (d->id, len, errCode, d->action); + GlobalFree (d); +} + +static void overlapped_action(long action, long id, + HANDLE fd, char *buf, long len) { + BOOL res; + long err; + completionData * d = GlobalAlloc(GPTR, sizeof(completionData)); + if (d == NULL) { + errno = ENOMEM; + uerror(action_name[action], Nothing); + } + d->id = id; + d->action = action; + + D(printf("Starting %s: id %ld, len %ld\n", action_name[action], id, len)); + res = + (action == READ_OVERLAPPED)? + ReadFileEx(fd, buf, len, &(d->overlapped), overlapped_completion): + WriteFileEx(fd, buf, len, &(d->overlapped), overlapped_completion); + + if (!res) { + err = GetLastError (); + if (err != ERROR_IO_PENDING) { + win32_maperr (err); + D(printf("Action %s failed: id %ld -> err %d (errCode %ld)\n", + action_name[action], id, errno, err)); + uerror("ReadFileEx", Nothing); + } + } +} + +CAMLprim value win_wrap_overlapped (value fd) { + CAMLparam1(fd); + CAMLlocal1(res); + D(printf("Wrapping file descriptor (async)\n")); + res = caml_alloc_tuple(2); + Store_field(res, 0, fd); + Store_field(res, 1, Val_long(0)); + CAMLreturn(res); +} + +/****/ + +#define Handle(fd) Handle_val(Field(fd, 0)) + +CAMLprim value win_read +(value fd, value buf, value ofs, value len, value id) { + CAMLparam4(fd, buf, ofs, len); + struct caml_bigarray *buf_arr = Bigarray_val(buf); + + if (Field(fd, 1) == Val_long(0)) + overlapped_action (READ_OVERLAPPED, Long_val(id), Handle(fd), + Array_data (buf_arr, ofs), Long_val(len)); + else + thread_io (READ, Long_val(id), Field(fd, 1), Handle(fd), + Array_data (buf_arr, ofs), Long_val(len)); + CAMLreturn (Val_unit); +} + +CAMLprim value win_write +(value fd, value buf, value ofs, value len, value id) { + CAMLparam4(fd, buf, ofs, len); + struct caml_bigarray *buf_arr = Bigarray_val(buf); + + if (Field(fd, 1) == Val_long(0)) + overlapped_action (WRITE_OVERLAPPED, Long_val(id), Handle(fd), + Array_data (buf_arr, ofs), Long_val(len)); + else + thread_io (WRITE, Long_val(id), Field(fd, 1), Handle(fd), + Array_data (buf_arr, ofs), Long_val(len)); + CAMLreturn (Val_unit); +} + +/* +#ifndef SO_UPDATE_CONNECT_CONTEXT +#define SO_UPDATE_CONNECT_CONTEXT 0x7010 +#endif + +static void after_connect (SOCKET s) { + if (!setsockopt(s, SOL_SOCKET, SO_UPDATE_CONNECT_CONTEXT, NULL, 0)) { + win32_maperr (GetLastError ()); + uerror("after_connect", Nothing); + } +} +*/ + +static HANDLE events[MAXIMUM_WAIT_OBJECTS]; +//static OVERLAPPED oData[MAXIMUM_WAIT_OBJECTS]; + +CAMLprim value win_register_wait (value socket, value kind, value idx) { + CAMLparam3(socket, kind, idx); + long i = Long_val(idx); + long mask; + + D(printf("Register: i %ld, kind %ld\n", Long_val(i), Long_val(kind))); + events[i] = CreateEvent(NULL, TRUE, FALSE, NULL); + mask = (Long_val(kind) == 0) ? FD_CONNECT : FD_ACCEPT; + if (WSAEventSelect(Socket_val(socket), events[i], mask) == SOCKET_ERROR) { + win32_maperr(WSAGetLastError ()); + uerror("WSAEventSelect", Nothing); + } + + CAMLreturn (Val_unit); +} + +CAMLprim value win_check_connection (value socket, value kind, value idx) { + CAMLparam3 (socket, kind, idx); + WSANETWORKEVENTS evs; + int res, err, i = Long_val(idx); + + D(printf("Check connection... %d\n", i)); + if (WSAEnumNetworkEvents(Socket_val(socket), NULL, &evs)) { + win32_maperr(WSAGetLastError ()); + uerror("WSAEnumNetworkEvents", Nothing); + } + if (WSAEventSelect(Socket_val(socket), NULL, 0) == SOCKET_ERROR) { + win32_maperr(WSAGetLastError ()); + uerror("WSAEventSelect", Nothing); + } + if (!CloseHandle(events[i])) { + win32_maperr(GetLastError ()); + uerror("CloseHandle", Nothing); + } + err = + evs.iErrorCode[(Long_val(kind) == 0) ? FD_CONNECT_BIT : FD_ACCEPT_BIT]; + D(printf("Check connection: %ld, err %d\n", evs.lNetworkEvents, err)); + if (err != 0) { + win32_maperr(err); + uerror("check_connection", Nothing); + } + CAMLreturn (Val_unit); +} + +static HANDLE dummyEvent; + +CAMLprim value init_lwt (value callback) { + CAMLparam1 (callback); + // GUID GuidConnectEx = WSAID_CONNECTEX; + // SOCKET s; + // DWORD l; + int i; + + D(printf("Init...\n")); + register_global_root (&completionCallback); + completionCallback = callback; + + dummyEvent = CreateEvent(NULL, TRUE, FALSE, NULL); // Dummy event + + DuplicateHandle (GetCurrentProcess (), GetCurrentThread (), + GetCurrentProcess (), &main_thread, + 0, FALSE, DUPLICATE_SAME_ACCESS); + + /* + s = socket(AF_INET, SOCK_STREAM, 0); + if (s == INVALID_SOCKET) return Val_unit; + WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER, + &GuidConnectEx, sizeof(GuidConnectEx), + &ConnectEx, sizeof(ConnectExPtr), + &l, NULL, NULL); + closesocket(s); + */ + + D(printf("Init done\n")); + CAMLreturn (Val_long (MAXIMUM_WAIT_OBJECTS)); +} + +CAMLprim value win_wait (value timeout, value event_count) { + CAMLparam2(timeout, event_count); + DWORD t, t2; + DWORD res; + long ret, n = Long_val(event_count); + t = Long_val(timeout); + if (t < 0) t = INFINITE; + t2 = (compN > 0) ? 0 : t; + D(printf("Waiting: %ld events, timeout %ldms -> %ldms\n", n, t, t2)); + res = + (n > 0) ? + WaitForMultipleObjectsEx(n, events, FALSE, t, TRUE) : + WaitForMultipleObjectsEx(1, &dummyEvent, FALSE, t, TRUE); + D(printf("Done waiting\n")); + if ((t != t2) && (res == WAIT_TIMEOUT)) res = WAIT_IO_COMPLETION; + switch (res) { + case WAIT_TIMEOUT: + D(printf("Timeout\n")); + ret = -1; + break; + case WAIT_IO_COMPLETION: + D(printf("I/O completion\n")); + ret = -2; + break; + case WAIT_FAILED: + D(printf("Wait failed\n")); + ret = 0; + win32_maperr (GetLastError ()); + uerror("WaitForMultipleObjectsEx", Nothing); + break; + default: + ret = res; + D(printf("Event: %ld\n", res)); + break; + } + get_queue (Val_unit); + CAMLreturn (Val_long(ret)); +} + +static long pipeSerial; + +value win_pipe(long readMode, long writeMode) { + CAMLparam0(); + SECURITY_ATTRIBUTES attr; + HANDLE readh, writeh; + CHAR name[MAX_PATH]; + CAMLlocal3(readfd, writefd, res); + + attr.nLength = sizeof(attr); + attr.lpSecurityDescriptor = NULL; + attr.bInheritHandle = TRUE; + + sprintf(name, "\\\\.\\Pipe\\UnisonAnonPipe.%08lx.%08lx", + GetCurrentProcessId(), pipeSerial++); + + readh = + CreateNamedPipeA + (name, PIPE_ACCESS_INBOUND | readMode, PIPE_TYPE_BYTE | PIPE_WAIT, + 1, UNIX_BUFFER_SIZE, UNIX_BUFFER_SIZE, 0, &attr); + + if (readh == INVALID_HANDLE_VALUE) { + win32_maperr(GetLastError()); + uerror("CreateNamedPipe", Nothing); + return FALSE; + } + + writeh = + CreateFileA + (name, GENERIC_WRITE, 0, &attr, OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | writeMode, NULL); + + if (writeh == INVALID_HANDLE_VALUE) { + win32_maperr(GetLastError()); + CloseHandle(readh); + uerror("CreateFile", Nothing); + return FALSE; + } + + readfd = win_alloc_handle(readh); + writefd = win_alloc_handle(writeh); + res = alloc_small(2, 0); + Store_field(res, 0, readfd); + Store_field(res, 1, writefd); + CAMLreturn (res); +} + +CAMLprim value win_pipe_in (value unit) { + CAMLparam0(); + CAMLreturn (win_pipe (FILE_FLAG_OVERLAPPED, 0)); +} + +CAMLprim value win_pipe_out (value unit) { + CAMLparam0(); + CAMLreturn (win_pipe (0, FILE_FLAG_OVERLAPPED)); +} + +static int socket_domain_table[] = { + PF_UNIX, PF_INET +}; + +static int socket_type_table[] = { + SOCK_STREAM, SOCK_DGRAM, SOCK_RAW, SOCK_SEQPACKET +}; + +CAMLprim value win_socket (value domain, value type, value proto) { + CAMLparam3(domain, type, proto); + SOCKET s; + + s = WSASocket(socket_domain_table[Int_val(domain)], + socket_type_table[Int_val(type)], + Int_val(proto), + NULL, 0, WSA_FLAG_OVERLAPPED); + D(printf("Created socket %lx\n", (long)s)); + if (s == INVALID_SOCKET) { + win32_maperr(WSAGetLastError ()); + uerror("WSASocket", Nothing); + } + CAMLreturn(win_alloc_socket(s)); +} + +/* +#ifndef WSAID_CONNECTEX +#define WSAID_CONNECTEX \ + {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}} +#endif + +typedef BOOL (WINAPI *ConnectExPtr)(SOCKET, const struct sockaddr *, int, PVOID, DWORD, LPDWORD, LPOVERLAPPED); + +static ConnectExPtr ConnectEx = NULL; + +CAMLprim value win_connect (value socket, value address, value id) { + CAMLparam3(socket, address, id); + SOCKET s = Socket_val (socket); + struct sockaddr addr; + int addr_len; + DWORD err; + int i; + + if (ConnectEx == NULL) { + errno = ENOSYS; + uerror("ConnectEx", Nothing); + } + if (eventCount == MAXIMUM_WAIT_OBJECTS) { + errno = EAGAIN; + uerror("ConnectEx", Nothing); + } + i = free_list[eventCount]; + eventCount++; + + ZeroMemory(&(oData[i]), sizeof(OVERLAPPED)); + oData[i].hEvent = events[i]; + ids[i] = Long_val(id); + sockets[i] = s; + + get_sockaddr(address, &addr, &addr_len); + if (!ConnectEx(s, &addr, addr_len, NULL, 0, 0, &(oData[i]))) { + err = WSAGetLastError (); + if (err != ERROR_IO_PENDING) { + win32_maperr(err); + uerror("ConnectEx", Nothing); + } + } else + after_connect(s); + CAMLreturn (Val_unit); +} +*/ + +static int notify_filter_flags[8] = { + FILE_NOTIFY_CHANGE_FILE_NAME, FILE_NOTIFY_CHANGE_DIR_NAME, + FILE_NOTIFY_CHANGE_ATTRIBUTES, FILE_NOTIFY_CHANGE_SIZE, + FILE_NOTIFY_CHANGE_LAST_WRITE, FILE_NOTIFY_CHANGE_LAST_ACCESS, + FILE_NOTIFY_CHANGE_CREATION, FILE_NOTIFY_CHANGE_SECURITY +}; + +CAMLprim value win_readdirtorychanges +(value fd_val, value buf_val, value recursive, value flags, value id_val) { + CAMLparam5(fd_val, buf_val, recursive, flags, id_val); + struct caml_bigarray *buf_arr = Bigarray_val(buf_val); + long id = Long_val(id_val); + HANDLE fd = Handle_val(fd_val); + char * buf = Array_data (buf_arr, 0); + long len = buf_arr->dim[0]; + long action = READDIRECTORYCHANGES; + BOOL res; + long err; + int notify_filter = convert_flag_list(flags, notify_filter_flags); + completionData * d = GlobalAlloc(GPTR, sizeof(completionData)); + if (d == NULL) { + errno = ENOMEM; + uerror(action_name[action], Nothing); + } + d->id = id; + d->action = action; + + D(printf("Starting %s: id %ld, len %ld\n", action_name[action], id, len)); + + res = ReadDirectoryChangesW (fd, buf, len, Bool_val(recursive), + notify_filter, NULL, &(d->overlapped), + overlapped_completion); + + if (!res) { + err = GetLastError (); + if (err != ERROR_IO_PENDING) { + win32_maperr (err); + D(printf("Action %s failed: id %ld -> err %d (errCode %ld)\n", + action_name[action], id, errno, err)); + uerror("ReadDirectoryChangesW", Nothing); + } + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_parse_directory_changes (value buf_val) { + CAMLparam1(buf_val); + CAMLlocal4(lst, tmp, elt, filename); + struct caml_bigarray *buf_arr = Bigarray_val(buf_val); + char * pos = Array_data (buf_arr, 0); + FILE_NOTIFY_INFORMATION * entry; + + lst = Val_long(0); + while (1) { + entry = (FILE_NOTIFY_INFORMATION *)pos; + elt = caml_alloc_tuple(2); + filename = caml_alloc_string(entry->FileNameLength); + memmove(String_val(filename), entry->FileName, entry->FileNameLength); + Store_field (elt, 0, filename); + Store_field (elt, 1, Val_long(entry->Action - 1)); + tmp = caml_alloc_tuple(2); + Store_field (tmp, 0, elt); + Store_field (tmp, 1, lst); + lst = tmp; + if (entry->NextEntryOffset == 0) break; + pos += entry->NextEntryOffset; + } + CAMLreturn(lst); +} + +CAMLprim value win_open_directory (value path, value wpath) { + CAMLparam2 (path, wpath); + HANDLE h; + h = CreateFileW((LPCWSTR) String_val(wpath), + FILE_LIST_DIRECTORY, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, + OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OVERLAPPED, + NULL); + if (h == INVALID_HANDLE_VALUE) { + win32_maperr (GetLastError ()); + uerror("open", path); + } + CAMLreturn(win_alloc_handle(h)); +} diff --git a/src/lwt/lwt_util.ml b/src/lwt/lwt_util.ml index 2a686e3..3e563a5 100644 --- a/src/lwt/lwt_util.ml +++ b/src/lwt/lwt_util.ml @@ -18,29 +18,29 @@ let rec map f l = return (v' :: l'))) let map_with_waiting_action f wa l = - let rec loop l = + let rec loop l = match l with [] -> - return [] + return [] | v :: r -> - let t = f v in - let rt = loop r in - t >>= (fun v' -> - (* Perform the specified "waiting action" for the next *) - (* item in the list. *) - if r <> [] then - wa (List.hd r) - else - (); - rt >>= (fun l' -> - return (v' :: l'))) + let t = f v in + let rt = loop r in + t >>= (fun v' -> + (* Perform the specified "waiting action" for the next *) + (* item in the list. *) + if r <> [] then + wa (List.hd r) + else + (); + rt >>= (fun l' -> + return (v' :: l'))) in if l <> [] then wa (List.hd l) else (); loop l - + let rec map_serial f l = match l with [] -> diff --git a/src/lwt/pqueue.ml b/src/lwt/pqueue.ml index b5815ee..e83fed8 100644 --- a/src/lwt/pqueue.ml +++ b/src/lwt/pqueue.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/lwt/pqueue.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/main.ml b/src/main.ml index 60b89ec..ad436a5 100644 --- a/src/main.ml +++ b/src/main.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/main.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -51,7 +51,7 @@ without loading a profile; and then we can't do command-line parsing because it is intertwined with profile loading. - NB: the Mac GUI handles these options itself and needs to change + NB: the Mac GUI handles these options itself and needs to change if any more are added. *) @@ -125,7 +125,7 @@ let interface = (function Uicommon.Text -> ["text"] | Uicommon.Graphic -> ["graphic"]);; -let catch_all f = +let catch_all f = try (* Util.msg "Starting catch_all...\n"; *) f (); @@ -192,7 +192,7 @@ let init () = begin (* Install an appropriate function for finding preference files. (We put this here just because the Prefs module lives below the Os module in the dependency hierarchy, so Prefs can't call Os directly.) *) - Util.supplyFileInUnisonDirFn + Util.supplyFileInUnisonDirFn (fun n -> Os.fileInUnisonDir(n)); (* Start a server if requested *) @@ -238,7 +238,7 @@ end module Body = functor (Ui : Uicommon.UI) -> struct let argv = init() in (* might not return *) (* if it returns start a UI *) - Ui.start + Ui.start (try (match Util.StringMap.find uiPrefName argv with "text"::_ -> Uicommon.Text diff --git a/src/mkProjectInfo.ml b/src/mkProjectInfo.ml index ac23c32..6e8d7b9 100644 --- a/src/mkProjectInfo.ml +++ b/src/mkProjectInfo.ml @@ -44,70 +44,9 @@ let pointVersionOrigin = 543 (* Revision that corresponds to point version 0 *) let revisionString = "$Rev$";; -let pointVersion = +let pointVersion = Scanf.sscanf revisionString "$Rev: %d " (fun x -> x) - pointVersionOrigin;; Printf.printf "MAJORVERSION=%d.%d\n" majorVersion minorVersion;; Printf.printf "VERSION=%d.%d.%d\n" majorVersion minorVersion pointVersion;; Printf.printf "NAME=%s\n" projectName;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/name.ml b/src/name.ml index a5b905d..d13ca27 100644 --- a/src/name.ml +++ b/src/name.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/name.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/os.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -23,7 +23,7 @@ let debug = Util.debug "os" (* Assumption: Prefs are not loaded on server, so clientHostName is always *) (* set to myCanonicalHostName. *) - + let localCanonicalHostName = try System.getenv "UNISONLOCALHOSTNAME" with Not_found -> Unix.gethostname() @@ -45,7 +45,7 @@ let tempFileSuffix = ref tempFileSuffixFixed let includeInTempNames s = (* BCP: Added this in Jan 08. If (as I believe) it never fails, then this tricky stuff can be deleted. *) - assert (s<>""); + assert (s<>""); tempFileSuffix := if s = "" then tempFileSuffixFixed else "." ^ s ^ tempFileSuffixFixed @@ -184,7 +184,7 @@ and delete fspath path = Fs.unlink absolutePath | `ABSENT -> ()) - + let rename fname sourcefspath sourcepath targetfspath targetpath = let source = Fspath.concat sourcefspath sourcepath in let source' = Fspath.toPrintString source in @@ -204,7 +204,7 @@ let rename fname sourcefspath sourcepath targetfspath targetpath = else if Fs.file_exists targetDouble then Fs.unlink targetDouble end) - + let symlink = if Util.isCygwin || (Util.osType != `Win32) then fun fspath path l -> @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/osx.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -310,7 +310,7 @@ let getFileInfos dataFspath dataPath typ = end, stats.Unix.LargeFile.st_mtime, begin match Util.osType with - `Win32 -> (* Was "stats.Unix.LargeFile.st_ctime", but + `Win32 -> (* Was "stats.Unix.LargeFile.st_ctime", but this was bogus: Windows ctimes are not reliable. [BCP, Apr 07] *) 0. diff --git a/src/osxsupport.c b/src/osxsupport.c index 95e818f..aeae587 100644 --- a/src/osxsupport.c +++ b/src/osxsupport.c @@ -110,7 +110,7 @@ CAMLprim value setFileInfos (value path, value fInfo) { sizeof attrBuf.finderInfo, options); if (retcode == -1 && errno == EACCES) { - /* Unlike with normal Unix attributes, we cannot set OS X attributes + /* Unlike with normal Unix attributes, we cannot set OS X attributes if file is read-only. Try making it writable temporarily. */ struct stat st; int r = stat(String_val(path), &st); diff --git a/src/path.ml b/src/path.ml index b46e25b..827fd40 100644 --- a/src/path.ml +++ b/src/path.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/path.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/pixmaps.ml b/src/pixmaps.ml index 04c9640..0713104 100644 --- a/src/pixmaps.ml +++ b/src/pixmaps.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/pixmaps.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -115,7 +115,7 @@ let success = [| " c None"; "* c #00dd00"; (* pixels *) -" "; +" "; " "; " *** "; " ****** "; @@ -138,7 +138,7 @@ let failure = [| " c None"; "* c #ff0000"; (* pixels *) -" * * "; +" * * "; " *** ** "; " *** *** "; " ** ** "; diff --git a/src/pred.ml b/src/pred.ml index 1032856..74be2bf 100644 --- a/src/pred.ml +++ b/src/pred.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/pred.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -40,8 +40,8 @@ let error_msg s = (* [select str [(p1, f1), ..., (pN, fN)] fO]: (roughly) *) (* match str with *) -(* p1 p' -> f1 p' *) -(* ... *) +(* p1 p' -> f1 p' *) +(* ... *) (* pN p' -> fN p' *) (* otherwise -> fO str *) let rec select str l f = @@ -68,7 +68,7 @@ let compile_pattern clause = | _ -> raise (Prefs.IllegalValue ("Malformed pattern: " ^ "\"" ^ clause ^ "\"\n" ^ "Only one instance of " ^ mapSeparator ^ " allowed.")) in - let compiled = + let compiled = begin try select p [("Name ", fun str -> Rx.seq [Rx.rx "(.*/)?"; Rx.globx str]); @@ -97,7 +97,7 @@ let compile_pattern clause = (compiled, v) let create name ?(local=false) ?(advanced=false) fulldoc = - let pref = + let pref = Prefs.create name ~local [] ((if advanced then "!" else "") ^ "add a pattern to the " ^ name ^ " list") @@ -108,7 +108,7 @@ let create name ?(local=false) ?(advanced=false) fulldoc = (fun l -> l) in {pref = pref; name = name; last_pref = []; default = []; last_def = []; last_mode = (Case.ops())#mode; - compiled = Rx.empty; associated_strings = []} + compiled = Rx.empty; associated_strings = []} let addDefaultPatterns p pats = p.default <- Safelist.append pats p.default diff --git a/src/pred.mli b/src/pred.mli index 74803a8..c5c567f 100644 --- a/src/pred.mli +++ b/src/pred.mli @@ -2,27 +2,27 @@ (* Copyright 1999-2016, Benjamin C. Pierce (see COPYING for details) *) (* Predicates over paths. - - General description: - A predicate is determined by a list of default patterns and a list of - current patterns. These patterns can be modified by - [addDefaultPatterns] and [intern]. Function [test p s] tests whether + General description: + + A predicate is determined by a list of default patterns and a list of + current patterns. These patterns can be modified by + [addDefaultPatterns] and [intern]. Function [test p s] tests whether string [s] satisfies predicate [p], i.e., it matches a pattern of [p]. - - For efficiency, the list of patterns are compiled into a regular - expression. Function [test] compares the current value of default - patterns and current patterns against the save ones (recorded in - last_pref/last_def) to determine whether recompilation is necessary. - + + For efficiency, the list of patterns are compiled into a regular + expression. Function [test] compares the current value of default + patterns and current patterns against the save ones (recorded in + last_pref/last_def) to determine whether recompilation is necessary. + Each pattern has the form <TYPE> <PAT> [ -> <ASSOCIATED STRING> ] The associated string is ignored by [test] but can be looked up by [assoc]. - Three forms of <TYPE>/<PAT> are recognized: - "Name <name>": ..../<name> (using globx) - "Path <path>": <path>, not starting with "/" (using globx) - "Regex <regex>": <regex> (using rx) + Three forms of <TYPE>/<PAT> are recognized: + "Name <name>": ..../<name> (using globx) + "Path <path>": <path>, not starting with "/" (using globx) + "Regex <regex>": <regex> (using rx) *) @@ -30,7 +30,7 @@ type t (* Create a new predicate and register it with the preference module. The first arg is the name of the predicate; the second is full (latex) documentation. *) -val create : string -> ?local:bool -> ?advanced:bool -> string -> t +val create : string -> ?local:bool -> ?advanced:bool -> string -> t (* Check whether a given path matches one of the default or current patterns *) val test : t -> string -> bool @@ -55,9 +55,8 @@ val extern : t -> string list (* Return the current list of associated strings *) val extern_associated_strings : t -> string list -(* Create an alternate name for a predicate (the new name will not appear +(* Create an alternate name for a predicate (the new name will not appear in usage messages or generated documentation) *) val alias : t (* existing predicate *) -> string (* new name *) -> unit - diff --git a/src/props.ml b/src/props.ml index ec4686f..3956c9e 100644 --- a/src/props.ml +++ b/src/props.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/props.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -192,7 +192,7 @@ let syncedPartsToString = bit 0o0001 "?" "-" "x" let dontChmod = - Prefs.createBool "dontchmod" + Prefs.createBool "dontchmod" false "!when set, never use the chmod system call" ( "By default, Unison uses the 'chmod' system call to set the permission bits" @@ -202,7 +202,7 @@ let dontChmod = let validatePrefs () = if Prefs.read dontChmod && (Prefs.read permMask <> 0) then raise (Util.Fatal - "If the 'dontchmod' preference is set, the 'perms' preference should be 0") + "If the 'dontchmod' preference is set, the 'perms' preference should be 0") let set fspath path kind (fp, mask) = (* BCP: removed "|| kind <> `Update" on 10/2005, but reinserted it on 11/2008. diff --git a/src/props.mli b/src/props.mli index c450aea..bf3eba5 100644 --- a/src/props.mli +++ b/src/props.mli @@ -41,4 +41,3 @@ val setDirChangeFlag : t -> dirChangedStamp -> int -> t * bool val dirMarkedUnchanged : t -> dirChangedStamp -> int -> bool val validatePrefs: unit -> unit - diff --git a/src/recon.ml b/src/recon.ml index b779231..a7c2fb8 100644 --- a/src/recon.ml +++ b/src/recon.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/recon.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -253,10 +253,10 @@ let shouldCancel path rc1 rc2 root2 = (Int64.of_int (Prefs.read maxSizeThreshold))) in match actionKind rc1 rc2 with - `UPDATE -> + `UPDATE -> if test `UPDATE then true, "would update a file with noupdate or noupdatepartial set" else testSize rc1, "would transfer a file of size greater than maxsizethreshold" - | `DELETION -> + | `DELETION -> if test `UPDATE then true, "would update a file with noupdate or noupdatepartial set" else test `DELETION, "would delete a file with nodeletion or nodeletionpartial set" | `CREATION -> @@ -268,7 +268,7 @@ let filterRi root1 root2 ri = Problem _ -> () | Different diff -> - let cancel,reason = + let cancel,reason = match diff.direction with Replica1ToReplica2 -> shouldCancel (Path.toString ri.path1) diff.rc1 diff.rc2 root2 @@ -276,8 +276,8 @@ let filterRi root1 root2 ri = shouldCancel (Path.toString ri.path1) diff.rc2 diff.rc1 root1 | Conflict _ | Merge -> false,"" - in - if cancel + in + if cancel then diff.direction <- Conflict reason @@ -307,7 +307,7 @@ let overrideReconcilerChoices ris = let checkThatPreferredRootIsValid () = let test_root predname = function | "" | "newer" -> () - | "older" as r -> + | "older" as r -> if not (Prefs.read Props.syncModtimes) then raise (Util.Transient (Printf.sprintf "The '%s=%s' preference can only be used with 'times=true'" @@ -637,7 +637,7 @@ let rec reconcile (* expect this.) *) let uc1' = File(desc1,ContentsSame) in let uc2' = File(desc2,ContentsSame) in - different uc1' uc2' "properties changed on both sides" + different uc1' uc2' "properties changed on both sides" (oldType prev) equals unequals | ContentsSame, ContentsSame when Props.similar desc1 desc2 -> (add_equal counter equals (uc1, uc2), unequals) @@ -732,9 +732,9 @@ let reconcileList allowPartial overrideReconcilerChoices sorted; (sorted, not (Tree.is_empty equals), dangerous) -(* This is the main function: it takes a list of updateItem lists and, - according to the roots and paths of synchronization, builds the - corresponding reconItem list. A second component indicates whether there +(* This is the main function: it takes a list of updateItem lists and, + according to the roots and paths of synchronization, builds the + corresponding reconItem list. A second component indicates whether there is any file updated in the same way on both sides. *) let reconcileAll ?(allowPartial = false) updatesList = Trace.status "Reconciling changes"; diff --git a/src/remote.ml b/src/remote.ml index 467c33f..37efd0d 100644 --- a/src/remote.ml +++ b/src/remote.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/remote.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -1292,7 +1292,7 @@ let openConnectionStart clroot = Prefs.read rshCmd else shell) in - let shellCmdArgs = + let shellCmdArgs = (if shell = "ssh" then Prefs.read sshargs else if shell = "rsh" then diff --git a/src/sortri.ml b/src/sortri.ml index 8988739..a744e40 100644 --- a/src/sortri.ml +++ b/src/sortri.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/sortri.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -16,7 +16,7 @@ *) -open Common +open Common let dbgsort = Util.debug "sort" @@ -66,7 +66,7 @@ let saveSortingPrefs () = bs = Prefs.read bysize; nf = Prefs.read newfirst } -let restoreDefaultSettings () = +let restoreDefaultSettings () = match !savedPrefs with None -> () | Some {nf=nf; bs=bs; sf=sf; sl=sl} -> @@ -86,12 +86,12 @@ let zeroSortingPrefs () = let sortByName () = saveSortingPrefs(); zeroSortingPrefs() - + let sortBySize () = saveSortingPrefs(); zeroSortingPrefs(); Prefs.set bysize true - + let sortNewFirst () = saveSortingPrefs(); Prefs.set newfirst (not (Prefs.read newfirst)) @@ -127,7 +127,7 @@ let compareReconItems () = let pred p = let b1 = p ri1 in let b2 = p ri2 in if b1 && b2 then 0 else if b1 then -1 else if b2 then 1 else 0 in - let cmp = + let cmp = combineCmp [ pred problematic; pred partiallyProblematic; @@ -146,4 +146,3 @@ let compareReconItems () = cmp let sortReconItems items = Safelist.stable_sort (compareReconItems()) items - diff --git a/src/sortri.mli b/src/sortri.mli index c518a5a..de084d7 100644 --- a/src/sortri.mli +++ b/src/sortri.mli @@ -1,7 +1,7 @@ (* Unison file synchronizer: src/sortri.mli *) (* Copyright 1999-2016, Benjamin C. Pierce (see COPYING for details) *) -(* Sort a list of recon items according to the current setting of +(* Sort a list of recon items according to the current setting of various preferences (defined in sort.ml, and accessible from the profile and via the functions below) *) val sortReconItems : Common.reconItem list -> Common.reconItem list @@ -16,4 +16,3 @@ val sortByName : unit -> unit val sortBySize : unit -> unit val sortNewFirst : unit -> unit val restoreDefaultSettings : unit -> unit - diff --git a/src/stasher.ml b/src/stasher.ml index dce4389..6ab9d00 100644 --- a/src/stasher.ml +++ b/src/stasher.ml @@ -1,6 +1,6 @@ (* Unison file synchronizer: src/stasher.ml *) (* $I2: Last modified by lescuyer *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -19,11 +19,11 @@ (* --------------------------------------------------------------------------*) (* Preferences for backing up and stashing *) - + let debug = Util.debug "stasher" let verbose = Util.debug "stasher+" -let backuplocation = +let backuplocation = Prefs.createString "backuploc" "central" "!where backups are stored ('local' or 'central')" ("This preference determines whether backups should be kept locally, near the " @@ -32,7 +32,7 @@ let backuplocation = ^"preference. If set to \\verb|local|, backups will be kept in " ^"the same directory as the original files, and if set to \\verb|central|," ^" \\texttt{backupdir} will be used instead.") - + let _ = Prefs.alias backuplocation "backuplocation" let backup = @@ -46,7 +46,7 @@ let backup = ^ "\\verb|maxbackups| preference." ^ "\n\n The syntax of \\ARG{pathspec} is described in " ^ "\\sectionref{pathspec}{Path Specification}.") - + let _ = Pred.alias backup "mirror" let backupnot = @@ -59,11 +59,11 @@ let backupnot = ^ "as with {\\tt ignore} and {\\tt ignorenot}.") let _ = Pred.alias backupnot "mirrornot" - + let shouldBackup p = let s = (Path.toString p) in Pred.test backup s && not (Pred.test backupnot s) - + let backupprefix = Prefs.createString "backupprefix" ".bak.$VERSION." "!prefix for the names of backup files" @@ -85,7 +85,7 @@ let backupprefix = ^ "whose prefix and suffix match {\\tt backupprefix} and {\\tt backupsuffix}. " ^ "So be careful to choose values for these preferences that are sufficiently " ^ "different from the names of your real files.") - + let backupsuffix = Prefs.createString "backupsuffix" "" "!a suffix to be added to names of backup files" @@ -103,25 +103,25 @@ let backups = let translateOldPrefs () = match (Pred.extern backup, Pred.extern backupnot, Prefs.read backups) with ([], [], true) -> - debug (fun () -> - Util.msg "backups preference set: translated into backup and backuplocation\n"); - Pred.intern backup ["Name *"]; + debug (fun () -> + Util.msg "backups preference set: translated into backup and backuplocation\n"); + Pred.intern backup ["Name *"]; Prefs.set backuplocation "local" - | (_, _, false) -> + | (_, _, false) -> () | _ -> raise (Util.Fatal ( "Both old 'backups' preference and " - ^ "new 'backup' preference are set!")) - + ^ "new 'backup' preference are set!")) + let maxbackups = Prefs.createInt "maxbackups" 2 "!number of backed up versions of a file" ("This preference specifies the number of backup versions that will " ^ "be kept by unison, for each path that matches the predicate " ^ "\\verb|backup|. The default is 2.") - + let _ = Prefs.alias maxbackups "mirrorversions" let _ = Prefs.alias maxbackups "backupversions" - + let backupdir = Prefs.createString "backupdir" "" "!directory for storing centralized backups" @@ -137,9 +137,9 @@ let backupDirectory () = with Not_found -> try Fspath.canonize (Some (System.getenv "UNISONMIRRORDIR")) with Not_found -> - if Prefs.read backupdir <> "" - then Fspath.canonize (Some (Prefs.read backupdir)) - else Fspath.canonize + if Prefs.read backupdir <> "" + then Fspath.canonize (Some (Prefs.read backupdir)) + else Fspath.canonize (Some (System.fspathToString (Os.fileInUnisonDir "backup")))) let backupcurrent = @@ -196,17 +196,17 @@ let backup_rx () = let (udir, uprefix) = ((match Filename.dirname prefix with | "." -> "" - | s -> (Fileutil.backslashes2forwardslashes s)^"/"), + | s -> (Fileutil.backslashes2forwardslashes s)^"/"), Filename.basename prefix) in - let (dir, prefix) = + let (dir, prefix) = ((match udir with "" -> None | _ -> Some(Str.quote udir)), Str.quote uprefix) in - if Str.string_match (Str.regexp ".*\\\\\\$VERSION.*") (prefix^suffix) 0 then + if Str.string_match (Str.regexp ".*\\\\\\$VERSION.*") (prefix^suffix) 0 then (dir, Str.global_replace (Str.regexp "\\\\\\$VERSION") version_rx prefix, Str.global_replace (Str.regexp "\\\\\\$VERSION") version_rx suffix) else raise (Util.Fatal "Either backupprefix or backupsuffix must contain '$VERSION'") - + (* We ignore files whose name ends in .unison.bak, since people may still have these lying around from using previous versions of Unison. *) let oldBackupPrefPathspec = "Name *.unison.bak" @@ -219,55 +219,55 @@ let addBackupFilesToIgnorePref () = Str.global_replace (Str.regexp "\\\\(") "" (Str.global_replace (Str.regexp "\\\\)") "" s) in let (full, dir) = - let d = - match dir_rx with - None -> "/" + let d = + match dir_rx with + None -> "/" | Some s -> regexp_to_rx s in let p = regexp_to_rx prefix_rx in let s = regexp_to_rx suffix_rx in debug (fun() -> Util.msg "d = %s\n" d); ("(.*/)?"^p^".*"^s, "(.*/)?"^(String.sub d 0 (String.length d - 1))) in - let theRegExp = - match dir_rx with - None -> "Regex " ^ full + let theRegExp = + match dir_rx with + None -> "Regex " ^ full | Some _ -> "Regex " ^ dir in Globals.addRegexpToIgnore oldBackupPrefPathspec; if Prefs.read backuplocation = "local" then begin - debug (fun () -> + debug (fun () -> Util.msg "New pattern being added to ignore preferences (for backup files):\n %s\n" theRegExp); Globals.addRegexpToIgnore theRegExp - end + end (* We use references for functions that compute the prefixes and suffixes in order to avoid using functions from the Str module each time we need them. *) let make_prefix = ref (fun i -> assert false) let make_suffix = ref (fun i -> assert false) - + (* This function updates the function used to create prefixes and suffixes for naming backup files, according to the preferences. *) let updateBackupNamingFunctions () = let makeFun s = match Str.full_split (Str.regexp "\\$VERSION") s with [] -> (fun _ -> "") - | [Str.Text t] -> - (fun _ -> t) - | [Str.Delim _; Str.Text t] -> - (fun i -> Printf.sprintf "%d%s" i t) + | [Str.Text t] -> + (fun _ -> t) + | [Str.Delim _; Str.Text t] -> + (fun i -> Printf.sprintf "%d%s" i t) | [Str.Text t; Str.Delim _] -> - (fun i -> Printf.sprintf "%s%d" t i) + (fun i -> Printf.sprintf "%s%d" t i) | [Str.Text t; Str.Delim _; Str.Text t'] -> - (fun i -> Printf.sprintf "%s%d%s" t i t') + (fun i -> Printf.sprintf "%s%d%s" t i t') | _ -> raise (Util.Fatal ( "The tag $VERSION should only appear " ^"once in the backupprefix and backupsuffix preferences.")) in - + make_prefix := makeFun (Prefs.read backupprefix); make_suffix := makeFun (Prefs.read backupsuffix); debug (fun () -> Util.msg "Prefix and suffix regexps for backup filenames have been updated\n") - + (*------------------------------------------------------------------------------------*) let makeBackupName path i = @@ -276,7 +276,7 @@ let makeBackupName path i = if i=0 && Prefs.read backuplocation = "central" then path else - Path.addSuffixToFinalName + Path.addSuffixToFinalName (Path.addPrefixToFinalName path (!make_prefix i)) (!make_suffix i) @@ -285,14 +285,14 @@ let stashDirectory fspath = "central" -> backupDirectory () | "local" -> fspath | _ -> raise (Util.Fatal ("backuplocation preference should be set" - ^"to central or local.")) - + ^"to central or local.")) + let showContent typ fspath path = match typ with | `FILE -> Fingerprint.toString (Fingerprint.file fspath path) | `SYMLINK -> Os.readLink fspath path | `DIRECTORY -> "DIR" - | `ABSENT -> "ABSENT" + | `ABSENT -> "ABSENT" (* Generates a file name for a backup file. If backup file already exists, the old file will be renamed with the count incremented. The newest @@ -300,7 +300,7 @@ let showContent typ fspath path = older files. *) (* BCP: Note that the way we keep bumping up the backup numbers on all existing backup files could make backups very expensive if someone sets maxbackups to a - sufficiently large number! + sufficiently large number! *) let backupPath fspath path = let sFspath = stashDirectory fspath in @@ -358,11 +358,11 @@ let backupPath fspath path = | None -> mkdirectories Path.empty | Some (_, backdir) -> mkdirectories backdir end; - Some(sFspath, sPath) - end + Some(sFspath, sPath) + end (*------------------------------------------------------------------------------------*) - + let backup fspath path (finalDisposition : [`AndRemove | `ByCopying]) arch = debug (fun () -> Util.msg "backup: %s / %s\n" @@ -373,18 +373,18 @@ let backup fspath path (finalDisposition : [`AndRemove | `ByCopying]) arch = let disposeIfNeeded() = if finalDisposition = `AndRemove then Os.delete workingDir realPath in - if not (Os.exists workingDir realPath) then + if not (Os.exists workingDir realPath) then debug (fun () -> Util.msg - "File %s in %s does not exist, so no need to back up\n" + "File %s in %s does not exist, so no need to back up\n" (Path.toString path) (Fspath.toDebugString fspath)) else if shouldBackup path then begin match backupPath fspath path with None -> disposeIfNeeded() | Some (backRoot, backPath) -> - debug (fun () -> Util.msg "Backing up %s / %s to %s in %s\n" + debug (fun () -> Util.msg "Backing up %s / %s to %s in %s\n" (Fspath.toDebugString fspath) (Path.toString path) (Path.toString backPath) (Fspath.toDebugString backRoot)); - let byCopying() = + let byCopying() = Copy.recursively fspath path backRoot backPath; disposeIfNeeded() in begin if finalDisposition = `AndRemove then @@ -399,46 +399,46 @@ let backup fspath path (finalDisposition : [`AndRemove | `ByCopying]) arch = end; Update.iterFiles backRoot backPath arch Xferhint.insertEntry end else begin - debug (fun () -> Util.msg "Path %s / %s does not need to be backed up\n" - (Fspath.toDebugString fspath) - (Path.toString path)); + debug (fun () -> Util.msg "Path %s / %s does not need to be backed up\n" + (Fspath.toDebugString fspath) + (Path.toString path)); disposeIfNeeded() end) - + (*------------------------------------------------------------------------------------*) let rec stashCurrentVersion fspath path sourcePathOpt = - if shouldBackupCurrent path then + if shouldBackupCurrent path then Util.convertUnixErrorsToTransient "stashCurrentVersion" (fun () -> let sourcePath = match sourcePathOpt with None -> path | Some p -> p in - debug (fun () -> Util.msg "stashCurrentVersion of %s (drawn from %s) in %s\n" + debug (fun () -> Util.msg "stashCurrentVersion of %s (drawn from %s) in %s\n" (Path.toString path) (Path.toString sourcePath) (Fspath.toDebugString fspath)); let stat = Fileinfo.get true fspath sourcePath in match stat.Fileinfo.typ with - `ABSENT -> () + `ABSENT -> () | `DIRECTORY -> assert (sourcePathOpt = None); debug (fun () -> Util.msg "Stashing recursively because file is a directory\n"); ignore (Safelist.iter (fun n -> - let pathChild = Path.child path n in - if not (Globals.shouldIgnore pathChild) then + let pathChild = Path.child path n in + if not (Globals.shouldIgnore pathChild) then stashCurrentVersion fspath (Path.child path n) None) (Os.childrenOf fspath path)) - | `SYMLINK -> + | `SYMLINK -> begin match backupPath fspath path with | None -> () | Some (stashFspath,stashPath) -> - Os.symlink stashFspath stashPath (Os.readLink fspath sourcePath) - end + Os.symlink stashFspath stashPath (Os.readLink fspath sourcePath) + end | `FILE -> begin match backupPath fspath path with | None -> () | Some (stashFspath, stashPath) -> - Copy.localFile - fspath sourcePath - stashFspath stashPath stashPath - `Copy + Copy.localFile + fspath sourcePath + stashFspath stashPath stashPath + `Copy stat.Fileinfo.desc (Osx.ressLength stat.Fileinfo.osX.Osx.ressInfo) None @@ -447,44 +447,44 @@ let rec stashCurrentVersion fspath path sourcePathOpt = let _ = Update.setStasherFun (fun fspath path -> stashCurrentVersion fspath path None) -(*------------------------------------------------------------------------------------*) - +(*------------------------------------------------------------------------------------*) + (* This function tries to find a backup of a recent version of the file at location (fspath, path) in the current replica, matching the given fingerprint. If no file is found, then the functions returns None *without* searching on the other replica *) let getRecentVersion fspath path fingerprint = debug (fun () -> - Util.msg "getRecentVersion of %s in %s\n" - (Path.toString path) + Util.msg "getRecentVersion of %s in %s\n" + (Path.toString path) (Fspath.toDebugString fspath)); Util.convertUnixErrorsToTransient "getRecentVersion" (fun () -> let dir = stashDirectory fspath in let rec aux_find i = let path = makeBackupName path i in if Os.exists dir path && - (* FIX: should check that the existing file has the same size, to + (* FIX: should check that the existing file has the same size, to avoid computing the fingerprint if it is obviously going to be different... *) - (let dig = Os.fingerprint dir path (Fileinfo.get false dir path) in - dig = fingerprint) + (let dig = Os.fingerprint dir path (Fileinfo.get false dir path) in + dig = fingerprint) then begin - debug (fun () -> - Util.msg "recent version %s found in %s\n" - (Path.toString path) - (Fspath.toDebugString dir)); - Some (Fspath.concat dir path) + debug (fun () -> + Util.msg "recent version %s found in %s\n" + (Path.toString path) + (Fspath.toDebugString dir)); + Some (Fspath.concat dir path) end else - if i = Prefs.read maxbackups then begin - debug (fun () -> - Util.msg "No recent version was available for %s on this root.\n" - (Fspath.toDebugString (Fspath.concat fspath path))); - None - end else - aux_find (i+1) + if i = Prefs.read maxbackups then begin + debug (fun () -> + Util.msg "No recent version was available for %s on this root.\n" + (Fspath.toDebugString (Fspath.concat fspath path))); + None + end else + aux_find (i+1) in aux_find 0) - -(*------------------------------------------------------------------------------------*) + +(*------------------------------------------------------------------------------------*) (* This function initializes the Stasher module according to the preferences defined in the profile. It should be called whenever a profile is reloaded. *) @@ -493,7 +493,7 @@ let initBackupsLocal () = translateOldPrefs (); addBackupFilesToIgnorePref (); updateBackupNamingFunctions () - + let initBackupsRoot: Common.root -> unit -> unit Lwt.t = Remote.registerRootCmd "initBackups" diff --git a/src/stasher.mli b/src/stasher.mli index 2f9a4e9..c6fba91 100644 --- a/src/stasher.mli +++ b/src/stasher.mli @@ -16,7 +16,7 @@ val backup: val stashCurrentVersion: Fspath.t (* fspath to stash *) -> Path.local (* path to stash *) - -> Path.local option (* path to actual bits to be stashed (used to stash an + -> Path.local option (* path to actual bits to be stashed (used to stash an additional archive version in addition to the current version) *) -> unit @@ -34,9 +34,7 @@ val backupDirectory : unit -> Fspath.t val shouldBackupCurrent : Path.t -> bool (* Low-level backupdir preference *) -val backupdir : string Prefs.t +val backupdir : string Prefs.t (* Initialize the module *) val initBackups: unit -> unit - - diff --git a/src/strings.ml b/src/strings.ml index 63c5021..8bc9d4c 100644 --- a/src/strings.ml +++ b/src/strings.ml @@ -2,13 +2,13 @@ This file has been automatically generated, see docs.ml. *) let docs = - ("about", ("About Unison", + ("about", ("About Unison", "Unison File Synchronizer\n\ Version 2.48.3\n\ \n\ ")) :: - ("", ("Overview", + ("", ("Overview", "Overview\n\ \n\ \032 Unison is a file-synchronization tool for Unix and Windows. It allows\n\ @@ -51,12 +51,12 @@ let docs = \n\ ")) :: - ("", ("Preface", + ("", ("Preface", "Preface\n\ \n\ ")) :: - ("people", ("People", + ("people", ("People", "People\n\ \n\ \032 Benjamin Pierce (http://www.cis.upenn.edu/~bcpierce/) leads the Unison\n\ @@ -87,7 +87,7 @@ let docs = \n\ ")) :: - ("lists", ("Mailing Lists and Bug Reporting", + ("lists", ("Mailing Lists and Bug Reporting", "Mailing Lists and Bug Reporting\n\ \n\ Mailing Lists:\n\ @@ -102,7 +102,7 @@ let docs = \n\ ")) :: - ("status", ("Development Status", + ("status", ("Development Status", "Development Status\n\ \n\ \032 Unison is no longer under active development as a research project.\n\ @@ -136,7 +136,7 @@ let docs = \n\ ")) :: - ("copying", ("Copying", + ("copying", ("Copying", "Copying\n\ \n\ \032 This file is part of Unison.\n\ @@ -157,7 +157,7 @@ let docs = \n\ ")) :: - ("ack", ("Acknowledgements", + ("ack", ("Acknowledgements", "Acknowledgements\n\ \n\ \032 Work on Unison has been supported by the National Science Foundation\n\ @@ -167,7 +167,7 @@ let docs = \n\ ")) :: - ("install", ("Installation", + ("install", ("Installation", "Installation\n\ \n\ \032 Unison is designed to be easy to install. The following sequence of\n\ @@ -359,7 +359,7 @@ let docs = \n\ ")) :: - ("tutorial", ("Tutorial", + ("tutorial", ("Tutorial", "Tutorial\n\ \n\ Preliminaries\n\ @@ -713,7 +713,7 @@ let docs = \n\ ")) :: - ("basics", ("Basic Concepts", + ("basics", ("Basic Concepts", "Basic Concepts\n\ \n\ \032 To understand how Unison works, it is necessary to discuss a few\n\ @@ -874,7 +874,7 @@ let docs = \n\ ")) :: - ("failures", ("Invariants", + ("failures", ("Invariants", "Invariants\n\ \n\ \032 Given the importance and delicacy of the job that it performs, it is\n\ @@ -1006,14 +1006,14 @@ let docs = \n\ ")) :: - ("", ("Reference Guide", + ("", ("Reference Guide", "Reference Guide\n\ \n\ \032 This section covers the features of Unison in detail.\n\ \n\ ")) :: - ("running", ("Running Unison", + ("running", ("Running Unison", "Running Unison\n\ \n\ \032 There are several ways to start Unison.\n\ @@ -2666,7 +2666,7 @@ let docs = \n\ ")) :: - ("ssh", ("Installing Ssh", + ("ssh", ("Installing Ssh", "Installing Ssh\n\ \n\ \032 Warning: These instructions may be out of date. More current\n\ @@ -2772,7 +2772,7 @@ let docs = \n\ ")) :: - ("news", ("Changes in Version 2.48.3", + ("news", ("Changes in Version 2.48.3", "Changes in Version 2.48.3\n\ \n\ \032 Changes since 2.45:\n\ @@ -4531,7 +4531,7 @@ let docs = \n\ ")) :: - ("", ("Junk", + ("", ("Junk", "Junk\n\ \032 __________________________________________________________________\n\ \n\ @@ -4544,4 +4544,3 @@ let docs = ")) :: [];; - diff --git a/src/system.ml b/src/system.ml index 4499c12..05cfa54 100644 --- a/src/system.ml +++ b/src/system.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/system.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/system/generic/system_impl.ml b/src/system/generic/system_impl.ml index 0c5e911..09e17b1 100644 --- a/src/system/generic/system_impl.ml +++ b/src/system/generic/system_impl.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/system/generic/system_impl.ml *) -(* Copyright 1999-2009, Benjamin C. Pierce +(* Copyright 1999-2009, Benjamin C. Pierce 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/src/system/system_generic.ml b/src/system/system_generic.ml index db514bd..22b5b6c 100755 --- a/src/system/system_generic.ml +++ b/src/system/system_generic.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/system/system_generic.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/system/system_intf.ml b/src/system/system_intf.ml index 9a1bde2..0575492 100644 --- a/src/system/system_intf.ml +++ b/src/system/system_intf.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/system/system_intf.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/system/system_win.ml b/src/system/system_win.ml index 71c565b..db294ab 100755 --- a/src/system/system_win.ml +++ b/src/system/system_win.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/system/system_win.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -331,7 +331,7 @@ let terminalStateFunctions () = from the console in order to be able to interrupt Unison at any time. *) { defaultTerminal = (fun () -> setConsoleMode oldstate; - setConsoleOutputCP oldcp); + setConsoleOutputCP oldcp); rawTerminal = (fun () -> setConsoleMode 0x19; setConsoleOutputCP 65001); startReading = (fun () -> setConsoleMode 0x18); stopReading = (fun () -> setConsoleMode 0x19) } diff --git a/src/system/system_win_stubs.c b/src/system/system_win_stubs.c index d14bd8e..883740a 100755 --- a/src/system/system_win_stubs.c +++ b/src/system/system_win_stubs.c @@ -1,561 +1,561 @@ -#define WINVER 0x0500
-
-#include <caml/mlvalues.h>
-#include <caml/alloc.h>
-#include <caml/memory.h>
-#include <caml/fail.h>
-
-#include <windows.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#define NT_MAX_PATH 32768
-
-#define Nothing ((value) 0)
-
-struct filedescr {
- union {
- HANDLE handle;
- SOCKET socket;
- } fd;
- enum { KIND_HANDLE, KIND_SOCKET } kind;
- int crt_fd;
-};
-#define Handle_val(v) (((struct filedescr *) Data_custom_val(v))->fd.handle)
-
-static value copy_wstring(LPCWSTR s)
-{
- int len;
- value res;
-
- len = 2 * wcslen(s) + 2; /* NULL character included */
- res = caml_alloc_string(len);
- memmove(String_val(res), s, len);
- return res;
-}
-
-extern void win32_maperr (DWORD errcode);
-extern void uerror (char * cmdname, value arg);
-extern value win_alloc_handle (HANDLE h);
-extern value cst_to_constr (int n, int * tbl, int size, int deflt);
-
-static int open_access_flags[12] = {
- GENERIC_READ, GENERIC_WRITE, GENERIC_READ|GENERIC_WRITE,
- 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static int open_create_flags[12] = {
- 0, 0, 0, 0, O_APPEND, O_CREAT, O_TRUNC, O_EXCL, 0, 0, 0, 0
-};
-
-/****/
-
-CAMLprim value win_rmdir(value path, value wpath)
-{
- CAMLparam2(path, wpath);
- if (!RemoveDirectoryW((LPWSTR)String_val(wpath))) {
- win32_maperr (GetLastError ());
- uerror("rmdir", path);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_mkdir(value path, value wpath)
-{
- CAMLparam2(path, wpath);
- if (!CreateDirectoryW((LPWSTR)String_val(wpath), NULL)) {
- win32_maperr (GetLastError ());
- uerror("mkdir", path);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_unlink(value path, value wpath)
-{
- CAMLparam2(path, wpath);
- if (!DeleteFileW((LPWSTR)String_val(wpath))) {
- win32_maperr (GetLastError ());
- uerror("unlink", path);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_rename(value path1, value wpath1, value wpath2)
-{
- int err, t;
- CAMLparam3(path1, wpath1, wpath2);
-
- t = 10;
- retry:
- if (!MoveFileExW((LPWSTR)String_val(wpath1), (LPWSTR)String_val(wpath2),
- MOVEFILE_REPLACE_EXISTING)) {
- err = GetLastError ();
- if ((err == ERROR_SHARING_VIOLATION || err == ERROR_ACCESS_DENIED) &&
- t < 1000) {
- /* The renaming may fail due to an indexer or an anti-virus.
- We retry after a short time in the hope that this other
- program is done with the file. */
- Sleep (t);
- t *= 2;
- goto retry;
- }
- win32_maperr (err);
- uerror("rename", path1);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_link(value path1, value wpath1, value wpath2)
-{
- CAMLparam3(path1, wpath1, wpath2);
-
- if (!CreateHardLinkW((LPWSTR)String_val(wpath2), (LPWSTR)String_val(wpath1),
- NULL)) {
- win32_maperr (GetLastError ());
- uerror("rename", path1);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_chmod (value path, value wpath, value perm) {
- DWORD attr;
- CAMLparam3(path, wpath, perm);
-
- attr = GetFileAttributesW ((LPCWSTR)String_val (wpath));
- if (attr == INVALID_FILE_ATTRIBUTES) {
- win32_maperr (GetLastError ());
- uerror("chmod", path);
- }
- if (Int_val(perm) & _S_IWRITE)
- attr &= ~FILE_ATTRIBUTE_READONLY;
- else
- attr |= FILE_ATTRIBUTE_READONLY;
-
- if (!SetFileAttributesW ((LPCWSTR)String_val (wpath), attr)) {
- win32_maperr (GetLastError ());
- uerror("chmod", path);
- }
-
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_utimes (value path, value wpath, value atime, value mtime) {
- HANDLE h;
- BOOL res;
- ULARGE_INTEGER iatime, imtime;
- FILETIME fatime, fmtime;
-
- CAMLparam4(path, wpath, atime, mtime);
-
- iatime.QuadPart = Double_val(atime);
- imtime.QuadPart = Double_val(mtime);
-
- /* http://www.filewatcher.com/p/Win32-UTCFileTime-1.44.tar.gz.93147/Win32-UTCFileTime-1.44/UTCFileTime.xs.html */
- /* http://savannah.nongnu.org/bugs/?22781#comment0 */
- if (iatime.QuadPart || imtime.QuadPart) {
- iatime.QuadPart += 11644473600ull;
- iatime.QuadPart *= 10000000ull;
- fatime.dwLowDateTime = iatime.LowPart;
- fatime.dwHighDateTime = iatime.HighPart;
- imtime.QuadPart += 11644473600ull;
- imtime.QuadPart *= 10000000ull;
- fmtime.dwLowDateTime = imtime.LowPart;
- fmtime.dwHighDateTime = imtime.HighPart;
- } else {
- GetSystemTimeAsFileTime (&fatime);
- fmtime = fatime;
- }
- h = CreateFileW ((LPWSTR) wpath, FILE_WRITE_ATTRIBUTES,
- FILE_SHARE_READ | FILE_SHARE_WRITE,
- NULL, OPEN_EXISTING, 0, NULL);
- if (h == INVALID_HANDLE_VALUE) {
- win32_maperr (GetLastError ());
- uerror("utimes", path);
- }
- res = SetFileTime (h, NULL, &fatime, &fmtime);
- if (res == 0) {
- win32_maperr (GetLastError ());
- (void)CloseHandle (h);
- uerror("utimes", path);
- }
- res = CloseHandle (h);
- if (res == 0) {
- win32_maperr (GetLastError ());
- uerror("utimes", path);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_open (value path, value wpath, value flags, value perm) {
- int fileaccess, createflags, fileattrib, filecreate;
- SECURITY_ATTRIBUTES attr;
- HANDLE h;
-
- CAMLparam4 (path, wpath, flags, perm);
-
- fileaccess = convert_flag_list(flags, open_access_flags);
-
- createflags = convert_flag_list(flags, open_create_flags);
- if ((createflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL))
- filecreate = CREATE_NEW;
- else if ((createflags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC))
- filecreate = CREATE_ALWAYS;
- else if (createflags & O_TRUNC)
- filecreate = TRUNCATE_EXISTING;
- else if (createflags & O_CREAT)
- filecreate = OPEN_ALWAYS;
- else
- filecreate = OPEN_EXISTING;
-
- if ((createflags & O_CREAT) && (Int_val(perm) & 0200) == 0)
- fileattrib = FILE_ATTRIBUTE_READONLY;
- else
- fileattrib = FILE_ATTRIBUTE_NORMAL;
-
- attr.nLength = sizeof(attr);
- attr.lpSecurityDescriptor = NULL;
- attr.bInheritHandle = TRUE;
-
- h = CreateFileW((LPCWSTR) String_val(wpath), fileaccess,
- FILE_SHARE_READ | FILE_SHARE_WRITE, &attr,
- filecreate, fileattrib, NULL);
-
- if (h == INVALID_HANDLE_VALUE) {
- win32_maperr (GetLastError ());
- uerror("open", path);
- }
-
- if (createflags & O_APPEND) SetFilePointer (h, 0, NULL, FILE_END);
-
- CAMLreturn(win_alloc_handle(h));
-}
-
-#define MAKEDWORDLONG(a,b) ((DWORDLONG)(((DWORD)(a))|(((DWORDLONG)((DWORD)(b)))<<32)))
-#define FILETIME_TO_TIME(ft) (((((ULONGLONG) ft.dwHighDateTime) << 32) + ft.dwLowDateTime) / 10000000ull - 11644473600ull)
-
-CAMLprim value win_stat(value path, value wpath)
-{
- int res, mode;
- HANDLE h;
- BY_HANDLE_FILE_INFORMATION info;
- CAMLparam2(path,wpath);
- CAMLlocal1 (v);
-
- h = CreateFileW ((LPCWSTR) String_val (wpath), 0, 0, NULL, OPEN_EXISTING,
- FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_READONLY, NULL);
-
- if (h == INVALID_HANDLE_VALUE) {
- win32_maperr (GetLastError ());
- uerror("stat", path);
- }
-
- res = GetFileInformationByHandle (h, &info);
- if (res == 0) {
- win32_maperr (GetLastError ());
- (void) CloseHandle (h);
- uerror("stat", path);
- }
-
- res = CloseHandle (h);
- if (res == 0) {
- win32_maperr (GetLastError ());
- uerror("stat", path);
- }
-
- v = caml_alloc (12, 0);
- Store_field (v, 0, Val_int (info.dwVolumeSerialNumber));
-
- // Apparently, we cannot trust the inode number to be stable when
- // nFileIndexHigh is 0.
- if (info.nFileIndexHigh == 0) info.nFileIndexLow = 0;
- /* The ocaml code truncates inode numbers to 31 bits. We hash the
- low and high parts in order to lose as little information as
- possible. */
- Store_field
- (v, 1, Val_int (MAKEDWORDLONG(info.nFileIndexLow,info.nFileIndexHigh)+155825701*((DWORDLONG)info.nFileIndexHigh)));
- Store_field
- (v, 2, Val_int (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
- ? 1: 0));
- mode = 0000444;
- if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- mode |= 0000111;
- if (!(info.dwFileAttributes & FILE_ATTRIBUTE_READONLY))
- mode |= 0000222;
- Store_field (v, 3, Val_int(mode));
- Store_field (v, 4, Val_int (info.nNumberOfLinks));
- Store_field (v, 5, Val_int (0));
- Store_field (v, 6, Val_int (0));
- Store_field (v, 7, Val_int (0));
- Store_field
- (v, 8, copy_int64(MAKEDWORDLONG(info.nFileSizeLow,info.nFileSizeHigh)));
- Store_field
- (v, 9, copy_double((double) FILETIME_TO_TIME(info.ftLastAccessTime)));
- Store_field
- (v, 10, copy_double((double) FILETIME_TO_TIME(info.ftLastWriteTime)));
- Store_field
- (v, 11, copy_double((double) FILETIME_TO_TIME(info.ftCreationTime)));
-
- CAMLreturn (v);
-}
-
-CAMLprim value win_chdir (value path, value wpath)
-{
- CAMLparam2(path,wpath);
- if (!SetCurrentDirectoryW ((LPWSTR)wpath)) {
- win32_maperr(GetLastError());
- uerror("chdir", path);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_getcwd (value unit)
-{
- int res;
- wchar_t s[NT_MAX_PATH];
- CAMLparam0();
- CAMLlocal1 (path);
-
- res = GetCurrentDirectoryW (NT_MAX_PATH, s);
- if (res == 0) {
- win32_maperr(GetLastError());
- uerror("getcwd", Nothing);
- }
- /* Normalize the path */
- res = GetLongPathNameW (s, s, NT_MAX_PATH);
- if (res == 0) {
- win32_maperr(GetLastError());
- uerror("getcwd", Nothing);
- }
- /* Convert the drive letter to uppercase */
- if (s[0] >= L'a' && s[0] <= L'z') s[0] -= 32;
- path = copy_wstring(s);
- CAMLreturn (path);
-}
-
-CAMLprim value win_findfirstw(value name)
-{
- HANDLE h;
- WIN32_FIND_DATAW fileinfo;
-
- CAMLparam1(name);
- CAMLlocal3(v, valname, valh);
-
- h = FindFirstFileW((LPCWSTR) String_val(name),&fileinfo);
- if (h == INVALID_HANDLE_VALUE) {
- DWORD err = GetLastError();
- if ((err == ERROR_NO_MORE_FILES) || (err == ERROR_FILE_NOT_FOUND))
- raise_end_of_file();
- else {
- win32_maperr(err);
- uerror("opendir", Nothing);
- }
- }
- valname = copy_wstring(fileinfo.cFileName);
- valh = win_alloc_handle(h);
- v = alloc_small(2, 0);
- Field(v,0) = valname;
- Field(v,1) = valh;
- CAMLreturn (v);
-}
-
-CAMLprim value win_findnextw(value valh)
-{
- WIN32_FIND_DATAW fileinfo;
- BOOL retcode;
-
- CAMLparam1(valh);
-
- retcode = FindNextFileW(Handle_val(valh), &fileinfo);
- if (!retcode) {
- DWORD err = GetLastError();
- if (err == ERROR_NO_MORE_FILES)
- raise_end_of_file();
- else {
- win32_maperr(err);
- uerror("readdir", Nothing);
- }
- }
- CAMLreturn (copy_wstring(fileinfo.cFileName));
-}
-
-CAMLprim value win_findclosew(value valh)
-{
- CAMLparam1(valh);
-
- if (! FindClose(Handle_val(valh))) {
- win32_maperr(GetLastError());
- uerror("closedir", Nothing);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_getenv(value var)
-{
- LPWSTR s;
- DWORD len;
- CAMLparam1(var);
- CAMLlocal1(res);
-
- s = stat_alloc (65536);
-
- len = GetEnvironmentVariableW((LPCWSTR) String_val(var), s, 65536);
- if (len == 0) { stat_free (s); raise_not_found(); }
-
- res = copy_wstring(s);
- stat_free (s);
- CAMLreturn (res);
-
-}
-
-CAMLprim value win_putenv(value var, value wvar, value v)
-{
- BOOL res;
- CAMLparam3(var, wvar, v);
-
- res = SetEnvironmentVariableW((LPCWSTR) String_val(wvar), (LPCWSTR) v);
- if (res == 0) {
- win32_maperr (GetLastError ());
- uerror("putenv", var);
- }
- CAMLreturn (Val_unit);
-}
-
-CAMLprim value win_argv(value unit)
-{
- int n, i;
- LPWSTR * l;
-
- CAMLparam0();
- CAMLlocal2(v,res);
-
- l = CommandLineToArgvW (GetCommandLineW (), &n);
-
- if (l == NULL) {
- win32_maperr (GetLastError ());
- uerror("argv", Nothing);
- }
- res = caml_alloc (n, 0);
- for (i = 0; i < n; i++) {
- v = copy_wstring (l[i]);
- Store_field (res, i, v);
- }
- LocalFree (l);
- CAMLreturn (res);
-}
-
-CAMLprim value w_create_process_native
-(value prog, value wprog, value wargs, value fd1, value fd2, value fd3)
-{
- int res, flags;
- PROCESS_INFORMATION pi;
- STARTUPINFOW si;
- wchar_t fullname [MAX_PATH];
- HANDLE h;
- CAMLparam5(wprog, wargs, fd1, fd2, fd3);
-
- res = SearchPathW (NULL, (LPCWSTR) String_val(wprog), L".exe",
- MAX_PATH, fullname, NULL);
- if (res == 0) {
- win32_maperr (GetLastError ());
- uerror("create_process", prog);
- }
-
- ZeroMemory(&si, sizeof(STARTUPINFO));
-
- si.cb = sizeof(STARTUPINFO);
- si.dwFlags = STARTF_USESTDHANDLES;
- si.hStdInput = Handle_val(fd1);
- si.hStdOutput = Handle_val(fd2);
- si.hStdError = Handle_val(fd3);
-
- flags = GetPriorityClass (GetCurrentProcess ());
- /*
- h = CreateFile ("CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (h != INVALID_HANDLE_VALUE)
- CloseHandle (h);
- else {
- flags |= CREATE_NEW_CONSOLE;
- // si.dwFlags |= STARTF_USESHOWWINDOW;
- // si.wShowWindow = SW_MINIMIZE;
- }
- */
-
- res = CreateProcessW (fullname, (LPWSTR) String_val(wargs),
- NULL, NULL, TRUE, flags,
- NULL, NULL, &si, &pi);
- if (res == 0) {
- win32_maperr (GetLastError ());
- uerror("create_process", prog);
- }
-
- CloseHandle (pi.hThread);
- CAMLreturn (Val_long (pi.hProcess));
-}
-
-CAMLprim value w_create_process(value * argv, int argn)
-{
- return w_create_process_native(argv[0], argv[1], argv[2],
- argv[3], argv[4], argv[5]);
-}
-
-/****/
-
-static HANDLE conin = INVALID_HANDLE_VALUE;
-
-static void init_conin ()
-{
- if (conin == INVALID_HANDLE_VALUE) {
- conin = CreateFile ("CONIN$", GENERIC_READ | GENERIC_WRITE,
- FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
- OPEN_EXISTING, 0, 0);
- if (conin == INVALID_HANDLE_VALUE) {
- win32_maperr (GetLastError ());
- uerror("init_conin", Nothing);
- }
- }
-}
-
-CAMLprim value win_get_console_mode (value unit)
-{
- DWORD mode;
- BOOL res;
-
- init_conin ();
-
- res = GetConsoleMode (conin, &mode);
- if (res == 0) {
- win32_maperr (GetLastError ());
- uerror("get_console_mode", Nothing);
- }
-
- return (Val_int (mode));
-}
-
-CAMLprim value win_set_console_mode (value mode)
-{
- BOOL res;
-
- init_conin ();
-
- res = SetConsoleMode (conin, Int_val(mode));
- if (res == 0) {
- win32_maperr (GetLastError ());
- uerror("set_console_mode", Nothing);
- }
- return (Val_unit);
-}
-
-CAMLprim value win_get_console_output_cp (value unit) {
- return (Val_int (GetConsoleOutputCP ()));
-}
-
-CAMLprim value win_set_console_output_cp (value cp) {
- BOOL res;
- res = SetConsoleOutputCP (Int_val (cp));
- if (res == 0) {
- win32_maperr (GetLastError ());
- uerror("set_console_cp", Nothing);
- }
- return (Val_unit);
-}
+#define WINVER 0x0500 + +#include <caml/mlvalues.h> +#include <caml/alloc.h> +#include <caml/memory.h> +#include <caml/fail.h> + +#include <windows.h> +#include <fcntl.h> +#include <sys/stat.h> + +#define NT_MAX_PATH 32768 + +#define Nothing ((value) 0) + +struct filedescr { + union { + HANDLE handle; + SOCKET socket; + } fd; + enum { KIND_HANDLE, KIND_SOCKET } kind; + int crt_fd; +}; +#define Handle_val(v) (((struct filedescr *) Data_custom_val(v))->fd.handle) + +static value copy_wstring(LPCWSTR s) +{ + int len; + value res; + + len = 2 * wcslen(s) + 2; /* NULL character included */ + res = caml_alloc_string(len); + memmove(String_val(res), s, len); + return res; +} + +extern void win32_maperr (DWORD errcode); +extern void uerror (char * cmdname, value arg); +extern value win_alloc_handle (HANDLE h); +extern value cst_to_constr (int n, int * tbl, int size, int deflt); + +static int open_access_flags[12] = { + GENERIC_READ, GENERIC_WRITE, GENERIC_READ|GENERIC_WRITE, + 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static int open_create_flags[12] = { + 0, 0, 0, 0, O_APPEND, O_CREAT, O_TRUNC, O_EXCL, 0, 0, 0, 0 +}; + +/****/ + +CAMLprim value win_rmdir(value path, value wpath) +{ + CAMLparam2(path, wpath); + if (!RemoveDirectoryW((LPWSTR)String_val(wpath))) { + win32_maperr (GetLastError ()); + uerror("rmdir", path); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_mkdir(value path, value wpath) +{ + CAMLparam2(path, wpath); + if (!CreateDirectoryW((LPWSTR)String_val(wpath), NULL)) { + win32_maperr (GetLastError ()); + uerror("mkdir", path); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_unlink(value path, value wpath) +{ + CAMLparam2(path, wpath); + if (!DeleteFileW((LPWSTR)String_val(wpath))) { + win32_maperr (GetLastError ()); + uerror("unlink", path); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_rename(value path1, value wpath1, value wpath2) +{ + int err, t; + CAMLparam3(path1, wpath1, wpath2); + + t = 10; + retry: + if (!MoveFileExW((LPWSTR)String_val(wpath1), (LPWSTR)String_val(wpath2), + MOVEFILE_REPLACE_EXISTING)) { + err = GetLastError (); + if ((err == ERROR_SHARING_VIOLATION || err == ERROR_ACCESS_DENIED) && + t < 1000) { + /* The renaming may fail due to an indexer or an anti-virus. + We retry after a short time in the hope that this other + program is done with the file. */ + Sleep (t); + t *= 2; + goto retry; + } + win32_maperr (err); + uerror("rename", path1); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_link(value path1, value wpath1, value wpath2) +{ + CAMLparam3(path1, wpath1, wpath2); + + if (!CreateHardLinkW((LPWSTR)String_val(wpath2), (LPWSTR)String_val(wpath1), + NULL)) { + win32_maperr (GetLastError ()); + uerror("rename", path1); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_chmod (value path, value wpath, value perm) { + DWORD attr; + CAMLparam3(path, wpath, perm); + + attr = GetFileAttributesW ((LPCWSTR)String_val (wpath)); + if (attr == INVALID_FILE_ATTRIBUTES) { + win32_maperr (GetLastError ()); + uerror("chmod", path); + } + if (Int_val(perm) & _S_IWRITE) + attr &= ~FILE_ATTRIBUTE_READONLY; + else + attr |= FILE_ATTRIBUTE_READONLY; + + if (!SetFileAttributesW ((LPCWSTR)String_val (wpath), attr)) { + win32_maperr (GetLastError ()); + uerror("chmod", path); + } + + CAMLreturn (Val_unit); +} + +CAMLprim value win_utimes (value path, value wpath, value atime, value mtime) { + HANDLE h; + BOOL res; + ULARGE_INTEGER iatime, imtime; + FILETIME fatime, fmtime; + + CAMLparam4(path, wpath, atime, mtime); + + iatime.QuadPart = Double_val(atime); + imtime.QuadPart = Double_val(mtime); + + /* http://www.filewatcher.com/p/Win32-UTCFileTime-1.44.tar.gz.93147/Win32-UTCFileTime-1.44/UTCFileTime.xs.html */ + /* http://savannah.nongnu.org/bugs/?22781#comment0 */ + if (iatime.QuadPart || imtime.QuadPart) { + iatime.QuadPart += 11644473600ull; + iatime.QuadPart *= 10000000ull; + fatime.dwLowDateTime = iatime.LowPart; + fatime.dwHighDateTime = iatime.HighPart; + imtime.QuadPart += 11644473600ull; + imtime.QuadPart *= 10000000ull; + fmtime.dwLowDateTime = imtime.LowPart; + fmtime.dwHighDateTime = imtime.HighPart; + } else { + GetSystemTimeAsFileTime (&fatime); + fmtime = fatime; + } + h = CreateFileW ((LPWSTR) wpath, FILE_WRITE_ATTRIBUTES, + FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, OPEN_EXISTING, 0, NULL); + if (h == INVALID_HANDLE_VALUE) { + win32_maperr (GetLastError ()); + uerror("utimes", path); + } + res = SetFileTime (h, NULL, &fatime, &fmtime); + if (res == 0) { + win32_maperr (GetLastError ()); + (void)CloseHandle (h); + uerror("utimes", path); + } + res = CloseHandle (h); + if (res == 0) { + win32_maperr (GetLastError ()); + uerror("utimes", path); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_open (value path, value wpath, value flags, value perm) { + int fileaccess, createflags, fileattrib, filecreate; + SECURITY_ATTRIBUTES attr; + HANDLE h; + + CAMLparam4 (path, wpath, flags, perm); + + fileaccess = convert_flag_list(flags, open_access_flags); + + createflags = convert_flag_list(flags, open_create_flags); + if ((createflags & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL)) + filecreate = CREATE_NEW; + else if ((createflags & (O_CREAT | O_TRUNC)) == (O_CREAT | O_TRUNC)) + filecreate = CREATE_ALWAYS; + else if (createflags & O_TRUNC) + filecreate = TRUNCATE_EXISTING; + else if (createflags & O_CREAT) + filecreate = OPEN_ALWAYS; + else + filecreate = OPEN_EXISTING; + + if ((createflags & O_CREAT) && (Int_val(perm) & 0200) == 0) + fileattrib = FILE_ATTRIBUTE_READONLY; + else + fileattrib = FILE_ATTRIBUTE_NORMAL; + + attr.nLength = sizeof(attr); + attr.lpSecurityDescriptor = NULL; + attr.bInheritHandle = TRUE; + + h = CreateFileW((LPCWSTR) String_val(wpath), fileaccess, + FILE_SHARE_READ | FILE_SHARE_WRITE, &attr, + filecreate, fileattrib, NULL); + + if (h == INVALID_HANDLE_VALUE) { + win32_maperr (GetLastError ()); + uerror("open", path); + } + + if (createflags & O_APPEND) SetFilePointer (h, 0, NULL, FILE_END); + + CAMLreturn(win_alloc_handle(h)); +} + +#define MAKEDWORDLONG(a,b) ((DWORDLONG)(((DWORD)(a))|(((DWORDLONG)((DWORD)(b)))<<32))) +#define FILETIME_TO_TIME(ft) (((((ULONGLONG) ft.dwHighDateTime) << 32) + ft.dwLowDateTime) / 10000000ull - 11644473600ull) + +CAMLprim value win_stat(value path, value wpath) +{ + int res, mode; + HANDLE h; + BY_HANDLE_FILE_INFORMATION info; + CAMLparam2(path,wpath); + CAMLlocal1 (v); + + h = CreateFileW ((LPCWSTR) String_val (wpath), 0, 0, NULL, OPEN_EXISTING, + FILE_FLAG_BACKUP_SEMANTICS | FILE_ATTRIBUTE_READONLY, NULL); + + if (h == INVALID_HANDLE_VALUE) { + win32_maperr (GetLastError ()); + uerror("stat", path); + } + + res = GetFileInformationByHandle (h, &info); + if (res == 0) { + win32_maperr (GetLastError ()); + (void) CloseHandle (h); + uerror("stat", path); + } + + res = CloseHandle (h); + if (res == 0) { + win32_maperr (GetLastError ()); + uerror("stat", path); + } + + v = caml_alloc (12, 0); + Store_field (v, 0, Val_int (info.dwVolumeSerialNumber)); + + // Apparently, we cannot trust the inode number to be stable when + // nFileIndexHigh is 0. + if (info.nFileIndexHigh == 0) info.nFileIndexLow = 0; + /* The ocaml code truncates inode numbers to 31 bits. We hash the + low and high parts in order to lose as little information as + possible. */ + Store_field + (v, 1, Val_int (MAKEDWORDLONG(info.nFileIndexLow,info.nFileIndexHigh)+155825701*((DWORDLONG)info.nFileIndexHigh))); + Store_field + (v, 2, Val_int (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY + ? 1: 0)); + mode = 0000444; + if (info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + mode |= 0000111; + if (!(info.dwFileAttributes & FILE_ATTRIBUTE_READONLY)) + mode |= 0000222; + Store_field (v, 3, Val_int(mode)); + Store_field (v, 4, Val_int (info.nNumberOfLinks)); + Store_field (v, 5, Val_int (0)); + Store_field (v, 6, Val_int (0)); + Store_field (v, 7, Val_int (0)); + Store_field + (v, 8, copy_int64(MAKEDWORDLONG(info.nFileSizeLow,info.nFileSizeHigh))); + Store_field + (v, 9, copy_double((double) FILETIME_TO_TIME(info.ftLastAccessTime))); + Store_field + (v, 10, copy_double((double) FILETIME_TO_TIME(info.ftLastWriteTime))); + Store_field + (v, 11, copy_double((double) FILETIME_TO_TIME(info.ftCreationTime))); + + CAMLreturn (v); +} + +CAMLprim value win_chdir (value path, value wpath) +{ + CAMLparam2(path,wpath); + if (!SetCurrentDirectoryW ((LPWSTR)wpath)) { + win32_maperr(GetLastError()); + uerror("chdir", path); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_getcwd (value unit) +{ + int res; + wchar_t s[NT_MAX_PATH]; + CAMLparam0(); + CAMLlocal1 (path); + + res = GetCurrentDirectoryW (NT_MAX_PATH, s); + if (res == 0) { + win32_maperr(GetLastError()); + uerror("getcwd", Nothing); + } + /* Normalize the path */ + res = GetLongPathNameW (s, s, NT_MAX_PATH); + if (res == 0) { + win32_maperr(GetLastError()); + uerror("getcwd", Nothing); + } + /* Convert the drive letter to uppercase */ + if (s[0] >= L'a' && s[0] <= L'z') s[0] -= 32; + path = copy_wstring(s); + CAMLreturn (path); +} + +CAMLprim value win_findfirstw(value name) +{ + HANDLE h; + WIN32_FIND_DATAW fileinfo; + + CAMLparam1(name); + CAMLlocal3(v, valname, valh); + + h = FindFirstFileW((LPCWSTR) String_val(name),&fileinfo); + if (h == INVALID_HANDLE_VALUE) { + DWORD err = GetLastError(); + if ((err == ERROR_NO_MORE_FILES) || (err == ERROR_FILE_NOT_FOUND)) + raise_end_of_file(); + else { + win32_maperr(err); + uerror("opendir", Nothing); + } + } + valname = copy_wstring(fileinfo.cFileName); + valh = win_alloc_handle(h); + v = alloc_small(2, 0); + Field(v,0) = valname; + Field(v,1) = valh; + CAMLreturn (v); +} + +CAMLprim value win_findnextw(value valh) +{ + WIN32_FIND_DATAW fileinfo; + BOOL retcode; + + CAMLparam1(valh); + + retcode = FindNextFileW(Handle_val(valh), &fileinfo); + if (!retcode) { + DWORD err = GetLastError(); + if (err == ERROR_NO_MORE_FILES) + raise_end_of_file(); + else { + win32_maperr(err); + uerror("readdir", Nothing); + } + } + CAMLreturn (copy_wstring(fileinfo.cFileName)); +} + +CAMLprim value win_findclosew(value valh) +{ + CAMLparam1(valh); + + if (! FindClose(Handle_val(valh))) { + win32_maperr(GetLastError()); + uerror("closedir", Nothing); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_getenv(value var) +{ + LPWSTR s; + DWORD len; + CAMLparam1(var); + CAMLlocal1(res); + + s = stat_alloc (65536); + + len = GetEnvironmentVariableW((LPCWSTR) String_val(var), s, 65536); + if (len == 0) { stat_free (s); raise_not_found(); } + + res = copy_wstring(s); + stat_free (s); + CAMLreturn (res); + +} + +CAMLprim value win_putenv(value var, value wvar, value v) +{ + BOOL res; + CAMLparam3(var, wvar, v); + + res = SetEnvironmentVariableW((LPCWSTR) String_val(wvar), (LPCWSTR) v); + if (res == 0) { + win32_maperr (GetLastError ()); + uerror("putenv", var); + } + CAMLreturn (Val_unit); +} + +CAMLprim value win_argv(value unit) +{ + int n, i; + LPWSTR * l; + + CAMLparam0(); + CAMLlocal2(v,res); + + l = CommandLineToArgvW (GetCommandLineW (), &n); + + if (l == NULL) { + win32_maperr (GetLastError ()); + uerror("argv", Nothing); + } + res = caml_alloc (n, 0); + for (i = 0; i < n; i++) { + v = copy_wstring (l[i]); + Store_field (res, i, v); + } + LocalFree (l); + CAMLreturn (res); +} + +CAMLprim value w_create_process_native +(value prog, value wprog, value wargs, value fd1, value fd2, value fd3) +{ + int res, flags; + PROCESS_INFORMATION pi; + STARTUPINFOW si; + wchar_t fullname [MAX_PATH]; + HANDLE h; + CAMLparam5(wprog, wargs, fd1, fd2, fd3); + + res = SearchPathW (NULL, (LPCWSTR) String_val(wprog), L".exe", + MAX_PATH, fullname, NULL); + if (res == 0) { + win32_maperr (GetLastError ()); + uerror("create_process", prog); + } + + ZeroMemory(&si, sizeof(STARTUPINFO)); + + si.cb = sizeof(STARTUPINFO); + si.dwFlags = STARTF_USESTDHANDLES; + si.hStdInput = Handle_val(fd1); + si.hStdOutput = Handle_val(fd2); + si.hStdError = Handle_val(fd3); + + flags = GetPriorityClass (GetCurrentProcess ()); + /* + h = CreateFile ("CONOUT$", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (h != INVALID_HANDLE_VALUE) + CloseHandle (h); + else { + flags |= CREATE_NEW_CONSOLE; + // si.dwFlags |= STARTF_USESHOWWINDOW; + // si.wShowWindow = SW_MINIMIZE; + } + */ + + res = CreateProcessW (fullname, (LPWSTR) String_val(wargs), + NULL, NULL, TRUE, flags, + NULL, NULL, &si, &pi); + if (res == 0) { + win32_maperr (GetLastError ()); + uerror("create_process", prog); + } + + CloseHandle (pi.hThread); + CAMLreturn (Val_long (pi.hProcess)); +} + +CAMLprim value w_create_process(value * argv, int argn) +{ + return w_create_process_native(argv[0], argv[1], argv[2], + argv[3], argv[4], argv[5]); +} + +/****/ + +static HANDLE conin = INVALID_HANDLE_VALUE; + +static void init_conin () +{ + if (conin == INVALID_HANDLE_VALUE) { + conin = CreateFile ("CONIN$", GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + OPEN_EXISTING, 0, 0); + if (conin == INVALID_HANDLE_VALUE) { + win32_maperr (GetLastError ()); + uerror("init_conin", Nothing); + } + } +} + +CAMLprim value win_get_console_mode (value unit) +{ + DWORD mode; + BOOL res; + + init_conin (); + + res = GetConsoleMode (conin, &mode); + if (res == 0) { + win32_maperr (GetLastError ()); + uerror("get_console_mode", Nothing); + } + + return (Val_int (mode)); +} + +CAMLprim value win_set_console_mode (value mode) +{ + BOOL res; + + init_conin (); + + res = SetConsoleMode (conin, Int_val(mode)); + if (res == 0) { + win32_maperr (GetLastError ()); + uerror("set_console_mode", Nothing); + } + return (Val_unit); +} + +CAMLprim value win_get_console_output_cp (value unit) { + return (Val_int (GetConsoleOutputCP ())); +} + +CAMLprim value win_set_console_output_cp (value cp) { + BOOL res; + res = SetConsoleOutputCP (Int_val (cp)); + if (res == 0) { + win32_maperr (GetLastError ()); + uerror("set_console_cp", Nothing); + } + return (Val_unit); +} diff --git a/src/system/win/system_impl.ml b/src/system/win/system_impl.ml index 642402d..3358baf 100644 --- a/src/system/win/system_impl.ml +++ b/src/system/win/system_impl.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/system/win/system_impl.ml *) -(* Copyright 1999-2009, Benjamin C. Pierce +(* Copyright 1999-2009, Benjamin C. Pierce 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/src/terminal.ml b/src/terminal.ml index cd11a03..2e3fe6b 100644 --- a/src/terminal.ml +++ b/src/terminal.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/terminal.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/test.ml b/src/test.ml index e15a94d..03dd5cb 100644 --- a/src/test.ml +++ b/src/test.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/test.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -37,12 +37,12 @@ let rec remove_file_or_dir d = else begin remove_file_or_dir (Fspath.concat d (Path.fromString f)); loop () - end + end | None -> handle.Fs.closedir (); Fs.rmdir d in loop () - end else + end else Fs.unlink d | None -> () @@ -128,7 +128,7 @@ let fsopt2string = function | Some(f) -> fs2string f let readfs p = - let rec loop p = + let rec loop p = let s = Fs.lstat p in match s.Unix.LargeFile.st_kind with | Unix.S_REG -> File (read p) @@ -137,7 +137,7 @@ let readfs p = | _ -> assert false in try Some(loop p) with Unix.Unix_error (Unix.ENOENT,_,_) -> None - + let default_perm = 0o755 let writefs p fs = @@ -208,11 +208,11 @@ let loadPrefs l = let displayRis ris = Safelist.iter - (fun ri -> + (fun ri -> Util.msg "%s\n" (Uicommon.reconItem2string Path.empty ri "")) ris -let sync ?(verbose=false) () = +let sync ?(verbose=false) () = let (reconItemList, _, _) = Recon.reconcileAll (Update.findUpdates None) in if verbose then begin @@ -234,8 +234,8 @@ type checkable = R1 | R2 | BACKUP1 | BACKUP2 let checkable2string = function R1 -> "R1" | R2 -> "R2" | BACKUP1 -> "BACKUP1" | BACKUP2 -> "BACKUP2" -let test() = - Util.warnPrinter := None; +let test() = + Util.warnPrinter := None; Prefs.set Trace.logging false; Prefs.set Trace.terse true; Trace.sendLogMsgsToStderr := false; @@ -244,7 +244,7 @@ let test() = let runtest name prefs f = Util.msg "%s...\n" name; - Util.convertUnixErrorsToFatal "Test.test" (fun() -> + Util.convertUnixErrorsToFatal "Test.test" (fun() -> currentTest := name; Prefs.load origPrefs; loadPrefs prefs; @@ -260,14 +260,14 @@ let test() = if not (Safelist.for_all (fun r -> Util.findsubstring "test" r <> None) (Globals.rawRoots())) then - raise (Util.Fatal + raise (Util.Fatal "Self-tests can only be run if both roots include the string 'test'"); if Util.findsubstring "test" (Fspath.toPrintString (Stasher.backupDirectory())) = None then - raise (Util.Fatal + raise (Util.Fatal ("Self-tests can only be run if the 'backupdir' preference (or wherever the backup " ^ "directory name is coming from, e.g. the UNISONBACKUPDIR environment variable) " ^ "includes the string 'test'")); - + Lwt_unix.run (Globals.allRootsIter (fun r -> makeRootEmpty r ())); let (r2,r1) = Globals.roots () in @@ -277,8 +277,8 @@ let test() = (Common.Local,_),(Common.Local,_) -> true | _ -> false in - let put c fs = - Lwt_unix.run + let put c fs = + Lwt_unix.run (match c with R1 -> putfs r1 fs | R2 -> putfs r2 fs | BACKUP1 | BACKUP2 -> assert false) in @@ -287,7 +287,7 @@ let test() = let check name c fs = debug (fun() -> Util.msg "Checking %s / %s\n" (!currentTest) name); let actual = - Lwt_unix.run + Lwt_unix.run ((match c with R1 -> getfs r1 | R2 -> getfs r2 | BACKUP1 -> getbackup r1 | BACKUP2 -> getbackup r2) ()) in let fail () = @@ -296,14 +296,14 @@ let test() = (!currentTest) name (checkable2string c) (fs2string fs) (fsopt2string actual); failures := !failures+1; raise (Util.Fatal (Printf.sprintf "Self-test %s / %s failed!" (!currentTest) name)) in - match actual with + match actual with Some(a) -> if not (equal a fs) then fail() | None -> fail() in let checkmissing name c = debug (fun() -> Util.msg "Checking nonexistence %s / %s\n" (!currentTest) name); let actual = - Lwt_unix.run + Lwt_unix.run ((match c with R1 -> getfs r1 | R2 -> getfs r2 | BACKUP1 -> getbackup r1 | BACKUP2 -> getbackup r2) ()) in if actual <> None then begin @@ -315,7 +315,7 @@ let test() = end in (* N.b.: When making up tests, it's important to choose file contents of different - lengths. The reason for this is that, on some Unix systems, it is possible for + lengths. The reason for this is that, on some Unix systems, it is possible for the inode number of a just-deleted file to be reassigned to the very next file created -- i.e., to the updated version of the file that the test script has just written. If the length of the contents is also the same and the test is @@ -357,8 +357,8 @@ let test() = ); (* Check for the bug reported by Ralf Lehmann *) - if not bothRootsLocal then - runtest "backups 1 (remote)" ["backup = Name *"] (fun() -> + if not bothRootsLocal then + runtest "backups 1 (remote)" ["backup = Name *"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); debug (fun () -> Util.msg "First check\n"); checkmissing "1" BACKUP1; @@ -373,11 +373,11 @@ let test() = check "6" BACKUP2 (Dir [("test.txt", File "1")]); ); - if bothRootsLocal then - runtest "fastercheckUNSAFE 1" ["fastercheckUNSAFE = true"] (fun() -> + if bothRootsLocal then + runtest "fastercheckUNSAFE 1" ["fastercheckUNSAFE = true"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); (* Create a file on both sides with different contents *) - put R1 (Dir ["x", File "foo"]); + put R1 (Dir ["x", File "foo"]); put R2 (Dir ["x", File "bar"]); sync(); check "1a" R1 (Dir ["x", File "foo"]); check "1b" R2 (Dir ["x", File "bar"]); @@ -389,7 +389,7 @@ let test() = (* Start again *) put R1 (Dir []); put R2 (Dir []); sync(); (* Create a file on both sides with different contents *) - put R1 (Dir ["x", File "foo"]); + put R1 (Dir ["x", File "foo"]); put R2 (Dir ["x", File "bar"]); sync(); (* Change contents without changing size and check that change is propagated *) put R1 (Dir ["x", File "f00"]); sync(); @@ -404,10 +404,10 @@ let test() = check "4" R2 (Dir ["x", File "foo"]); ); - (raise (Util.Fatal "Skipping some tests -- remove me!\n") : unit); + (raise (Util.Fatal "Skipping some tests -- remove me!\n") : unit); - if bothRootsLocal then - runtest "backups 1 (local)" ["backup = Name *"] (fun() -> + if bothRootsLocal then + runtest "backups 1 (local)" ["backup = Name *"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); (* Create a file and a directory *) put R1 (Dir ["x", File "foo"; "d", Dir ["a", File "barr"]]); sync(); @@ -421,7 +421,7 @@ let test() = (".bak.1.x", File "foo"); (".bak.1.d", Dir [("a", File "barr")])]) ); - runtest "backups 2" ["backup = Name *"; "backuplocation = local"] (fun() -> + runtest "backups 2" ["backup = Name *"; "backuplocation = local"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); (* Create a file and a directory *) put R1 (Dir ["x", File "foo"; "d", Dir ["a", File "barr"]]); sync(); @@ -431,7 +431,7 @@ let test() = check "1" R2 (Dir [(".bak.0.x", File "foo"); (".bak.0.d", Dir [("a", File "barr")])]); ); - runtest "backups 2a" ["backup = Name *"; "backuplocation = local"] (fun() -> + runtest "backups 2a" ["backup = Name *"; "backuplocation = local"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); (* Create a file and a directory *) put R1 (Dir ["foo", File "1"]); sync(); @@ -439,10 +439,10 @@ let test() = check "2" R1 (Dir [("foo", File "1")]); put R1 (Dir ["foo", File "2"]); sync(); check "3" R1 (Dir [("foo", File "2")]); - check "4" R2 (Dir [("foo", File "2"); (".bak.0.foo", File "1")]); + check "4" R2 (Dir [("foo", File "2"); (".bak.0.foo", File "1")]); ); - runtest "backups 3" ["backup = Name *"; "backuplocation = local"; "backupcurrent = Name *"] (fun() -> + runtest "backups 3" ["backup = Name *"; "backuplocation = local"; "backupcurrent = Name *"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); put R1 (Dir ["x", File "foo"]); sync (); check "1a" R1 (Dir [("x", File "foo"); (".bak.0.x", File "foo")]); @@ -452,7 +452,7 @@ let test() = check "2b" R2 (Dir [("x", File "barr"); (".bak.1.x", File "foo"); (".bak.0.x", File "barr")]); ); - runtest "backups 4" ["backup = Name *"; "backupcurrent = Name *"; "maxbackups = 7"] (fun() -> + runtest "backups 4" ["backup = Name *"; "backupcurrent = Name *"; "maxbackups = 7"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); put R1 (Dir ["x", File "foo"]); sync(); check "1a" BACKUP1 (Dir [("x", File "foo")]); @@ -462,7 +462,7 @@ let test() = check "1c" BACKUP1 (Dir [("x", File "bazzz"); (".bak.2.x", File "foo"); (".bak.1.x", File "barr")]); ); - runtest "backups 5 (directories)" ["backup = Name *"; "backupcurrent = Name *"; "maxbackups = 7"] (fun() -> + runtest "backups 5 (directories)" ["backup = Name *"; "backupcurrent = Name *"; "maxbackups = 7"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); (* Create a directory x containing files a and l; check that the current version gets backed up *) put R1 (Dir ["x", Dir ["a", File "foo"; "l", File "./foo"]]); sync(); @@ -474,31 +474,31 @@ let test() = whether we're running the test locally or remotely; in the former case, we should see *both* the old and the new version as backups *) put R1 (Dir ["x", File "bazzz"]); sync(); - if bothRootsLocal then + if bothRootsLocal then check "3" BACKUP1 (Dir [("x", File "bazzz"); (".bak.2.x", Dir [("l", File "./barr"); ("b", File "barr"); ("a", File "foo"); (".bak.1.l", File "./foo")]); (".bak.1.x", Dir [("l", File "./barr"); ("b", File "barr")])]) - else + else check "3" BACKUP1 (Dir [("x", File "bazzz"); (".bak.1.x", Dir [("l", File "./barr"); ("b", File "barr"); ("a", File "foo"); (".bak.1.l", File "./foo")])]); ); - runtest "backups 6 (backup prefix/suffix)" ["backup = Name *"; + runtest "backups 6 (backup prefix/suffix)" ["backup = Name *"; "backuplocation = local"; "backupprefix = back/$VERSION-"; "backupsuffix = .backup"; - "backupcurrent = Name *"] (fun() -> + "backupcurrent = Name *"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); put R1 (Dir ["x", File "foo"]); sync(); check "1" R1 (Dir [("x", File "foo"); ("back", Dir [("0-x.backup", File "foo")])]); ); if not (Prefs.read Globals.someHostIsRunningWindows) then begin - runtest "links 1 (directories and links)" ["backup = Name *"; "backupcurrent = Name *"; "maxbackups = 7"] (fun() -> + runtest "links 1 (directories and links)" ["backup = Name *"; "backupcurrent = Name *"; "maxbackups = 7"] (fun() -> put R1 (Dir []); put R2 (Dir []); sync(); put R1 (Dir ["x", Dir ["a", File "foo"; "l", Link "./foo"]]); sync(); check "1" BACKUP1 (Dir [("x", Dir [("l", Link "./foo"); ("a", File "foo")])]); put R2 (Dir ["x", Dir ["b", File "barr"; "l", Link "./barr"]]); sync(); check "2" BACKUP1 (Dir [("x", Dir [("l", Link "./barr"); ("b", File "barr"); ("a", File "foo"); (".bak.1.l", Link "./foo")])]); put R1 (Dir ["x", File "bazzz"]); sync(); - if bothRootsLocal then + if bothRootsLocal then check "3" BACKUP1 (Dir [("x", File "bazzz"); (".bak.2.x", Dir [("l", Link "./barr"); ("b", File "barr"); ("a", File "foo"); @@ -513,7 +513,7 @@ let test() = (* Test that we correctly fail when we try to 'follow' a symlink that does not point to anything *) - runtest "links 2 (symlink to nowhere)" ["follow = Name y"] (fun() -> + runtest "links 2 (symlink to nowhere)" ["follow = Name y"] (fun() -> let orig = (Dir []) in put R1 orig; put R2 orig; sync(); put R1 (Dir ["y", Link "x"]); sync(); diff --git a/src/transfer.ml b/src/transfer.ml index b619b2d..4af0243 100644 --- a/src/transfer.ml +++ b/src/transfer.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/transfer.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/transfer.mli b/src/transfer.mli index 17cdf0d..d482d6b 100644 --- a/src/transfer.mli +++ b/src/transfer.mli @@ -5,24 +5,24 @@ Rsync : general algorithm description The rsync algorithm is a technique for reducing the cost of a file - transfer by avoiding the transfer of blocks that are already at the + transfer by avoiding the transfer of blocks that are already at the destination. Imagine we have source and destination computers that have files X and - Y respectively, where X and Y are similar. The algorithm proceeds as + Y respectively, where X and Y are similar. The algorithm proceeds as follows : - - The destination computer divides file Y into blocks of an agreed-upon + - The destination computer divides file Y into blocks of an agreed-upon size N. - - For each block, the destination computer computes two functions of the + - For each block, the destination computer computes two functions of the block's contents : - - A 128-bit fingerprint of the block, which with very high + - A 128-bit fingerprint of the block, which with very high probability is different from the fingerprints of different blocks. - - A small checksum, which can be computed in a "rolling" fashion. + - A small checksum, which can be computed in a "rolling" fashion. More precisely, if we are given the checksum for the N-byte block at offset k, and we are given the bytes at offsets k and N+k, we can efficiently compute the checksum for the N-byte block at offset k+1. - The destination computer sends a list of fingerprints and checksums to - the source computer. Blocks are identified implicitly by the order in + the source computer. Blocks are identified implicitly by the order in which they appear in the list. - The source computer searches through file X to identify blocks that have the same fingerprints as blocks that appear in the list sent @@ -82,7 +82,7 @@ module Rsync : (* Compute block information from the old file *) val rsyncPreprocess : - in_channel (* old file descriptor *) + in_channel (* old file descriptor *) -> Uutil.Filesize.t (* source file length *) -> Uutil.Filesize.t (* destination file length *) -> rsync_block_info * int @@ -91,22 +91,22 @@ module Rsync : val rsyncDecompress : int (* block size *) -> in_channel (* old file descriptor *) - -> out_channel (* output file descriptor *) + -> out_channel (* output file descriptor *) -> (int -> unit) (* progress report *) - -> transfer_instruction (* transfer instruction received *) - -> bool + -> transfer_instruction (* transfer instruction received *) + -> bool (*** SOURCE HOST ***) (* Using block information, parse the new file and send transfer instructions accordingly *) val rsyncCompress : - rsync_block_info + rsync_block_info (* block info received from the destination *) -> in_channel (* new file descriptor *) -> Uutil.Filesize.t (* source file length *) -> (int -> unit) (* progress report *) - -> transmitter (* transfer instruction transmitter *) + -> transmitter (* transfer instruction transmitter *) -> unit Lwt.t end diff --git a/src/transport.ml b/src/transport.ml index 6b53cd2..039d8c3 100644 --- a/src/transport.ml +++ b/src/transport.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/transport.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -72,7 +72,7 @@ let rLogCounter = ref 0 let logLwtNumbered (lwtDescription: string) (lwtShortDescription: string) (t: unit -> 'a Lwt.t): 'a Lwt.t = let _ = (rLogCounter := (!rLogCounter) + 1; !rLogCounter) in - let lwtDescription = Util.replacesubstring lwtDescription "\n " "" in + let lwtDescription = Util.replacesubstring lwtDescription "\n " "" in logLwt (Printf.sprintf "[BGN] %s\n" lwtDescription) t (fun _ -> Printf.sprintf "[END] %s\n" lwtShortDescription) diff --git a/src/tree.ml b/src/tree.ml index c2dbe4f..d8d933f 100644 --- a/src/tree.ml +++ b/src/tree.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/tree.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/ubase/depend b/src/ubase/depend deleted file mode 100644 index a581d26..0000000 --- a/src/ubase/depend +++ /dev/null @@ -1,24 +0,0 @@ -myMap.cmo : myMap.cmi -myMap.cmx : myMap.cmi -prefs.cmo : util.cmi uarg.cmi safelist.cmi prefs.cmi -prefs.cmx : util.cmx uarg.cmx safelist.cmx prefs.cmi -proplist.cmo : util.cmi proplist.cmi -proplist.cmx : util.cmx proplist.cmi -rx.cmo : rx.cmi -rx.cmx : rx.cmi -safelist.cmo : safelist.cmi -safelist.cmx : safelist.cmi -trace.cmo : util.cmi safelist.cmi prefs.cmi trace.cmi -trace.cmx : util.cmx safelist.cmx prefs.cmx trace.cmi -uarg.cmo : util.cmi safelist.cmi uarg.cmi -uarg.cmx : util.cmx safelist.cmx uarg.cmi -util.cmo : safelist.cmi util.cmi -util.cmx : safelist.cmx util.cmi -myMap.cmi : -prefs.cmi : util.cmi -proplist.cmi : -rx.cmi : -safelist.cmi : -trace.cmi : prefs.cmi -uarg.cmi : -util.cmi : diff --git a/src/ubase/myMap.mli b/src/ubase/myMap.mli index 7111493..3fcd0f5 100644 --- a/src/ubase/myMap.mli +++ b/src/ubase/myMap.mli @@ -22,10 +22,10 @@ Some functions have been added to suit Unison's needs. over the keys. All operations over maps are purely applicative (no side-effects). The implementation uses balanced binary trees, and therefore searching - and insertion take time logarithmic in the size of the map. + and insertion take time logarithmic in the size of the map. *) -module type OrderedType = +module type OrderedType = sig type t (** The type of the map keys. *) diff --git a/src/ubase/prefs.ml b/src/ubase/prefs.ml index 55842c9..44df052 100644 --- a/src/ubase/prefs.ml +++ b/src/ubase/prefs.ml @@ -31,7 +31,7 @@ let profilePathname n = if System.file_exists f then f else Util.fileInUnisonDir (n ^ ".prf") -let thePrefsFile () = +let thePrefsFile () = match !profileName with None -> raise (Util.Transient("No preference file has been specified")) | Some(n) -> profilePathname n @@ -63,7 +63,7 @@ let addprinter name f = printers := (name, f) :: !printers (* When we load a new profile, we need to reset all preferences to their *) (* default values. Each preference has a resetter for doing this. *) -let resetters = ref [] +let resetters = ref [] let addresetter f = resetters := f :: !resetters @@ -271,13 +271,13 @@ let oneLineDocs u = let formatAll p = String.concat "" (Safelist.rev - (Util.StringMap.fold + (Util.StringMap.fold (fun name (doc, pspec, _) l -> (formatOne name pspec doc (String.length doc > 0 && doc.[0] <> '*' && p doc)) :: l) !prefs [])) in - u ^ "\n" + u ^ "\n" ^ "Basic options: \n" ^ formatAll (fun doc -> doc.[0] <> '!') ^ "\nAdvanced options: \n" @@ -296,16 +296,16 @@ let processCmdLine usage hook = in let anonfun = try - let (_, p, _) = Util.StringMap.find "rest" !prefs in + let (_, p, _) = Util.StringMap.find "rest" !prefs in match hook "rest" p with Uarg.String stringFunction -> stringFunction | _ -> defaultanonfun with Not_found -> defaultanonfun - in + in try Uarg.parse argspecs anonfun (oneLineDocs usage) - with IllegalValue str -> + with IllegalValue str -> raise(Util.Fatal(Printf.sprintf "%s \n%s\n" (oneLineDocs usage) str)) let parseCmdLine usage = @@ -314,7 +314,7 @@ let parseCmdLine usage = (* Scan command line without actually setting any preferences; return a *) (* string map associating a list of strings with each option appearing on *) (* the command line. *) -let scanCmdLine usage = +let scanCmdLine usage = let m = ref (Util.StringMap.empty : (string list) Util.StringMap.t) in let insert name s = let old = try Util.StringMap.find name !m with Not_found -> [] in @@ -333,7 +333,7 @@ let scanCmdLine usage = (*****************************************************************************) let string2bool name = function - "true" -> true + "true" -> true | "false" -> false | other -> raise (Util.Fatal (name^" expects a boolean value, but \n"^other ^ " is not a boolean")) @@ -341,8 +341,8 @@ let string2bool name = function let string2int name string = try int_of_string string - with Failure "int_of_string" -> - raise (Util.Fatal (name ^ " expects an integer value, but\n" + with Failure "int_of_string" -> + raise (Util.Fatal (name ^ " expects an integer value, but\n" ^ string ^ " is not an integer")) (* Takes a filename and returns a list of "parsed lines" containing @@ -375,7 +375,7 @@ let rec readAFile filename : (string * int * string * string) list = (* Takes a list of strings in reverse order and yields a list of "parsed lines" in correct order *) -and parseLines filename lines = +and parseLines filename lines = let rec loop lines lineNum res = match lines with [] -> res @@ -390,8 +390,8 @@ and parseLines filename lines = let sublines = readAFile f in loop rest (lineNum+1) (Safelist.append sublines res) | _ -> raise (Util.Fatal(Printf.sprintf - "File \"%s\", line %d:\nGarbled 'include' directive: %s" - filename lineNum theLine)) + "File \"%s\", line %d:\nGarbled 'include' directive: %s" + filename lineNum theLine)) else try let pos = String.index theLine '=' in let varName = Util.trimWhitespace (String.sub theLine 0 pos) in @@ -401,7 +401,7 @@ and parseLines filename lines = loop rest (lineNum+1) ((filename, lineNum, varName, theResult)::res) with Not_found -> (* theLine does not contain '=' *) raise(Util.Fatal(Printf.sprintf - "File \"%s\", line %d:\nGarbled line (no '='):\n%s" filename lineNum theLine)) in + "File \"%s\", line %d:\nGarbled line (no '='):\n%s" filename lineNum theLine)) in loop lines 1 [] let processLines lines = @@ -418,11 +418,11 @@ let processLines lines = stringFunction theResult | _ -> assert false with Not_found -> - raise (Util.Fatal ("File \""^ fileName ^ "\", line " ^ + raise (Util.Fatal ("File \""^ fileName ^ "\", line " ^ string_of_int lineNum ^ ": `" ^ varName ^ "' is not a valid option")) - | IllegalValue str -> - raise(Util.Fatal("File \""^ fileName ^ "\", line " ^ + | IllegalValue str -> + raise(Util.Fatal("File \""^ fileName ^ "\", line " ^ string_of_int lineNum ^ ": " ^ str))) lines @@ -469,7 +469,7 @@ let addprefsto = createString "addprefsto" "" \\texttt{addprefsto \\ARG{filename}} makes Unison \ add new preferences to the file named \\ARG{filename} instead." -let addLine l = +let addLine l = let filename = if read addprefsto <> "" then profilePathname (read addprefsto) @@ -493,7 +493,7 @@ let addLine l = (Printf.sprintf "Could not write preferences file (%s)\n" e) in Util.warn resultmsg; resultmsg - end + end let add name value = addLine (name ^ " = " ^ value) diff --git a/src/ubase/prefs.mli b/src/ubase/prefs.mli index 70b3c86..71f665c 100644 --- a/src/ubase/prefs.mli +++ b/src/ubase/prefs.mli @@ -20,7 +20,7 @@ val createBool : -> string (* documentation string *) -> string (* full (tex) documentation string *) -> bool t (* -> new preference value *) - + val createInt : string (* preference name *) -> ?local:bool (* whether it is local to the client *) @@ -28,7 +28,7 @@ val createInt : -> string (* documentation string *) -> string (* full (tex) documentation string *) -> int t (* -> new preference value *) - + val createString : string (* preference name *) -> ?local:bool (* whether it is local to the client *) @@ -36,7 +36,7 @@ val createString : -> string (* documentation string *) -> string (* full (tex) documentation string *) -> string t (* -> new preference value *) - + val createFspath : string (* preference name *) -> ?local:bool (* whether it is local to the client *) @@ -44,7 +44,7 @@ val createFspath : -> string (* documentation string *) -> string (* full (tex) documentation string *) -> System.fspath t (* -> new preference value *) - + val createStringList : string (* preference name *) -> ?local:bool (* whether it is local to the client *) @@ -74,7 +74,7 @@ val create : (1st arg is old value of preference) *) -> ('a -> string list) (* printing function for preference values *) -> 'a t (* -> new preference value *) - + (* Create an alternate name for a preference (the new name will not appear *) (* in usage messages or generated documentation) *) val alias : 'a t (* existing preference *) @@ -152,5 +152,4 @@ val list : unit -> string list (* ------------------------------------------------------------------------- *) val printFullDocs : unit -> unit -val dumpPrefsToStderr : unit -> unit - +val dumpPrefsToStderr : unit -> unit diff --git a/src/ubase/rx.ml b/src/ubase/rx.ml index 9f3b352..f774e58 100644 --- a/src/ubase/rx.ml +++ b/src/ubase/rx.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/ubase/rx.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -166,7 +166,7 @@ let rec dif x y = match x.desc, y.desc with Dif (x1, y1), _ -> dif x1 (alt2 y1 y) | Alt [], _ -> empty - | _, Alt [] -> x + | _, Alt [] -> x | _ -> make (Dif (x, y)) (**** Computation of the next states of an automata ****) @@ -482,7 +482,7 @@ module CSetMap = let trans_set cache cm s = match s with [i, j] when i = j -> - [cm.(i)] + [cm.(i)] | _ -> let v = (cset_hash_rec s, s) in try diff --git a/src/ubase/safelist.ml b/src/ubase/safelist.ml index 30db6d2..4a88b18 100644 --- a/src/ubase/safelist.ml +++ b/src/ubase/safelist.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/ubase/safelist.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -138,7 +138,7 @@ let fold_right f l accu = let flatten_map f l = flatten (map f l) -let remove x l = +let remove x l = let rec loop acc = function | [] -> List.rev acc | a :: rest -> diff --git a/src/ubase/trace.ml b/src/ubase/trace.ml index 0db1edd..3584bab 100644 --- a/src/ubase/trace.ml +++ b/src/ubase/trace.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/ubase/trace.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -30,7 +30,7 @@ let redirect x = (traceprinter := x) let debugmods = Prefs.createStringList "debug" - "!debug module xxx ('all' -> everything, 'verbose' -> more)" + "!debug module xxx ('all' -> everything, 'verbose' -> more)" ("This preference is used to make Unison print various sorts of " ^ "information about what it is doing internally on the standard " ^ "error stream. It can be used many times, each time with the name " @@ -48,14 +48,14 @@ let debugmods = let debugtimes = Prefs.createBool "debugtimes" false "*annotate debugging messages with timestamps" "" - + let runningasserver = ref false let debugging() = (Prefs.read debugmods) <> [] let enabled modname = let m = Prefs.read debugmods in - let en = + let en = m <> [] && ( (* tracing labeled "" is enabled if anything is *) (modname = "") || (* '-debug verbose' enables everything *) @@ -70,7 +70,7 @@ let enabled modname = (Safelist.mem (modname ^ "+") m) ) in en - + let enable modname onoff = let m = Prefs.read debugmods in let m' = if onoff then (modname::m) else (Safelist.remove modname m) in @@ -144,7 +144,7 @@ let writeLog s = | `Stdout -> Printf.printf "%s" s | `Stderr -> Util.msg "%s" s | `FormatStdout -> Format.printf "%s " s - end else debug "" (fun() -> + end else debug "" (fun() -> match !traceprinter with | `Stdout -> Printf.printf "%s" s | `Stderr -> Util.msg "%s" s @@ -173,7 +173,7 @@ let defaultMessageDisplayer s = let show() = if s<>"" then Util.msg "%s\n" s in if enabled "" then debug "" show else if not !runningasserver then show() - end + end let messageDisplayer = ref defaultMessageDisplayer @@ -184,7 +184,7 @@ let statusFormatter = ref defaultStatusFormatter let statusMsgMajor = ref "" let statusMsgMinor = ref "" -let displayMessageLocally (mt,s) = +let displayMessageLocally (mt,s) = let display = !messageDisplayer in let displayStatus() = display (!statusFormatter !statusMsgMajor !statusMsgMinor) in @@ -210,7 +210,7 @@ let status s = displayMessage (StatusMajor, s) let statusMinor s = displayMessage (StatusMinor, s) - + let statusDetail s = let ss = if not !runningasserver then s else (Util.padto 30 s) ^ " [server]" in displayMessage (StatusMinor, ss) @@ -221,15 +221,15 @@ let logverbose s = let temp = !sendLogMsgsToStderr in sendLogMsgsToStderr := !sendLogMsgsToStderr && not (Prefs.read terse); displayMessage (Log, s); - sendLogMsgsToStderr := temp + sendLogMsgsToStderr := temp (* ---------------------------------------------------------------------- *) (* Timing *) - + let printTimers = Prefs.createBool "timers" false "*print timing information" "" - + type timer = string * float let gettime () = Unix.gettimeofday() @@ -253,4 +253,3 @@ let showTimer (desc, t1) = if Prefs.read(printTimers) then let t2 = gettime() in message (Printf.sprintf "%s (%.2f seconds)" desc (t2 -. t1)) - diff --git a/src/ubase/trace.mli b/src/ubase/trace.mli index 8c750e5..996f3a4 100644 --- a/src/ubase/trace.mli +++ b/src/ubase/trace.mli @@ -28,7 +28,7 @@ val runningasserver : bool ref (* Tell the Trace module which local stream to use for tracing and debugging messages *) -val redirect : [`Stdout | `Stderr | `FormatStdout] -> unit +val redirect : [`Stdout | `Stderr | `FormatStdout] -> unit (* ---------------------------------------------------------------------- *) (* Tracing *) @@ -37,7 +37,7 @@ val redirect : [`Stdout | `Stderr | `FormatStdout] -> unit user is going to see it. The default value just prints the string on stderr. The graphical user interface should install an appropriate function here when it starts. In the server process, this - variable's value is ignored. *) + variable's value is ignored. *) val messageDisplayer : (string -> unit) ref (* The function used to format a status message (with a major and a minor diff --git a/src/ubase/util.ml b/src/ubase/util.ml index 8c017db..656b3d3 100644 --- a/src/ubase/util.ml +++ b/src/ubase/util.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/ubase/util.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -81,7 +81,7 @@ let format_to_string f = let s = Format.flush_str_formatter () in curr_formatter := old_formatter; s - + let flush () = Format.pp_print_flush (!curr_formatter) () (*****************************************************************************) @@ -355,7 +355,7 @@ let rec replacesubstring s fromstring tostring = before ^ tostring ^ (replacesubstring after fromstring tostring) let replacesubstrings s pairs = - Safelist.fold_left + Safelist.fold_left (fun s' (froms,tos) -> replacesubstring s' froms tos) s pairs diff --git a/src/ubase/util.mli b/src/ubase/util.mli index 71d1fc4..59b5d61 100644 --- a/src/ubase/util.mli +++ b/src/ubase/util.mli @@ -109,7 +109,7 @@ val format : ('a, Format.formatter, unit) format -> 'a val flush : unit -> unit -val format_to_string : (unit -> unit) -> string +val format_to_string : (unit -> unit) -> string (** [format_to_string f] runs [f] in a context where the Format functions are redirected to a string, which it returns. *) @@ -5,7 +5,5 @@ Implementations are provided by Uitext and Uitk. *) module type SIG = sig - val start : unit -> unit + val start : unit -> unit end - - diff --git a/src/uicommon.ml b/src/uicommon.ml index 8462a30..f0cbf40 100644 --- a/src/uicommon.ml +++ b/src/uicommon.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/uicommon.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -85,7 +85,7 @@ let contactquietly = ^ "during startup.") let contactingServerMsg () = - Printf.sprintf "Contacting server..." + Printf.sprintf "Contacting server..." let repeat = Prefs.createString "repeat" "" @@ -115,7 +115,7 @@ let confirmmerge = ^ " the user can then cancel all the effects of applying the merge if it" ^ " turns out that the result is not satisfactory. In " ^ " batch-mode, this preference has no effect. Default is false.") - + let runTestsPrefName = "selftest" let runtests = Prefs.createBool runTestsPrefName false @@ -149,8 +149,8 @@ let showprev = "*Show previous properties, if they differ from current" "" -(* The next function produces nothing unless the "showprev" - preference is set. This is because it tends to make the +(* The next function produces nothing unless the "showprev" + preference is set. This is because it tends to make the output trace too long and annoying. *) let prevProps newprops ui = if not (Prefs.read showprev) then "" @@ -180,26 +180,26 @@ let replicaContent2string rc sep = | `FILE, `Created -> d (choose "new file " "file ") | `FILE, `Modified -> - d "changed file " + d "changed file " | `FILE, `PropsChanged -> - d "changed props " + d "changed props " | `SYMLINK, `Created -> d (choose "new symlink " "symlink ") | `SYMLINK, `Modified -> - d "changed symlink " + d "changed symlink " | `DIRECTORY, `Created -> d (choose "new dir " "dir ") | `DIRECTORY, `Modified -> d "changed dir " | `DIRECTORY, `PropsChanged -> - d "dir props changed" + d "dir props changed" (* Some cases that can't happen... *) | `ABSENT, (`Created | `Modified | `PropsChanged) | `SYMLINK, `PropsChanged | (`FILE|`SYMLINK|`DIRECTORY), `Deleted -> assert false - + let replicaContent2shortString rc = match rc.typ, rc.status with _, `Unchanged -> " " @@ -256,12 +256,12 @@ let displayPath previousPath path = let (level,suffixNames) = loop 0 previousNames names in let suffixPath = Safelist.fold_left Path.child Path.empty suffixNames in - let spaces = String.make (level*3) ' ' in + let spaces = String.make (level*3) ' ' in spaces ^ (Path.toString suffixPath) let roots2string () = let replica1, replica2 = roots2niceStrings 12 (Globals.roots()) in - (Printf.sprintf "%s %s " replica1 replica2) + (Printf.sprintf "%s %s " replica1 replica2) type action = AError | ASkip of bool | ALtoR of bool | ARtoL of bool | AMerge @@ -327,7 +327,7 @@ let showDiffs ri printer errprinter id = begin try Files.diff root1 ri.path1 ui1 root2 ri.path2 ui2 printer id with Util.Transient e -> errprinter e - end + end | Different _ -> errprinter "Can't diff: path doesn't refer to a file in both replicas" @@ -420,7 +420,7 @@ let shortUsageMsg = ^ " -doc tutorial\".\n" ^ "For other documentation, type \"" ^ Uutil.myName ^ " -doc topics\".\n" -let usageMsg = coreUsageMsg +let usageMsg = coreUsageMsg let debug = Trace.debug "startup" @@ -448,7 +448,7 @@ let architecture = (* During startup the client determines the case sensitivity of each root. If any root is case insensitive, all roots must know this -- it's propagated in a pref. Also, detects HFS (needed for resource forks) and - Windows (needed for permissions) and does some sanity checking. *) + Windows (needed for permissions) and does some sanity checking. *) let validateAndFixupPrefs () = Props.validatePrefs(); let supportUnicodeCaseSensitive = supportUnicodeCaseSensitive () in @@ -511,11 +511,11 @@ let initPrefs ~profileName ~displayWaitMessage ~getFirstRoot ~getSecondRoot (* Tell the preferences module the name of the profile *) Prefs.profileName := Some(profileName); - + (* Check whether the -selftest flag is present on the command line *) let testFlagPresent = Util.StringMap.mem runTestsPrefName (Prefs.scanCmdLine usageMsg) in - + (* If the -selftest flag is present, then we skip loading the preference file. (This is prevents possible confusions where settings from a preference file could cause unit tests to fail.) *) @@ -544,7 +544,7 @@ let initPrefs ~profileName ~displayWaitMessage ~getFirstRoot ~getSecondRoot (* Install dummy roots and backup directory if we are running self-tests *) if Prefs.read runtests then begin - if Globals.rawRoots() = [] then + if Globals.rawRoots() = [] then Prefs.loadStrings ["root = test-a.tmp"; "root = test-b.tmp"]; if (Prefs.read Stasher.backupdir) = "" then Prefs.loadStrings ["backupdir = test-backup.tmp"]; @@ -609,11 +609,11 @@ let initPrefs ~profileName ~displayWaitMessage ~getFirstRoot ~getSecondRoot (Clroot.clroot2string (Clroot.parseRoot clr))) (Globals.rawRoots ()); Printf.eprintf " i.e. (in canonical order)\n"; - Safelist.iter (fun r -> + Safelist.iter (fun r -> Printf.eprintf " %s\n" (root2string r)) (Globals.rootsInCanonicalOrder()); Printf.eprintf "\n"); - + Lwt_unix.run (validateAndFixupPrefs () >>= Globals.propagatePrefs); @@ -621,9 +621,9 @@ let initPrefs ~profileName ~displayWaitMessage ~getFirstRoot ~getSecondRoot (* Initializes some backups stuff according to the preferences just loaded from the profile. Important to do it here, after prefs are propagated, because the function will also be run on the server, if any. Also, this should be done each time a profile is reloaded - on this side, that's why it's here. *) + on this side, that's why it's here. *) Stasher.initBackups (); - + firstTime := false (********************************************************************** @@ -658,7 +658,7 @@ let uiInit (* Make sure we have a directory for archives and profiles *) Os.createUnisonDir(); - + (* Extract any command line profile or roots *) let clprofile = ref None in begin @@ -704,7 +704,7 @@ let uiInit clprofile := getProfile(); match !clprofile with None -> exit 0 (* None means the user wants to quit *) - | Some x -> x + | Some x -> x end else begin (* Roots given on command line. The profile should be the default. *) @@ -724,7 +724,7 @@ let uiInit (* Load the profile and command-line arguments *) initPrefs profileName displayWaitMessage getFirstRoot getSecondRoot termInteract; - + (* Turn on GC messages, if the '-debug gc' flag was provided *) if Trace.enabled "gc" then Gc.set {(Gc.get ()) with Gc.verbose = 0x3F}; diff --git a/src/uigtk2.ml b/src/uigtk2.ml index afc3b77..83c0c1d 100644 --- a/src/uigtk2.ml +++ b/src/uigtk2.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/uigtk2.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -2570,7 +2570,7 @@ let messageBox ~title ?(action = fun t -> t#destroy) message = (* twoBoxAdvanced: Display a message in a window and wait for the user to hit one of two buttons. Return true if the first button is - chosen, false if the second button is chosen. Also has a button for + chosen, false if the second button is chosen. Also has a button for showing more details to the user in a messageBox dialog *) let twoBoxAdvanced ~parent ~title ~message ~longtext ~advLabel ~astock ~bstock = @@ -3527,7 +3527,7 @@ lst_store#set ~row ~column:c_path path; catch (fun () -> Transport.transportItem theSI.ri (Uutil.File.ofLine i) - (fun title text -> + (fun title text -> textDetailed := (Some text); if Prefs.read Uicommon.confirmmerge then twoBoxAdvanced @@ -3539,7 +3539,7 @@ lst_store#set ~row ~column:c_path path; ~advLabel:"View details..." ~astock:`YES ~bstock:`NO - else + else true) >>= (fun () -> return Util.Succeeded)) @@ -4007,12 +4007,12 @@ lst_store#set ~row ~column:c_path path; right#add_accelerator ~group:accel_group ~modi:[`SHIFT] GdkKeysyms._less; right#add_accelerator ~group:accel_group ~modi:[`SHIFT] GdkKeysyms._comma; - let skip = + let skip = grAdd grAction (actionMenu#add_image_item ~key:GdkKeysyms._slash ~callback:questionAction ~image:((GMisc.image ~stock:`NO ~icon_size:`MENU ())#coerce) "Do _Not Propagate Changes") in - grAdd grAction skip; + grAdd grAction skip; skip#add_accelerator ~group:accel_group ~modi:[`SHIFT] GdkKeysyms._minus; let merge = diff --git a/src/uimac14/Bridge.h b/src/uimac14/Bridge.h index 7657b80..4c15602 100644 --- a/src/uimac14/Bridge.h +++ b/src/uimac14/Bridge.h @@ -8,51 +8,51 @@ #import <Cocoa/Cocoa.h> /* - Bridge supports safe calling from C back to OCaml by using daemon threads - spawned from OCaml to make the actual calls and converting all argument / return values - in the OCaml thread (when in possession of the OCaml lock) + Bridge supports safe calling from C back to OCaml by using daemon threads + spawned from OCaml to make the actual calls and converting all argument / return values + in the OCaml thread (when in possession of the OCaml lock) */ @interface Bridge : NSObject { } -+ (void)startup:(const char **)argv; ++ (void)startup:(const char **)argv; @end /* - ocamlCall(sig, funcName, [args...]); - - Call ocaml function (via safe thread handoff mechanism). - Args/return values are converted to/from C/OCaml according to the - supplied type signture string. Type codes are: - x - void (for return type) - i - long - s - char * - S - NSString * + ocamlCall(sig, funcName, [args...]); + + Call ocaml function (via safe thread handoff mechanism). + Args/return values are converted to/from C/OCaml according to the + supplied type signture string. Type codes are: + x - void (for return type) + i - long + s - char * + S - NSString * N - NSNumber * - @ - OCamlValue (see below) - - Examples: - long count = (long)ocamlCall("iS", "lengthOfString", @"Some String"); - - (void)ocamlCall("x", "someVoidOCamlFunction"); - - OCamlValue *v = (id)ocamlCall("@Si", "makeArray", @"Some String", 10); - NSString s = [v getField:0 withType:'S']; + @ - OCamlValue (see below) + + Examples: + long count = (long)ocamlCall("iS", "lengthOfString", @"Some String"); + + (void)ocamlCall("x", "someVoidOCamlFunction"); + + OCamlValue *v = (id)ocamlCall("@Si", "makeArray", @"Some String", 10); + NSString s = [v getField:0 withType:'S']; */ extern void *ocamlCall(const char *argTypes, ...); // Wrapper/proxy for unconverted OCaml values @interface OCamlValue : NSObject { - long _v; + long _v; } - initWithValue:(long)v; - (void *)getField:(long)i withType:(char)t; - // get value by position. See ocamlCall for list of type conversion codes - + // get value by position. See ocamlCall for list of type conversion codes + - (long)count; - // count of items in array - + // count of items in array + - (long)value; - // returns Ocaml value directly -- not safe to use except in direct callback from OCaml - // (i.e. in the OCaml thread) + // returns Ocaml value directly -- not safe to use except in direct callback from OCaml + // (i.e. in the OCaml thread) @end diff --git a/src/uimac14/Bridge.m b/src/uimac14/Bridge.m index affba25..3b8deb4 100644 --- a/src/uimac14/Bridge.m +++ b/src/uimac14/Bridge.m @@ -25,18 +25,18 @@ #include <stdarg.h> /* - CMF, April 2007: Alternate strategy for solving UI crashes based on + CMF, April 2007: Alternate strategy for solving UI crashes based on http://alan.petitepomme.net/cwn/2005.03.08.html#9: 1) Run OCaml in a separate thread from the Cocoa main run loop. 2) Handle all calls to OCaml as callbacks -- have an OCaml thread hang in C-land and use mutexes and conditions to pass control from the C calling thread to the OCaml callback thread. - + Value Conversion Done in Bridge Thread: - Value creation/conversion (like calls to caml_named_value or caml_copy_string) + Value creation/conversion (like calls to caml_named_value or caml_copy_string) or access calls (like Field) need to occur in the OCaml thread. We do this by passing C args for conversion to the bridgeThreadWait() thread. - + Example of vulnerability: Field(caml_reconItems,j) could dereference caml_reconItems when the GC (running independently in an OCaml thread) could be moving it. @@ -60,45 +60,45 @@ const char **the_argv; { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - pthread_mutex_lock(&init_lock); + pthread_mutex_lock(&init_lock); /* Initialize ocaml gc, etc. */ caml_startup((char **)the_argv); // cast to avoid warning, caml_startup assumes non-const, // NSApplicationMain assumes const - - // Register these with the collector - // NSLog(@"*** _ocamlStartup - back from startup; signalling! (%d)", pthread_self()); + + // Register these with the collector + // NSLog(@"*** _ocamlStartup - back from startup; signalling! (%d)", pthread_self()); doneInit = TRUE; - pthread_cond_signal(&init_cond); - pthread_mutex_unlock(&init_lock); - - // now start the callback thread - // NSLog(@"*** _ocamlStartup - calling callbackThreadCreate (%d)", pthread_self()); - value *f = caml_named_value("callbackThreadCreate"); - (void)caml_callback_exn(*f,Val_unit); + pthread_cond_signal(&init_cond); + pthread_mutex_unlock(&init_lock); + + // now start the callback thread + // NSLog(@"*** _ocamlStartup - calling callbackThreadCreate (%d)", pthread_self()); + value *f = caml_named_value("callbackThreadCreate"); + (void)caml_callback_exn(*f,Val_unit); [pool release]; } + (void)startup:(const char **)argv { - if (_instance) return; - - _instance = [[Bridge alloc] init]; - - [[NSExceptionHandler defaultExceptionHandler] setDelegate:_instance]; - [[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask: - (NSLogUncaughtExceptionMask | NSLogTopLevelExceptionMask)]; - - // Init OCaml in another thread and wait for it to be ready - pthread_mutex_lock(&init_lock); - the_argv = argv; - [NSThread detachNewThreadSelector:@selector(_ocamlStartup:) - toTarget:_instance withObject:nil]; - - // NSLog(@"*** waiting for completion of caml_init"); - while (!doneInit) pthread_cond_wait(&init_cond, &init_lock); - pthread_mutex_unlock(&init_lock); - // NSLog(@"*** caml_init complete!"); + if (_instance) return; + + _instance = [[Bridge alloc] init]; + + [[NSExceptionHandler defaultExceptionHandler] setDelegate:_instance]; + [[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask: + (NSLogUncaughtExceptionMask | NSLogTopLevelExceptionMask)]; + + // Init OCaml in another thread and wait for it to be ready + pthread_mutex_lock(&init_lock); + the_argv = argv; + [NSThread detachNewThreadSelector:@selector(_ocamlStartup:) + toTarget:_instance withObject:nil]; + + // NSLog(@"*** waiting for completion of caml_init"); + while (!doneInit) pthread_cond_wait(&init_cond, &init_lock); + pthread_mutex_unlock(&init_lock); + // NSLog(@"*** caml_init complete!"); } #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 @@ -106,14 +106,14 @@ typedef unsigned int NSUInteger; #endif - (BOOL)exceptionHandler:(NSExceptionHandler *)sender shouldLogException:(NSException *)exception mask:(NSUInteger)aMask { - // if (![[exception name] isEqual:@"OCamlException"]) return YES; - + // if (![[exception name] isEqual:@"OCamlException"]) return YES; + NSString *msg = [NSString stringWithFormat:@"Uncaught exception: %@", [exception reason]]; msg = [[msg componentsSeparatedByString:@"\n"] componentsJoinedByString:@" "]; NSLog(@"%@", msg); NSRunAlertPanel(@"Fatal error", msg, @"Exit", nil, nil); - exit(1); - return FALSE; + exit(1); + return FALSE; } @end @@ -122,25 +122,25 @@ typedef unsigned int NSUInteger; // CallState struct is allocated on the C thread stack and then handed // to the OCaml callback thread to perform value conversion and issue the call typedef struct { - enum { SafeCall, OldCall, FieldAccess } opCode; - - // New style calls - const char *argTypes; - va_list args; - - // Field access - value *valueP; - long fieldIndex; - char fieldType; - - // Return values - char *exception; - void *retV; - BOOL _autorelease; - - // for old style (unsafe) calls - value call, a1, a2, a3, ret; - int argCount; + enum { SafeCall, OldCall, FieldAccess } opCode; + + // New style calls + const char *argTypes; + va_list args; + + // Field access + value *valueP; + long fieldIndex; + char fieldType; + + // Return values + char *exception; + void *retV; + BOOL _autorelease; + + // for old style (unsafe) calls + value call, a1, a2, a3, ret; + int argCount; } CallState; static CallState *_CallState = NULL; @@ -153,193 +153,193 @@ CAMLprim value bridgeThreadWait(value ignore) CAMLparam0(); CAMLlocal1 (args); args = caml_alloc_tuple(3); - - // NSLog(@"*** bridgeThreadWait init! (%d) Taking lock...", pthread_self()); - while (TRUE) { - // unblock ocaml while we wait for work - caml_enter_blocking_section(); - - pthread_mutex_lock(&global_call_lock); - while (!_CallState) pthread_cond_wait(&global_call_cond, &global_call_lock); - - // pick up our work and free up the call lock for other threads - CallState *cs = _CallState; - _CallState = NULL; - pthread_mutex_unlock(&global_call_lock); - - // NSLog(@"*** bridgeThreadWait: have call -- leaving caml_blocking_section"); - - // we have a call to do -- get the ocaml lock - caml_leave_blocking_section(); - - // NSLog(@"*** bridgeThreadWait: doing call"); + + // NSLog(@"*** bridgeThreadWait init! (%d) Taking lock...", pthread_self()); + while (TRUE) { + // unblock ocaml while we wait for work + caml_enter_blocking_section(); + + pthread_mutex_lock(&global_call_lock); + while (!_CallState) pthread_cond_wait(&global_call_cond, &global_call_lock); + + // pick up our work and free up the call lock for other threads + CallState *cs = _CallState; + _CallState = NULL; + pthread_mutex_unlock(&global_call_lock); + + // NSLog(@"*** bridgeThreadWait: have call -- leaving caml_blocking_section"); + + // we have a call to do -- get the ocaml lock + caml_leave_blocking_section(); + + // NSLog(@"*** bridgeThreadWait: doing call"); NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - char retType = 'v'; - value e = Val_unit; - if (cs->opCode == SafeCall) { + char retType = 'v'; + value e = Val_unit; + if (cs->opCode == SafeCall) { int i; - char *fname = va_arg(cs->args, char *); - value *f = caml_named_value(fname); - // varargs with C-based args -- convert them to OCaml values based on type code string - const char *p = cs->argTypes; - retType = *p++; - int argCount = 0; - for(; *p != '\0'; p++) { - const char *str; - switch (*p) { - case 's': - str = va_arg(cs->args, const char *); - Store_field (args, argCount, caml_copy_string(str)); - break; - case 'S': - str = [va_arg(cs->args, NSString *) UTF8String]; - Store_field (args, argCount, caml_copy_string(str)); - break; - case 'i': + char *fname = va_arg(cs->args, char *); + value *f = caml_named_value(fname); + // varargs with C-based args -- convert them to OCaml values based on type code string + const char *p = cs->argTypes; + retType = *p++; + int argCount = 0; + for(; *p != '\0'; p++) { + const char *str; + switch (*p) { + case 's': + str = va_arg(cs->args, const char *); + Store_field (args, argCount, caml_copy_string(str)); + break; + case 'S': + str = [va_arg(cs->args, NSString *) UTF8String]; + Store_field (args, argCount, caml_copy_string(str)); + break; + case 'i': Store_field (args, argCount, Val_long(va_arg(cs->args, long))); - break; - case '@': + break; + case '@': Store_field (args, argCount, [va_arg(cs->args, OCamlValue *) value]); - break; + break; default: NSCAssert1(0, @"Unknown input type '%c'", *p); - break; - } - argCount++; + break; + } + argCount++; NSCAssert(argCount <= 3, @"More than 3 arguments"); - } - // Call OCaml -- TODO: add support for > 3 args - if (argCount == 3) e = caml_callback3_exn(*f,Field(args,0),Field(args,1),Field(args,2)); - else if (argCount == 2) e = caml_callback2_exn(*f,Field(args,0),Field(args,1)); - else if (argCount == 1) e = caml_callback_exn(*f,Field(args,0)); - else e = caml_callback_exn(*f,Val_unit); + } + // Call OCaml -- TODO: add support for > 3 args + if (argCount == 3) e = caml_callback3_exn(*f,Field(args,0),Field(args,1),Field(args,2)); + else if (argCount == 2) e = caml_callback2_exn(*f,Field(args,0),Field(args,1)); + else if (argCount == 1) e = caml_callback_exn(*f,Field(args,0)); + else e = caml_callback_exn(*f,Val_unit); for (i = 0; i < argCount; i++) Store_field (args, i, Val_unit); - } else if (cs->opCode == OldCall) { - // old style (unsafe) version where OCaml values were passed directly from C thread - if (cs->argCount == 3) e = caml_callback3_exn(cs->call,cs->a1,cs->a2,cs->a3); - else if (cs->argCount == 2) e = caml_callback2_exn(cs->call,cs->a1,cs->a2); - else e = caml_callback_exn(cs->call,cs->a1); - retType = 'v'; - } else if (cs->opCode == FieldAccess) { - long index = cs->fieldIndex; - e = (index == -1) ? Val_long(Wosize_val(*cs->valueP)) : Field(*cs->valueP, index); - retType = cs->fieldType; - } - - // Process return value - cs->_autorelease = FALSE; - cs->ret = e; // OCaml return type -- unsafe... - if (!Is_exception_result(e)) { - switch (retType) { - case 'S': - *((NSString **)&cs->retV) = (e == Val_unit) ? NULL : [[NSString alloc] initWithUTF8String:String_val(e)]; - cs->_autorelease = TRUE; - break; - case 'N': + } else if (cs->opCode == OldCall) { + // old style (unsafe) version where OCaml values were passed directly from C thread + if (cs->argCount == 3) e = caml_callback3_exn(cs->call,cs->a1,cs->a2,cs->a3); + else if (cs->argCount == 2) e = caml_callback2_exn(cs->call,cs->a1,cs->a2); + else e = caml_callback_exn(cs->call,cs->a1); + retType = 'v'; + } else if (cs->opCode == FieldAccess) { + long index = cs->fieldIndex; + e = (index == -1) ? Val_long(Wosize_val(*cs->valueP)) : Field(*cs->valueP, index); + retType = cs->fieldType; + } + + // Process return value + cs->_autorelease = FALSE; + cs->ret = e; // OCaml return type -- unsafe... + if (!Is_exception_result(e)) { + switch (retType) { + case 'S': + *((NSString **)&cs->retV) = (e == Val_unit) ? NULL : [[NSString alloc] initWithUTF8String:String_val(e)]; + cs->_autorelease = TRUE; + break; + case 'N': if (Is_long (e)) { - *((NSNumber **)&cs->retV) = [[NSNumber alloc] initWithLong:Long_val(e)]; + *((NSNumber **)&cs->retV) = [[NSNumber alloc] initWithLong:Long_val(e)]; } else { - *((NSNumber **)&cs->retV) = [[NSNumber alloc] initWithDouble:Double_val(e)]; + *((NSNumber **)&cs->retV) = [[NSNumber alloc] initWithDouble:Double_val(e)]; } - cs->_autorelease = TRUE; - break; - case '@': - *((NSObject **)&cs->retV) = (e == Val_unit) ? NULL : [[OCamlValue alloc] initWithValue:e]; - cs->_autorelease = TRUE; - break; - case 'i': - *((long *)&cs->retV) = Long_val(e); - break; - case 'x': + cs->_autorelease = TRUE; + break; + case '@': + *((NSObject **)&cs->retV) = (e == Val_unit) ? NULL : [[OCamlValue alloc] initWithValue:e]; + cs->_autorelease = TRUE; + break; + case 'i': + *((long *)&cs->retV) = Long_val(e); + break; + case 'x': break; default: NSCAssert1(0, @"Unknown return type '%c'", retType); break; - } - } + } + } - if (Is_exception_result(e)) { - // get exception string -- it will get thrown back in the calling thread - value *f = caml_named_value("unisonExnInfo"); + if (Is_exception_result(e)) { + // get exception string -- it will get thrown back in the calling thread + value *f = caml_named_value("unisonExnInfo"); // We leak memory here... cs->exception = strdup(String_val(caml_callback(*f,Extract_exception(e)))); - } - - [pool release]; - - // NSLog(@"*** bridgeThreadWait: returning"); - - // we're done, signal back - pthread_mutex_lock(&global_res_lock); - _RetState = cs; - pthread_cond_signal(&global_res_cond); - pthread_mutex_unlock(&global_res_lock); - } - // Never get here... + } + + [pool release]; + + // NSLog(@"*** bridgeThreadWait: returning"); + + // we're done, signal back + pthread_mutex_lock(&global_res_lock); + _RetState = cs; + pthread_cond_signal(&global_res_cond); + pthread_mutex_unlock(&global_res_lock); + } + // Never get here... CAMLreturn (Val_unit); } void *_passCall(CallState *cs) { pthread_mutex_lock(&global_call_lock); - _CallState = cs; - - // signal so call can happen on other thread - pthread_mutex_lock(&global_res_lock); - pthread_cond_signal(&global_call_cond); - pthread_mutex_unlock(&global_call_lock); - - // NSLog(@"*** _passCall (%d) -- performing signal and waiting", pthread_self()); - - // wait until done -- make sure the result is for our call - while (_RetState != cs) pthread_cond_wait(&global_res_cond, &global_res_lock); - _RetState = NULL; - pthread_mutex_unlock(&global_res_lock); - - // NSLog(@"*** doCallback -- back with result"); - if (cs->exception) { - @throw [NSException exceptionWithName:@"OCamlException" - reason:[NSString stringWithUTF8String:cs->exception] - userInfo:nil]; - } - if (cs->_autorelease) [((id)cs->retV) autorelease]; + _CallState = cs; + + // signal so call can happen on other thread + pthread_mutex_lock(&global_res_lock); + pthread_cond_signal(&global_call_cond); + pthread_mutex_unlock(&global_call_lock); + + // NSLog(@"*** _passCall (%d) -- performing signal and waiting", pthread_self()); + + // wait until done -- make sure the result is for our call + while (_RetState != cs) pthread_cond_wait(&global_res_cond, &global_res_lock); + _RetState = NULL; + pthread_mutex_unlock(&global_res_lock); + + // NSLog(@"*** doCallback -- back with result"); + if (cs->exception) { + @throw [NSException exceptionWithName:@"OCamlException" + reason:[NSString stringWithUTF8String:cs->exception] + userInfo:nil]; + } + if (cs->_autorelease) [((id)cs->retV) autorelease]; return cs->retV; } void *ocamlCall(const char *argTypes, ...) { - CallState cs; - cs.opCode = SafeCall; - cs.exception = NULL; - cs.argTypes = argTypes; - va_start(cs.args, argTypes); - void * res = _passCall(&cs); - - va_end(cs.args); - return res; + CallState cs; + cs.opCode = SafeCall; + cs.exception = NULL; + cs.argTypes = argTypes; + va_start(cs.args, argTypes); + void * res = _passCall(&cs); + + va_end(cs.args); + return res; } void *getField(value *vP, long index, char type) { - CallState cs; - cs.opCode = FieldAccess; - cs.valueP = vP; - cs.fieldIndex = index; - cs.fieldType = type; - cs.exception = NULL; - return _passCall(&cs); + CallState cs; + cs.opCode = FieldAccess; + cs.valueP = vP; + cs.fieldIndex = index; + cs.fieldType = type; + cs.exception = NULL; + return _passCall(&cs); } @implementation OCamlValue - initWithValue:(long)v { - [super init]; - _v = v; - caml_register_global_root((value *)&_v); - return self; + [super init]; + _v = v; + caml_register_global_root((value *)&_v); + return self; } - (long)count @@ -354,15 +354,15 @@ void *getField(value *vP, long index, char type) - (long)value { - // Unsafe to use! - return _v; + // Unsafe to use! + return _v; } - (void)dealloc { - _v = Val_unit; + _v = Val_unit; caml_remove_global_root((value *)&_v); - [super dealloc]; + [super dealloc]; } @end @@ -384,24 +384,24 @@ void reportExn(const char *msg) { // FIXME! Claim is that value conversion must also happen in the OCaml thread... value doCallback (value c, int argcount, value v1, value v2, value v3, BOOL exitOnException) { - // NSLog(@"*** doCallback: (%d) -- trying to acquire global lock", pthread_self()); - CallState cs; - cs.opCode = OldCall; - cs.exception = NULL; - cs.call = c; - cs.a1 = v1; - cs.a2 = v2; - cs.a3 = v3; - cs.argCount = argcount; - @try { - return _passCall(&cs); - } @catch (NSException *ex) { - if (exitOnException) { - reportExn(cs.exception); - exit(1); - } - @throw ex; - } + // NSLog(@"*** doCallback: (%d) -- trying to acquire global lock", pthread_self()); + CallState cs; + cs.opCode = OldCall; + cs.exception = NULL; + cs.call = c; + cs.a1 = v1; + cs.a2 = v2; + cs.a3 = v3; + cs.argCount = argcount; + @try { + return _passCall(&cs); + } @catch (NSException *ex) { + if (exitOnException) { + reportExn(cs.exception); + exit(1); + } + @throw ex; + } } value Callback_checkexn(value c,value v) { diff --git a/src/uimac14/ColorGradientView.m b/src/uimac14/ColorGradientView.m index 01e32b5..2be5f78 100644 --- a/src/uimac14/ColorGradientView.m +++ b/src/uimac14/ColorGradientView.m @@ -10,7 +10,7 @@ @implementation ColorGradientView -// Automatically create accessor methods +// Automatically create accessor methods @synthesize startingColor; @synthesize endingColor; @synthesize angle; @@ -39,7 +39,7 @@ initWithStartingColor:startingColor endingColor:endingColor]; [aGradient drawInRect:[self bounds] angle:angle]; - [aGradient release]; + [aGradient release]; } } diff --git a/src/uimac14/ImageAndTextCell.m b/src/uimac14/ImageAndTextCell.m index 34be861..0b88b00 100644 --- a/src/uimac14/ImageAndTextCell.m +++ b/src/uimac14/ImageAndTextCell.m @@ -1,44 +1,44 @@ /* - ImageAndTextCell.m - Copyright (c) 2001-2004, Apple Computer, Inc., all rights reserved. - Author: Chuck Pisula + ImageAndTextCell.m + Copyright (c) 2001-2004, Apple Computer, Inc., all rights reserved. + Author: Chuck Pisula - Milestones: - Initially created 3/1/01 + Milestones: + Initially created 3/1/01 Subclass of NSTextFieldCell which can display text and an image simultaneously. */ /* IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in - consideration of your agreement to the following terms, and your use, installation, - modification or redistribution of this Apple software constitutes acceptance of these - terms. If you do not agree with these terms, please do not use, install, modify or + consideration of your agreement to the following terms, and your use, installation, + modification or redistribution of this Apple software constitutes acceptance of these + terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in - this original Apple software (the "Apple Software"), to use, reproduce, modify and - redistribute the Apple Software, with or without modifications, in source and/or binary - forms; provided that if you redistribute the Apple Software in its entirety and without - modifications, you must retain this notice and the following text and disclaimers in all - such redistributions of the Apple Software. Neither the name, trademarks, service marks - or logos of Apple Computer, Inc. may be used to endorse or promote products derived from + + In consideration of your agreement to abide by the following terms, and subject to these + terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in + this original Apple software (the "Apple Software"), to use, reproduce, modify and + redistribute the Apple Software, with or without modifications, in source and/or binary + forms; provided that if you redistribute the Apple Software in its entirety and without + modifications, you must retain this notice and the following text and disclaimers in all + such redistributions of the Apple Software. Neither the name, trademarks, service marks + or logos of Apple Computer, Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple - herein, including but not limited to any patent rights that may be infringed by your + herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, - EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, + EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, - REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND - WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, + REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND + WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -128,4 +128,3 @@ typedef int NSInteger; } @end - diff --git a/src/uimac14/Info.plist b/src/uimac14/Info.plist index 550155a..c5326f9 100644 --- a/src/uimac14/Info.plist +++ b/src/uimac14/Info.plist @@ -2,31 +2,31 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>CFBundleName</key> - <string>Unison</string> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>Unison</string> - <key>CFBundleIconFile</key> - <string>Unison.icns</string> - <key>CFBundleIdentifier</key> - <string>edu.upenn.cis.Unison</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleShortVersionString</key> - <string>$(MARKETING_VERSION)</string> - <key>CFBundleGetInfoString</key> - <string>${MARKETING_VERSION}, ©1999-2016, licensed under GNU GPL.</string> - <key>NSHumanReadableCopyright</key> - <string>©1999-2016, licensed under GNU GPL v3.</string> - <key>NSMainNibFile</key> - <string>MainMenu</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> + <key>CFBundleName</key> + <string>Unison</string> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>Unison</string> + <key>CFBundleIconFile</key> + <string>Unison.icns</string> + <key>CFBundleIdentifier</key> + <string>edu.upenn.cis.Unison</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleShortVersionString</key> + <string>$(MARKETING_VERSION)</string> + <key>CFBundleGetInfoString</key> + <string>${MARKETING_VERSION}, ©1999-2016, licensed under GNU GPL.</string> + <key>NSHumanReadableCopyright</key> + <string>©1999-2016, licensed under GNU GPL v3.</string> + <key>NSMainNibFile</key> + <string>MainMenu</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> </dict> </plist> diff --git a/src/uimac14/Info.plist.template b/src/uimac14/Info.plist.template index 22a46af..230e60d 100644 --- a/src/uimac14/Info.plist.template +++ b/src/uimac14/Info.plist.template @@ -2,33 +2,33 @@ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>CFBundleName</key> - <string>Unison</string> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>Unison</string> - <key>CFBundleIconFile</key> - <string>Unison.icns</string> - <key>CFBundleIdentifier</key> - <string>edu.upenn.cis.Unison</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>@@VERSION@@</string> - <key>CFBundleShortVersionString</key> - <string>@@VERSION@@</string> - <key>CFBundleGetInfoString</key> - <string>@@VERSION@@. ©1999-2007, licensed under GNU GPL.</string> - <key>NSHumanReadableCopyright</key> - <string>©1999-2006, licensed under GNU GPL.</string> - <key>NSMainNibFile</key> - <string>MainMenu</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> + <key>CFBundleName</key> + <string>Unison</string> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>Unison</string> + <key>CFBundleIconFile</key> + <string>Unison.icns</string> + <key>CFBundleIdentifier</key> + <string>edu.upenn.cis.Unison</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>@@VERSION@@</string> + <key>CFBundleShortVersionString</key> + <string>@@VERSION@@</string> + <key>CFBundleGetInfoString</key> + <string>@@VERSION@@. ©1999-2007, licensed under GNU GPL.</string> + <key>NSHumanReadableCopyright</key> + <string>©1999-2006, licensed under GNU GPL.</string> + <key>NSMainNibFile</key> + <string>MainMenu</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> </dict> </plist> diff --git a/src/uimac14/MyController.h b/src/uimac14/MyController.h index 94f97ba..9f907f3 100644 --- a/src/uimac14/MyController.h +++ b/src/uimac14/MyController.h @@ -18,56 +18,56 @@ { IBOutlet NSWindow *mainWindow; UnisonToolbar *toolbar; - + IBOutlet NSWindow *cltoolWindow; IBOutlet NSButton *cltoolPref; - + IBOutlet ProfileController *profileController; IBOutlet NSView *chooseProfileView; NSString *myProfile; - + IBOutlet PreferencesController *preferencesController; IBOutlet NSView *preferencesView; - + IBOutlet NSView *updatesView; IBOutlet NSView *ConnectingView; IBOutlet ColorGradientView *connectingViewGradient; - + NSView *blankView; - + IBOutlet ReconTableView *tableView; IBOutlet NSTextField *updatesText; IBOutlet NSTextField *detailsTextView; IBOutlet NSTextField *statusText; IBOutlet ColorGradientView *detailsTextViewGradient; - + IBOutlet NSWindow *passwordWindow; IBOutlet NSTextField *passwordPrompt; IBOutlet NSTextField *passwordText; IBOutlet NSButton *passwordCancelButton; BOOL waitingForPassword; - + IBOutlet NSWindow *aboutWindow; IBOutlet NSTextField *versionText; - + IBOutlet NSProgressIndicator *progressBar; - + IBOutlet NotificationController *notificationController; - + BOOL syncable; - BOOL duringSync; + BOOL duringSync; BOOL afterSync; - + NSMutableArray *reconItems; ParentReconItem *rootItem; OCamlValue *preconn; - + BOOL doneFirstDiff; IBOutlet NSWindow *diffWindow; IBOutlet NSTextView *diffView; IBOutlet NSSegmentedControl *tableModeSelector; IBOutlet NSProgressIndicator *connectingAnimation; - + IBOutlet NSWindow *preferencesWindow; IBOutlet NSButton* checkOpenProfile; IBOutlet NSComboBox *profileBox; @@ -79,12 +79,12 @@ IBOutlet NSSplitView *splitView; id fontChangeTarget; - + BOOL isBatchSet; NSTimer *_timer; NSAlert *_timeoutAlert; NSUInteger _secondsRemaining; - + BOOL shouldExitAfterWarning; } @@ -144,4 +144,3 @@ - (void) updateFontDisplay; @end - diff --git a/src/uimac14/MyController.m b/src/uimac14/MyController.m index b6edfd8..302bffe 100644 --- a/src/uimac14/MyController.m +++ b/src/uimac14/MyController.m @@ -23,18 +23,18 @@ static MyController *me; // needed by reloadTable and displayStatus, below // BCP (11/09): Added per Onne Gorter: // if user closes main window, terminate app, instead of keeping an empty app around with no window -- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { +- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication { return YES; } - (id)init { if (([super init])) { - + /* Initialize locals */ me = self; doneFirstDiff = NO; - + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys: /* By default, invite user to install cltool */ @@ -45,11 +45,11 @@ static MyController *me; // needed by reloadTable and displayStatus, below @"", @"detailsFont", @"", @"diffFont", nil]; - + [defaults registerDefaults:appDefaults]; fontChangeTarget = nil; } - + return self; } @@ -63,8 +63,8 @@ static MyController *me; // needed by reloadTable and displayStatus, below - (void)awakeFromNib { [splitView setAutosaveName:@"splitView"]; - - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSFont *defaultFont = [NSFont fontWithName:@"Monaco" size:11]; NSData *detailsFontData = [defaults dataForKey:@"detailsFont"]; if (detailsFontData) { @@ -97,70 +97,70 @@ static MyController *me; // needed by reloadTable and displayStatus, below [diffView setFont:defaultFont]; } else [diffView setFont:defaultFont]; - + blankView = [[NSView alloc] init]; - + /* Double clicking in the profile list will open the profile */ [[profileController tableView] setTarget:self]; [[profileController tableView] setDoubleAction:@selector(openButton:)]; - - [tableView setAutoresizesOutlineColumn:NO]; - - // use combo-cell for path + + [tableView setAutoresizesOutlineColumn:NO]; + + // use combo-cell for path [[tableView tableColumnWithIdentifier:@"path"] setDataCell:[[[ImageAndTextCell alloc] init] autorelease]]; - - // Custom progress cell - ProgressCell *progressCell = [[[ProgressCell alloc] init] autorelease]; - [[tableView tableColumnWithIdentifier:@"percentTransferred"] setDataCell:progressCell]; - + + // Custom progress cell + ProgressCell *progressCell = [[[ProgressCell alloc] init] autorelease]; + [[tableView tableColumnWithIdentifier:@"percentTransferred"] setDataCell:progressCell]; + /* Set up the version string in the about box. We use a custom about box just because PRCS doesn't seem capable of getting the version into the InfoPlist.strings file; otherwise we'd use the standard about box. */ [versionText setStringValue:ocamlCall("S", "unisonGetVersion")]; - + /* Command-line processing */ - OCamlValue *clprofile = (id)ocamlCall("@", "unisonInit0"); - - BOOL areRootsSet = (long)ocamlCall("i", "areRootsSet") ? YES : NO; - if (areRootsSet) { - NSLog(@"Roots are on the command line"); - } - else { - NSLog(@"Roots are not set on the command line"); - } - + OCamlValue *clprofile = (id)ocamlCall("@", "unisonInit0"); + + BOOL areRootsSet = (long)ocamlCall("i", "areRootsSet") ? YES : NO; + if (areRootsSet) { + NSLog(@"Roots are on the command line"); + } + else { + NSLog(@"Roots are not set on the command line"); + } + /* Add toolbar */ - toolbar = [[[UnisonToolbar alloc] + toolbar = [[[UnisonToolbar alloc] initWithIdentifier: @"unisonToolbar" :self :tableView] autorelease]; [mainWindow setToolbar: toolbar]; - [toolbar takeTableModeView:tableModeSelector]; - [self initTableMode]; - - + [toolbar takeTableModeView:tableModeSelector]; + [self initTableMode]; + + /* Set up the first window the user will see */ if (clprofile) { /* A profile name was given on the command line */ - NSString *profileName = [clprofile getField:0 withType:'S']; + NSString *profileName = [clprofile getField:0 withType:'S']; [self profileSelected:profileName]; - + /* If invoked from terminal we need to bring the app to the front */ [NSApp activateIgnoringOtherApps:YES]; - + /* Start the connection */ [self connect:profileName]; } else if (areRootsSet) { - /* If invoked from terminal we need to bring the app to the front */ - [NSApp activateIgnoringOtherApps:YES]; - /* Start the connection with the empty profile name, indicating roots only */ - [self connect:@""]; + /* If invoked from terminal we need to bring the app to the front */ + [NSApp activateIgnoringOtherApps:YES]; + /* Start the connection with the empty profile name, indicating roots only */ + [self connect:@""]; } else { /* If invoked from terminal we need to bring the app to the front */ [NSApp activateIgnoringOtherApps:YES]; if ([[NSUserDefaults standardUserDefaults] boolForKey:@"openProfileAtStartup"]) { - NSString *profileToOpen = [[NSUserDefaults standardUserDefaults] + NSString *profileToOpen = [[NSUserDefaults standardUserDefaults] stringForKey:@"profileToOpen"]; if ([[profileToOpen trim] compare:@""] != NSOrderedSame && [[profileController getProfiles] indexOfObject:profileToOpen] != NSNotFound) { @@ -175,17 +175,17 @@ static MyController *me; // needed by reloadTable and displayStatus, below [self chooseProfiles]; } } - + [mainWindow display]; [mainWindow makeKeyAndOrderFront:nil]; /* unless user has clicked Don't ask me again, ask about cltool */ - if ( ([[NSUserDefaults standardUserDefaults] boolForKey:@"CheckCltool"]) && - (![[NSFileManager defaultManager] - /* BCP 6/2016: Changed from /usr/bin/unison for El Capitan, per + if ( ([[NSUserDefaults standardUserDefaults] boolForKey:@"CheckCltool"]) && + (![[NSFileManager defaultManager] + /* BCP 6/2016: Changed from /usr/bin/unison for El Capitan, per suggestion from Alan Shutko */ - fileExistsAtPath:@"/usr/local/bin/unison"]) ) - [self raiseCltoolWindow:nil]; + fileExistsAtPath:@"/usr/local/bin/unison"]) ) + [self raiseCltoolWindow:nil]; } - (IBAction) checkOpenProfileChanged:(id)sender { @@ -228,7 +228,7 @@ static MyController *me; // needed by reloadTable and displayStatus, below [mainWindow setContentView:chooseProfileView]; [toolbar setView:@"chooseProfileView"]; [mainWindow setTitle:@"Unison"]; - + // profiles get keyboard input [mainWindow makeFirstResponder:[profileController tableView]]; [chooseProfileView display]; @@ -278,7 +278,7 @@ static MyController *me; // needed by reloadTable and displayStatus, below [profileBox removeAllItems]; [profileBox addItemsWithObjectValues:[profileController getProfiles]]; NSUInteger index = [[profileController getProfiles] indexOfObject: - [[NSUserDefaults standardUserDefaults] + [[NSUserDefaults standardUserDefaults] stringForKey:@"profileToOpen"]]; if (index == NSNotFound) { [checkOpenProfile setState:NSOffState]; @@ -321,27 +321,27 @@ static MyController *me; // needed by reloadTable and displayStatus, below - (void)updateToolbar { - [toolbar validateVisibleItems]; - [tableModeSelector setEnabled:((syncable && !duringSync) || afterSync)]; + [toolbar validateVisibleItems]; + [tableModeSelector setEnabled:((syncable && !duringSync) || afterSync)]; - // Why? + // Why? [updatesView setNeedsDisplay:YES]; } - (void)updateTableViewWithReset:(BOOL)shouldResetSelection { - [tableView reloadData]; - if (shouldResetSelection) { - [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; - shouldResetSelection = NO; - } - [updatesView setNeedsDisplay:YES]; + [tableView reloadData]; + if (shouldResetSelection) { + [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; + shouldResetSelection = NO; + } + [updatesView setNeedsDisplay:YES]; } - (void)updateProgressBar:(NSNumber *)newProgress { - // NSLog(@"Updating progress bar: %i - %i", (int)[newProgress doubleValue], (int)[progressBar doubleValue]); - [progressBar incrementBy:([newProgress doubleValue] - [progressBar doubleValue])]; + // NSLog(@"Updating progress bar: %i - %i", (int)[newProgress doubleValue], (int)[progressBar doubleValue]); + [progressBar incrementBy:([newProgress doubleValue] - [progressBar doubleValue])]; } - (void)updateTableViewSelection @@ -353,14 +353,14 @@ static MyController *me; // needed by reloadTable and displayStatus, below - (void)outlineViewSelectionDidChange:(NSNotification *)note { - [self updateTableViewSelection]; + [self updateTableViewSelection]; } - (void)connect:(NSString *)profileName { // contact server, propagate prefs NSLog(@"Connecting to %@...", profileName); - + // Switch to ConnectingView [mainWindow setContentView:blankView]; [self resizeWindowToSize:[updatesView frame].size]; @@ -368,17 +368,17 @@ static MyController *me; // needed by reloadTable and displayStatus, below [mainWindow setContentMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)]; [mainWindow setContentView:ConnectingView]; [toolbar setView:@"connectingView"]; - + // Update (almost) immediately [ConnectingView display]; [connectingAnimation startAnimation:self]; - + syncable = NO; - afterSync = NO; - - [self updateToolbar]; - - // will spawn thread on OCaml side and callback when complete + afterSync = NO; + + [self updateToolbar]; + + // will spawn thread on OCaml side and callback when complete (void)ocamlCall("xS", "unisonInit1", profileName); } @@ -388,38 +388,38 @@ CAMLprim value unisonInit1Complete(value v) if (v == Val_unit) { NSLog(@"Connected."); [me->connectingAnimation stopAnimation:me]; - [me->preconn release]; - me->preconn = NULL; - [me performSelectorOnMainThread:@selector(afterOpen:) withObject:nil waitUntilDone:FALSE]; + [me->preconn release]; + me->preconn = NULL; + [me performSelectorOnMainThread:@selector(afterOpen:) withObject:nil waitUntilDone:FALSE]; } else { // prompting required - me->preconn = [[OCamlValue alloc] initWithValue:Field(v,0)]; // value of Some - [me performSelectorOnMainThread:@selector(unisonInit1Complete:) withObject:nil waitUntilDone:FALSE]; - } + me->preconn = [[OCamlValue alloc] initWithValue:Field(v,0)]; // value of Some + [me performSelectorOnMainThread:@selector(unisonInit1Complete:) withObject:nil waitUntilDone:FALSE]; + } [pool release]; return Val_unit; } - (void)unisonInit1Complete:(id)ignore { - @try { - OCamlValue *prompt = ocamlCall("@@", "openConnectionPrompt", preconn); - if (!prompt) { - // turns out, no prompt needed, but must finish opening connection - ocamlCall("x@", "openConnectionEnd", preconn); - NSLog(@"Connected."); - waitingForPassword = NO; - [self afterOpen]; - return; - } - waitingForPassword = YES; - - [self raisePasswordWindow:[prompt getField:0 withType:'S']]; - } @catch (NSException *ex) { - NSRunAlertPanel(@"Connection Error", [ex description], @"OK", nil, nil); - [self chooseProfiles]; - return; - } + @try { + OCamlValue *prompt = ocamlCall("@@", "openConnectionPrompt", preconn); + if (!prompt) { + // turns out, no prompt needed, but must finish opening connection + ocamlCall("x@", "openConnectionEnd", preconn); + NSLog(@"Connected."); + waitingForPassword = NO; + [self afterOpen]; + return; + } + waitingForPassword = YES; + + [self raisePasswordWindow:[prompt getField:0 withType:'S']]; + } @catch (NSException *ex) { + NSRunAlertPanel(@"Connection Error", [ex description], @"OK", nil, nil); + [self chooseProfiles]; + return; + } NSLog(@"Connected."); } @@ -449,33 +449,33 @@ CAMLprim value unisonInit1Complete(value v) if ((long)ocamlCall("iS", "unisonAuthenticityMsg", prompt)) { int i = NSRunAlertPanel(@"New host",prompt,@"Yes",@"No",nil); if (i == NSAlertDefaultReturn) { - ocamlCall("x@s", "openConnectionReply", preconn, "yes"); - prompt = ocamlCall("S@", "openConnectionPrompt", preconn); + ocamlCall("x@s", "openConnectionReply", preconn, "yes"); + prompt = ocamlCall("S@", "openConnectionPrompt", preconn); if (!prompt) { // all done with prompts, finish opening connection - ocamlCall("x@", "openConnectionEnd", preconn); + ocamlCall("x@", "openConnectionEnd", preconn); waitingForPassword = NO; [self afterOpen]; return; } else { - [self raisePasswordWindow:[NSString + [self raisePasswordWindow:[NSString stringWithUTF8String:String_val(Field(prompt,0))]]; return; } } if (i == NSAlertAlternateReturn) { - ocamlCall("x@", "openConnectionCancel", preconn); + ocamlCall("x@", "openConnectionCancel", preconn); return; } else { NSLog(@"Unrecognized response '%d' from NSRunAlertPanel",i); - ocamlCall("x@", "openConnectionCancel", preconn); + ocamlCall("x@", "openConnectionCancel", preconn); return; } } NSLog(@"Unrecognized message from ssh: %@",prompt); - ocamlCall("x@", "openConnectionCancel", preconn); + ocamlCall("x@", "openConnectionCancel", preconn); } // The password window will invoke this when Enter occurs, b/c we @@ -493,37 +493,37 @@ CAMLprim value unisonInit1Complete(value v) [passwordWindow orderOut:self]; [NSApp endSheet:passwordWindow]; if ([sender isEqualTo:passwordCancelButton]) { - ocamlCall("x@", "openConnectionCancel", preconn); + ocamlCall("x@", "openConnectionCancel", preconn); [self chooseProfiles]; return; } NSString *password = [passwordText stringValue]; - ocamlCall("x@S", "openConnectionReply", preconn, password); + ocamlCall("x@S", "openConnectionReply", preconn, password); OCamlValue *prompt = ocamlCall("@@", "openConnectionPrompt", preconn); if (!prompt) { // all done with prompts, finish opening connection - ocamlCall("x@", "openConnectionEnd", preconn); + ocamlCall("x@", "openConnectionEnd", preconn); waitingForPassword = NO; [self afterOpen]; } else { - [self raisePasswordWindow:[prompt getField:0 withType:'S']]; + [self raisePasswordWindow:[prompt getField:0 withType:'S']]; } } - (void)afterOpen:(id)ignore { - [self afterOpen]; + [self afterOpen]; } - (void)afterOpen { if (waitingForPassword) return; // move to updates window after clearing it - [self updateReconItems:nil]; - [progressBar setDoubleValue:0.0]; - [progressBar stopAnimation:self]; + [self updateReconItems:nil]; + [progressBar setDoubleValue:0.0]; + [progressBar stopAnimation:self]; // [self clearDetails]; [mainWindow setContentView:blankView]; [self resizeWindowToSize:[updatesView frame].size]; @@ -537,20 +537,20 @@ CAMLprim value unisonInit1Complete(value v) afterSync = NO; [tableView deselectAll:self]; - [self updateToolbar]; - [self updateProgressBar:[NSNumber numberWithDouble:0.0]]; - + [self updateToolbar]; + [self updateProgressBar:[NSNumber numberWithDouble:0.0]]; + // this should depend on the number of reconitems, and is now done // in updateReconItems: // reconItems table gets keyboard input //[mainWindow makeFirstResponder:tableView]; [tableView scrollRowToVisible:0]; - [preconn release]; + [preconn release]; preconn = nil; // so old preconn can be garbage collected - // This will run in another thread spawned in OCaml and will return immediately - // We'll get a call back to unisonInit2Complete() when it is complete - ocamlCall("x", "unisonInit2"); + // This will run in another thread spawned in OCaml and will return immediately + // We'll get a call back to unisonInit2Complete() when it is complete + ocamlCall("x", "unisonInit2"); } - (void)doSync @@ -558,63 +558,63 @@ CAMLprim value unisonInit1Complete(value v) [tableView setEditable:NO]; syncable = NO; duringSync = YES; - - [self updateToolbar]; - - // This will run in another thread spawned in OCaml and will return immediately - // We'll get a call back to syncComplete() when it is complete - ocamlCall("x", "unisonSynchronize"); + + [self updateToolbar]; + + // This will run in another thread spawned in OCaml and will return immediately + // We'll get a call back to syncComplete() when it is complete + ocamlCall("x", "unisonSynchronize"); } - (IBAction)syncButton:(id)sender { - [self doSync]; + [self doSync]; } - (void)afterUpdate:(id)retainedReconItems { - // NSLog(@"In afterUpdate:..."); + // NSLog(@"In afterUpdate:..."); [self updateReconItems:retainedReconItems]; - [retainedReconItems release]; + [retainedReconItems release]; [notificationController updateFinishedFor:[self profile]]; // label the left and right columns with the roots - NSString *leftHost = [(NSString *)ocamlCall("S", "unisonFirstRootString") trim]; - NSString *rightHost = [(NSString *)ocamlCall("S", "unisonSecondRootString") trim]; - /* + NSString *leftHost = [(NSString *)ocamlCall("S", "unisonFirstRootString") trim]; + NSString *rightHost = [(NSString *)ocamlCall("S", "unisonSecondRootString") trim]; + /* [[[tableView tableColumnWithIdentifier:@"left"] headerCell] setObjectValue:lefthost]; [[[tableView tableColumnWithIdentifier:@"right"] headerCell] setObjectValue:rightHost]; */ - [mainWindow setTitle: [NSString stringWithFormat:@"Unison: %@ (%@ <-> %@)", - [self profile], leftHost, rightHost]]; - - // initial sort - [tableView setSortDescriptors:[NSArray arrayWithObjects: - [[tableView tableColumnWithIdentifier:@"fileSizeString"] sortDescriptorPrototype], - [[tableView tableColumnWithIdentifier:@"path"] sortDescriptorPrototype], - nil]]; - - [self updateTableViewWithReset:([reconItems count] > 0)]; - [self updateToolbar]; - isBatchSet = (long)ocamlCall("i", "isBatchSet") ? YES : NO; - if (isBatchSet) { - NSLog(@"batch set on the command line"); - } - else { - NSLog(@"batch not set on the command line"); - } - - if (isBatchSet) { - [self doSync]; - } + [mainWindow setTitle: [NSString stringWithFormat:@"Unison: %@ (%@ <-> %@)", + [self profile], leftHost, rightHost]]; + + // initial sort + [tableView setSortDescriptors:[NSArray arrayWithObjects: + [[tableView tableColumnWithIdentifier:@"fileSizeString"] sortDescriptorPrototype], + [[tableView tableColumnWithIdentifier:@"path"] sortDescriptorPrototype], + nil]]; + + [self updateTableViewWithReset:([reconItems count] > 0)]; + [self updateToolbar]; + isBatchSet = (long)ocamlCall("i", "isBatchSet") ? YES : NO; + if (isBatchSet) { + NSLog(@"batch set on the command line"); + } + else { + NSLog(@"batch not set on the command line"); + } + + if (isBatchSet) { + [self doSync]; + } } CAMLprim value unisonInit2Complete(value v) { id pool = [[NSAutoreleasePool alloc] init]; - [me performSelectorOnMainThread:@selector(afterUpdate:) withObject:[[OCamlValue alloc] initWithValue:v] waitUntilDone:FALSE]; + [me performSelectorOnMainThread:@selector(afterUpdate:) withObject:[[OCamlValue alloc] initWithValue:v] waitUntilDone:FALSE]; [pool release]; return Val_unit; } @@ -625,15 +625,15 @@ CAMLprim value unisonInit2Complete(value v) duringSync = NO; afterSync = YES; [self updateToolbar]; - + int i; for (i = 0; i < [reconItems count]; i++) { [[reconItems objectAtIndex:i] resetProgress]; } - [self updateTableViewSelection]; - - [self updateTableViewWithReset:FALSE]; + [self updateTableViewSelection]; + + [self updateTableViewWithReset:FALSE]; } - (void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo @@ -644,7 +644,7 @@ CAMLprim value unisonInit2Complete(value v) case NSAlertAlternateReturn: return; break; - + default: [[NSApplication sharedApplication] performSelector: @selector(terminate:) withObject: nil afterDelay: 0.0]; break; @@ -666,19 +666,19 @@ CAMLprim value unisonInit2Complete(value v) - (void)quitIfBatch:(id)ignore { - if (isBatchSet) { - NSLog(@"Automatically quitting because of -batch"); - _timeoutAlert = [NSAlert alertWithMessageText: @"" defaultButton: @"Quit" alternateButton: @"Cancel" otherButton: nil informativeTextWithFormat: @""]; - - _secondsRemaining = 10; - - _timer = [NSTimer scheduledTimerWithTimeInterval: 1 target: self selector: @selector(updateCountdown) userInfo: nil repeats: YES]; - - [_timeoutAlert beginSheetModalForWindow: mainWindow modalDelegate: self didEndSelector: @selector(alertDidEnd:returnCode:contextInfo:) contextInfo: NULL]; - } + if (isBatchSet) { + NSLog(@"Automatically quitting because of -batch"); + _timeoutAlert = [NSAlert alertWithMessageText: @"" defaultButton: @"Quit" alternateButton: @"Cancel" otherButton: nil informativeTextWithFormat: @""]; + + _secondsRemaining = 10; + + _timer = [NSTimer scheduledTimerWithTimeInterval: 1 target: self selector: @selector(updateCountdown) userInfo: nil repeats: YES]; + + [_timeoutAlert beginSheetModalForWindow: mainWindow modalDelegate: self didEndSelector: @selector(alertDidEnd:returnCode:contextInfo:) contextInfo: NULL]; + } } -// TODO: (BCP, 3/2012) Note that the string literal "~/unison.log" here is wrong -- +// TODO: (BCP, 3/2012) Note that the string literal "~/unison.log" here is wrong -- // this is a user-settable preference (in ubase/trace.ml) and we should ask for its value. CAMLprim value syncComplete() { @@ -689,33 +689,33 @@ CAMLprim value syncComplete() [pool release]; [me performSelectorOnMainThread:@selector(quitIfBatch:) withObject:nil waitUntilDone:FALSE]; - + return Val_unit; } // A function called from ocaml - (void)reloadTable:(NSNumber *)i { - // NSLog(@"*** ReloadTable: %i", [i intValue]); + // NSLog(@"*** ReloadTable: %i", [i intValue]); [[reconItems objectAtIndex:[i intValue]] resetProgress]; - [self updateTableViewWithReset:FALSE]; + [self updateTableViewWithReset:FALSE]; } CAMLprim value reloadTable(value row) { id pool = [[NSAutoreleasePool alloc] init]; - // NSLog(@"OCaml says... ReloadTable: %i", Int_val(row)); - NSNumber *num = [[NSNumber alloc] initWithInt:Int_val(row)]; - [me performSelectorOnMainThread:@selector(reloadTable:) withObject:num waitUntilDone:FALSE]; - [num release]; + // NSLog(@"OCaml says... ReloadTable: %i", Int_val(row)); + NSNumber *num = [[NSNumber alloc] initWithInt:Int_val(row)]; + [me performSelectorOnMainThread:@selector(reloadTable:) withObject:num waitUntilDone:FALSE]; + [num release]; [pool release]; return Val_unit; } - (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { - if (item == nil) item = rootItem; - return [[item children] count]; + if (item == nil) item = rootItem; + return [[item children] count]; } - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item { @@ -723,60 +723,60 @@ CAMLprim value reloadTable(value row) } - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item { - if (item == nil) item = rootItem; - return [[item children] objectAtIndex:index]; + if (item == nil) item = rootItem; + return [[item children] objectAtIndex:index]; } - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { NSString *identifier = [tableColumn identifier]; - if (item == nil) item = rootItem; + if (item == nil) item = rootItem; - if ([identifier isEqualToString:@"percentTransferred"] && (!duringSync && !afterSync)) return nil; + if ([identifier isEqualToString:@"percentTransferred"] && (!duringSync && !afterSync)) return nil; - return [item valueForKey:identifier]; + return [item valueForKey:identifier]; } static NSDictionary *_SmallGreyAttributes = nil; -- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { - NSString *identifier = [tableColumn identifier]; +- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { + NSString *identifier = [tableColumn identifier]; if ([identifier isEqualToString:@"path"]) { - // The file icon - [(ImageAndTextCell*)cell setImage:[item fileIcon]]; - - // For parents, format the file count into the text - long fileCount = [item fileCount]; - if (fileCount > 1) { - NSString *countString = [NSString stringWithFormat:@" (%ld files)", fileCount]; - NSString *fullString = [(NSString *)[cell objectValue] stringByAppendingString:countString]; - NSMutableAttributedString *as = [[NSMutableAttributedString alloc] initWithString:fullString]; - - if (!_SmallGreyAttributes) { - NSColor *txtColor = [NSColor grayColor]; - NSFont *txtFont = [NSFont systemFontOfSize:9.0]; - _SmallGreyAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:txtFont, - NSFontAttributeName, txtColor, NSForegroundColorAttributeName, nil] retain]; - } - [as setAttributes:_SmallGreyAttributes range:NSMakeRange([fullString length] - [countString length], [countString length])]; - [cell setAttributedStringValue:as]; - [as release]; - } + // The file icon + [(ImageAndTextCell*)cell setImage:[item fileIcon]]; + + // For parents, format the file count into the text + long fileCount = [item fileCount]; + if (fileCount > 1) { + NSString *countString = [NSString stringWithFormat:@" (%ld files)", fileCount]; + NSString *fullString = [(NSString *)[cell objectValue] stringByAppendingString:countString]; + NSMutableAttributedString *as = [[NSMutableAttributedString alloc] initWithString:fullString]; + + if (!_SmallGreyAttributes) { + NSColor *txtColor = [NSColor grayColor]; + NSFont *txtFont = [NSFont systemFontOfSize:9.0]; + _SmallGreyAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:txtFont, + NSFontAttributeName, txtColor, NSForegroundColorAttributeName, nil] retain]; + } + [as setAttributes:_SmallGreyAttributes range:NSMakeRange([fullString length] - [countString length], [countString length])]; + [cell setAttributedStringValue:as]; + [as release]; + } } else if ([identifier isEqualToString:@"percentTransferred"]) { - [(ProgressCell*)cell setIcon:[item direction]]; - [(ProgressCell*)cell setStatusString:[item progressString]]; - [(ProgressCell*)cell setIsActive:[item isKindOfClass:[LeafReconItem class]]]; + [(ProgressCell*)cell setIcon:[item direction]]; + [(ProgressCell*)cell setStatusString:[item progressString]]; + [(ProgressCell*)cell setIsActive:[item isKindOfClass:[LeafReconItem class]]]; } } -- (void)outlineView:(NSOutlineView *)outlineView +- (void)outlineView:(NSOutlineView *)outlineView sortDescriptorsDidChange:(NSArray *)oldDescriptors { - NSArray *originalSelection = [outlineView selectedObjects]; - - // do we want to catch case of object changes to allow resort in same direction for progress / direction? - // Could check if our objects change and if the first item at the head of new and old were the same - [rootItem sortUsingDescriptors:[outlineView sortDescriptors]]; - [outlineView reloadData]; - [outlineView setSelectedObjects:originalSelection]; + NSArray *originalSelection = [outlineView selectedObjects]; + + // do we want to catch case of object changes to allow resort in same direction for progress / direction? + // Could check if our objects change and if the first item at the head of new and old were the same + [rootItem sortUsingDescriptors:[outlineView sortDescriptors]]; + [outlineView reloadData]; + [outlineView setSelectedObjects:originalSelection]; } // Delegate methods @@ -792,93 +792,93 @@ static NSDictionary *_SmallGreyAttributes = nil; - (int)tableMode { - return [tableModeSelector selectedSegment]; + return [tableModeSelector selectedSegment]; } - (IBAction)tableModeChanged:(id)sender { - [[NSUserDefaults standardUserDefaults] setInteger:[self tableMode]+1 forKey:@"TableLayout"]; - [self updateForChangedItems]; + [[NSUserDefaults standardUserDefaults] setInteger:[self tableMode]+1 forKey:@"TableLayout"]; + [self updateForChangedItems]; } - (void)initTableMode { - int mode = [[NSUserDefaults standardUserDefaults] integerForKey:@"TableLayout"] - 1; - if (mode == -1) mode = 1; - [tableModeSelector setSelectedSegment:mode]; + int mode = [[NSUserDefaults standardUserDefaults] integerForKey:@"TableLayout"] - 1; + if (mode == -1) mode = 1; + [tableModeSelector setSelectedSegment:mode]; } - (void)updateReconItems:(OCamlValue *)caml_reconItems { [reconItems release]; reconItems = [[NSMutableArray alloc] init]; - long i, n =[caml_reconItems count]; + long i, n =[caml_reconItems count]; for (i=0; i<n; i++) { - LeafReconItem *item = [[LeafReconItem alloc] initWithRiAndIndex:(id)[caml_reconItems getField:i withType:'@'] index:i]; + LeafReconItem *item = [[LeafReconItem alloc] initWithRiAndIndex:(id)[caml_reconItems getField:i withType:'@'] index:i]; [reconItems addObject:item]; - [item release]; + [item release]; } - [self updateForChangedItems]; + [self updateForChangedItems]; } - (void)expandConflictedParent:(ParentReconItem *)parent { - if ([parent hasConflictedChildren]) { - // NSLog(@"Expanding conflictedParent: %@", [parent fullPath]); - [tableView expandItem:parent expandChildren:NO]; - NSArray *children = [parent children]; - int i = 0, count = [children count]; - for (;i < count; i++) { - id child = [children objectAtIndex:i]; - if ([child isKindOfClass:[ParentReconItem class]]) [self expandConflictedParent:child]; - } - } + if ([parent hasConflictedChildren]) { + // NSLog(@"Expanding conflictedParent: %@", [parent fullPath]); + [tableView expandItem:parent expandChildren:NO]; + NSArray *children = [parent children]; + int i = 0, count = [children count]; + for (;i < count; i++) { + id child = [children objectAtIndex:i]; + if ([child isKindOfClass:[ParentReconItem class]]) [self expandConflictedParent:child]; + } + } } - (void)updateForChangedItems { - int tableMode = [self tableMode]; - - [rootItem release]; - ParentReconItem *root = rootItem = [[ParentReconItem alloc] init]; - - if (tableMode != 0 && [reconItems count]) { - // Special roll-up root item for outline displays - root = [[ParentReconItem alloc] init]; - [rootItem addChild:root nested:NO]; - [root setPath:@"All Changes..."]; - [root setFullPath:@""]; - [root release]; - } - + int tableMode = [self tableMode]; + + [rootItem release]; + ParentReconItem *root = rootItem = [[ParentReconItem alloc] init]; + + if (tableMode != 0 && [reconItems count]) { + // Special roll-up root item for outline displays + root = [[ParentReconItem alloc] init]; + [rootItem addChild:root nested:NO]; + [root setPath:@"All Changes..."]; + [root setFullPath:@""]; + [root release]; + } + int j = 0, n =[reconItems count]; for (; j<n; j++) { - [root addChild:[reconItems objectAtIndex:j] nested:(tableMode != 0)]; + [root addChild:[reconItems objectAtIndex:j] nested:(tableMode != 0)]; } - - if (tableMode == 1) [root collapseParentsWithSingleChildren:YES]; - - [tableView reloadData]; - - if (NO) { - // Pre-expand entire tree - int i = [[rootItem children] count]; - while (i--) { - [tableView expandItem:[[rootItem children] objectAtIndex:i] expandChildren:YES]; - } - } else if (tableMode != 0) { - // Always open root node - [tableView expandItem:rootItem expandChildren:NO]; - - // then smart expand to reveal conflicts / changes in direction - [self expandConflictedParent:root]; - - // then open more levels if we can do so without causing scrolling - [tableView expandChildrenIfSpace]; - } - + + if (tableMode == 1) [root collapseParentsWithSingleChildren:YES]; + + [tableView reloadData]; + + if (NO) { + // Pre-expand entire tree + int i = [[rootItem children] count]; + while (i--) { + [tableView expandItem:[[rootItem children] objectAtIndex:i] expandChildren:YES]; + } + } else if (tableMode != 0) { + // Always open root node + [tableView expandItem:rootItem expandChildren:NO]; + + // then smart expand to reveal conflicts / changes in direction + [self expandConflictedParent:root]; + + // then open more levels if we can do so without causing scrolling + [tableView expandChildrenIfSpace]; + } + // Make sure details get updated (or cleared) - [self updateTableViewSelection]; + [self updateTableViewSelection]; // Only enable sync if there are reconitems if ([reconItems count]>0) { @@ -892,17 +892,17 @@ static NSDictionary *_SmallGreyAttributes = nil; else { [tableView setEditable:NO]; afterSync = YES; // rescan should be enabled - + // reconItems table no longer gets keyboard input [mainWindow makeFirstResponder:nil]; } - [self updateToolbar]; + [self updateToolbar]; } - (id)updateForIgnore:(id)item { long j = (long)ocamlCall("ii", "unisonUpdateForIgnore", [reconItems indexOfObjectIdenticalTo:item]); - NSLog(@"Updating for ignore..."); + NSLog(@"Updating for ignore..."); [self updateReconItems:(OCamlValue *)ocamlCall("@", "unisonState")]; return [reconItems objectAtIndex:j]; } @@ -911,17 +911,17 @@ static NSDictionary *_SmallGreyAttributes = nil; CAMLprim value displayStatus(value s) { id pool = [[NSAutoreleasePool alloc] init]; - NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; + NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; // NSLog(@"displayStatus: %@", str); [me performSelectorOnMainThread:@selector(statusTextSet:) withObject:str waitUntilDone:FALSE]; - [str release]; + [str release]; [pool release]; return Val_unit; } - (void)statusTextSet:(NSString *)s { /* filter out strings with # reconitems, and empty strings */ - if (!NSEqualRanges([s rangeOfString:@"reconitems"], + if (!NSEqualRanges([s rangeOfString:@"reconitems"], NSMakeRange(NSNotFound,0))) return; [statusText setStringValue:s]; } @@ -930,10 +930,10 @@ CAMLprim value displayStatus(value s) CAMLprim value displayGlobalProgress(value p) { id pool = [[NSAutoreleasePool alloc] init]; - NSNumber *num = [[NSNumber alloc] initWithDouble:Double_val(p)]; - [me performSelectorOnMainThread:@selector(updateProgressBar:) - withObject:num waitUntilDone:FALSE]; - [num release]; + NSNumber *num = [[NSNumber alloc] initWithDouble:Double_val(p)]; + [me performSelectorOnMainThread:@selector(updateProgressBar:) + withObject:num waitUntilDone:FALSE]; + [num release]; [pool release]; return Val_unit; } @@ -942,10 +942,10 @@ CAMLprim value displayGlobalProgress(value p) CAMLprim value displayDiff(value s, value s2) { id pool = [[NSAutoreleasePool alloc] init]; - [me performSelectorOnMainThread:@selector(diffViewTextSet:) - withObject:[NSArray arrayWithObjects:[NSString stringWithUTF8String:String_val(s)], - [NSString stringWithUTF8String:String_val(s2)], nil] - waitUntilDone:FALSE]; + [me performSelectorOnMainThread:@selector(diffViewTextSet:) + withObject:[NSArray arrayWithObjects:[NSString stringWithUTF8String:String_val(s)], + [NSString stringWithUTF8String:String_val(s2)], nil] + waitUntilDone:FALSE]; [pool release]; return Val_unit; } @@ -956,15 +956,15 @@ CAMLprim value displayDiffErr(value s) id pool = [[NSAutoreleasePool alloc] init]; NSString * str = [NSString stringWithUTF8String:String_val(s)]; str = [[str componentsSeparatedByString:@"\n"] componentsJoinedByString:@" "]; - [me->statusText performSelectorOnMainThread:@selector(setStringValue:) - withObject:str waitUntilDone:FALSE]; + [me->statusText performSelectorOnMainThread:@selector(setStringValue:) + withObject:str waitUntilDone:FALSE]; [pool release]; return Val_unit; } - (void)diffViewTextSet:(NSArray *)args { - [self diffViewTextSet:[args objectAtIndex:0] bodyText:[args objectAtIndex:1]]; + [self diffViewTextSet:[args objectAtIndex:0] bodyText:[args objectAtIndex:1]]; } - (void)diffViewTextSet:(NSString *)title bodyText:(NSString *)body { @@ -980,17 +980,17 @@ CAMLprim value displayDiffErr(value s) float mainOriginX = [mainWindow frame].origin.x; float mainOriginY = [mainWindow frame].origin.y; float mainWidth = [mainWindow frame].size.width; - float mainHeight = [mainWindow frame].size.height; + float mainHeight = [mainWindow frame].size.height; float diffWidth = [diffWindow frame].size.width; float diffX = mainOriginX+mainWidth; float maxX = screenOriginX+screenWidth-diffWidth; if (diffX > maxX) diffX = maxX; float diffY = mainOriginY + mainHeight; - + NSPoint diffOrigin = NSMakePoint(diffX,diffY); [diffWindow cascadeTopLeftFromPoint:diffOrigin]; - + doneFirstDiff = YES; } [diffWindow orderFront:nil]; @@ -998,10 +998,10 @@ CAMLprim value displayDiffErr(value s) - (void)displayDetails:(ReconItem *)item { - //[detailsTextView setFont:diffFont]; - NSString *text = [item details]; - if (!text) text = @""; - [detailsTextView setStringValue:text]; + //[detailsTextView setFont:diffFont]; + NSString *text = [item details]; + if (!text) text = @""; + [detailsTextView setStringValue:text]; } - (void)clearDetails @@ -1038,10 +1038,10 @@ CAMLprim value displayDiffErr(value s) NSRect screenFrame = [[mainWindow screen] visibleFrame]; NSRect mainWindowFrame = [mainWindow frame]; NSRect theWindowFrame = [theWindow frame]; - - float winX = mainWindowFrame.origin.x + + + float winX = mainWindowFrame.origin.x + (mainWindowFrame.size.width - theWindowFrame.size.width)/2; - float winY = mainWindowFrame.origin.y + + float winY = mainWindowFrame.origin.y + (mainWindowFrame.size.height + theWindowFrame.size.height)/2; if (winX<screenFrame.origin.x) winX=screenFrame.origin.x; @@ -1055,7 +1055,7 @@ CAMLprim value displayDiffErr(value s) [theWindow cascadeTopLeftFromPoint: NSMakePoint(winX,winY)]; - + [theWindow makeKeyAndOrderFront:nil]; } @@ -1071,7 +1071,7 @@ CAMLprim value displayDiffErr(value s) - (IBAction)installCommandLineTool:(id)sender { /* Install the command-line tool in /usr/bin/unison. - Requires root privilege, so we ask for it and + Requires root privilege, so we ask for it and pass the task off to /bin/sh. */ OSStatus myStatus; @@ -1079,12 +1079,12 @@ CAMLprim value displayDiffErr(value s) AuthorizationFlags myFlags = kAuthorizationFlagDefaults; AuthorizationRef myAuthorizationRef; myStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, - myFlags, &myAuthorizationRef); + myFlags, &myAuthorizationRef); if (myStatus != errAuthorizationSuccess) return; { AuthorizationItem myItems = {kAuthorizationRightExecute, 0, - NULL, 0}; + NULL, 0}; AuthorizationRights myRights = {1, &myItems}; myFlags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | @@ -1102,8 +1102,8 @@ CAMLprim value displayDiffErr(value s) // [bundle pathForResource:@"cltool" ofType:nil]; if (exec_path == nil) return; - char *args[] = { "-f", (char *)[exec_path UTF8String], - "/usr/local/bin/unison", NULL }; + char *args[] = { "-f", (char *)[exec_path UTF8String], + "/usr/local/bin/unison", NULL }; myFlags = kAuthorizationFlagDefaults; myStatus = AuthorizationExecuteWithPrivileges @@ -1115,7 +1115,7 @@ CAMLprim value displayDiffErr(value s) /* if (myStatus == errAuthorizationCanceled) NSLog(@"The attempt was canceled\n"); - else if (myStatus) + else if (myStatus) NSLog(@"There was an authorization error: %ld\n", myStatus); */ } @@ -1179,10 +1179,10 @@ CAMLprim value displayDiffErr(value s) CAMLprim value fatalError(value s) { - NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; + NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; [me performSelectorOnMainThread:@selector(fatalError:) withObject:str waitUntilDone:FALSE]; - [str release]; + [str release]; return Val_unit; } @@ -1195,10 +1195,10 @@ CAMLprim value fatalError(value s) CAMLprim value warnPanel(value s) { - NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; - + NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; + [me performSelectorOnMainThread:@selector(warnPanel:) withObject:str waitUntilDone:TRUE]; - [str release]; + [str release]; if (me -> shouldExitAfterWarning) { return Val_true; } else { @@ -1221,9 +1221,9 @@ CAMLprim value warnPanel(value s) @implementation NSString (_UnisonUtil) - (NSString *)trim { - NSCharacterSet *ws = [NSCharacterSet whitespaceCharacterSet]; - int len = [self length], i = len; - while (i && [ws characterIsMember:[self characterAtIndex:i-1]]) i--; - return (i == len) ? self : [self substringToIndex:i]; + NSCharacterSet *ws = [NSCharacterSet whitespaceCharacterSet]; + int len = [self length], i = len; + while (i && [ws characterIsMember:[self characterAtIndex:i-1]]) i--; + return (i == len) ? self : [self substringToIndex:i]; } @end diff --git a/src/uimac14/PreferencesController.m b/src/uimac14/PreferencesController.m index 3016e98..f1e1ede 100644 --- a/src/uimac14/PreferencesController.m +++ b/src/uimac14/PreferencesController.m @@ -54,7 +54,7 @@ return NO; } } - ocamlCall("xSSS", "unisonProfileInit", profileName, firstRoot, secondRoot); + ocamlCall("xSSS", "unisonProfileInit", profileName, firstRoot, secondRoot); return YES; } diff --git a/src/uimac14/ProfileController.m b/src/uimac14/ProfileController.m index 1108a7f..6185513 100644 --- a/src/uimac14/ProfileController.m +++ b/src/uimac14/ProfileController.m @@ -20,11 +20,11 @@ NSString *unisonDirectory() #endif unsigned int count = [files count]; unsigned int i,j; - + [profiles release]; profiles = [[NSMutableArray alloc] init]; defaultIndex = -1; - + for (i = j = 0; i < count; i++) { NSString *file = [files objectAtIndex:i]; if ([[file pathExtension] isEqualTo:@"prf"]) { diff --git a/src/uimac14/ProfileTableView.m b/src/uimac14/ProfileTableView.m index 7a3c1e1..eea7b91 100644 --- a/src/uimac14/ProfileTableView.m +++ b/src/uimac14/ProfileTableView.m @@ -24,7 +24,7 @@ /* Override default highlight colour to match ReconTableView */ - (id)_highlightColorForCell:(NSCell *)cell -{ +{ if(([[self window] firstResponder] == self) && [[self window] isMainWindow] && [[self window] isKeyWindow]) diff --git a/src/uimac14/ProgressCell.h b/src/uimac14/ProgressCell.h index 0d17652..c2ef4ad 100644 --- a/src/uimac14/ProgressCell.h +++ b/src/uimac14/ProgressCell.h @@ -2,12 +2,12 @@ @interface ProgressCell : NSCell { - float _minVal, _maxVal; // defaults to 0.0, 100.0 - BOOL _isActive; - BOOL _useFullView; // default: NO - BOOL _isError; // default: NO - NSImage *_icon; - NSString *_statusString; + float _minVal, _maxVal; // defaults to 0.0, 100.0 + BOOL _isActive; + BOOL _useFullView; // default: NO + BOOL _isError; // default: NO + NSImage *_icon; + NSString *_statusString; } - (void)setStatusString:(NSString *)string; - (void)setIcon:(NSImage *)image; diff --git a/src/uimac14/ProgressCell.m b/src/uimac14/ProgressCell.m index 7d65ba3..d9078bd 100644 --- a/src/uimac14/ProgressCell.m +++ b/src/uimac14/ProgressCell.m @@ -1,8 +1,8 @@ /****************************************************************************** * Copyright 2008, 2016 (see file COPYING for more information) * - * Loosely based on TorrentCell from Transmission (.png files are from - * the original). + * Loosely based on TorrentCell from Transmission (.png files are from + * the original). *****************************************************************************/ #import "ProgressCell.h" @@ -10,69 +10,69 @@ #define BAR_HEIGHT 12.0 static NSImage *_ProgressWhite, *_ProgressBlue, *_ProgressGray, *_ProgressGreen, - *_ProgressAdvanced, *_ProgressEndWhite, *_ProgressEndBlue, - *_ProgressEndGray, *_ProgressEndGreen, *_ProgressLightGreen, - *_ProgressEndAdvanced, * _ErrorImage; + *_ProgressAdvanced, *_ProgressEndWhite, *_ProgressEndBlue, + *_ProgressEndGray, *_ProgressEndGreen, *_ProgressLightGreen, + *_ProgressEndAdvanced, * _ErrorImage; static NSSize ZeroSize; @implementation ProgressCell + (void) initialize { - NSSize startSize = NSMakeSize(100.0, BAR_HEIGHT); - ZeroSize = NSMakeSize(0.0, 0.0); - - _ProgressWhite = [NSImage imageNamed: @"ProgressBarWhite.png"]; - [_ProgressWhite setScalesWhenResized: YES]; - - _ProgressBlue = [NSImage imageNamed: @"ProgressBarBlue.png"]; - [_ProgressBlue setScalesWhenResized: YES]; - [_ProgressBlue setSize: startSize]; - - _ProgressGray = [NSImage imageNamed: @"ProgressBarGray.png"]; - [_ProgressGray setScalesWhenResized: YES]; - [_ProgressGray setSize: startSize]; - - _ProgressGreen = [NSImage imageNamed: @"ProgressBarGreen.png"]; - [_ProgressGreen setScalesWhenResized: YES]; - - _ProgressLightGreen = [NSImage imageNamed: @"ProgressBarLightGreen.png"]; - [_ProgressLightGreen setScalesWhenResized: YES]; - - _ProgressAdvanced = [NSImage imageNamed: @"ProgressBarAdvanced.png"]; - [_ProgressAdvanced setScalesWhenResized: YES]; - - _ProgressEndWhite = [NSImage imageNamed: @"ProgressBarEndWhite.png"]; - _ProgressEndBlue = [NSImage imageNamed: @"ProgressBarEndBlue.png"]; - _ProgressEndGray = [NSImage imageNamed: @"ProgressBarEndGray.png"]; - _ProgressEndGreen = [NSImage imageNamed: @"ProgressBarEndGreen.png"]; - _ProgressEndAdvanced = [NSImage imageNamed: @"ProgressBarEndAdvanced.png"]; - - _ErrorImage = [[NSImage imageNamed: @"Error.tiff"] copy]; - [_ErrorImage setFlipped: YES]; + NSSize startSize = NSMakeSize(100.0, BAR_HEIGHT); + ZeroSize = NSMakeSize(0.0, 0.0); + + _ProgressWhite = [NSImage imageNamed: @"ProgressBarWhite.png"]; + [_ProgressWhite setScalesWhenResized: YES]; + + _ProgressBlue = [NSImage imageNamed: @"ProgressBarBlue.png"]; + [_ProgressBlue setScalesWhenResized: YES]; + [_ProgressBlue setSize: startSize]; + + _ProgressGray = [NSImage imageNamed: @"ProgressBarGray.png"]; + [_ProgressGray setScalesWhenResized: YES]; + [_ProgressGray setSize: startSize]; + + _ProgressGreen = [NSImage imageNamed: @"ProgressBarGreen.png"]; + [_ProgressGreen setScalesWhenResized: YES]; + + _ProgressLightGreen = [NSImage imageNamed: @"ProgressBarLightGreen.png"]; + [_ProgressLightGreen setScalesWhenResized: YES]; + + _ProgressAdvanced = [NSImage imageNamed: @"ProgressBarAdvanced.png"]; + [_ProgressAdvanced setScalesWhenResized: YES]; + + _ProgressEndWhite = [NSImage imageNamed: @"ProgressBarEndWhite.png"]; + _ProgressEndBlue = [NSImage imageNamed: @"ProgressBarEndBlue.png"]; + _ProgressEndGray = [NSImage imageNamed: @"ProgressBarEndGray.png"]; + _ProgressEndGreen = [NSImage imageNamed: @"ProgressBarEndGreen.png"]; + _ProgressEndAdvanced = [NSImage imageNamed: @"ProgressBarEndAdvanced.png"]; + + _ErrorImage = [[NSImage imageNamed: @"Error.tiff"] copy]; + [_ErrorImage setFlipped: YES]; } - (id)init { - self = [super init]; - _minVal = 0.0; - _maxVal = 100.0; - _isActive = YES; + self = [super init]; + _minVal = 0.0; + _maxVal = 100.0; + _isActive = YES; _statusString = @""; - return self; + return self; } - (void)dealloc { - [_icon release]; - [_statusString release]; - [super dealloc]; + [_icon release]; + [_statusString release]; + [super dealloc]; } - (void)setStatusString:(NSString *)string { - _statusString = [string retain]; + _statusString = [string retain]; } - (void)setIcon:(NSImage *)image @@ -82,14 +82,14 @@ static NSSize ZeroSize; - (void)setIsActive:(BOOL)yn { - _isActive = yn; + _isActive = yn; } - (void)drawBarImage:(NSImage *)barImage width:(float)width point:(NSPoint)point { if (width <= 0.0) return; - + if ([barImage size].width < width) [barImage setSize: NSMakeSize(width * 2.0, BAR_HEIGHT)]; @@ -98,43 +98,43 @@ static NSSize ZeroSize; - (void)drawBar:(float)width point:(NSPoint)point { - id objectValue = [self objectValue]; - if (!objectValue) return; - + id objectValue = [self objectValue]; + if (!objectValue) return; + float value = [objectValue floatValue]; - float progress = (value - _minVal)/ (_maxVal - _minVal); + float progress = (value - _minVal)/ (_maxVal - _minVal); width -= 2.0; float completedWidth, remainingWidth = 0.0; - + //bar images and widths NSImage * barLeftEnd, * barRightEnd, * barComplete, * barRemaining; - if (progress >= 1.0) { + if (progress >= 1.0) { completedWidth = width; barLeftEnd = _ProgressEndGreen; barRightEnd = _ProgressEndGreen; barComplete = _ProgressGreen; barRemaining = _ProgressLightGreen; - } - else { + } + else { completedWidth = progress * width; remainingWidth = width - completedWidth; - barLeftEnd = (remainingWidth == width) ? _ProgressEndWhite - : ((_isActive) ? _ProgressEndBlue : _ProgressEndGray); - barRightEnd = (completedWidth < width) ? _ProgressEndWhite - : ((_isActive) ? _ProgressEndBlue : _ProgressEndGray); + barLeftEnd = (remainingWidth == width) ? _ProgressEndWhite + : ((_isActive) ? _ProgressEndBlue : _ProgressEndGray); + barRightEnd = (completedWidth < width) ? _ProgressEndWhite + : ((_isActive) ? _ProgressEndBlue : _ProgressEndGray); barComplete = _isActive ? _ProgressBlue : _ProgressGray; barRemaining = _ProgressWhite; } - + [barLeftEnd compositeToPoint: point operation: NSCompositeSourceOver]; - + point.x += 1.0; [self drawBarImage: barComplete width: completedWidth point: point]; - + point.x += completedWidth; [self drawBarImage: barRemaining width: remainingWidth point: point]; - + point.x += remainingWidth; [barRightEnd compositeToPoint: point operation: NSCompositeSourceOver]; } @@ -143,49 +143,49 @@ static NSSize ZeroSize; { NSPoint pen = cellFrame.origin; const float PADDING = 3.0; - - // progress bar - pen.y += PADDING + BAR_HEIGHT; - float mainWidth = cellFrame.size.width; - float barWidth = mainWidth; - [self drawBar: barWidth point: pen]; - - //icon - NSImage * image = _isError ? _ErrorImage : _icon; - if (image) { + + // progress bar + pen.y += PADDING + BAR_HEIGHT; + float mainWidth = cellFrame.size.width; + float barWidth = mainWidth; + [self drawBar: barWidth point: pen]; + + //icon + NSImage * image = _isError ? _ErrorImage : _icon; + if (image) { NSSize imageSize = [image size]; NSRect imageFrame; - imageFrame.origin = cellFrame.origin; + imageFrame.origin = cellFrame.origin; imageFrame.size = imageSize; imageFrame.origin.x += ceil((cellFrame.size.width - imageSize.width) / 2); imageFrame.origin.y += [view isFlipped] ? - ceil((cellFrame.size.height + imageSize.height) / 2) - : ceil((cellFrame.size.height - imageSize.height) / 2); + ceil((cellFrame.size.height + imageSize.height) / 2) + : ceil((cellFrame.size.height - imageSize.height) / 2); [image compositeToPoint:imageFrame.origin operation:NSCompositeSourceOver]; - } + } - // status string - if (_statusString) { - BOOL highlighted = [self isHighlighted] && [[self highlightColorWithFrame: cellFrame inView: view] + // status string + if (_statusString) { + BOOL highlighted = [self isHighlighted] && [[self highlightColorWithFrame: cellFrame inView: view] isEqual: [NSColor alternateSelectedControlColor]]; - NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [paragraphStyle setLineBreakMode: NSLineBreakByTruncatingTail]; - - NSDictionary * statusAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: - highlighted ? [NSColor whiteColor] : [NSColor darkGrayColor], NSForegroundColorAttributeName, - [NSFont boldSystemFontOfSize: 9.0], NSFontAttributeName, - paragraphStyle, NSParagraphStyleAttributeName, nil]; - [paragraphStyle release]; - - NSSize statusSize = [_statusString sizeWithAttributes: statusAttributes]; - pen = cellFrame.origin; - pen.x += (cellFrame.size.width - statusSize.width) * 0.5; - pen.y += (cellFrame.size.height - statusSize.height) * 0.5; - - [_statusString drawInRect: NSMakeRect(pen.x, pen.y, statusSize.width, statusSize.height) - withAttributes: statusAttributes]; - [statusAttributes release]; - } + NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; + [paragraphStyle setLineBreakMode: NSLineBreakByTruncatingTail]; + + NSDictionary * statusAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: + highlighted ? [NSColor whiteColor] : [NSColor darkGrayColor], NSForegroundColorAttributeName, + [NSFont boldSystemFontOfSize: 9.0], NSFontAttributeName, + paragraphStyle, NSParagraphStyleAttributeName, nil]; + [paragraphStyle release]; + + NSSize statusSize = [_statusString sizeWithAttributes: statusAttributes]; + pen = cellFrame.origin; + pen.x += (cellFrame.size.width - statusSize.width) * 0.5; + pen.y += (cellFrame.size.height - statusSize.height) * 0.5; + + [_statusString drawInRect: NSMakeRect(pen.x, pen.y, statusSize.width, statusSize.height) + withAttributes: statusAttributes]; + [statusAttributes release]; + } } - (id)copyWithZone: (NSZone *)zone diff --git a/src/uimac14/ReconItem.h b/src/uimac14/ReconItem.h index 299b8b7..fd9024b 100644 --- a/src/uimac14/ReconItem.h +++ b/src/uimac14/ReconItem.h @@ -6,7 +6,7 @@ @interface ReconItem : NSObject { - ReconItem *parent; + ReconItem *parent; NSString *path; NSString *fullPath; BOOL selected; @@ -71,8 +71,8 @@ @interface ParentReconItem : ReconItem { - NSMutableArray *_children; - long fileCount; + NSMutableArray *_children; + long fileCount; } - (void)addChild:(ReconItem *)item nested:(BOOL)useNesting; - (void)sortUsingDescriptors:(NSArray *)sortDescriptors; diff --git a/src/uimac14/ReconItem.m b/src/uimac14/ReconItem.m index 754dd31..8478d5e 100644 --- a/src/uimac14/ReconItem.m +++ b/src/uimac14/ReconItem.m @@ -6,12 +6,12 @@ @implementation ReconItem - init { - [super init]; - selected = NO; // NB only used/updated during sorts. Not a - // reliable indicator of whether item is selected - fileSize = -1.; - bytesTransferred = -1.; - return self; + [super init]; + selected = NO; // NB only used/updated during sorts. Not a + // reliable indicator of whether item is selected + fileSize = -1.; + bytesTransferred = -1.; + return self; } - (void)dealloc @@ -20,28 +20,28 @@ [fullPath release]; // [direction release]; // assuming retained by cache, so not retained // [directionSortString release]; // no retain/release necessary because is constant - [super dealloc]; + [super dealloc]; } -- (ReconItem *)parent +- (ReconItem *)parent { - return parent; + return parent; } - (void)setParent:(ReconItem *)p { - parent = p; + parent = p; } - (void)willChange { - // propagate up parent chain - [parent willChange]; + // propagate up parent chain + [parent willChange]; } - (NSArray *)children { - return nil; + return nil; } - (BOOL)selected @@ -61,28 +61,28 @@ - (void)setPath:(NSString *)aPath { - [path autorelease]; - path = [aPath retain]; - - // invalidate - [fullPath autorelease]; - fullPath = nil; + [path autorelease]; + path = [aPath retain]; + + // invalidate + [fullPath autorelease]; + fullPath = nil; } - (NSString *)fullPath { - if (!fullPath) { - NSString *parentPath = [parent fullPath]; - [self setFullPath:(([parentPath length] > 0) ? [parentPath stringByAppendingFormat:@"/%@", path] : path)]; - } + if (!fullPath) { + NSString *parentPath = [parent fullPath]; + [self setFullPath:(([parentPath length] > 0) ? [parentPath stringByAppendingFormat:@"/%@", path] : path)]; + } return fullPath; } - (void)setFullPath:(NSString *)p { - [fullPath autorelease]; - fullPath = [p retain]; + [fullPath autorelease]; + fullPath = [p retain]; } - (NSString *)left @@ -99,139 +99,139 @@ static NSMutableDictionary *_ChangeIconsByType = nil; - (NSImage *)changeIconFor:(NSString *)type other:(NSString *)other { - if (![type length]) { - if ([other isEqual:@"Created"]) { - type = @"Absent"; - } else if ([other length]) { - type = @"Unmodified"; - } else - return nil; - } - - NSImage *result = [_ChangeIconsByType objectForKey:type]; - if (!result) { - NSString *imageName = [NSString stringWithFormat:@"Change_%@.png", type]; - result = [NSImage imageNamed:imageName]; - if (!_ChangeIconsByType) _ChangeIconsByType = [[NSMutableDictionary alloc] init]; - [_ChangeIconsByType setObject:result forKey:type]; - } - return result; + if (![type length]) { + if ([other isEqual:@"Created"]) { + type = @"Absent"; + } else if ([other length]) { + type = @"Unmodified"; + } else + return nil; + } + + NSImage *result = [_ChangeIconsByType objectForKey:type]; + if (!result) { + NSString *imageName = [NSString stringWithFormat:@"Change_%@.png", type]; + result = [NSImage imageNamed:imageName]; + if (!_ChangeIconsByType) _ChangeIconsByType = [[NSMutableDictionary alloc] init]; + [_ChangeIconsByType setObject:result forKey:type]; + } + return result; } - (NSImage *)leftIcon { - return [self changeIconFor:[self left] other:[self right]]; + return [self changeIconFor:[self left] other:[self right]]; } - (NSImage *)rightIcon { - return [self changeIconFor:[self right] other:[self left]]; + return [self changeIconFor:[self right] other:[self left]]; } - (double)computeFileSize { - return 0.; + return 0.; } - (double)bytesTransferred { - return 0.; + return 0.; } - (long)fileCount { - return 1; + return 1; } - (double)fileSize { - if (fileSize == -1.) fileSize = [self computeFileSize]; - return fileSize; + if (fileSize == -1.) fileSize = [self computeFileSize]; + return fileSize; } - (NSString *)formatFileSize:(double)size { - if (size == 0) return @"--"; - if (size < 1024) return @"< 1KB"; // return [NSString stringWithFormat:@"%i bytes", size]; - size /= 1024; - if (size < 1024) return [NSString stringWithFormat:@"%i KB", (int)size]; - size /= 1024; - if (size < 1024) return [NSString stringWithFormat:@"%1.1f MB", size]; - size = size / 1024; - return [NSString stringWithFormat:@"%1.1f GB", size]; + if (size == 0) return @"--"; + if (size < 1024) return @"< 1KB"; // return [NSString stringWithFormat:@"%i bytes", size]; + size /= 1024; + if (size < 1024) return [NSString stringWithFormat:@"%i KB", (int)size]; + size /= 1024; + if (size < 1024) return [NSString stringWithFormat:@"%1.1f MB", size]; + size = size / 1024; + return [NSString stringWithFormat:@"%1.1f GB", size]; } - (NSString *)fileSizeString { - return [self formatFileSize:[self fileSize]]; + return [self formatFileSize:[self fileSize]]; } - (NSString *)bytesTransferredString { - return [self formatFileSize:[self bytesTransferred]]; + return [self formatFileSize:[self bytesTransferred]]; } - (NSNumber *)percentTransferred { - double size = [self computeFileSize]; - return (size > 0) ? [NSNumber numberWithDouble:([self bytesTransferred] / (size) * 100.0)] - : nil; + double size = [self computeFileSize]; + return (size > 0) ? [NSNumber numberWithDouble:([self bytesTransferred] / (size) * 100.0)] + : nil; } static NSMutableDictionary *_iconsByExtension = nil; - (NSImage *)iconForExtension:(NSString *)extension { - NSImage *icon = [_iconsByExtension objectForKey:extension]; - if (!_iconsByExtension) _iconsByExtension = [[NSMutableDictionary alloc] init]; - if (!icon) { - icon = [[NSWorkspace sharedWorkspace] iconForFileType:extension]; - [icon setSize:NSMakeSize(16.0, 16.0)]; - [_iconsByExtension setObject:icon forKey:extension]; - } - return icon; + NSImage *icon = [_iconsByExtension objectForKey:extension]; + if (!_iconsByExtension) _iconsByExtension = [[NSMutableDictionary alloc] init]; + if (!icon) { + icon = [[NSWorkspace sharedWorkspace] iconForFileType:extension]; + [icon setSize:NSMakeSize(16.0, 16.0)]; + [_iconsByExtension setObject:icon forKey:extension]; + } + return icon; } - (NSImage *)fileIcon { - return [self iconForExtension:NSFileTypeForHFSTypeCode(kOpenFolderIcon)]; + return [self iconForExtension:NSFileTypeForHFSTypeCode(kOpenFolderIcon)]; } - (NSString *)dirString { - return @"<-?->"; + return @"<-?->"; } - (NSImage *)direction { - if (direction) return direction; + if (direction) return direction; NSString * dirString = [self dirString]; BOOL changedFromDefault = [self changedFromDefault]; - + if ([dirString isEqual:@"<-?->"]) { if (changedFromDefault | resolved) { direction = [NSImage imageNamed: @"table-skip.tif"]; - directionSortString = @"3"; - } + directionSortString = @"3"; + } else { direction = [NSImage imageNamed: @"table-conflict.tif"]; - directionSortString = @"2"; + directionSortString = @"2"; } } - + else if ([dirString isEqual:@"---->"]) { if (changedFromDefault) { direction = [NSImage imageNamed: @"table-right-blue.tif"]; directionSortString = @"6"; } - else { + else { direction = [NSImage imageNamed: @"table-right-green.tif"]; directionSortString = @"8"; } } - + else if ([dirString isEqual:@"<----"]) { if (changedFromDefault) { direction = [NSImage imageNamed: @"table-left-blue.tif"]; @@ -247,17 +247,17 @@ static NSMutableDictionary *_iconsByExtension = nil; direction = [NSImage imageNamed: @"table-merge.tif"]; directionSortString = @"4"; } - - else if ([dirString isEqual:@"<--->"]) { - direction = [NSImage imageNamed: @"table-mixed.tif"]; - directionSortString = @"9"; - } + + else if ([dirString isEqual:@"<--->"]) { + direction = [NSImage imageNamed: @"table-mixed.tif"]; + directionSortString = @"9"; + } else { direction = [NSImage imageNamed: @"table-error.tif"]; directionSortString = @"1"; } - + [direction retain]; return direction; } @@ -306,13 +306,13 @@ static NSMutableDictionary *_iconsByExtension = nil; { switch (action) { case 'I': - ocamlCall("xS", "unisonIgnorePath", [self fullPath]); + ocamlCall("xS", "unisonIgnorePath", [self fullPath]); break; case 'E': - ocamlCall("xS", "unisonIgnoreExt", [self path]); + ocamlCall("xS", "unisonIgnoreExt", [self path]); break; case 'N': - ocamlCall("xS", "unisonIgnoreName", [self path]); + ocamlCall("xS", "unisonIgnoreName", [self path]); break; default: NSLog(@"ReconItem.doIgnore : unknown ignore"); @@ -373,13 +373,13 @@ static NSMutableDictionary *_iconsByExtension = nil; - (NSString *)progress { - return nil; + return nil; } - (BOOL)transferInProgress { - double soFar = [self bytesTransferred]; - return (soFar > 0) && (soFar < [self fileSize]); + double soFar = [self bytesTransferred]; + return (soFar > 0) && (soFar < [self fileSize]); } - (void)resetProgress @@ -388,16 +388,16 @@ static NSMutableDictionary *_iconsByExtension = nil; - (NSString *)progressString { - NSString *progress = [self progress]; - if ([progress length] == 0. || [progress hasSuffix:@"%"]) - progress = [self transferInProgress] ? [self bytesTransferredString] : @""; - else if ([progress isEqual:@"done"]) progress = @""; - return progress; + NSString *progress = [self progress]; + if ([progress length] == 0. || [progress hasSuffix:@"%"]) + progress = [self transferInProgress] ? [self bytesTransferredString] : @""; + else if ([progress isEqual:@"done"]) progress = @""; + return progress; } - (NSString *)details { - return nil; + return nil; } - (NSString *)updateDetails @@ -407,17 +407,17 @@ static NSMutableDictionary *_iconsByExtension = nil; - (BOOL)isConflict { - return NO; + return NO; } - (BOOL)changedFromDefault { - return NO; + return NO; } - (void)revertDirection { - [self willChange]; + [self willChange]; [direction release]; direction = nil; resolved = NO; @@ -425,7 +425,7 @@ static NSMutableDictionary *_iconsByExtension = nil; - (BOOL)canDiff { - return NO; + return NO; } - (void)showDiffs @@ -434,7 +434,7 @@ static NSMutableDictionary *_iconsByExtension = nil; - (ReconItem *)collapseParentsWithSingleChildren:(BOOL)isRoot { - return self; + return self; } - (NSString *)description @@ -456,7 +456,7 @@ static NSMutableDictionary *_iconsByExtension = nil; { [super init]; ri = [v retain]; - index = i; + index = i; resolved = NO; directionSortString = @""; return self; @@ -469,7 +469,7 @@ static NSMutableDictionary *_iconsByExtension = nil; [right release]; [progress release]; [details release]; - + [super dealloc]; } @@ -482,13 +482,13 @@ static NSMutableDictionary *_iconsByExtension = nil; - (NSString *)left { if (!left) left = [(NSString *)ocamlCall("S@", "unisonRiToLeft", ri) retain]; - return left; + return left; } - (NSString *)right { - if (!right) right = [(NSString *)ocamlCall("S@", "unisonRiToRight", ri) retain]; - return right; + if (!right) right = [(NSString *)ocamlCall("S@", "unisonRiToRight", ri) retain]; + return right; } - (double)computeFileSize @@ -498,58 +498,58 @@ static NSMutableDictionary *_iconsByExtension = nil; - (double)bytesTransferred { - if (bytesTransferred == -1.) { - // need to force to fileSize if done, otherwise may not match up to 100% - bytesTransferred = ([[self progress] isEqual:@"done"]) ? [self fileSize] + if (bytesTransferred == -1.) { + // need to force to fileSize if done, otherwise may not match up to 100% + bytesTransferred = ([[self progress] isEqual:@"done"]) ? [self fileSize] : [(NSNumber*)ocamlCall("N@", "unisonRiToBytesTransferred", ri) doubleValue]; - } - return bytesTransferred; + } + return bytesTransferred; } - (NSImage *)fileIcon { - NSString *extension = [[self path] pathExtension]; - - if ([@"" isEqual:extension]) { - NSString *type = (NSString *)ocamlCall("S@", "unisonRiToFileType", ri); - extension = [type isEqual:@"dir"] - ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) - : NSFileTypeForHFSTypeCode(kGenericDocumentIcon); - } - return [self iconForExtension:extension]; + NSString *extension = [[self path] pathExtension]; + + if ([@"" isEqual:extension]) { + NSString *type = (NSString *)ocamlCall("S@", "unisonRiToFileType", ri); + extension = [type isEqual:@"dir"] + ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) + : NSFileTypeForHFSTypeCode(kGenericDocumentIcon); + } + return [self iconForExtension:extension]; } - (NSString *)dirString { - return (NSString *)ocamlCall("S@", "unisonRiToDirection", ri); + return (NSString *)ocamlCall("S@", "unisonRiToDirection", ri); } - (void)setDirection:(char *)d { - [self willChange]; + [self willChange]; [super setDirection:d]; - ocamlCall("x@", d, ri); + ocamlCall("x@", d, ri); } - (NSString *)progress { if (!progress) { - progress = [(NSString *)ocamlCall("S@", "unisonRiToProgress", ri) retain]; - if ([progress isEqual:@"FAILED"]) [self updateDetails]; + progress = [(NSString *)ocamlCall("S@", "unisonRiToProgress", ri) retain]; + if ([progress isEqual:@"FAILED"]) [self updateDetails]; } - return progress; + return progress; } - (void)resetProgress { // Get rid of the memoized progress because we expect it to change - [self willChange]; - bytesTransferred = -1.; + [self willChange]; + bytesTransferred = -1.; [progress release]; - - // Force update now so we get the result while the OCaml thread is available - // [self progress]; - // [self bytesTransferred]; + + // Force update now so we get the result while the OCaml thread is available + // [self progress]; + // [self bytesTransferred]; progress = nil; } @@ -561,35 +561,35 @@ static NSMutableDictionary *_iconsByExtension = nil; - (NSString *)updateDetails { - [details autorelease]; - details = [(NSString *)ocamlCall("S@", "unisonRiToDetails", ri) retain]; + [details autorelease]; + details = [(NSString *)ocamlCall("S@", "unisonRiToDetails", ri) retain]; return details; } - (BOOL)isConflict { - return ((long)ocamlCall("i@", "unisonRiIsConflict", ri) ? YES : NO); + return ((long)ocamlCall("i@", "unisonRiIsConflict", ri) ? YES : NO); } - (BOOL)changedFromDefault { - return ((long)ocamlCall("i@", "changedFromDefault", ri) ? YES : NO); + return ((long)ocamlCall("i@", "changedFromDefault", ri) ? YES : NO); } - (void)revertDirection { - ocamlCall("x@", "unisonRiRevert", ri); - [super revertDirection]; + ocamlCall("x@", "unisonRiRevert", ri); + [super revertDirection]; } - (BOOL)canDiff { - return ((long)ocamlCall("i@", "canDiff", ri) ? YES : NO); + return ((long)ocamlCall("i@", "canDiff", ri) ? YES : NO); } - (void)showDiffs { - ocamlCall("x@i", "runShowDiffs", ri, index); + ocamlCall("x@i", "runShowDiffs", ri, index); } @end @@ -600,19 +600,19 @@ static NSMutableDictionary *_iconsByExtension = nil; @implementation NSImage (TintedImage) -- (NSImage *)tintedImageWithColor:(NSColor *) tint operation:(NSCompositingOperation) op +- (NSImage *)tintedImageWithColor:(NSColor *) tint operation:(NSCompositingOperation) op { - NSSize size = [self size]; - NSRect imageBounds = NSMakeRect(0, 0, size.width, size.height); - NSImage *newImage = [[NSImage alloc] initWithSize:size]; - - [newImage lockFocus]; - [self compositeToPoint:NSZeroPoint operation:NSCompositeSourceOver]; - [tint set]; - NSRectFillUsingOperation(imageBounds, op); - [newImage unlockFocus]; - - return [newImage autorelease]; + NSSize size = [self size]; + NSRect imageBounds = NSMakeRect(0, 0, size.width, size.height); + NSImage *newImage = [[NSImage alloc] initWithSize:size]; + + [newImage lockFocus]; + [self compositeToPoint:NSZeroPoint operation:NSCompositeSourceOver]; + [tint set]; + NSRectFillUsingOperation(imageBounds, op); + [newImage unlockFocus]; + + return [newImage autorelease]; } @end @@ -620,35 +620,35 @@ static NSMutableDictionary *_iconsByExtension = nil; // ---- Parent nodes in grouped items @implementation ParentReconItem -- init +- init { - [super init]; - _children = [[NSMutableArray alloc] init]; - return self; + [super init]; + _children = [[NSMutableArray alloc] init]; + return self; } - initWithPath:(NSString *)aPath { - [self init]; - path = [aPath retain]; - return self; + [self init]; + path = [aPath retain]; + return self; } - (void)dealloc { - [_children release]; - [super dealloc]; + [_children release]; + [super dealloc]; } - (NSArray *)children; { - return _children; + return _children; } - (ReconItem *)findChildWithPath:(NSArray *)pathArray level:level{ ReconItem *item; NSString *element = [pathArray count] ? [pathArray objectAtIndex:level] : @""; - + for (item in _children) { if ([item isKindOfClass:[ParentReconItem class]] && [[item path] isEqual:element]) { return item; @@ -660,203 +660,202 @@ static NSMutableDictionary *_iconsByExtension = nil; - (void)addChild:(ReconItem *)item pathArray:(NSArray *)pathArray level:(int)level { // NSLog(@"Adding child: %@", pathArray); - NSString *element = [pathArray count] ? [pathArray objectAtIndex:level] : @""; - - // if we're at the leaf of the path, then add the item - if (((0 == [pathArray count]) && (0 == level)) || (level == [pathArray count]-1)) { - [item setParent:self]; - [item setPath:element]; - [_children addObject:item]; - return; - } - - // find / add matching parent node - ReconItem *parentItem = [self findChildWithPath:pathArray level:level]; - if (parentItem == nil || ![parentItem isKindOfClass:[ParentReconItem class]]) { - parentItem = [[ParentReconItem alloc] initWithPath:element]; - [parentItem setParent:self]; - [_children addObject:parentItem]; - [parentItem release]; - } - - [(ParentReconItem *)parentItem addChild:item pathArray:pathArray level:level+1]; + NSString *element = [pathArray count] ? [pathArray objectAtIndex:level] : @""; + + // if we're at the leaf of the path, then add the item + if (((0 == [pathArray count]) && (0 == level)) || (level == [pathArray count]-1)) { + [item setParent:self]; + [item setPath:element]; + [_children addObject:item]; + return; + } + + // find / add matching parent node + ReconItem *parentItem = [self findChildWithPath:pathArray level:level]; + if (parentItem == nil || ![parentItem isKindOfClass:[ParentReconItem class]]) { + parentItem = [[ParentReconItem alloc] initWithPath:element]; + [parentItem setParent:self]; + [_children addObject:parentItem]; + [parentItem release]; + } + + [(ParentReconItem *)parentItem addChild:item pathArray:pathArray level:level+1]; } - (void)addChild:(ReconItem *)item nested:(BOOL)nested { - [item setPath:nil]; // invalidate/reset - - if (nested) { - [self addChild:item pathArray:[[item path] pathComponents] level:0]; - } else { - [item setParent:self]; - [_children addObject:item]; - } + [item setPath:nil]; // invalidate/reset + + if (nested) { + [self addChild:item pathArray:[[item path] pathComponents] level:0]; + } else { + [item setParent:self]; + [_children addObject:item]; + } } - (void)sortUsingDescriptors:(NSArray *)sortDescriptors { - // sort our children - [_children sortUsingDescriptors:sortDescriptors]; - - // then have them sort theirs - int i = [_children count]; - while (i--) { - id child = [_children objectAtIndex:i]; - if ([child isKindOfClass:[ParentReconItem class]]) [child sortUsingDescriptors:sortDescriptors]; - } + // sort our children + [_children sortUsingDescriptors:sortDescriptors]; + + // then have them sort theirs + int i = [_children count]; + while (i--) { + id child = [_children objectAtIndex:i]; + if ([child isKindOfClass:[ParentReconItem class]]) [child sortUsingDescriptors:sortDescriptors]; + } } - (ReconItem *)collapseParentsWithSingleChildren:(BOOL)isRoot { - // replace ourselves? - if (!isRoot && [_children count] == 1) { - ReconItem *child = [_children lastObject]; - [child setPath:[path stringByAppendingFormat:@"/%@", [child path]]]; - return [child collapseParentsWithSingleChildren:NO]; - } - - // recurse - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - ReconItem *replacement = [child collapseParentsWithSingleChildren:NO]; - if (child != replacement) { - [_children replaceObjectAtIndex:i withObject:replacement]; - [replacement setParent:self]; - } - } - return self; + // replace ourselves? + if (!isRoot && [_children count] == 1) { + ReconItem *child = [_children lastObject]; + [child setPath:[path stringByAppendingFormat:@"/%@", [child path]]]; + return [child collapseParentsWithSingleChildren:NO]; + } + + // recurse + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + ReconItem *replacement = [child collapseParentsWithSingleChildren:NO]; + if (child != replacement) { + [_children replaceObjectAtIndex:i withObject:replacement]; + [replacement setParent:self]; + } + } + return self; } - (void)willChange { - // invalidate child-based state - // Assuming caches / constant, so not retained / released - // [direction autorelease]; - // [directionSortString autorelease]; - direction = nil; - directionSortString = nil; - bytesTransferred = -1.; - // fileSize = -1; + // invalidate child-based state + // Assuming caches / constant, so not retained / released + // [direction autorelease]; + // [directionSortString autorelease]; + direction = nil; + directionSortString = nil; + bytesTransferred = -1.; + // fileSize = -1; // resolved = NO; - // propagate up parent chain - [parent willChange]; + // propagate up parent chain + [parent willChange]; } // Propagation methods - (void)doAction:(unichar)action { - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - [child doAction:action]; - } + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + [child doAction:action]; + } } - (void)doIgnore:(unichar)action { - // handle Path ignores at this level, name and extension at the child nodes - if (action == 'I') { - [super doIgnore:'I']; - } else { - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - [child doIgnore:action]; - } - } + // handle Path ignores at this level, name and extension at the child nodes + if (action == 'I') { + [super doIgnore:'I']; + } else { + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + [child doIgnore:action]; + } + } } // Rollup methods - (long)fileCount { - if (fileCount == 0) { - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - fileCount += [child fileCount]; - } - } - return fileCount; + if (fileCount == 0) { + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + fileCount += [child fileCount]; + } + } + return fileCount; } - (double)computeFileSize { - double size = 0; - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - size += [child fileSize]; - } - return size; + double size = 0; + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + size += [child fileSize]; + } + return size; } - (double)bytesTransferred { - if (bytesTransferred == -1.) { - bytesTransferred = 0.; - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - bytesTransferred += [child bytesTransferred]; - } - } - return bytesTransferred; + if (bytesTransferred == -1.) { + bytesTransferred = 0.; + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + bytesTransferred += [child bytesTransferred]; + } + } + return bytesTransferred; } - (NSString *)dirString { - NSString *rollup = nil; - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - NSString *dirString = [child dirString]; - if (!rollup || [dirString isEqual:rollup]) { - rollup = dirString; - } else { - // conflict - if ([dirString isEqual:@"---->"] || [dirString isEqual:@"<----"] || [dirString isEqual:@"<--->"]) { - if ([rollup isEqual:@"---->"] || [rollup isEqual:@"<----"] || [rollup isEqual:@"<--->"]) { - rollup = @"<--->"; - } - } else { - rollup = @"<-?->"; - } - } - } - // NSLog(@"dirString for %@: %@", path, rollup); - return rollup; + NSString *rollup = nil; + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + NSString *dirString = [child dirString]; + if (!rollup || [dirString isEqual:rollup]) { + rollup = dirString; + } else { + // conflict + if ([dirString isEqual:@"---->"] || [dirString isEqual:@"<----"] || [dirString isEqual:@"<--->"]) { + if ([rollup isEqual:@"---->"] || [rollup isEqual:@"<----"] || [rollup isEqual:@"<--->"]) { + rollup = @"<--->"; + } + } else { + rollup = @"<-?->"; + } + } + } + // NSLog(@"dirString for %@: %@", path, rollup); + return rollup; } - (BOOL)hasConflictedChildren { - NSString *dirString = [self dirString]; - BOOL result = [dirString isEqual:@"<--->"] || [dirString isEqual:@"<-?->"]; - // NSLog(@"hasConflictedChildren (%@): %@: %i", [self path], dirString, result); - return result; + NSString *dirString = [self dirString]; + BOOL result = [dirString isEqual:@"<--->"] || [dirString isEqual:@"<-?->"]; + // NSLog(@"hasConflictedChildren (%@): %@: %i", [self path], dirString, result); + return result; } static NSMutableDictionary *_parentImages = nil; static NSColor *_veryLightGreyColor = nil; - (NSImage *)direction { - if (!_parentImages) { - _parentImages = [[NSMutableDictionary alloc] init]; - _veryLightGreyColor = [[NSColor colorWithCalibratedRed:0.7 green:0.7 blue:0.7 alpha:1.0] retain]; - } - NSImage *baseImage = [super direction]; - NSImage *parentImage = [_parentImages objectForKey:baseImage]; - if (!parentImage) { - // make parent images a grey version of the leaf images - parentImage = [baseImage tintedImageWithColor:_veryLightGreyColor operation:NSCompositeSourceIn]; - [_parentImages setObject:parentImage forKey:baseImage]; - } - return parentImage; + if (!_parentImages) { + _parentImages = [[NSMutableDictionary alloc] init]; + _veryLightGreyColor = [[NSColor colorWithCalibratedRed:0.7 green:0.7 blue:0.7 alpha:1.0] retain]; + } + NSImage *baseImage = [super direction]; + NSImage *parentImage = [_parentImages objectForKey:baseImage]; + if (!parentImage) { + // make parent images a grey version of the leaf images + parentImage = [baseImage tintedImageWithColor:_veryLightGreyColor operation:NSCompositeSourceIn]; + [_parentImages setObject:parentImage forKey:baseImage]; + } + return parentImage; } @end - diff --git a/src/uimac14/ReconTableView.h b/src/uimac14/ReconTableView.h index 89a0dcd..dd175ff 100644 --- a/src/uimac14/ReconTableView.h +++ b/src/uimac14/ReconTableView.h @@ -1,6 +1,6 @@ // // ReconTableView.h -// +// // NSTableView extended to handle additional keyboard events for the reconcile window. // The keyDown: method is redefined. // diff --git a/src/uimac14/ReconTableView.m b/src/uimac14/ReconTableView.m index fedbc11..abfcc8d 100644 --- a/src/uimac14/ReconTableView.m +++ b/src/uimac14/ReconTableView.m @@ -14,7 +14,7 @@ - (NSArray *)selectedObjects { - NSMutableArray *result = [NSMutableArray array]; + NSMutableArray *result = [NSMutableArray array]; NSIndexSet *set = [self selectedRowIndexes]; NSUInteger index = [set firstIndex]; while (index != NSNotFound) { @@ -26,59 +26,59 @@ - (void)setSelectedObjects:(NSArray *)selectedObjects { - NSMutableIndexSet *set = [NSMutableIndexSet indexSet]; - int i = [selectedObjects count]; - while (i--) { - int index = [self rowForItem:[selectedObjects objectAtIndex:i]]; - if (index >= 0) [set addIndex:index]; - } - [self selectRowIndexes:set byExtendingSelection:NO]; + NSMutableIndexSet *set = [NSMutableIndexSet indexSet]; + int i = [selectedObjects count]; + while (i--) { + int index = [self rowForItem:[selectedObjects objectAtIndex:i]]; + if (index >= 0) [set addIndex:index]; + } + [self selectRowIndexes:set byExtendingSelection:NO]; } - (NSEnumerator *)selectedObjectEnumerator { - return [[self selectedObjects] objectEnumerator]; + return [[self selectedObjects] objectEnumerator]; } -- (int)rowCapacityWithoutScrolling +- (int)rowCapacityWithoutScrolling { - float bodyHeight = [self visibleRect].size.height; - bodyHeight -= [[self headerView] visibleRect].size.height; - return bodyHeight / ([self rowHeight] + 2.0); + float bodyHeight = [self visibleRect].size.height; + bodyHeight -= [[self headerView] visibleRect].size.height; + return bodyHeight / ([self rowHeight] + 2.0); } - (BOOL)_canAcceptRowCountWithoutScrolling:(int)rows { - return ([self numberOfRows] + rows) <= [self rowCapacityWithoutScrolling]; + return ([self numberOfRows] + rows) <= [self rowCapacityWithoutScrolling]; } - (BOOL)_expandChildrenIfSpace:(id)parent level:(int)level { - BOOL didExpand = NO; - id dataSource = [self dataSource]; - int count = [dataSource outlineView:self numberOfChildrenOfItem:parent]; - if (level == 0) { - if (count && ([self isItemExpanded:parent] || [self _canAcceptRowCountWithoutScrolling:count])) { - [self expandItem:parent expandChildren:NO]; - didExpand = YES; - } - } else { - // try expanding each of our children. If all expand, then return YES, - // indicating that it may be worth trying the next level - int i; - for (i=0; i < count; i++) { - id child = [dataSource outlineView:self child:i ofItem:parent]; - didExpand = [self _expandChildrenIfSpace:child level:level-1] || didExpand; - } - } - - return didExpand; + BOOL didExpand = NO; + id dataSource = [self dataSource]; + int count = [dataSource outlineView:self numberOfChildrenOfItem:parent]; + if (level == 0) { + if (count && ([self isItemExpanded:parent] || [self _canAcceptRowCountWithoutScrolling:count])) { + [self expandItem:parent expandChildren:NO]; + didExpand = YES; + } + } else { + // try expanding each of our children. If all expand, then return YES, + // indicating that it may be worth trying the next level + int i; + for (i=0; i < count; i++) { + id child = [dataSource outlineView:self child:i ofItem:parent]; + didExpand = [self _expandChildrenIfSpace:child level:level-1] || didExpand; + } + } + + return didExpand; } - (void)expandChildrenIfSpace { - int level = 1; - while ([self _expandChildrenIfSpace:nil level:level]) level++; + int level = 1; + while ([self _expandChildrenIfSpace:nil level:level]) level++; } @end @@ -116,14 +116,14 @@ else if (action == @selector(showDiff:)) { if ((!editable) || (!([self numberOfSelectedRows]==1))) return NO; - else return [self canDiffSelection]; + else return [self canDiffSelection]; } else return YES; } - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - return [self validateItem:[menuItem action]]; + return [self validateItem:[menuItem action]]; } - (BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem @@ -134,10 +134,10 @@ - (void)doIgnore:(unichar)c { NSEnumerator *e = [self selectedObjectEnumerator]; - ReconItem *item, *last = nil; + ReconItem *item, *last = nil; while (item = [e nextObject]) { [item doIgnore:c]; - last = item; + last = item; } if (last) { // something was selected MyController* controller = (MyController*) [self dataSource]; @@ -166,14 +166,14 @@ { int numSelected = 0; NSEnumerator *e = [self selectedObjectEnumerator]; - ReconItem *item, *last = nil; + ReconItem *item, *last = nil; while (item = [e nextObject]) { numSelected++; [item doAction:c]; - last = item; + last = item; } if (numSelected>0) { - int nextRow = [self rowForItem:last] + 1; + int nextRow = [self rowForItem:last] + 1; if (numSelected == 1 && [self numberOfRows] > nextRow && c!='d') { // Move to next row, unless already at last row, or if more than one row selected [self selectRowIndexes:[NSIndexSet indexSetWithIndex:nextRow] byExtendingSelection:NO]; @@ -215,7 +215,7 @@ NSMutableArray *reconItems = [controller reconItems]; int i = 0; for (; i < [reconItems count]; i++) { - ReconItem *item = [reconItems objectAtIndex:i]; + ReconItem *item = [reconItems objectAtIndex:i]; if ([item isConflict]) [self selectRowIndexes:[NSIndexSet indexSetWithIndex:[self rowForItem:item]] byExtendingSelection:YES]; } @@ -276,17 +276,17 @@ { BOOL canDiff = YES; NSEnumerator *e = [self selectedObjectEnumerator]; - ReconItem *item; + ReconItem *item; while (item = [e nextObject]) { if (![item canDiff]) canDiff= NO; - } + } return canDiff; } -/* Override default highlight colour because it's hard to see the +/* Override default highlight colour because it's hard to see the conflict/resolution icons */ - (id)_highlightColorForCell:(NSCell *)cell -{ +{ if(([[self window] firstResponder] == self) && [[self window] isMainWindow] && [[self window] isKeyWindow]) diff --git a/src/uimac14/UnisonToolbar.h b/src/uimac14/UnisonToolbar.h index d7a23ae..ba67d6b 100644 --- a/src/uimac14/UnisonToolbar.h +++ b/src/uimac14/UnisonToolbar.h @@ -1,6 +1,6 @@ // // UnisonToolbar.h -// +// // Extended NSToolbar with several views // // Created by Ben Willmore on Sun March 12 2006. @@ -16,10 +16,10 @@ <NSToolbarDelegate> #endif { - ReconTableView* tableView; - MyController* myController; - NSString* currentView; - NSView* tableModeView; + ReconTableView* tableView; + MyController* myController; + NSString* currentView; + NSView* tableModeView; } - initWithIdentifier:(NSString *) identifier :(MyController *) aController :(ReconTableView *) aTableView; diff --git a/src/uimac14/UnisonToolbar.m b/src/uimac14/UnisonToolbar.m index dbbd325..8cb8080 100644 --- a/src/uimac14/UnisonToolbar.m +++ b/src/uimac14/UnisonToolbar.m @@ -1,6 +1,6 @@ // // UnisonToolbar.h -// +// // Extended NSToolbar with several views // // Created by Ben Willmore on Sun March 12 2006. @@ -30,12 +30,12 @@ static NSString* TableModeIdentifier = @"TableMode"; - initWithIdentifier:(NSString *) identifier :(MyController *) aController :(ReconTableView *) aTableView { if ((self = [super initWithIdentifier: identifier])) { - [self setAllowsUserCustomization: NO]; - [self setAutosavesConfiguration: NO]; - [self setDelegate: self]; - myController = aController; - tableView = aTableView; - currentView = @""; + [self setAllowsUserCustomization: NO]; + [self setAutosavesConfiguration: NO]; + [self setDelegate: self]; + myController = aController; + tableView = aTableView; + currentView = @""; } return self; @@ -43,44 +43,44 @@ static NSString* TableModeIdentifier = @"TableMode"; - (void)takeTableModeView:(NSView *)view { - tableModeView = [view retain]; - [view setHidden:YES]; + tableModeView = [view retain]; + [view setHidden:YES]; } - (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted { NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease]; if ([itemIdent isEqual: QuitItemIdentifier]) { - [toolbarItem setLabel: @"Quit"]; - [toolbarItem setImage: [NSImage imageNamed: @"quit.tif"]]; - [toolbarItem setTarget:NSApp]; - [toolbarItem setAction:@selector(terminate:)]; - } - else if ([itemIdent isEqual: OpenItemIdentifier]) { + [toolbarItem setLabel: @"Quit"]; + [toolbarItem setImage: [NSImage imageNamed: @"quit.tif"]]; + [toolbarItem setTarget:NSApp]; + [toolbarItem setAction:@selector(terminate:)]; + } + else if ([itemIdent isEqual: OpenItemIdentifier]) { [toolbarItem setLabel: @"Open"]; [toolbarItem setImage: [NSImage imageNamed: @"go.tif"]]; [toolbarItem setTarget:myController]; [toolbarItem setAction:@selector(openButton:)]; } - else if ([itemIdent isEqual: NewItemIdentifier]) { + else if ([itemIdent isEqual: NewItemIdentifier]) { [toolbarItem setLabel: @"New"]; [toolbarItem setImage: [NSImage imageNamed: @"add.tif"]]; [toolbarItem setTarget:myController]; [toolbarItem setAction:@selector(createButton:)]; } - else if ([itemIdent isEqual: CancelItemIdentifier]) { + else if ([itemIdent isEqual: CancelItemIdentifier]) { [toolbarItem setLabel: @"Cancel"]; [toolbarItem setImage: [NSImage imageNamed: @"restart.tif"]]; [toolbarItem setTarget:myController]; [toolbarItem setAction:@selector(chooseProfiles)]; } - else if ([itemIdent isEqual: SaveItemIdentifier]) { + else if ([itemIdent isEqual: SaveItemIdentifier]) { [toolbarItem setLabel: @"Save"]; [toolbarItem setImage: [NSImage imageNamed: @"save.tif"]]; [toolbarItem setTarget:myController]; [toolbarItem setAction:@selector(saveProfileButton:)]; - } - else if ([itemIdent isEqual: GoItemIdentifier]) { + } + else if ([itemIdent isEqual: GoItemIdentifier]) { [toolbarItem setLabel: @"Go"]; [toolbarItem setImage: [NSImage imageNamed: @"go.tif"]]; [toolbarItem setTarget:myController]; @@ -108,64 +108,64 @@ static NSString* TableModeIdentifier = @"TableMode"; [toolbarItem setLabel: @"Merge"]; [toolbarItem setImage: [NSImage imageNamed: @"merge.tif"]]; [toolbarItem setTarget:tableView]; - [toolbarItem setAction:@selector(merge:)]; + [toolbarItem setAction:@selector(merge:)]; } - else if ([itemIdent isEqual: LToRItemIdentifier]) { + else if ([itemIdent isEqual: LToRItemIdentifier]) { [toolbarItem setLabel: @"Left to right"]; [toolbarItem setImage: [NSImage imageNamed: @"right.tif"]]; [toolbarItem setTarget:tableView]; [toolbarItem setAction:@selector(copyLR:)]; - } - else if ([itemIdent isEqual: SkipItemIdentifier]) { + } + else if ([itemIdent isEqual: SkipItemIdentifier]) { [toolbarItem setLabel: @"Skip"]; [toolbarItem setImage: [NSImage imageNamed: @"skip.tif"]]; [toolbarItem setTarget:tableView]; [toolbarItem setAction:@selector(leaveAlone:)]; - } - else if ([itemIdent isEqual: DiffItemIdentifier]) { + } + else if ([itemIdent isEqual: DiffItemIdentifier]) { [toolbarItem setLabel: @"Diff"]; [toolbarItem setImage: [NSImage imageNamed: @"diff.tif"]]; [toolbarItem setTarget:tableView]; [toolbarItem setAction:@selector(showDiff:)]; - } - else if ([itemIdent isEqual: TableModeIdentifier]) { - [toolbarItem setLabel:@"Layout"]; - [toolbarItem setToolTip:@"Switch table nesting"]; - [tableModeView setHidden:NO]; - [toolbarItem setView:tableModeView]; - //[toolbarItem setMinSize:NSMakeSize(NSWidth([tableModeView frame]),NSHeight([tableModeView frame])+10)]; - //[toolbarItem setMaxSize:NSMakeSize(NSWidth([tableModeView frame]),NSHeight([tableModeView frame])+10)]; - } - - return toolbarItem; + } + else if ([itemIdent isEqual: TableModeIdentifier]) { + [toolbarItem setLabel:@"Layout"]; + [toolbarItem setToolTip:@"Switch table nesting"]; + [tableModeView setHidden:NO]; + [toolbarItem setView:tableModeView]; + //[toolbarItem setMinSize:NSMakeSize(NSWidth([tableModeView frame]),NSHeight([tableModeView frame])+10)]; + //[toolbarItem setMaxSize:NSMakeSize(NSWidth([tableModeView frame]),NSHeight([tableModeView frame])+10)]; + } + + return toolbarItem; } - (NSArray *) itemIdentifiersForView: (NSString *) whichView { if ([whichView isEqual: @"chooseProfileView"]) { - return [NSArray arrayWithObjects: QuitItemIdentifier, NewItemIdentifier, OpenItemIdentifier, nil]; - } - else if ([whichView isEqual: @"preferencesView"]) { - return [NSArray arrayWithObjects: QuitItemIdentifier, SaveItemIdentifier, CancelItemIdentifier, nil]; - } - else if ([whichView isEqual: @"ConnectingView"]) { - return [NSArray arrayWithObjects: QuitItemIdentifier, nil]; - } - else if ([whichView isEqual: @"updatesView"]) { - return [NSArray arrayWithObjects: QuitItemIdentifier, - RestartItemIdentifier, - NSToolbarSpaceItemIdentifier, - GoItemIdentifier, - RescanItemIdentifier, - NSToolbarSpaceItemIdentifier, - RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, - SkipItemIdentifier, + return [NSArray arrayWithObjects: QuitItemIdentifier, NewItemIdentifier, OpenItemIdentifier, nil]; + } + else if ([whichView isEqual: @"preferencesView"]) { + return [NSArray arrayWithObjects: QuitItemIdentifier, SaveItemIdentifier, CancelItemIdentifier, nil]; + } + else if ([whichView isEqual: @"ConnectingView"]) { + return [NSArray arrayWithObjects: QuitItemIdentifier, nil]; + } + else if ([whichView isEqual: @"updatesView"]) { + return [NSArray arrayWithObjects: QuitItemIdentifier, + RestartItemIdentifier, + NSToolbarSpaceItemIdentifier, + GoItemIdentifier, + RescanItemIdentifier, + NSToolbarSpaceItemIdentifier, + RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, + SkipItemIdentifier, NSToolbarSpaceItemIdentifier, - DiffItemIdentifier, - TableModeIdentifier, nil]; - } - else { - return [NSArray arrayWithObjects: QuitItemIdentifier, Nil]; - } + DiffItemIdentifier, + TableModeIdentifier, nil]; + } + else { + return [NSArray arrayWithObjects: QuitItemIdentifier, Nil]; + } } - (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *) toolbar { @@ -173,44 +173,44 @@ static NSString* TableModeIdentifier = @"TableMode"; } - (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar { - return [NSArray arrayWithObjects: QuitItemIdentifier, OpenItemIdentifier, NewItemIdentifier, - CancelItemIdentifier, SaveItemIdentifier, - GoItemIdentifier, RestartItemIdentifier, RescanItemIdentifier, - RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, - SkipItemIdentifier, DiffItemIdentifier, - NSToolbarSpaceItemIdentifier, nil]; + return [NSArray arrayWithObjects: QuitItemIdentifier, OpenItemIdentifier, NewItemIdentifier, + CancelItemIdentifier, SaveItemIdentifier, + GoItemIdentifier, RestartItemIdentifier, RescanItemIdentifier, + RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, + SkipItemIdentifier, DiffItemIdentifier, + NSToolbarSpaceItemIdentifier, nil]; } - (void) setView: (NSString *) whichView { - if ([whichView isEqual:currentView]) return; - - currentView = whichView; - - int i; - NSArray *identifiers; - NSString *oldIdentifier; - NSString *newIdentifier; - - identifiers=[self itemIdentifiersForView:whichView]; - for (i=0; i<[identifiers count]; i++) { - newIdentifier = [identifiers objectAtIndex:i]; - if (i<[[self items] count]) { - oldIdentifier = [[[self items] objectAtIndex:i] itemIdentifier]; - if ([newIdentifier isEqual: oldIdentifier] ) { - [[[self items] objectAtIndex:i] setEnabled:YES]; - } - else { - [self removeItemAtIndex:i]; - [self insertItemWithItemIdentifier:newIdentifier atIndex:i]; - } - } - else { - [self insertItemWithItemIdentifier:newIdentifier atIndex:i]; - } - } - while ([[self items] count] > [identifiers count]) { - [self removeItemAtIndex:[identifiers count]]; - } + if ([whichView isEqual:currentView]) return; + + currentView = whichView; + + int i; + NSArray *identifiers; + NSString *oldIdentifier; + NSString *newIdentifier; + + identifiers=[self itemIdentifiersForView:whichView]; + for (i=0; i<[identifiers count]; i++) { + newIdentifier = [identifiers objectAtIndex:i]; + if (i<[[self items] count]) { + oldIdentifier = [[[self items] objectAtIndex:i] itemIdentifier]; + if ([newIdentifier isEqual: oldIdentifier] ) { + [[[self items] objectAtIndex:i] setEnabled:YES]; + } + else { + [self removeItemAtIndex:i]; + [self insertItemWithItemIdentifier:newIdentifier atIndex:i]; + } + } + else { + [self insertItemWithItemIdentifier:newIdentifier atIndex:i]; + } + } + while ([[self items] count] > [identifiers count]) { + [self removeItemAtIndex:[identifiers count]]; + } } @end diff --git a/src/uimac14/main.m b/src/uimac14/main.m index 3bfcfbd..8068a61 100644 --- a/src/uimac14/main.m +++ b/src/uimac14/main.m @@ -13,7 +13,7 @@ int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; int i; - + /* When you click-start or use the open command, the program is invoked with a command-line arg of the form -psn_XXXXXXXXX. The XXXXXXXX is a "process serial number" and it seems to be important for Carbon programs. We need @@ -24,9 +24,9 @@ int main(int argc, const char *argv[]) argc--; argv[1] = NULL; } - - [Bridge startup:argv]; - + + [Bridge startup:argv]; + /* Check for invocations that don't start up the gui */ for (i=1; i<argc; i++) { if (!strcmp(argv[i],"-doc") || @@ -35,19 +35,19 @@ int main(int argc, const char *argv[]) !strcmp(argv[i],"-server") || !strcmp(argv[i],"-socket") || !strcmp(argv[i],"-ui")) { - NSLog(@"Calling nonGuiStartup"); - @try { - ocamlCall("x", "unisonNonGuiStartup"); - } @catch (NSException *ex) { - NSLog(@"Uncaught exception: %@", [ex reason]); - exit(1); - } + NSLog(@"Calling nonGuiStartup"); + @try { + ocamlCall("x", "unisonNonGuiStartup"); + } @catch (NSException *ex) { + NSLog(@"Uncaught exception: %@", [ex reason]); + exit(1); + } /* If we get here without exiting first, the non GUI startup detected a -ui graphic or command-line profile, and we should in fact start the GUI. */ } } - - /* go! */ + + /* go! */ [pool release]; return NSApplicationMain(argc, argv); } diff --git a/src/uimac14/ssselectabletoolbar/README b/src/uimac14/ssselectabletoolbar/README index 680fd84..0208bcd 100644 --- a/src/uimac14/ssselectabletoolbar/README +++ b/src/uimac14/ssselectabletoolbar/README @@ -3,21 +3,21 @@ SSSelectable Toolbar Copyright (c) 2011 Steve Streeting -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Why? @@ -39,20 +39,16 @@ How to use 2) In Interface Builder, drag & drop an NSToolbar on to your window 3) Change the type to 'SSSelectableToolbar' 4) Connect the 'window' outlet of the toolbar to the parent window -5) Drag & drop NSToolbarItem instances on to the toolbar and check the +5) Drag & drop NSToolbarItem instances on to the toolbar and check the 'Selectable' option 6) Change the type of each one to 'SSSelectableToolbarItem' 7) Create a Custom View instance at the root of the document (not in the window) for each pane and populate them how you like -8) Connect the 'linkedView' outlet of each toolbar item to the corresponding +8) Connect the 'linkedView' outlet of each toolbar item to the corresponding pane view 9) Connect the 'nextKeyView' outlet of each custom view to the control that should become the first responder when switching to that tab (Optional) -And you're ready to go. Each toolbar item will switch to its corresponding pane, -resizing the window as necessary. You can make the window resizable if you like, +And you're ready to go. Each toolbar item will switch to its corresponding pane, +resizing the window as necessary. You can make the window resizable if you like, and the user size will be remembered when switching back and forth. - - - - diff --git a/src/uimac14/ssselectabletoolbar/SSSelectableToolbar.h b/src/uimac14/ssselectabletoolbar/SSSelectableToolbar.h index c8538a4..4d7af3a 100644 --- a/src/uimac14/ssselectabletoolbar/SSSelectableToolbar.h +++ b/src/uimac14/ssselectabletoolbar/SSSelectableToolbar.h @@ -8,17 +8,17 @@ #import <Cocoa/Cocoa.h> -@interface SSSelectableToolbar : NSToolbar +@interface SSSelectableToolbar : NSToolbar { - NSWindow* window; - NSView* blankView; - NSInteger defaultItemIndex; + NSWindow* window; + NSView* blankView; + NSInteger defaultItemIndex; } @property (nonatomic, retain) IBOutlet NSWindow* window; @property (nonatomic, assign) NSInteger defaultItemIndex; -(NSToolbarItem*)itemWithIdentifier:(NSString*)identifier; -// select the item with the given index, ordered as per the palette and ignoring +// select the item with the given index, ordered as per the palette and ignoring // all types of buttons except SSSelectableToolbarItem -(void)selectItemWithIndex:(NSInteger)idx; // Convert a selectable item index (ignoring all except selectable items in palette) diff --git a/src/uimac14/ssselectabletoolbar/SSSelectableToolbar.m b/src/uimac14/ssselectabletoolbar/SSSelectableToolbar.m index 6d0ceef..9f1e035 100644 --- a/src/uimac14/ssselectabletoolbar/SSSelectableToolbar.m +++ b/src/uimac14/ssselectabletoolbar/SSSelectableToolbar.m @@ -16,142 +16,142 @@ - (id) initWithIdentifier:(NSString *)identifier { - if (self = [super initWithIdentifier:identifier]) - { - blankView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]; - } - return self; + if (self = [super initWithIdentifier:identifier]) + { + blankView = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]; + } + return self; } - (void) dealloc { - [blankView release]; - [window release]; - [super dealloc]; + [blankView release]; + [window release]; + [super dealloc]; } -(IBAction)toolbarItemClicked:sender { - // this is really only here so I can set up a target / action which makes button clickable + // this is really only here so I can set up a target / action which makes button clickable } -(void)selectDefaultItem:sender { - // select the default item first time becomes key - [self selectItemWithIndex:defaultItemIndex]; - // Don't tell us again - [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidBecomeKeyNotification object:window]; + // select the default item first time becomes key + [self selectItemWithIndex:defaultItemIndex]; + // Don't tell us again + [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidBecomeKeyNotification object:window]; } -(void) awakeFromNib { - // Set target / action on all buttons to make them clickable - NSArray* items = [self visibleItems]; - for (NSToolbarItem* item in items) - { - if ([item isKindOfClass:[SSSelectableToolbarItem class]]) - { - [item setTarget:self]; - [item setAction:@selector(toolbarItemClicked:)]; - } - } - - // Wait until window displayed before sizing (important for displaying in sheets) - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(selectDefaultItem:) - name:NSWindowDidBecomeKeyNotification - object:window]; - + // Set target / action on all buttons to make them clickable + NSArray* items = [self visibleItems]; + for (NSToolbarItem* item in items) + { + if ([item isKindOfClass:[SSSelectableToolbarItem class]]) + { + [item setTarget:self]; + [item setAction:@selector(toolbarItemClicked:)]; + } + } + + // Wait until window displayed before sizing (important for displaying in sheets) + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(selectDefaultItem:) + name:NSWindowDidBecomeKeyNotification + object:window]; + } -(NSToolbarItem*)itemWithIdentifier:(NSString*)identifier { - for (NSToolbarItem* item in [self items]) - { - if ([[item itemIdentifier] isEqual:identifier]) - return item; - } - return nil; + for (NSToolbarItem* item in [self items]) + { + if ([[item itemIdentifier] isEqual:identifier]) + return item; + } + return nil; } - (void)setSelectedItemIdentifier:(NSString *)itemIdentifier { - [super setSelectedItemIdentifier:itemIdentifier]; - - NSToolbarItem* item = [self itemWithIdentifier:itemIdentifier]; - if ([item isKindOfClass:[SSSelectableToolbarItem class]]) - { - SSSelectableToolbarItem* ssitem = (SSSelectableToolbarItem*)item; - - NSView* view = [ssitem linkedView]; - if (view && window) - { - NSView* oldView = [window contentView]; - NSRect oldFrame = [oldView frame]; - NSRect newFrame = [view frame]; - NSRect oldWinFrame = [window frame]; - NSRect winFrame = oldWinFrame; - float toolbarHeight = NSHeight(oldWinFrame) - NSHeight(oldFrame); - - // resize - winFrame.size.width = newFrame.size.width; - winFrame.size.height = newFrame.size.height + toolbarHeight; - winFrame.origin.y -= NSHeight(winFrame) - NSHeight(oldWinFrame); - [window setContentView:blankView]; - [window setFrame:winFrame display:YES animate:YES]; - [window setContentView:view]; - - // change title - [window setTitle:[ssitem label]]; - - // tab to first control (if nextKeyView connected) - NSView* keyView = [view nextKeyView]; - if (keyView) - [window makeFirstResponder:keyView]; - - - } - } + [super setSelectedItemIdentifier:itemIdentifier]; + + NSToolbarItem* item = [self itemWithIdentifier:itemIdentifier]; + if ([item isKindOfClass:[SSSelectableToolbarItem class]]) + { + SSSelectableToolbarItem* ssitem = (SSSelectableToolbarItem*)item; + + NSView* view = [ssitem linkedView]; + if (view && window) + { + NSView* oldView = [window contentView]; + NSRect oldFrame = [oldView frame]; + NSRect newFrame = [view frame]; + NSRect oldWinFrame = [window frame]; + NSRect winFrame = oldWinFrame; + float toolbarHeight = NSHeight(oldWinFrame) - NSHeight(oldFrame); + + // resize + winFrame.size.width = newFrame.size.width; + winFrame.size.height = newFrame.size.height + toolbarHeight; + winFrame.origin.y -= NSHeight(winFrame) - NSHeight(oldWinFrame); + [window setContentView:blankView]; + [window setFrame:winFrame display:YES animate:YES]; + [window setContentView:view]; + + // change title + [window setTitle:[ssitem label]]; + + // tab to first control (if nextKeyView connected) + NSView* keyView = [view nextKeyView]; + if (keyView) + [window makeFirstResponder:keyView]; + + + } + } } -(void)selectItemWithIndex:(NSInteger)idx { - NSInteger currIdx = 0; - for (NSToolbarItem* item in [self items]) - { - if ([item isKindOfClass:[SSSelectableToolbarItem class]]) - { - if (currIdx == idx) - { - [self setSelectedItemIdentifier:[item itemIdentifier]]; - return; - } - // We're only counting these types, ignore spacing and other default items - ++currIdx; - } - } - + NSInteger currIdx = 0; + for (NSToolbarItem* item in [self items]) + { + if ([item isKindOfClass:[SSSelectableToolbarItem class]]) + { + if (currIdx == idx) + { + [self setSelectedItemIdentifier:[item itemIdentifier]]; + return; + } + // We're only counting these types, ignore spacing and other default items + ++currIdx; + } + } + } -(NSInteger)selectableItemIndexToMainIndex:(NSInteger)idx { - NSInteger selIdx = 0; - NSInteger mainIdx = 0; - for (NSToolbarItem* item in [self items]) - { - if ([item isKindOfClass:[SSSelectableToolbarItem class]]) - { - if (selIdx == idx) - { - return mainIdx; - } - ++selIdx; - } - ++mainIdx; - } - - return -1; + NSInteger selIdx = 0; + NSInteger mainIdx = 0; + for (NSToolbarItem* item in [self items]) + { + if ([item isKindOfClass:[SSSelectableToolbarItem class]]) + { + if (selIdx == idx) + { + return mainIdx; + } + ++selIdx; + } + ++mainIdx; + } + + return -1; } @end diff --git a/src/uimac14/ssselectabletoolbar/SSSelectableToolbarItem.h b/src/uimac14/ssselectabletoolbar/SSSelectableToolbarItem.h index 716ac4a..08649fa 100644 --- a/src/uimac14/ssselectabletoolbar/SSSelectableToolbarItem.h +++ b/src/uimac14/ssselectabletoolbar/SSSelectableToolbarItem.h @@ -9,9 +9,9 @@ #import <Cocoa/Cocoa.h> -@interface SSSelectableToolbarItem : NSToolbarItem +@interface SSSelectableToolbarItem : NSToolbarItem { - NSView* linkedView; + NSView* linkedView; } @property (nonatomic, retain) IBOutlet NSView* linkedView; diff --git a/src/uimac14/ssselectabletoolbar/SSSelectableToolbarItem.m b/src/uimac14/ssselectabletoolbar/SSSelectableToolbarItem.m index 87bfd82..79433b0 100644 --- a/src/uimac14/ssselectabletoolbar/SSSelectableToolbarItem.m +++ b/src/uimac14/ssselectabletoolbar/SSSelectableToolbarItem.m @@ -15,8 +15,8 @@ -(void) dealloc { - [linkedView release]; - [super dealloc]; + [linkedView release]; + [super dealloc]; } @end diff --git a/src/uimac14/uimacnew.xcodeproj/project.pbxproj b/src/uimac14/uimacnew.xcodeproj/project.pbxproj index a47cf9d..d6f0940 100644 --- a/src/uimac14/uimacnew.xcodeproj/project.pbxproj +++ b/src/uimac14/uimacnew.xcodeproj/project.pbxproj @@ -1,784 +1,784 @@ // !$*UTF8*$! { - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { /* Begin PBXAggregateTarget section */ - 2A124E780DE1C48400524237 /* Create ExternalSettings */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 2A124E7C0DE1C4A200524237 /* Build configuration list for PBXAggregateTarget "Create ExternalSettings" */; - buildPhases = ( - 2A124E7E0DE1C4BE00524237 /* Run Script (version, ocaml lib dir) */, - ); - dependencies = ( - ); - name = "Create ExternalSettings"; - productName = "Create ExternalSettings"; - }; + 2A124E780DE1C48400524237 /* Create ExternalSettings */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 2A124E7C0DE1C4A200524237 /* Build configuration list for PBXAggregateTarget "Create ExternalSettings" */; + buildPhases = ( + 2A124E7E0DE1C4BE00524237 /* Run Script (version, ocaml lib dir) */, + ); + dependencies = ( + ); + name = "Create ExternalSettings"; + productName = "Create ExternalSettings"; + }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 2A3C3F7D09922D4900E404E9 /* NotificationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A3C3F7B09922D4900E404E9 /* NotificationController.m */; }; - 2E282CC80D9AE2B000439D01 /* unison-blob.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 2E282CC70D9AE2B000439D01 /* unison-blob.o */; }; - 44042CB60BE4FC9B00A6BBB2 /* ProgressCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */; }; - 44042D1B0BE52AED00A6BBB2 /* ProgressBarAdvanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */; }; - 44042D1C0BE52AEE00A6BBB2 /* ProgressBarBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */; }; - 44042D1D0BE52AEE00A6BBB2 /* ProgressBarEndAdvanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */; }; - 44042D1E0BE52AEE00A6BBB2 /* ProgressBarEndBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */; }; - 44042D1F0BE52AEE00A6BBB2 /* ProgressBarEndGray.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */; }; - 44042D200BE52AEE00A6BBB2 /* ProgressBarEndGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */; }; - 44042D210BE52AEE00A6BBB2 /* ProgressBarEndWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */; }; - 44042D220BE52AEE00A6BBB2 /* ProgressBarGray.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */; }; - 44042D230BE52AEE00A6BBB2 /* ProgressBarGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */; }; - 44042D240BE52AEE00A6BBB2 /* ProgressBarLightGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */; }; - 44042D250BE52AEE00A6BBB2 /* ProgressBarWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */; }; - 440EEAF30C03EC3D00ACAAB0 /* Change_Created.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */; }; - 440EEAF90C03F0B800ACAAB0 /* Change_Deleted.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */; }; - 440EEAFA0C03F0B800ACAAB0 /* Change_Modified.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */; }; - 440EEAFB0C03F0B800ACAAB0 /* Change_PropsChanged.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */; }; - 445A291B0BFA5B3300E4E641 /* Outline-Deep.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */; }; - 445A29270BFA5C1200E4E641 /* Outline-Flat.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A29260BFA5C1200E4E641 /* Outline-Flat.png */; }; - 445A29290BFA5C1B00E4E641 /* Outline-Flattened.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */; }; - 445A2A5E0BFAB6C300E4E641 /* ImageAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */; }; - 449F03E10BE00DE9003F15C8 /* Bridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 449F03DF0BE00DE9003F15C8 /* Bridge.m */; }; - 44A794A10BE16C380069680C /* ExceptionHandling.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44A794A00BE16C380069680C /* ExceptionHandling.framework */; }; - 44A797F40BE3F9B70069680C /* table-mixed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 44A797F10BE3F9B70069680C /* table-mixed.tif */; }; - 44F472B10C0DB735006428EF /* Change_Absent.png in Resources */ = {isa = PBXBuildFile; fileRef = 44F472AF0C0DB735006428EF /* Change_Absent.png */; }; - 44F472B20C0DB735006428EF /* Change_Unmodified.png in Resources */ = {isa = PBXBuildFile; fileRef = 44F472B00C0DB735006428EF /* Change_Unmodified.png */; }; - 69C625E70664EC3300B3C46A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 69C625E80664EC3300B3C46A /* Unison.icns in Resources */ = {isa = PBXBuildFile; fileRef = 69C625CA0664E94E00B3C46A /* Unison.icns */; }; - 69C625EA0664EC3300B3C46A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; - 69C625EB0664EC3300B3C46A /* MyController.m in Sources */ = {isa = PBXBuildFile; fileRef = 69660DC704F08CC100CF23A4 /* MyController.m */; }; - 69C625EC0664EC3300B3C46A /* ProfileController.m in Sources */ = {isa = PBXBuildFile; fileRef = 690F564504F11EC300CF23A4 /* ProfileController.m */; }; - 69C625ED0664EC3300B3C46A /* ReconItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */; }; - 69C625EE0664EC3300B3C46A /* ReconTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 69BA7DA904FD695200CF23A4 /* ReconTableView.m */; }; - 69C625EF0664EC3300B3C46A /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 697985CE050CFA2D00CF23A4 /* PreferencesController.m */; }; - 69C625F00664EC3300B3C46A /* ProfileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 691CE181051BB44A00CF23A4 /* ProfileTableView.m */; }; - 69C625F20664EC3300B3C46A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 69E407BA07EB95AA00D37AA1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69E407B907EB95AA00D37AA1 /* Security.framework */; }; - 8450B1381918859E00A2C4D6 /* ColorGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8450B1371918859E00A2C4D6 /* ColorGradientView.m */; }; - 849BE4FF191AC10E001B6FBF /* README in Resources */ = {isa = PBXBuildFile; fileRef = 849BE4FA191AC10E001B6FBF /* README */; }; - 849BE500191AC10E001B6FBF /* SSSelectableToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 849BE4FC191AC10E001B6FBF /* SSSelectableToolbar.m */; }; - 849BE501191AC10E001B6FBF /* SSSelectableToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 849BE4FE191AC10E001B6FBF /* SSSelectableToolbarItem.m */; }; - B518071C09D6652100B1B21F /* add.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071209D6652100B1B21F /* add.tif */; }; - B518071D09D6652100B1B21F /* diff.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071309D6652100B1B21F /* diff.tif */; }; - B518071E09D6652100B1B21F /* go.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071409D6652100B1B21F /* go.tif */; }; - B518071F09D6652100B1B21F /* left.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071509D6652100B1B21F /* left.tif */; }; - B518072009D6652100B1B21F /* merge.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071609D6652100B1B21F /* merge.tif */; }; - B518072109D6652100B1B21F /* quit.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071709D6652100B1B21F /* quit.tif */; }; - B518072209D6652100B1B21F /* restart.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071809D6652100B1B21F /* restart.tif */; }; - B518072309D6652100B1B21F /* right.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071909D6652100B1B21F /* right.tif */; }; - B518072409D6652100B1B21F /* save.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071A09D6652100B1B21F /* save.tif */; }; - B518072509D6652100B1B21F /* skip.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071B09D6652100B1B21F /* skip.tif */; }; - B554004109C4E5AA0089E1C3 /* UnisonToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */; }; - B5B44C1909DF61A4000DC7AF /* table-conflict.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1109DF61A4000DC7AF /* table-conflict.tif */; }; - B5B44C1A09DF61A4000DC7AF /* table-error.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1209DF61A4000DC7AF /* table-error.tif */; }; - B5B44C1B09DF61A4000DC7AF /* table-left-blue.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */; }; - B5B44C1C09DF61A4000DC7AF /* table-left-green.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1409DF61A4000DC7AF /* table-left-green.tif */; }; - B5B44C1D09DF61A4000DC7AF /* table-merge.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1509DF61A4000DC7AF /* table-merge.tif */; }; - B5B44C1E09DF61A4000DC7AF /* table-right-blue.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */; }; - B5B44C1F09DF61A4000DC7AF /* table-right-green.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1709DF61A4000DC7AF /* table-right-green.tif */; }; - B5B44C2009DF61A4000DC7AF /* table-skip.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1809DF61A4000DC7AF /* table-skip.tif */; }; - B5E03B3909E38B9E0058C7B9 /* rescan.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5E03B3809E38B9E0058C7B9 /* rescan.tif */; }; - DE2444D610C294EA007E1546 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DE2444D410C294EA007E1546 /* MainMenu.xib */; }; + 2A3C3F7D09922D4900E404E9 /* NotificationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A3C3F7B09922D4900E404E9 /* NotificationController.m */; }; + 2E282CC80D9AE2B000439D01 /* unison-blob.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 2E282CC70D9AE2B000439D01 /* unison-blob.o */; }; + 44042CB60BE4FC9B00A6BBB2 /* ProgressCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */; }; + 44042D1B0BE52AED00A6BBB2 /* ProgressBarAdvanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */; }; + 44042D1C0BE52AEE00A6BBB2 /* ProgressBarBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */; }; + 44042D1D0BE52AEE00A6BBB2 /* ProgressBarEndAdvanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */; }; + 44042D1E0BE52AEE00A6BBB2 /* ProgressBarEndBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */; }; + 44042D1F0BE52AEE00A6BBB2 /* ProgressBarEndGray.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */; }; + 44042D200BE52AEE00A6BBB2 /* ProgressBarEndGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */; }; + 44042D210BE52AEE00A6BBB2 /* ProgressBarEndWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */; }; + 44042D220BE52AEE00A6BBB2 /* ProgressBarGray.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */; }; + 44042D230BE52AEE00A6BBB2 /* ProgressBarGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */; }; + 44042D240BE52AEE00A6BBB2 /* ProgressBarLightGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */; }; + 44042D250BE52AEE00A6BBB2 /* ProgressBarWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */; }; + 440EEAF30C03EC3D00ACAAB0 /* Change_Created.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */; }; + 440EEAF90C03F0B800ACAAB0 /* Change_Deleted.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */; }; + 440EEAFA0C03F0B800ACAAB0 /* Change_Modified.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */; }; + 440EEAFB0C03F0B800ACAAB0 /* Change_PropsChanged.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */; }; + 445A291B0BFA5B3300E4E641 /* Outline-Deep.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */; }; + 445A29270BFA5C1200E4E641 /* Outline-Flat.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A29260BFA5C1200E4E641 /* Outline-Flat.png */; }; + 445A29290BFA5C1B00E4E641 /* Outline-Flattened.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */; }; + 445A2A5E0BFAB6C300E4E641 /* ImageAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */; }; + 449F03E10BE00DE9003F15C8 /* Bridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 449F03DF0BE00DE9003F15C8 /* Bridge.m */; }; + 44A794A10BE16C380069680C /* ExceptionHandling.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44A794A00BE16C380069680C /* ExceptionHandling.framework */; }; + 44A797F40BE3F9B70069680C /* table-mixed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 44A797F10BE3F9B70069680C /* table-mixed.tif */; }; + 44F472B10C0DB735006428EF /* Change_Absent.png in Resources */ = {isa = PBXBuildFile; fileRef = 44F472AF0C0DB735006428EF /* Change_Absent.png */; }; + 44F472B20C0DB735006428EF /* Change_Unmodified.png in Resources */ = {isa = PBXBuildFile; fileRef = 44F472B00C0DB735006428EF /* Change_Unmodified.png */; }; + 69C625E70664EC3300B3C46A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; + 69C625E80664EC3300B3C46A /* Unison.icns in Resources */ = {isa = PBXBuildFile; fileRef = 69C625CA0664E94E00B3C46A /* Unison.icns */; }; + 69C625EA0664EC3300B3C46A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + 69C625EB0664EC3300B3C46A /* MyController.m in Sources */ = {isa = PBXBuildFile; fileRef = 69660DC704F08CC100CF23A4 /* MyController.m */; }; + 69C625EC0664EC3300B3C46A /* ProfileController.m in Sources */ = {isa = PBXBuildFile; fileRef = 690F564504F11EC300CF23A4 /* ProfileController.m */; }; + 69C625ED0664EC3300B3C46A /* ReconItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */; }; + 69C625EE0664EC3300B3C46A /* ReconTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 69BA7DA904FD695200CF23A4 /* ReconTableView.m */; }; + 69C625EF0664EC3300B3C46A /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 697985CE050CFA2D00CF23A4 /* PreferencesController.m */; }; + 69C625F00664EC3300B3C46A /* ProfileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 691CE181051BB44A00CF23A4 /* ProfileTableView.m */; }; + 69C625F20664EC3300B3C46A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 69E407BA07EB95AA00D37AA1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69E407B907EB95AA00D37AA1 /* Security.framework */; }; + 8450B1381918859E00A2C4D6 /* ColorGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8450B1371918859E00A2C4D6 /* ColorGradientView.m */; }; + 849BE4FF191AC10E001B6FBF /* README in Resources */ = {isa = PBXBuildFile; fileRef = 849BE4FA191AC10E001B6FBF /* README */; }; + 849BE500191AC10E001B6FBF /* SSSelectableToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 849BE4FC191AC10E001B6FBF /* SSSelectableToolbar.m */; }; + 849BE501191AC10E001B6FBF /* SSSelectableToolbarItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 849BE4FE191AC10E001B6FBF /* SSSelectableToolbarItem.m */; }; + B518071C09D6652100B1B21F /* add.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071209D6652100B1B21F /* add.tif */; }; + B518071D09D6652100B1B21F /* diff.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071309D6652100B1B21F /* diff.tif */; }; + B518071E09D6652100B1B21F /* go.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071409D6652100B1B21F /* go.tif */; }; + B518071F09D6652100B1B21F /* left.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071509D6652100B1B21F /* left.tif */; }; + B518072009D6652100B1B21F /* merge.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071609D6652100B1B21F /* merge.tif */; }; + B518072109D6652100B1B21F /* quit.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071709D6652100B1B21F /* quit.tif */; }; + B518072209D6652100B1B21F /* restart.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071809D6652100B1B21F /* restart.tif */; }; + B518072309D6652100B1B21F /* right.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071909D6652100B1B21F /* right.tif */; }; + B518072409D6652100B1B21F /* save.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071A09D6652100B1B21F /* save.tif */; }; + B518072509D6652100B1B21F /* skip.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071B09D6652100B1B21F /* skip.tif */; }; + B554004109C4E5AA0089E1C3 /* UnisonToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */; }; + B5B44C1909DF61A4000DC7AF /* table-conflict.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1109DF61A4000DC7AF /* table-conflict.tif */; }; + B5B44C1A09DF61A4000DC7AF /* table-error.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1209DF61A4000DC7AF /* table-error.tif */; }; + B5B44C1B09DF61A4000DC7AF /* table-left-blue.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */; }; + B5B44C1C09DF61A4000DC7AF /* table-left-green.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1409DF61A4000DC7AF /* table-left-green.tif */; }; + B5B44C1D09DF61A4000DC7AF /* table-merge.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1509DF61A4000DC7AF /* table-merge.tif */; }; + B5B44C1E09DF61A4000DC7AF /* table-right-blue.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */; }; + B5B44C1F09DF61A4000DC7AF /* table-right-green.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1709DF61A4000DC7AF /* table-right-green.tif */; }; + B5B44C2009DF61A4000DC7AF /* table-skip.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1809DF61A4000DC7AF /* table-skip.tif */; }; + B5E03B3909E38B9E0058C7B9 /* rescan.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5E03B3809E38B9E0058C7B9 /* rescan.tif */; }; + DE2444D610C294EA007E1546 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = DE2444D410C294EA007E1546 /* MainMenu.xib */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 2A124E7F0DE1C4E400524237 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2A124E780DE1C48400524237; - remoteInfo = "Create ExternalSettings"; - }; + 2A124E7F0DE1C4E400524237 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2A124E780DE1C48400524237; + remoteInfo = "Create ExternalSettings"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - 2A3C3F3709922AA600E404E9 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - BB6E50CF10CAA57600E23F8A /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 7; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; + 2A3C3F3709922AA600E404E9 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BB6E50CF10CAA57600E23F8A /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 7; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; - 2A3C3F7A09922D4900E404E9 /* NotificationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationController.h; sourceTree = "<group>"; }; - 2A3C3F7B09922D4900E404E9 /* NotificationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationController.m; sourceTree = "<group>"; }; - 2E282CC70D9AE2B000439D01 /* unison-blob.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; name = "unison-blob.o"; path = "../unison-blob.o"; sourceTree = SOURCE_ROOT; }; - 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ExternalSettings.xcconfig; sourceTree = "<group>"; }; - 44042CB30BE4FC9B00A6BBB2 /* ProgressCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgressCell.h; sourceTree = "<group>"; }; - 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProgressCell.m; sourceTree = "<group>"; }; - 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarAdvanced.png; path = progressicons/ProgressBarAdvanced.png; sourceTree = "<group>"; }; - 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarBlue.png; path = progressicons/ProgressBarBlue.png; sourceTree = "<group>"; }; - 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndAdvanced.png; path = progressicons/ProgressBarEndAdvanced.png; sourceTree = "<group>"; }; - 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndBlue.png; path = progressicons/ProgressBarEndBlue.png; sourceTree = "<group>"; }; - 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndGray.png; path = progressicons/ProgressBarEndGray.png; sourceTree = "<group>"; }; - 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndGreen.png; path = progressicons/ProgressBarEndGreen.png; sourceTree = "<group>"; }; - 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndWhite.png; path = progressicons/ProgressBarEndWhite.png; sourceTree = "<group>"; }; - 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGray.png; path = progressicons/ProgressBarGray.png; sourceTree = "<group>"; }; - 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGreen.png; path = progressicons/ProgressBarGreen.png; sourceTree = "<group>"; }; - 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarLightGreen.png; path = progressicons/ProgressBarLightGreen.png; sourceTree = "<group>"; }; - 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarWhite.png; path = progressicons/ProgressBarWhite.png; sourceTree = "<group>"; }; - 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Created.png; sourceTree = "<group>"; }; - 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Deleted.png; sourceTree = "<group>"; }; - 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Modified.png; sourceTree = "<group>"; }; - 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_PropsChanged.png; sourceTree = "<group>"; }; - 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Deep.png"; sourceTree = "<group>"; }; - 445A29260BFA5C1200E4E641 /* Outline-Flat.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Flat.png"; sourceTree = "<group>"; }; - 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Flattened.png"; sourceTree = "<group>"; }; - 445A2A5B0BFAB6A100E4E641 /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageAndTextCell.h; sourceTree = "<group>"; }; - 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ImageAndTextCell.m; sourceTree = "<group>"; }; - 449F03DE0BE00DE9003F15C8 /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bridge.h; sourceTree = "<group>"; }; - 449F03DF0BE00DE9003F15C8 /* Bridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Bridge.m; sourceTree = "<group>"; }; - 44A794A00BE16C380069680C /* ExceptionHandling.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExceptionHandling.framework; path = /System/Library/Frameworks/ExceptionHandling.framework; sourceTree = "<absolute>"; }; - 44A797F10BE3F9B70069680C /* table-mixed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-mixed.tif"; sourceTree = "<group>"; }; - 44F472AF0C0DB735006428EF /* Change_Absent.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Absent.png; sourceTree = "<group>"; }; - 44F472B00C0DB735006428EF /* Change_Unmodified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Unmodified.png; sourceTree = "<group>"; }; - 690F564404F11EC300CF23A4 /* ProfileController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileController.h; sourceTree = "<group>"; }; - 690F564504F11EC300CF23A4 /* ProfileController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProfileController.m; sourceTree = "<group>"; }; - 691CE180051BB44A00CF23A4 /* ProfileTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileTableView.h; sourceTree = "<group>"; }; - 691CE181051BB44A00CF23A4 /* ProfileTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProfileTableView.m; sourceTree = "<group>"; }; - 69660DC604F08CC100CF23A4 /* MyController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyController.h; sourceTree = "<group>"; }; - 69660DC704F08CC100CF23A4 /* MyController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MyController.m; sourceTree = "<group>"; }; - 697985CD050CFA2D00CF23A4 /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PreferencesController.h; sourceTree = "<group>"; }; - 697985CE050CFA2D00CF23A4 /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = PreferencesController.m; sourceTree = "<group>"; }; - 69BA7DA804FD695200CF23A4 /* ReconTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReconTableView.h; sourceTree = "<group>"; }; - 69BA7DA904FD695200CF23A4 /* ReconTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReconTableView.m; sourceTree = "<group>"; }; - 69C625CA0664E94E00B3C46A /* Unison.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Unison.icns; sourceTree = "<group>"; }; - 69C625F40664EC3300B3C46A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - 69C625F50664EC3300B3C46A /* Unison.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Unison.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ReconItem.m; sourceTree = "<group>"; }; - 69D3C6FA04F1CC3700CF23A4 /* ReconItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ReconItem.h; sourceTree = "<group>"; }; - 69E407B907EB95AA00D37AA1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; }; - 8450B1361918859E00A2C4D6 /* ColorGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorGradientView.h; sourceTree = "<group>"; }; - 8450B1371918859E00A2C4D6 /* ColorGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorGradientView.m; sourceTree = "<group>"; }; - 849BE4FA191AC10E001B6FBF /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; - 849BE4FB191AC10E001B6FBF /* SSSelectableToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSSelectableToolbar.h; sourceTree = "<group>"; }; - 849BE4FC191AC10E001B6FBF /* SSSelectableToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSSelectableToolbar.m; sourceTree = "<group>"; }; - 849BE4FD191AC10E001B6FBF /* SSSelectableToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSSelectableToolbarItem.h; sourceTree = "<group>"; }; - 849BE4FE191AC10E001B6FBF /* SSSelectableToolbarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSSelectableToolbarItem.m; sourceTree = "<group>"; }; - B518071209D6652100B1B21F /* add.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = add.tif; sourceTree = "<group>"; }; - B518071309D6652100B1B21F /* diff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = diff.tif; sourceTree = "<group>"; }; - B518071409D6652100B1B21F /* go.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = go.tif; sourceTree = "<group>"; }; - B518071509D6652100B1B21F /* left.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = left.tif; sourceTree = "<group>"; }; - B518071609D6652100B1B21F /* merge.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = merge.tif; sourceTree = "<group>"; }; - B518071709D6652100B1B21F /* quit.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = quit.tif; sourceTree = "<group>"; }; - B518071809D6652100B1B21F /* restart.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = restart.tif; sourceTree = "<group>"; }; - B518071909D6652100B1B21F /* right.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = right.tif; sourceTree = "<group>"; }; - B518071A09D6652100B1B21F /* save.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = save.tif; sourceTree = "<group>"; }; - B518071B09D6652100B1B21F /* skip.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = skip.tif; sourceTree = "<group>"; }; - B554003E09C4E5A00089E1C3 /* UnisonToolbar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UnisonToolbar.h; sourceTree = "<group>"; }; - B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UnisonToolbar.m; sourceTree = "<group>"; }; - B5B44C1109DF61A4000DC7AF /* table-conflict.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-conflict.tif"; sourceTree = "<group>"; }; - B5B44C1209DF61A4000DC7AF /* table-error.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-error.tif"; sourceTree = "<group>"; }; - B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-left-blue.tif"; sourceTree = "<group>"; }; - B5B44C1409DF61A4000DC7AF /* table-left-green.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-left-green.tif"; sourceTree = "<group>"; }; - B5B44C1509DF61A4000DC7AF /* table-merge.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-merge.tif"; sourceTree = "<group>"; }; - B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-right-blue.tif"; sourceTree = "<group>"; }; - B5B44C1709DF61A4000DC7AF /* table-right-green.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-right-green.tif"; sourceTree = "<group>"; }; - B5B44C1809DF61A4000DC7AF /* table-skip.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-skip.tif"; sourceTree = "<group>"; }; - B5E03B3809E38B9E0058C7B9 /* rescan.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = rescan.tif; sourceTree = "<group>"; }; - DE2444D510C294EA007E1546 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; }; + 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 2A3C3F7A09922D4900E404E9 /* NotificationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationController.h; sourceTree = "<group>"; }; + 2A3C3F7B09922D4900E404E9 /* NotificationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationController.m; sourceTree = "<group>"; }; + 2E282CC70D9AE2B000439D01 /* unison-blob.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; name = "unison-blob.o"; path = "../unison-blob.o"; sourceTree = SOURCE_ROOT; }; + 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ExternalSettings.xcconfig; sourceTree = "<group>"; }; + 44042CB30BE4FC9B00A6BBB2 /* ProgressCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgressCell.h; sourceTree = "<group>"; }; + 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProgressCell.m; sourceTree = "<group>"; }; + 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarAdvanced.png; path = progressicons/ProgressBarAdvanced.png; sourceTree = "<group>"; }; + 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarBlue.png; path = progressicons/ProgressBarBlue.png; sourceTree = "<group>"; }; + 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndAdvanced.png; path = progressicons/ProgressBarEndAdvanced.png; sourceTree = "<group>"; }; + 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndBlue.png; path = progressicons/ProgressBarEndBlue.png; sourceTree = "<group>"; }; + 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndGray.png; path = progressicons/ProgressBarEndGray.png; sourceTree = "<group>"; }; + 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndGreen.png; path = progressicons/ProgressBarEndGreen.png; sourceTree = "<group>"; }; + 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndWhite.png; path = progressicons/ProgressBarEndWhite.png; sourceTree = "<group>"; }; + 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGray.png; path = progressicons/ProgressBarGray.png; sourceTree = "<group>"; }; + 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGreen.png; path = progressicons/ProgressBarGreen.png; sourceTree = "<group>"; }; + 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarLightGreen.png; path = progressicons/ProgressBarLightGreen.png; sourceTree = "<group>"; }; + 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarWhite.png; path = progressicons/ProgressBarWhite.png; sourceTree = "<group>"; }; + 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Created.png; sourceTree = "<group>"; }; + 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Deleted.png; sourceTree = "<group>"; }; + 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Modified.png; sourceTree = "<group>"; }; + 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_PropsChanged.png; sourceTree = "<group>"; }; + 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Deep.png"; sourceTree = "<group>"; }; + 445A29260BFA5C1200E4E641 /* Outline-Flat.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Flat.png"; sourceTree = "<group>"; }; + 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Flattened.png"; sourceTree = "<group>"; }; + 445A2A5B0BFAB6A100E4E641 /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageAndTextCell.h; sourceTree = "<group>"; }; + 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ImageAndTextCell.m; sourceTree = "<group>"; }; + 449F03DE0BE00DE9003F15C8 /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bridge.h; sourceTree = "<group>"; }; + 449F03DF0BE00DE9003F15C8 /* Bridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Bridge.m; sourceTree = "<group>"; }; + 44A794A00BE16C380069680C /* ExceptionHandling.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExceptionHandling.framework; path = /System/Library/Frameworks/ExceptionHandling.framework; sourceTree = "<absolute>"; }; + 44A797F10BE3F9B70069680C /* table-mixed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-mixed.tif"; sourceTree = "<group>"; }; + 44F472AF0C0DB735006428EF /* Change_Absent.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Absent.png; sourceTree = "<group>"; }; + 44F472B00C0DB735006428EF /* Change_Unmodified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Unmodified.png; sourceTree = "<group>"; }; + 690F564404F11EC300CF23A4 /* ProfileController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileController.h; sourceTree = "<group>"; }; + 690F564504F11EC300CF23A4 /* ProfileController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProfileController.m; sourceTree = "<group>"; }; + 691CE180051BB44A00CF23A4 /* ProfileTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileTableView.h; sourceTree = "<group>"; }; + 691CE181051BB44A00CF23A4 /* ProfileTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProfileTableView.m; sourceTree = "<group>"; }; + 69660DC604F08CC100CF23A4 /* MyController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyController.h; sourceTree = "<group>"; }; + 69660DC704F08CC100CF23A4 /* MyController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MyController.m; sourceTree = "<group>"; }; + 697985CD050CFA2D00CF23A4 /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PreferencesController.h; sourceTree = "<group>"; }; + 697985CE050CFA2D00CF23A4 /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = PreferencesController.m; sourceTree = "<group>"; }; + 69BA7DA804FD695200CF23A4 /* ReconTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReconTableView.h; sourceTree = "<group>"; }; + 69BA7DA904FD695200CF23A4 /* ReconTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReconTableView.m; sourceTree = "<group>"; }; + 69C625CA0664E94E00B3C46A /* Unison.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Unison.icns; sourceTree = "<group>"; }; + 69C625F40664EC3300B3C46A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; + 69C625F50664EC3300B3C46A /* Unison.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Unison.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ReconItem.m; sourceTree = "<group>"; }; + 69D3C6FA04F1CC3700CF23A4 /* ReconItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ReconItem.h; sourceTree = "<group>"; }; + 69E407B907EB95AA00D37AA1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; }; + 8450B1361918859E00A2C4D6 /* ColorGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorGradientView.h; sourceTree = "<group>"; }; + 8450B1371918859E00A2C4D6 /* ColorGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ColorGradientView.m; sourceTree = "<group>"; }; + 849BE4FA191AC10E001B6FBF /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; }; + 849BE4FB191AC10E001B6FBF /* SSSelectableToolbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSSelectableToolbar.h; sourceTree = "<group>"; }; + 849BE4FC191AC10E001B6FBF /* SSSelectableToolbar.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSSelectableToolbar.m; sourceTree = "<group>"; }; + 849BE4FD191AC10E001B6FBF /* SSSelectableToolbarItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SSSelectableToolbarItem.h; sourceTree = "<group>"; }; + 849BE4FE191AC10E001B6FBF /* SSSelectableToolbarItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SSSelectableToolbarItem.m; sourceTree = "<group>"; }; + B518071209D6652100B1B21F /* add.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = add.tif; sourceTree = "<group>"; }; + B518071309D6652100B1B21F /* diff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = diff.tif; sourceTree = "<group>"; }; + B518071409D6652100B1B21F /* go.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = go.tif; sourceTree = "<group>"; }; + B518071509D6652100B1B21F /* left.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = left.tif; sourceTree = "<group>"; }; + B518071609D6652100B1B21F /* merge.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = merge.tif; sourceTree = "<group>"; }; + B518071709D6652100B1B21F /* quit.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = quit.tif; sourceTree = "<group>"; }; + B518071809D6652100B1B21F /* restart.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = restart.tif; sourceTree = "<group>"; }; + B518071909D6652100B1B21F /* right.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = right.tif; sourceTree = "<group>"; }; + B518071A09D6652100B1B21F /* save.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = save.tif; sourceTree = "<group>"; }; + B518071B09D6652100B1B21F /* skip.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = skip.tif; sourceTree = "<group>"; }; + B554003E09C4E5A00089E1C3 /* UnisonToolbar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UnisonToolbar.h; sourceTree = "<group>"; }; + B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UnisonToolbar.m; sourceTree = "<group>"; }; + B5B44C1109DF61A4000DC7AF /* table-conflict.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-conflict.tif"; sourceTree = "<group>"; }; + B5B44C1209DF61A4000DC7AF /* table-error.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-error.tif"; sourceTree = "<group>"; }; + B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-left-blue.tif"; sourceTree = "<group>"; }; + B5B44C1409DF61A4000DC7AF /* table-left-green.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-left-green.tif"; sourceTree = "<group>"; }; + B5B44C1509DF61A4000DC7AF /* table-merge.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-merge.tif"; sourceTree = "<group>"; }; + B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-right-blue.tif"; sourceTree = "<group>"; }; + B5B44C1709DF61A4000DC7AF /* table-right-green.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-right-green.tif"; sourceTree = "<group>"; }; + B5B44C1809DF61A4000DC7AF /* table-skip.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-skip.tif"; sourceTree = "<group>"; }; + B5E03B3809E38B9E0058C7B9 /* rescan.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = rescan.tif; sourceTree = "<group>"; }; + DE2444D510C294EA007E1546 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 69C625F10664EC3300B3C46A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 69C625F20664EC3300B3C46A /* Cocoa.framework in Frameworks */, - 69E407BA07EB95AA00D37AA1 /* Security.framework in Frameworks */, - 44A794A10BE16C380069680C /* ExceptionHandling.framework in Frameworks */, - 2E282CC80D9AE2B000439D01 /* unison-blob.o in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; + 69C625F10664EC3300B3C46A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 69C625F20664EC3300B3C46A /* Cocoa.framework in Frameworks */, + 69E407BA07EB95AA00D37AA1 /* Security.framework in Frameworks */, + 44A794A10BE16C380069680C /* ExceptionHandling.framework in Frameworks */, + 2E282CC80D9AE2B000439D01 /* unison-blob.o in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 69C625F50664EC3300B3C46A /* Unison.app */, - ); - name = Products; - sourceTree = "<group>"; - }; - 29B97314FDCFA39411CA2CEA /* uimac */ = { - isa = PBXGroup; - children = ( - 44042D0F0BE52AD700A6BBB2 /* progressicons */, - B5B44C1009DF61A4000DC7AF /* tableicons */, - B518071109D6652000B1B21F /* toolbar */, - 44A795C90BE2B91B0069680C /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - 69C625F40664EC3300B3C46A /* Info.plist */, - 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */, - 2E282CB80D9AE16300439D01 /* External objects */, - ); - name = uimac; - sourceTree = "<group>"; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 29B97316FDCFA39411CA2CEA /* main.m */, - ); - name = "Other Sources"; - sourceTree = "<group>"; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - DE2444D410C294EA007E1546 /* MainMenu.xib */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - 69C625CA0664E94E00B3C46A /* Unison.icns */, - ); - name = Resources; - sourceTree = "<group>"; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 44A794A00BE16C380069680C /* ExceptionHandling.framework */, - 69E407B907EB95AA00D37AA1 /* Security.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 2E282CB80D9AE16300439D01 /* External objects */ = { - isa = PBXGroup; - children = ( - 2E282CC70D9AE2B000439D01 /* unison-blob.o */, - ); - name = "External objects"; - sourceTree = "<group>"; - }; - 44042D0F0BE52AD700A6BBB2 /* progressicons */ = { - isa = PBXGroup; - children = ( - 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */, - 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */, - 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */, - 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */, - 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */, - 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */, - 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */, - 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */, - 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */, - 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */, - 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */, - ); - name = progressicons; - sourceTree = "<group>"; - }; - 44A795C90BE2B91B0069680C /* Classes */ = { - isa = PBXGroup; - children = ( - 849BE4F9191AC10E001B6FBF /* ssselectabletoolbar */, - 8450B1361918859E00A2C4D6 /* ColorGradientView.h */, - 8450B1371918859E00A2C4D6 /* ColorGradientView.m */, - 69660DC604F08CC100CF23A4 /* MyController.h */, - 69660DC704F08CC100CF23A4 /* MyController.m */, - 2A3C3F7A09922D4900E404E9 /* NotificationController.h */, - 2A3C3F7B09922D4900E404E9 /* NotificationController.m */, - 69BA7DA804FD695200CF23A4 /* ReconTableView.h */, - 69BA7DA904FD695200CF23A4 /* ReconTableView.m */, - 69D3C6FA04F1CC3700CF23A4 /* ReconItem.h */, - 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */, - 445A2A5B0BFAB6A100E4E641 /* ImageAndTextCell.h */, - 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */, - 44042CB30BE4FC9B00A6BBB2 /* ProgressCell.h */, - 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */, - 690F564404F11EC300CF23A4 /* ProfileController.h */, - 690F564504F11EC300CF23A4 /* ProfileController.m */, - 697985CD050CFA2D00CF23A4 /* PreferencesController.h */, - 697985CE050CFA2D00CF23A4 /* PreferencesController.m */, - 691CE180051BB44A00CF23A4 /* ProfileTableView.h */, - 691CE181051BB44A00CF23A4 /* ProfileTableView.m */, - B554003E09C4E5A00089E1C3 /* UnisonToolbar.h */, - B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */, - 449F03DE0BE00DE9003F15C8 /* Bridge.h */, - 449F03DF0BE00DE9003F15C8 /* Bridge.m */, - ); - name = Classes; - sourceTree = "<group>"; - }; - 849BE4F9191AC10E001B6FBF /* ssselectabletoolbar */ = { - isa = PBXGroup; - children = ( - 849BE4FA191AC10E001B6FBF /* README */, - 849BE4FB191AC10E001B6FBF /* SSSelectableToolbar.h */, - 849BE4FC191AC10E001B6FBF /* SSSelectableToolbar.m */, - 849BE4FD191AC10E001B6FBF /* SSSelectableToolbarItem.h */, - 849BE4FE191AC10E001B6FBF /* SSSelectableToolbarItem.m */, - ); - path = ssselectabletoolbar; - sourceTree = "<group>"; - }; - B518071109D6652000B1B21F /* toolbar */ = { - isa = PBXGroup; - children = ( - B5E03B3809E38B9E0058C7B9 /* rescan.tif */, - B518071209D6652100B1B21F /* add.tif */, - B518071309D6652100B1B21F /* diff.tif */, - B518071409D6652100B1B21F /* go.tif */, - B518071509D6652100B1B21F /* left.tif */, - B518071609D6652100B1B21F /* merge.tif */, - B518071709D6652100B1B21F /* quit.tif */, - B518071809D6652100B1B21F /* restart.tif */, - B518071909D6652100B1B21F /* right.tif */, - B518071A09D6652100B1B21F /* save.tif */, - B518071B09D6652100B1B21F /* skip.tif */, - ); - path = toolbar; - sourceTree = "<group>"; - }; - B5B44C1009DF61A4000DC7AF /* tableicons */ = { - isa = PBXGroup; - children = ( - 44F472AF0C0DB735006428EF /* Change_Absent.png */, - 44F472B00C0DB735006428EF /* Change_Unmodified.png */, - 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */, - 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */, - 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */, - 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */, - 44A797F10BE3F9B70069680C /* table-mixed.tif */, - B5B44C1109DF61A4000DC7AF /* table-conflict.tif */, - B5B44C1209DF61A4000DC7AF /* table-error.tif */, - B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */, - B5B44C1409DF61A4000DC7AF /* table-left-green.tif */, - B5B44C1509DF61A4000DC7AF /* table-merge.tif */, - B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */, - B5B44C1709DF61A4000DC7AF /* table-right-green.tif */, - B5B44C1809DF61A4000DC7AF /* table-skip.tif */, - 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */, - 445A29260BFA5C1200E4E641 /* Outline-Flat.png */, - 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */, - ); - path = tableicons; - sourceTree = "<group>"; - }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 69C625F50664EC3300B3C46A /* Unison.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 29B97314FDCFA39411CA2CEA /* uimac */ = { + isa = PBXGroup; + children = ( + 44042D0F0BE52AD700A6BBB2 /* progressicons */, + B5B44C1009DF61A4000DC7AF /* tableicons */, + B518071109D6652000B1B21F /* toolbar */, + 44A795C90BE2B91B0069680C /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + 69C625F40664EC3300B3C46A /* Info.plist */, + 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */, + 2E282CB80D9AE16300439D01 /* External objects */, + ); + name = uimac; + sourceTree = "<group>"; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = "<group>"; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + DE2444D410C294EA007E1546 /* MainMenu.xib */, + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, + 69C625CA0664E94E00B3C46A /* Unison.icns */, + ); + name = Resources; + sourceTree = "<group>"; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + 44A794A00BE16C380069680C /* ExceptionHandling.framework */, + 69E407B907EB95AA00D37AA1 /* Security.framework */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 2E282CB80D9AE16300439D01 /* External objects */ = { + isa = PBXGroup; + children = ( + 2E282CC70D9AE2B000439D01 /* unison-blob.o */, + ); + name = "External objects"; + sourceTree = "<group>"; + }; + 44042D0F0BE52AD700A6BBB2 /* progressicons */ = { + isa = PBXGroup; + children = ( + 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */, + 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */, + 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */, + 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */, + 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */, + 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */, + 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */, + 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */, + 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */, + 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */, + 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */, + ); + name = progressicons; + sourceTree = "<group>"; + }; + 44A795C90BE2B91B0069680C /* Classes */ = { + isa = PBXGroup; + children = ( + 849BE4F9191AC10E001B6FBF /* ssselectabletoolbar */, + 8450B1361918859E00A2C4D6 /* ColorGradientView.h */, + 8450B1371918859E00A2C4D6 /* ColorGradientView.m */, + 69660DC604F08CC100CF23A4 /* MyController.h */, + 69660DC704F08CC100CF23A4 /* MyController.m */, + 2A3C3F7A09922D4900E404E9 /* NotificationController.h */, + 2A3C3F7B09922D4900E404E9 /* NotificationController.m */, + 69BA7DA804FD695200CF23A4 /* ReconTableView.h */, + 69BA7DA904FD695200CF23A4 /* ReconTableView.m */, + 69D3C6FA04F1CC3700CF23A4 /* ReconItem.h */, + 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */, + 445A2A5B0BFAB6A100E4E641 /* ImageAndTextCell.h */, + 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */, + 44042CB30BE4FC9B00A6BBB2 /* ProgressCell.h */, + 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */, + 690F564404F11EC300CF23A4 /* ProfileController.h */, + 690F564504F11EC300CF23A4 /* ProfileController.m */, + 697985CD050CFA2D00CF23A4 /* PreferencesController.h */, + 697985CE050CFA2D00CF23A4 /* PreferencesController.m */, + 691CE180051BB44A00CF23A4 /* ProfileTableView.h */, + 691CE181051BB44A00CF23A4 /* ProfileTableView.m */, + B554003E09C4E5A00089E1C3 /* UnisonToolbar.h */, + B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */, + 449F03DE0BE00DE9003F15C8 /* Bridge.h */, + 449F03DF0BE00DE9003F15C8 /* Bridge.m */, + ); + name = Classes; + sourceTree = "<group>"; + }; + 849BE4F9191AC10E001B6FBF /* ssselectabletoolbar */ = { + isa = PBXGroup; + children = ( + 849BE4FA191AC10E001B6FBF /* README */, + 849BE4FB191AC10E001B6FBF /* SSSelectableToolbar.h */, + 849BE4FC191AC10E001B6FBF /* SSSelectableToolbar.m */, + 849BE4FD191AC10E001B6FBF /* SSSelectableToolbarItem.h */, + 849BE4FE191AC10E001B6FBF /* SSSelectableToolbarItem.m */, + ); + path = ssselectabletoolbar; + sourceTree = "<group>"; + }; + B518071109D6652000B1B21F /* toolbar */ = { + isa = PBXGroup; + children = ( + B5E03B3809E38B9E0058C7B9 /* rescan.tif */, + B518071209D6652100B1B21F /* add.tif */, + B518071309D6652100B1B21F /* diff.tif */, + B518071409D6652100B1B21F /* go.tif */, + B518071509D6652100B1B21F /* left.tif */, + B518071609D6652100B1B21F /* merge.tif */, + B518071709D6652100B1B21F /* quit.tif */, + B518071809D6652100B1B21F /* restart.tif */, + B518071909D6652100B1B21F /* right.tif */, + B518071A09D6652100B1B21F /* save.tif */, + B518071B09D6652100B1B21F /* skip.tif */, + ); + path = toolbar; + sourceTree = "<group>"; + }; + B5B44C1009DF61A4000DC7AF /* tableicons */ = { + isa = PBXGroup; + children = ( + 44F472AF0C0DB735006428EF /* Change_Absent.png */, + 44F472B00C0DB735006428EF /* Change_Unmodified.png */, + 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */, + 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */, + 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */, + 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */, + 44A797F10BE3F9B70069680C /* table-mixed.tif */, + B5B44C1109DF61A4000DC7AF /* table-conflict.tif */, + B5B44C1209DF61A4000DC7AF /* table-error.tif */, + B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */, + B5B44C1409DF61A4000DC7AF /* table-left-green.tif */, + B5B44C1509DF61A4000DC7AF /* table-merge.tif */, + B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */, + B5B44C1709DF61A4000DC7AF /* table-right-green.tif */, + B5B44C1809DF61A4000DC7AF /* table-skip.tif */, + 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */, + 445A29260BFA5C1200E4E641 /* Outline-Flat.png */, + 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */, + ); + path = tableicons; + sourceTree = "<group>"; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 69C625DD0664EC3300B3C46A /* uimac */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2A3C3F280992245300E404E9 /* Build configuration list for PBXNativeTarget "uimac" */; - buildPhases = ( - 2E282CBA0D9AE17300439D01 /* Run Script (make unison-blob.o) */, - 69C625E50664EC3300B3C46A /* Resources */, - 69C625E90664EC3300B3C46A /* Sources */, - 69C625F10664EC3300B3C46A /* Frameworks */, - 2A3C3F3709922AA600E404E9 /* CopyFiles */, - BB6E50CF10CAA57600E23F8A /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 2A124E800DE1C4E400524237 /* PBXTargetDependency */, - ); - name = uimac; - productInstallPath = "$(HOME)/Applications"; - productName = uimac; - productReference = 69C625F50664EC3300B3C46A /* Unison.app */; - productType = "com.apple.product-type.application"; - }; + 69C625DD0664EC3300B3C46A /* uimac */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2A3C3F280992245300E404E9 /* Build configuration list for PBXNativeTarget "uimac" */; + buildPhases = ( + 2E282CBA0D9AE17300439D01 /* Run Script (make unison-blob.o) */, + 69C625E50664EC3300B3C46A /* Resources */, + 69C625E90664EC3300B3C46A /* Sources */, + 69C625F10664EC3300B3C46A /* Frameworks */, + 2A3C3F3709922AA600E404E9 /* CopyFiles */, + BB6E50CF10CAA57600E23F8A /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + 2A124E800DE1C4E400524237 /* PBXTargetDependency */, + ); + name = uimac; + productInstallPath = "$(HOME)/Applications"; + productName = uimac; + productReference = 69C625F50664EC3300B3C46A /* Unison.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0410; - }; - buildConfigurationList = 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - English, - Japanese, - French, - German, - ); - mainGroup = 29B97314FDCFA39411CA2CEA /* uimac */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 69C625DD0664EC3300B3C46A /* uimac */, - 2A124E780DE1C48400524237 /* Create ExternalSettings */, - ); - }; + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0410; + }; + buildConfigurationList = 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* uimac */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 69C625DD0664EC3300B3C46A /* uimac */, + 2A124E780DE1C48400524237 /* Create ExternalSettings */, + ); + }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 69C625E50664EC3300B3C46A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 69C625E70664EC3300B3C46A /* InfoPlist.strings in Resources */, - 69C625E80664EC3300B3C46A /* Unison.icns in Resources */, - B518071C09D6652100B1B21F /* add.tif in Resources */, - B518071D09D6652100B1B21F /* diff.tif in Resources */, - B518071E09D6652100B1B21F /* go.tif in Resources */, - B518071F09D6652100B1B21F /* left.tif in Resources */, - B518072009D6652100B1B21F /* merge.tif in Resources */, - B518072109D6652100B1B21F /* quit.tif in Resources */, - B518072209D6652100B1B21F /* restart.tif in Resources */, - B518072309D6652100B1B21F /* right.tif in Resources */, - B518072409D6652100B1B21F /* save.tif in Resources */, - B518072509D6652100B1B21F /* skip.tif in Resources */, - B5B44C1909DF61A4000DC7AF /* table-conflict.tif in Resources */, - B5B44C1A09DF61A4000DC7AF /* table-error.tif in Resources */, - B5B44C1B09DF61A4000DC7AF /* table-left-blue.tif in Resources */, - B5B44C1C09DF61A4000DC7AF /* table-left-green.tif in Resources */, - B5B44C1D09DF61A4000DC7AF /* table-merge.tif in Resources */, - B5B44C1E09DF61A4000DC7AF /* table-right-blue.tif in Resources */, - B5B44C1F09DF61A4000DC7AF /* table-right-green.tif in Resources */, - B5B44C2009DF61A4000DC7AF /* table-skip.tif in Resources */, - B5E03B3909E38B9E0058C7B9 /* rescan.tif in Resources */, - 44A797F40BE3F9B70069680C /* table-mixed.tif in Resources */, - 44042D1B0BE52AED00A6BBB2 /* ProgressBarAdvanced.png in Resources */, - 44042D1C0BE52AEE00A6BBB2 /* ProgressBarBlue.png in Resources */, - 44042D1D0BE52AEE00A6BBB2 /* ProgressBarEndAdvanced.png in Resources */, - 44042D1E0BE52AEE00A6BBB2 /* ProgressBarEndBlue.png in Resources */, - 44042D1F0BE52AEE00A6BBB2 /* ProgressBarEndGray.png in Resources */, - 44042D200BE52AEE00A6BBB2 /* ProgressBarEndGreen.png in Resources */, - 44042D210BE52AEE00A6BBB2 /* ProgressBarEndWhite.png in Resources */, - 44042D220BE52AEE00A6BBB2 /* ProgressBarGray.png in Resources */, - 44042D230BE52AEE00A6BBB2 /* ProgressBarGreen.png in Resources */, - 44042D240BE52AEE00A6BBB2 /* ProgressBarLightGreen.png in Resources */, - 44042D250BE52AEE00A6BBB2 /* ProgressBarWhite.png in Resources */, - 445A291B0BFA5B3300E4E641 /* Outline-Deep.png in Resources */, - 445A29270BFA5C1200E4E641 /* Outline-Flat.png in Resources */, - 445A29290BFA5C1B00E4E641 /* Outline-Flattened.png in Resources */, - 440EEAF30C03EC3D00ACAAB0 /* Change_Created.png in Resources */, - 440EEAF90C03F0B800ACAAB0 /* Change_Deleted.png in Resources */, - 440EEAFA0C03F0B800ACAAB0 /* Change_Modified.png in Resources */, - 440EEAFB0C03F0B800ACAAB0 /* Change_PropsChanged.png in Resources */, - 44F472B10C0DB735006428EF /* Change_Absent.png in Resources */, - 44F472B20C0DB735006428EF /* Change_Unmodified.png in Resources */, - DE2444D610C294EA007E1546 /* MainMenu.xib in Resources */, - 849BE4FF191AC10E001B6FBF /* README in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; + 69C625E50664EC3300B3C46A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 69C625E70664EC3300B3C46A /* InfoPlist.strings in Resources */, + 69C625E80664EC3300B3C46A /* Unison.icns in Resources */, + B518071C09D6652100B1B21F /* add.tif in Resources */, + B518071D09D6652100B1B21F /* diff.tif in Resources */, + B518071E09D6652100B1B21F /* go.tif in Resources */, + B518071F09D6652100B1B21F /* left.tif in Resources */, + B518072009D6652100B1B21F /* merge.tif in Resources */, + B518072109D6652100B1B21F /* quit.tif in Resources */, + B518072209D6652100B1B21F /* restart.tif in Resources */, + B518072309D6652100B1B21F /* right.tif in Resources */, + B518072409D6652100B1B21F /* save.tif in Resources */, + B518072509D6652100B1B21F /* skip.tif in Resources */, + B5B44C1909DF61A4000DC7AF /* table-conflict.tif in Resources */, + B5B44C1A09DF61A4000DC7AF /* table-error.tif in Resources */, + B5B44C1B09DF61A4000DC7AF /* table-left-blue.tif in Resources */, + B5B44C1C09DF61A4000DC7AF /* table-left-green.tif in Resources */, + B5B44C1D09DF61A4000DC7AF /* table-merge.tif in Resources */, + B5B44C1E09DF61A4000DC7AF /* table-right-blue.tif in Resources */, + B5B44C1F09DF61A4000DC7AF /* table-right-green.tif in Resources */, + B5B44C2009DF61A4000DC7AF /* table-skip.tif in Resources */, + B5E03B3909E38B9E0058C7B9 /* rescan.tif in Resources */, + 44A797F40BE3F9B70069680C /* table-mixed.tif in Resources */, + 44042D1B0BE52AED00A6BBB2 /* ProgressBarAdvanced.png in Resources */, + 44042D1C0BE52AEE00A6BBB2 /* ProgressBarBlue.png in Resources */, + 44042D1D0BE52AEE00A6BBB2 /* ProgressBarEndAdvanced.png in Resources */, + 44042D1E0BE52AEE00A6BBB2 /* ProgressBarEndBlue.png in Resources */, + 44042D1F0BE52AEE00A6BBB2 /* ProgressBarEndGray.png in Resources */, + 44042D200BE52AEE00A6BBB2 /* ProgressBarEndGreen.png in Resources */, + 44042D210BE52AEE00A6BBB2 /* ProgressBarEndWhite.png in Resources */, + 44042D220BE52AEE00A6BBB2 /* ProgressBarGray.png in Resources */, + 44042D230BE52AEE00A6BBB2 /* ProgressBarGreen.png in Resources */, + 44042D240BE52AEE00A6BBB2 /* ProgressBarLightGreen.png in Resources */, + 44042D250BE52AEE00A6BBB2 /* ProgressBarWhite.png in Resources */, + 445A291B0BFA5B3300E4E641 /* Outline-Deep.png in Resources */, + 445A29270BFA5C1200E4E641 /* Outline-Flat.png in Resources */, + 445A29290BFA5C1B00E4E641 /* Outline-Flattened.png in Resources */, + 440EEAF30C03EC3D00ACAAB0 /* Change_Created.png in Resources */, + 440EEAF90C03F0B800ACAAB0 /* Change_Deleted.png in Resources */, + 440EEAFA0C03F0B800ACAAB0 /* Change_Modified.png in Resources */, + 440EEAFB0C03F0B800ACAAB0 /* Change_PropsChanged.png in Resources */, + 44F472B10C0DB735006428EF /* Change_Absent.png in Resources */, + 44F472B20C0DB735006428EF /* Change_Unmodified.png in Resources */, + DE2444D610C294EA007E1546 /* MainMenu.xib in Resources */, + 849BE4FF191AC10E001B6FBF /* README in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 2A124E7E0DE1C4BE00524237 /* Run Script (version, ocaml lib dir) */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script (version, ocaml lib dir)"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [ -x /usr/libexec/path_helper ]; then\n eval `/usr/libexec/path_helper -s`\nfi\nif [ ! -x ${PROJECT_DIR}/../Makefile.ProjectInfo ]; then\n if [ ! -x ${PROJECT_DIR}/../mkProjectInfo ]; then\n cd ${PROJECT_DIR}/..; ocamlc -o mkProjectInfo unix.cma str.cma mkProjectInfo.ml\n fi\n cd ${PROJECT_DIR}/..; ./mkProjectInfo > Makefile.ProjectInfo\nfi\nOCAMLLIBDIR=`ocamlc -v | tail -n -1 | sed -e 's/.* //g' | sed -e 's/\\\\\\/\\\\//g' | tr -d '\\r'`\nsource ${PROJECT_DIR}/../Makefile.ProjectInfo\necho MARKETING_VERSION = $VERSION > ${PROJECT_DIR}/ExternalSettings.xcconfig\necho OCAMLLIBDIR = $OCAMLLIBDIR >> ${PROJECT_DIR}/ExternalSettings.xcconfig"; - }; - 2E282CBA0D9AE17300439D01 /* Run Script (make unison-blob.o) */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script (make unison-blob.o)"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"Building unison-blob.o...\"\nif [ -x /usr/libexec/path_helper ]; then\n eval `/usr/libexec/path_helper -s`\nfi\ncd ${PROJECT_DIR}/..\nmake unison-blob.o\necho \"done\""; - }; + 2A124E7E0DE1C4BE00524237 /* Run Script (version, ocaml lib dir) */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script (version, ocaml lib dir)"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ -x /usr/libexec/path_helper ]; then\n eval `/usr/libexec/path_helper -s`\nfi\nif [ ! -x ${PROJECT_DIR}/../Makefile.ProjectInfo ]; then\n if [ ! -x ${PROJECT_DIR}/../mkProjectInfo ]; then\n cd ${PROJECT_DIR}/..; ocamlc -o mkProjectInfo unix.cma str.cma mkProjectInfo.ml\n fi\n cd ${PROJECT_DIR}/..; ./mkProjectInfo > Makefile.ProjectInfo\nfi\nOCAMLLIBDIR=`ocamlc -v | tail -n -1 | sed -e 's/.* //g' | sed -e 's/\\\\\\/\\\\//g' | tr -d '\\r'`\nsource ${PROJECT_DIR}/../Makefile.ProjectInfo\necho MARKETING_VERSION = $VERSION > ${PROJECT_DIR}/ExternalSettings.xcconfig\necho OCAMLLIBDIR = $OCAMLLIBDIR >> ${PROJECT_DIR}/ExternalSettings.xcconfig"; + }; + 2E282CBA0D9AE17300439D01 /* Run Script (make unison-blob.o) */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script (make unison-blob.o)"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"Building unison-blob.o...\"\nif [ -x /usr/libexec/path_helper ]; then\n eval `/usr/libexec/path_helper -s`\nfi\ncd ${PROJECT_DIR}/..\nmake unison-blob.o\necho \"done\""; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 69C625E90664EC3300B3C46A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 69C625EA0664EC3300B3C46A /* main.m in Sources */, - 69C625EB0664EC3300B3C46A /* MyController.m in Sources */, - 69C625EC0664EC3300B3C46A /* ProfileController.m in Sources */, - 69C625ED0664EC3300B3C46A /* ReconItem.m in Sources */, - 69C625EE0664EC3300B3C46A /* ReconTableView.m in Sources */, - 69C625EF0664EC3300B3C46A /* PreferencesController.m in Sources */, - 69C625F00664EC3300B3C46A /* ProfileTableView.m in Sources */, - 2A3C3F7D09922D4900E404E9 /* NotificationController.m in Sources */, - B554004109C4E5AA0089E1C3 /* UnisonToolbar.m in Sources */, - 449F03E10BE00DE9003F15C8 /* Bridge.m in Sources */, - 44042CB60BE4FC9B00A6BBB2 /* ProgressCell.m in Sources */, - 445A2A5E0BFAB6C300E4E641 /* ImageAndTextCell.m in Sources */, - 8450B1381918859E00A2C4D6 /* ColorGradientView.m in Sources */, - 849BE500191AC10E001B6FBF /* SSSelectableToolbar.m in Sources */, - 849BE501191AC10E001B6FBF /* SSSelectableToolbarItem.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; + 69C625E90664EC3300B3C46A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 69C625EA0664EC3300B3C46A /* main.m in Sources */, + 69C625EB0664EC3300B3C46A /* MyController.m in Sources */, + 69C625EC0664EC3300B3C46A /* ProfileController.m in Sources */, + 69C625ED0664EC3300B3C46A /* ReconItem.m in Sources */, + 69C625EE0664EC3300B3C46A /* ReconTableView.m in Sources */, + 69C625EF0664EC3300B3C46A /* PreferencesController.m in Sources */, + 69C625F00664EC3300B3C46A /* ProfileTableView.m in Sources */, + 2A3C3F7D09922D4900E404E9 /* NotificationController.m in Sources */, + B554004109C4E5AA0089E1C3 /* UnisonToolbar.m in Sources */, + 449F03E10BE00DE9003F15C8 /* Bridge.m in Sources */, + 44042CB60BE4FC9B00A6BBB2 /* ProgressCell.m in Sources */, + 445A2A5E0BFAB6C300E4E641 /* ImageAndTextCell.m in Sources */, + 8450B1381918859E00A2C4D6 /* ColorGradientView.m in Sources */, + 849BE500191AC10E001B6FBF /* SSSelectableToolbar.m in Sources */, + 849BE501191AC10E001B6FBF /* SSSelectableToolbarItem.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 2A124E800DE1C4E400524237 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 2A124E780DE1C48400524237 /* Create ExternalSettings */; - targetProxy = 2A124E7F0DE1C4E400524237 /* PBXContainerItemProxy */; - }; + 2A124E800DE1C4E400524237 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2A124E780DE1C48400524237 /* Create ExternalSettings */; + targetProxy = 2A124E7F0DE1C4E400524237 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = "<group>"; - }; - DE2444D410C294EA007E1546 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - DE2444D510C294EA007E1546 /* English */, - ); - name = MainMenu.xib; - sourceTree = "<group>"; - }; + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C165DFE840E0CC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = "<group>"; + }; + DE2444D410C294EA007E1546 /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + DE2444D510C294EA007E1546 /* English */, + ); + name = MainMenu.xib; + sourceTree = "<group>"; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 2A124E790DE1C48400524237 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - PRODUCT_NAME = "Create ExternalSettings"; - }; - name = Development; - }; - 2A124E7A0DE1C48400524237 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - PRODUCT_NAME = "Create ExternalSettings"; - ZERO_LINK = NO; - }; - name = Deployment; - }; - 2A124E7B0DE1C48400524237 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "Create ExternalSettings"; - }; - name = Default; - }; - 2A3C3F290992245300E404E9 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(FRAMEWORK_SEARCH_PATHS)", - "$(SRCROOT)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = ""; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ""; - NSZombieEnabled = YES; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-L$(OCAMLLIBDIR)", - "-lunix", - "-lthreadsnat", - "-lcamlstr", - "-lbigarray", - "-lasmrun", - ); - PRODUCT_NAME = Unison; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - ZERO_LINK = YES; - }; - name = Development; - }; - 2A3C3F2A0992245300E404E9 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(FRAMEWORK_SEARCH_PATHS)", - "$(SRCROOT)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = ""; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-L$(OCAMLLIBDIR)", - "-lunix", - "-lthreadsnat", - "-lcamlstr", - "-lbigarray", - "-lasmrun", - ); - PRODUCT_NAME = Unison; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - ZERO_LINK = NO; - }; - name = Deployment; - }; - 2A3C3F2B0992245300E404E9 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - FRAMEWORK_SEARCH_PATHS = ( - "$(FRAMEWORK_SEARCH_PATHS)", - "$(SRCROOT)", - "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", - ); - FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = ""; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-L$(OCAMLLIBDIR)", - "-lunix", - "-lthreadsnat", - "-lcamlstr", - "-lbigarray", - "-lasmrun", - ); - PRODUCT_NAME = Unison; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - ZERO_LINK = NO; - }; - name = Default; - }; - 2A3C3F2D0992245300E404E9 /* Development */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; - buildSettings = { - LIBRARY_SEARCH_PATHS = ""; - SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; - }; - name = Development; - }; - 2A3C3F2E0992245300E404E9 /* Deployment */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; - buildSettings = { - LIBRARY_SEARCH_PATHS = ""; - SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; - }; - name = Deployment; - }; - 2A3C3F2F0992245300E404E9 /* Default */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; - buildSettings = { - LIBRARY_SEARCH_PATHS = ""; - SDKROOT = macosx; - USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; - }; - name = Default; - }; + 2A124E790DE1C48400524237 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = "Create ExternalSettings"; + }; + name = Development; + }; + 2A124E7A0DE1C48400524237 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + PRODUCT_NAME = "Create ExternalSettings"; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 2A124E7B0DE1C48400524237 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "Create ExternalSettings"; + }; + name = Default; + }; + 2A3C3F290992245300E404E9 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(FRAMEWORK_SEARCH_PATHS)", + "$(SRCROOT)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = ""; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ""; + NSZombieEnabled = YES; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-L$(OCAMLLIBDIR)", + "-lunix", + "-lthreadsnat", + "-lcamlstr", + "-lbigarray", + "-lasmrun", + ); + PRODUCT_NAME = Unison; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = app; + ZERO_LINK = YES; + }; + name = Development; + }; + 2A3C3F2A0992245300E404E9 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(FRAMEWORK_SEARCH_PATHS)", + "$(SRCROOT)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = ""; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-L$(OCAMLLIBDIR)", + "-lunix", + "-lthreadsnat", + "-lcamlstr", + "-lbigarray", + "-lasmrun", + ); + PRODUCT_NAME = Unison; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 2A3C3F2B0992245300E404E9 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + FRAMEWORK_SEARCH_PATHS = ( + "$(FRAMEWORK_SEARCH_PATHS)", + "$(SRCROOT)", + "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", + ); + FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = ""; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-L$(OCAMLLIBDIR)", + "-lunix", + "-lthreadsnat", + "-lcamlstr", + "-lbigarray", + "-lasmrun", + ); + PRODUCT_NAME = Unison; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = Default; + }; + 2A3C3F2D0992245300E404E9 /* Development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; + buildSettings = { + LIBRARY_SEARCH_PATHS = ""; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; + }; + name = Development; + }; + 2A3C3F2E0992245300E404E9 /* Deployment */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; + buildSettings = { + LIBRARY_SEARCH_PATHS = ""; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; + }; + name = Deployment; + }; + 2A3C3F2F0992245300E404E9 /* Default */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; + buildSettings = { + LIBRARY_SEARCH_PATHS = ""; + SDKROOT = macosx; + USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; + }; + name = Default; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 2A124E7C0DE1C4A200524237 /* Build configuration list for PBXAggregateTarget "Create ExternalSettings" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2A124E790DE1C48400524237 /* Development */, - 2A124E7A0DE1C48400524237 /* Deployment */, - 2A124E7B0DE1C48400524237 /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; - 2A3C3F280992245300E404E9 /* Build configuration list for PBXNativeTarget "uimac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2A3C3F290992245300E404E9 /* Development */, - 2A3C3F2A0992245300E404E9 /* Deployment */, - 2A3C3F2B0992245300E404E9 /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; - 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2A3C3F2D0992245300E404E9 /* Development */, - 2A3C3F2E0992245300E404E9 /* Deployment */, - 2A3C3F2F0992245300E404E9 /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; + 2A124E7C0DE1C4A200524237 /* Build configuration list for PBXAggregateTarget "Create ExternalSettings" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A124E790DE1C48400524237 /* Development */, + 2A124E7A0DE1C48400524237 /* Deployment */, + 2A124E7B0DE1C48400524237 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 2A3C3F280992245300E404E9 /* Build configuration list for PBXNativeTarget "uimac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A3C3F290992245300E404E9 /* Development */, + 2A3C3F2A0992245300E404E9 /* Deployment */, + 2A3C3F2B0992245300E404E9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A3C3F2D0992245300E404E9 /* Development */, + 2A3C3F2E0992245300E404E9 /* Deployment */, + 2A3C3F2F0992245300E404E9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; /* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; } diff --git a/src/uimacbridge.ml b/src/uimacbridge.ml index 4efff15..b679752 100644 --- a/src/uimacbridge.ml +++ b/src/uimacbridge.ml @@ -22,7 +22,7 @@ let unsynchronizedPaths = ref None;; let unisonDirectory() = System.fspathToPrintString Os.unisonDir ;; Callback.register "unisonDirectory" unisonDirectory;; - + (* Defined in MyController.m, used to redisplay the table when the status for a row changes *) external displayStatus : string -> unit = "displayStatus";; @@ -61,7 +61,7 @@ let unisonInit0() = (* Install an appropriate function for finding preference files. (We put this in Util just because the Prefs module lives below the Os module in the dependency hierarchy, so Prefs can't call Os directly.) *) - Util.supplyFileInUnisonDirFn + Util.supplyFileInUnisonDirFn (fun n -> Os.fileInUnisonDir(n)); (* Display status in GUI instead of on stderr *) let formatStatus major minor = (Util.padto 30 (major ^ " ")) ^ minor in @@ -131,7 +131,7 @@ let unisonInit1 profileName = (* Tell the preferences module the name of the profile *) Prefs.profileName := Some(profileName); - + (* If the profile does not exist, create an empty one (this should only happen if the profile is 'default', since otherwise we will already have checked that the named one exists). *) @@ -206,7 +206,7 @@ let unisonInit2 () = (Clroot.clroot2string (Clroot.parseRoot clr))) (Globals.rawRoots ()); Printf.eprintf " i.e. (in canonical order)\n"; - Safelist.iter (fun r -> + Safelist.iter (fun r -> Printf.eprintf " %s\n" (root2string r)) (Globals.rootsInCanonicalOrder()); Printf.eprintf "\n" @@ -219,9 +219,9 @@ let unisonInit2 () = (* Initializes some backups stuff according to the preferences just loaded from the profile. Important to do it here, after prefs are propagated, because the function will also be run on the server, if any. Also, this should be done each time a profile is reloaded - on this side, that's why it's here. *) + on this side, that's why it's here. *) Stasher.initBackups (); - + (* Turn on GC messages, if the '-debug gc' flag was provided *) if Trace.enabled "gc" then Gc.set {(Gc.get ()) with Gc.verbose = 0x3F}; @@ -359,8 +359,8 @@ let unisonSynchronize () = catch (fun () -> Transport.transportItem theSI.ri (Uutil.File.ofLine i) - (fun title text -> - Trace.status (Printf.sprintf "MERGE %s: %s" title text); true) + (fun title text -> + Trace.status (Printf.sprintf "MERGE %s: %s" title text); true) >>= (fun () -> return Util.Succeeded)) (fun e -> diff --git a/src/uimacbridgenew.ml b/src/uimacbridgenew.ml index 7826f95..e83061c 100644 --- a/src/uimacbridgenew.ml +++ b/src/uimacbridgenew.ml @@ -24,7 +24,7 @@ let unisonDirectory() = System.fspathToString Os.unisonDir ;; Callback.register "unisonDirectory" unisonDirectory;; -(* Global progress indicator, similar to uigtk2.m; *) +(* Global progress indicator, similar to uigtk2.m; *) external displayGlobalProgress : float -> unit = "displayGlobalProgress";; let totalBytesToTransfer = ref Uutil.Filesize.zero;; @@ -34,7 +34,7 @@ let lastFrac = ref 0.;; let showGlobalProgress b = (* Concatenate the new message *) totalBytesTransferred := Uutil.Filesize.add !totalBytesTransferred b; - let v = + let v = if !totalBytesToTransfer = Uutil.Filesize.dummy then 0. else if !totalBytesToTransfer = Uutil.Filesize.zero then 100. else (Uutil.Filesize.percentageOfTotalSize @@ -60,20 +60,20 @@ external displayStatus : string -> unit = "displayStatus";; let displayStatus s = displayStatus (Unicode.protect s);; (* - Called to create callback threads which wait on the C side for callbacks. - (We create three just for good measure...) - - FIXME: the thread created by Thread.create doesn't run even if we yield -- - we have to join. At that point we actually do get a different pthread, but - we've caused the calling thread to block (forever). As a result, this call - never returns. + Called to create callback threads which wait on the C side for callbacks. + (We create three just for good measure...) + + FIXME: the thread created by Thread.create doesn't run even if we yield -- + we have to join. At that point we actually do get a different pthread, but + we've caused the calling thread to block (forever). As a result, this call + never returns. *) -let callbackThreadCreate() = - let tCode () = - bridgeThreadWait 1; - in ignore (Thread.create tCode ()); ignore (Thread.create tCode ()); - let tid = Thread.create tCode () - in Thread.join tid; +let callbackThreadCreate() = + let tCode () = + bridgeThreadWait 1; + in ignore (Thread.create tCode ()); ignore (Thread.create tCode ()); + let tid = Thread.create tCode () + in Thread.join tid; ;; Callback.register "callbackThreadCreate" callbackThreadCreate;; @@ -83,7 +83,7 @@ external displayFatalError : string -> unit = "fatalError";; let fatalError message = Trace.log (message ^ "\n"); displayFatalError message - + (* Defined in MyController.m; display the warning and ask whether to exit or proceed *) external displayWarnPanel : string -> bool = "warnPanel";; @@ -93,10 +93,10 @@ let setWarnPrinter() = Some(fun s -> Trace.log ("Warning: " ^ s ^ "\n"); if not (Prefs.read Globals.batch) then begin - if (displayWarnPanel s) then begin + if (displayWarnPanel s) then begin Lwt_unix.run (Update.unlockArchives ()); exit Uicommon.fatalExit - end + end end) let doInOtherThread f = @@ -145,7 +145,7 @@ let unisonInit0() = (* Install an appropriate function for finding preference files. (We put this in Util just because the Prefs module lives below the Os module in the dependency hierarchy, so Prefs can't call Os directly.) *) - Util.supplyFileInUnisonDirFn + Util.supplyFileInUnisonDirFn (fun n -> Os.fileInUnisonDir(n)); (* Display status in GUI instead of on stderr *) let formatStatus major minor = (Util.padto 30 (major ^ " ")) ^ minor in @@ -205,7 +205,7 @@ Callback.register "unisonInit0" unisonInit0;; (* Utility function to tell the UI whether roots were set *) -let areRootsSet () = +let areRootsSet () = match Globals.rawRoots() with | [] -> false | _ -> true @@ -236,7 +236,7 @@ let do_unisonInit1 profileName = if profileName <> "" then begin (* Tell the preferences module the name of the profile *) Prefs.profileName := Some(profileName); - + (* If the profile does not exist, create an empty one (this should only happen if the profile is 'default', since otherwise we will already have checked that the named one exists). *) @@ -327,7 +327,7 @@ let do_unisonInit2 () = (Clroot.clroot2string (Clroot.parseRoot clr))) (Globals.rawRoots ()); Printf.eprintf " i.e. (in canonical order)\n"; - Safelist.iter (fun r -> + Safelist.iter (fun r -> Printf.eprintf " %s\n" (root2string r)) (Globals.rootsInCanonicalOrder()); Printf.eprintf "\n" @@ -335,7 +335,7 @@ let do_unisonInit2 () = (* Install the warning panel, hopefully it's not too late *) setWarnPrinter(); - + Lwt_unix.run (Uicommon.validateAndFixupPrefs () >>= Globals.propagatePrefs); @@ -343,9 +343,9 @@ let do_unisonInit2 () = (* Initializes some backups stuff according to the preferences just loaded from the profile. Important to do it here, after prefs are propagated, because the function will also be run on the server, if any. Also, this should be done each time a profile is reloaded - on this side, that's why it's here. *) + on this side, that's why it's here. *) Stasher.initBackups (); - + (* Turn on GC messages, if the '-debug gc' flag was provided *) if Trace.enabled "gc" then Gc.set {(Gc.get ()) with Gc.verbose = 0x3F}; @@ -506,7 +506,7 @@ let displayDiffErr err = displayDiffErr (Unicode.protect err) (* If only properties have changed, we can't diff or merge. 'Can't diff' is produced (uicommon.ml) if diff is attemped when either side has PropsChanged *) -let filesAreDifferent status1 status2 = +let filesAreDifferent status1 status2 = match status1, status2 with `PropsChanged, `Unchanged -> false | `Unchanged, `PropsChanged -> false @@ -514,7 +514,7 @@ let filesAreDifferent status1 status2 = | _, _ -> true;; (* check precondition for diff; used to disable diff button *) -let canDiff ri = +let canDiff ri = match ri.ri.replicas with Problem _ -> false | Different {rc1 = {typ = `FILE; status = status1}; @@ -581,8 +581,8 @@ let do_unisonSynchronize () = catch (fun () -> Transport.transportItem theSI.ri (Uutil.File.ofLine i) - (fun title text -> - debug (fun () -> Util.msg "MERGE '%s': '%s'" + (fun title text -> + debug (fun () -> Util.msg "MERGE '%s': '%s'" title text); displayDiff title text; true) >>= (fun () -> @@ -762,10 +762,10 @@ let unisonRiIsConflict ri = | _ -> false;; Callback.register "unisonRiIsConflict" unisonRiIsConflict;; -(* Test whether reconItem's current state is different from - Unison's recommendation. Used to colour arrows in +(* Test whether reconItem's current state is different from + Unison's recommendation. Used to colour arrows in the reconItems table *) -let changedFromDefault ri = +let changedFromDefault ri = match ri.ri.replicas with Different diff -> diff.direction <> diff.default_direction | _ -> false;; @@ -798,4 +798,3 @@ let unisonExnInfo e = | _ -> Printexc.to_string e;; Callback.register "unisonExnInfo" (fun e -> Unicode.protect (unisonExnInfo e));; - diff --git a/src/uimacnew/Bridge.h b/src/uimacnew/Bridge.h index 7657b80..4c15602 100644 --- a/src/uimacnew/Bridge.h +++ b/src/uimacnew/Bridge.h @@ -8,51 +8,51 @@ #import <Cocoa/Cocoa.h> /* - Bridge supports safe calling from C back to OCaml by using daemon threads - spawned from OCaml to make the actual calls and converting all argument / return values - in the OCaml thread (when in possession of the OCaml lock) + Bridge supports safe calling from C back to OCaml by using daemon threads + spawned from OCaml to make the actual calls and converting all argument / return values + in the OCaml thread (when in possession of the OCaml lock) */ @interface Bridge : NSObject { } -+ (void)startup:(const char **)argv; ++ (void)startup:(const char **)argv; @end /* - ocamlCall(sig, funcName, [args...]); - - Call ocaml function (via safe thread handoff mechanism). - Args/return values are converted to/from C/OCaml according to the - supplied type signture string. Type codes are: - x - void (for return type) - i - long - s - char * - S - NSString * + ocamlCall(sig, funcName, [args...]); + + Call ocaml function (via safe thread handoff mechanism). + Args/return values are converted to/from C/OCaml according to the + supplied type signture string. Type codes are: + x - void (for return type) + i - long + s - char * + S - NSString * N - NSNumber * - @ - OCamlValue (see below) - - Examples: - long count = (long)ocamlCall("iS", "lengthOfString", @"Some String"); - - (void)ocamlCall("x", "someVoidOCamlFunction"); - - OCamlValue *v = (id)ocamlCall("@Si", "makeArray", @"Some String", 10); - NSString s = [v getField:0 withType:'S']; + @ - OCamlValue (see below) + + Examples: + long count = (long)ocamlCall("iS", "lengthOfString", @"Some String"); + + (void)ocamlCall("x", "someVoidOCamlFunction"); + + OCamlValue *v = (id)ocamlCall("@Si", "makeArray", @"Some String", 10); + NSString s = [v getField:0 withType:'S']; */ extern void *ocamlCall(const char *argTypes, ...); // Wrapper/proxy for unconverted OCaml values @interface OCamlValue : NSObject { - long _v; + long _v; } - initWithValue:(long)v; - (void *)getField:(long)i withType:(char)t; - // get value by position. See ocamlCall for list of type conversion codes - + // get value by position. See ocamlCall for list of type conversion codes + - (long)count; - // count of items in array - + // count of items in array + - (long)value; - // returns Ocaml value directly -- not safe to use except in direct callback from OCaml - // (i.e. in the OCaml thread) + // returns Ocaml value directly -- not safe to use except in direct callback from OCaml + // (i.e. in the OCaml thread) @end diff --git a/src/uimacnew/Bridge.m b/src/uimacnew/Bridge.m index affba25..3b8deb4 100644 --- a/src/uimacnew/Bridge.m +++ b/src/uimacnew/Bridge.m @@ -25,18 +25,18 @@ #include <stdarg.h> /* - CMF, April 2007: Alternate strategy for solving UI crashes based on + CMF, April 2007: Alternate strategy for solving UI crashes based on http://alan.petitepomme.net/cwn/2005.03.08.html#9: 1) Run OCaml in a separate thread from the Cocoa main run loop. 2) Handle all calls to OCaml as callbacks -- have an OCaml thread hang in C-land and use mutexes and conditions to pass control from the C calling thread to the OCaml callback thread. - + Value Conversion Done in Bridge Thread: - Value creation/conversion (like calls to caml_named_value or caml_copy_string) + Value creation/conversion (like calls to caml_named_value or caml_copy_string) or access calls (like Field) need to occur in the OCaml thread. We do this by passing C args for conversion to the bridgeThreadWait() thread. - + Example of vulnerability: Field(caml_reconItems,j) could dereference caml_reconItems when the GC (running independently in an OCaml thread) could be moving it. @@ -60,45 +60,45 @@ const char **the_argv; { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - pthread_mutex_lock(&init_lock); + pthread_mutex_lock(&init_lock); /* Initialize ocaml gc, etc. */ caml_startup((char **)the_argv); // cast to avoid warning, caml_startup assumes non-const, // NSApplicationMain assumes const - - // Register these with the collector - // NSLog(@"*** _ocamlStartup - back from startup; signalling! (%d)", pthread_self()); + + // Register these with the collector + // NSLog(@"*** _ocamlStartup - back from startup; signalling! (%d)", pthread_self()); doneInit = TRUE; - pthread_cond_signal(&init_cond); - pthread_mutex_unlock(&init_lock); - - // now start the callback thread - // NSLog(@"*** _ocamlStartup - calling callbackThreadCreate (%d)", pthread_self()); - value *f = caml_named_value("callbackThreadCreate"); - (void)caml_callback_exn(*f,Val_unit); + pthread_cond_signal(&init_cond); + pthread_mutex_unlock(&init_lock); + + // now start the callback thread + // NSLog(@"*** _ocamlStartup - calling callbackThreadCreate (%d)", pthread_self()); + value *f = caml_named_value("callbackThreadCreate"); + (void)caml_callback_exn(*f,Val_unit); [pool release]; } + (void)startup:(const char **)argv { - if (_instance) return; - - _instance = [[Bridge alloc] init]; - - [[NSExceptionHandler defaultExceptionHandler] setDelegate:_instance]; - [[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask: - (NSLogUncaughtExceptionMask | NSLogTopLevelExceptionMask)]; - - // Init OCaml in another thread and wait for it to be ready - pthread_mutex_lock(&init_lock); - the_argv = argv; - [NSThread detachNewThreadSelector:@selector(_ocamlStartup:) - toTarget:_instance withObject:nil]; - - // NSLog(@"*** waiting for completion of caml_init"); - while (!doneInit) pthread_cond_wait(&init_cond, &init_lock); - pthread_mutex_unlock(&init_lock); - // NSLog(@"*** caml_init complete!"); + if (_instance) return; + + _instance = [[Bridge alloc] init]; + + [[NSExceptionHandler defaultExceptionHandler] setDelegate:_instance]; + [[NSExceptionHandler defaultExceptionHandler] setExceptionHandlingMask: + (NSLogUncaughtExceptionMask | NSLogTopLevelExceptionMask)]; + + // Init OCaml in another thread and wait for it to be ready + pthread_mutex_lock(&init_lock); + the_argv = argv; + [NSThread detachNewThreadSelector:@selector(_ocamlStartup:) + toTarget:_instance withObject:nil]; + + // NSLog(@"*** waiting for completion of caml_init"); + while (!doneInit) pthread_cond_wait(&init_cond, &init_lock); + pthread_mutex_unlock(&init_lock); + // NSLog(@"*** caml_init complete!"); } #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 @@ -106,14 +106,14 @@ typedef unsigned int NSUInteger; #endif - (BOOL)exceptionHandler:(NSExceptionHandler *)sender shouldLogException:(NSException *)exception mask:(NSUInteger)aMask { - // if (![[exception name] isEqual:@"OCamlException"]) return YES; - + // if (![[exception name] isEqual:@"OCamlException"]) return YES; + NSString *msg = [NSString stringWithFormat:@"Uncaught exception: %@", [exception reason]]; msg = [[msg componentsSeparatedByString:@"\n"] componentsJoinedByString:@" "]; NSLog(@"%@", msg); NSRunAlertPanel(@"Fatal error", msg, @"Exit", nil, nil); - exit(1); - return FALSE; + exit(1); + return FALSE; } @end @@ -122,25 +122,25 @@ typedef unsigned int NSUInteger; // CallState struct is allocated on the C thread stack and then handed // to the OCaml callback thread to perform value conversion and issue the call typedef struct { - enum { SafeCall, OldCall, FieldAccess } opCode; - - // New style calls - const char *argTypes; - va_list args; - - // Field access - value *valueP; - long fieldIndex; - char fieldType; - - // Return values - char *exception; - void *retV; - BOOL _autorelease; - - // for old style (unsafe) calls - value call, a1, a2, a3, ret; - int argCount; + enum { SafeCall, OldCall, FieldAccess } opCode; + + // New style calls + const char *argTypes; + va_list args; + + // Field access + value *valueP; + long fieldIndex; + char fieldType; + + // Return values + char *exception; + void *retV; + BOOL _autorelease; + + // for old style (unsafe) calls + value call, a1, a2, a3, ret; + int argCount; } CallState; static CallState *_CallState = NULL; @@ -153,193 +153,193 @@ CAMLprim value bridgeThreadWait(value ignore) CAMLparam0(); CAMLlocal1 (args); args = caml_alloc_tuple(3); - - // NSLog(@"*** bridgeThreadWait init! (%d) Taking lock...", pthread_self()); - while (TRUE) { - // unblock ocaml while we wait for work - caml_enter_blocking_section(); - - pthread_mutex_lock(&global_call_lock); - while (!_CallState) pthread_cond_wait(&global_call_cond, &global_call_lock); - - // pick up our work and free up the call lock for other threads - CallState *cs = _CallState; - _CallState = NULL; - pthread_mutex_unlock(&global_call_lock); - - // NSLog(@"*** bridgeThreadWait: have call -- leaving caml_blocking_section"); - - // we have a call to do -- get the ocaml lock - caml_leave_blocking_section(); - - // NSLog(@"*** bridgeThreadWait: doing call"); + + // NSLog(@"*** bridgeThreadWait init! (%d) Taking lock...", pthread_self()); + while (TRUE) { + // unblock ocaml while we wait for work + caml_enter_blocking_section(); + + pthread_mutex_lock(&global_call_lock); + while (!_CallState) pthread_cond_wait(&global_call_cond, &global_call_lock); + + // pick up our work and free up the call lock for other threads + CallState *cs = _CallState; + _CallState = NULL; + pthread_mutex_unlock(&global_call_lock); + + // NSLog(@"*** bridgeThreadWait: have call -- leaving caml_blocking_section"); + + // we have a call to do -- get the ocaml lock + caml_leave_blocking_section(); + + // NSLog(@"*** bridgeThreadWait: doing call"); NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - char retType = 'v'; - value e = Val_unit; - if (cs->opCode == SafeCall) { + char retType = 'v'; + value e = Val_unit; + if (cs->opCode == SafeCall) { int i; - char *fname = va_arg(cs->args, char *); - value *f = caml_named_value(fname); - // varargs with C-based args -- convert them to OCaml values based on type code string - const char *p = cs->argTypes; - retType = *p++; - int argCount = 0; - for(; *p != '\0'; p++) { - const char *str; - switch (*p) { - case 's': - str = va_arg(cs->args, const char *); - Store_field (args, argCount, caml_copy_string(str)); - break; - case 'S': - str = [va_arg(cs->args, NSString *) UTF8String]; - Store_field (args, argCount, caml_copy_string(str)); - break; - case 'i': + char *fname = va_arg(cs->args, char *); + value *f = caml_named_value(fname); + // varargs with C-based args -- convert them to OCaml values based on type code string + const char *p = cs->argTypes; + retType = *p++; + int argCount = 0; + for(; *p != '\0'; p++) { + const char *str; + switch (*p) { + case 's': + str = va_arg(cs->args, const char *); + Store_field (args, argCount, caml_copy_string(str)); + break; + case 'S': + str = [va_arg(cs->args, NSString *) UTF8String]; + Store_field (args, argCount, caml_copy_string(str)); + break; + case 'i': Store_field (args, argCount, Val_long(va_arg(cs->args, long))); - break; - case '@': + break; + case '@': Store_field (args, argCount, [va_arg(cs->args, OCamlValue *) value]); - break; + break; default: NSCAssert1(0, @"Unknown input type '%c'", *p); - break; - } - argCount++; + break; + } + argCount++; NSCAssert(argCount <= 3, @"More than 3 arguments"); - } - // Call OCaml -- TODO: add support for > 3 args - if (argCount == 3) e = caml_callback3_exn(*f,Field(args,0),Field(args,1),Field(args,2)); - else if (argCount == 2) e = caml_callback2_exn(*f,Field(args,0),Field(args,1)); - else if (argCount == 1) e = caml_callback_exn(*f,Field(args,0)); - else e = caml_callback_exn(*f,Val_unit); + } + // Call OCaml -- TODO: add support for > 3 args + if (argCount == 3) e = caml_callback3_exn(*f,Field(args,0),Field(args,1),Field(args,2)); + else if (argCount == 2) e = caml_callback2_exn(*f,Field(args,0),Field(args,1)); + else if (argCount == 1) e = caml_callback_exn(*f,Field(args,0)); + else e = caml_callback_exn(*f,Val_unit); for (i = 0; i < argCount; i++) Store_field (args, i, Val_unit); - } else if (cs->opCode == OldCall) { - // old style (unsafe) version where OCaml values were passed directly from C thread - if (cs->argCount == 3) e = caml_callback3_exn(cs->call,cs->a1,cs->a2,cs->a3); - else if (cs->argCount == 2) e = caml_callback2_exn(cs->call,cs->a1,cs->a2); - else e = caml_callback_exn(cs->call,cs->a1); - retType = 'v'; - } else if (cs->opCode == FieldAccess) { - long index = cs->fieldIndex; - e = (index == -1) ? Val_long(Wosize_val(*cs->valueP)) : Field(*cs->valueP, index); - retType = cs->fieldType; - } - - // Process return value - cs->_autorelease = FALSE; - cs->ret = e; // OCaml return type -- unsafe... - if (!Is_exception_result(e)) { - switch (retType) { - case 'S': - *((NSString **)&cs->retV) = (e == Val_unit) ? NULL : [[NSString alloc] initWithUTF8String:String_val(e)]; - cs->_autorelease = TRUE; - break; - case 'N': + } else if (cs->opCode == OldCall) { + // old style (unsafe) version where OCaml values were passed directly from C thread + if (cs->argCount == 3) e = caml_callback3_exn(cs->call,cs->a1,cs->a2,cs->a3); + else if (cs->argCount == 2) e = caml_callback2_exn(cs->call,cs->a1,cs->a2); + else e = caml_callback_exn(cs->call,cs->a1); + retType = 'v'; + } else if (cs->opCode == FieldAccess) { + long index = cs->fieldIndex; + e = (index == -1) ? Val_long(Wosize_val(*cs->valueP)) : Field(*cs->valueP, index); + retType = cs->fieldType; + } + + // Process return value + cs->_autorelease = FALSE; + cs->ret = e; // OCaml return type -- unsafe... + if (!Is_exception_result(e)) { + switch (retType) { + case 'S': + *((NSString **)&cs->retV) = (e == Val_unit) ? NULL : [[NSString alloc] initWithUTF8String:String_val(e)]; + cs->_autorelease = TRUE; + break; + case 'N': if (Is_long (e)) { - *((NSNumber **)&cs->retV) = [[NSNumber alloc] initWithLong:Long_val(e)]; + *((NSNumber **)&cs->retV) = [[NSNumber alloc] initWithLong:Long_val(e)]; } else { - *((NSNumber **)&cs->retV) = [[NSNumber alloc] initWithDouble:Double_val(e)]; + *((NSNumber **)&cs->retV) = [[NSNumber alloc] initWithDouble:Double_val(e)]; } - cs->_autorelease = TRUE; - break; - case '@': - *((NSObject **)&cs->retV) = (e == Val_unit) ? NULL : [[OCamlValue alloc] initWithValue:e]; - cs->_autorelease = TRUE; - break; - case 'i': - *((long *)&cs->retV) = Long_val(e); - break; - case 'x': + cs->_autorelease = TRUE; + break; + case '@': + *((NSObject **)&cs->retV) = (e == Val_unit) ? NULL : [[OCamlValue alloc] initWithValue:e]; + cs->_autorelease = TRUE; + break; + case 'i': + *((long *)&cs->retV) = Long_val(e); + break; + case 'x': break; default: NSCAssert1(0, @"Unknown return type '%c'", retType); break; - } - } + } + } - if (Is_exception_result(e)) { - // get exception string -- it will get thrown back in the calling thread - value *f = caml_named_value("unisonExnInfo"); + if (Is_exception_result(e)) { + // get exception string -- it will get thrown back in the calling thread + value *f = caml_named_value("unisonExnInfo"); // We leak memory here... cs->exception = strdup(String_val(caml_callback(*f,Extract_exception(e)))); - } - - [pool release]; - - // NSLog(@"*** bridgeThreadWait: returning"); - - // we're done, signal back - pthread_mutex_lock(&global_res_lock); - _RetState = cs; - pthread_cond_signal(&global_res_cond); - pthread_mutex_unlock(&global_res_lock); - } - // Never get here... + } + + [pool release]; + + // NSLog(@"*** bridgeThreadWait: returning"); + + // we're done, signal back + pthread_mutex_lock(&global_res_lock); + _RetState = cs; + pthread_cond_signal(&global_res_cond); + pthread_mutex_unlock(&global_res_lock); + } + // Never get here... CAMLreturn (Val_unit); } void *_passCall(CallState *cs) { pthread_mutex_lock(&global_call_lock); - _CallState = cs; - - // signal so call can happen on other thread - pthread_mutex_lock(&global_res_lock); - pthread_cond_signal(&global_call_cond); - pthread_mutex_unlock(&global_call_lock); - - // NSLog(@"*** _passCall (%d) -- performing signal and waiting", pthread_self()); - - // wait until done -- make sure the result is for our call - while (_RetState != cs) pthread_cond_wait(&global_res_cond, &global_res_lock); - _RetState = NULL; - pthread_mutex_unlock(&global_res_lock); - - // NSLog(@"*** doCallback -- back with result"); - if (cs->exception) { - @throw [NSException exceptionWithName:@"OCamlException" - reason:[NSString stringWithUTF8String:cs->exception] - userInfo:nil]; - } - if (cs->_autorelease) [((id)cs->retV) autorelease]; + _CallState = cs; + + // signal so call can happen on other thread + pthread_mutex_lock(&global_res_lock); + pthread_cond_signal(&global_call_cond); + pthread_mutex_unlock(&global_call_lock); + + // NSLog(@"*** _passCall (%d) -- performing signal and waiting", pthread_self()); + + // wait until done -- make sure the result is for our call + while (_RetState != cs) pthread_cond_wait(&global_res_cond, &global_res_lock); + _RetState = NULL; + pthread_mutex_unlock(&global_res_lock); + + // NSLog(@"*** doCallback -- back with result"); + if (cs->exception) { + @throw [NSException exceptionWithName:@"OCamlException" + reason:[NSString stringWithUTF8String:cs->exception] + userInfo:nil]; + } + if (cs->_autorelease) [((id)cs->retV) autorelease]; return cs->retV; } void *ocamlCall(const char *argTypes, ...) { - CallState cs; - cs.opCode = SafeCall; - cs.exception = NULL; - cs.argTypes = argTypes; - va_start(cs.args, argTypes); - void * res = _passCall(&cs); - - va_end(cs.args); - return res; + CallState cs; + cs.opCode = SafeCall; + cs.exception = NULL; + cs.argTypes = argTypes; + va_start(cs.args, argTypes); + void * res = _passCall(&cs); + + va_end(cs.args); + return res; } void *getField(value *vP, long index, char type) { - CallState cs; - cs.opCode = FieldAccess; - cs.valueP = vP; - cs.fieldIndex = index; - cs.fieldType = type; - cs.exception = NULL; - return _passCall(&cs); + CallState cs; + cs.opCode = FieldAccess; + cs.valueP = vP; + cs.fieldIndex = index; + cs.fieldType = type; + cs.exception = NULL; + return _passCall(&cs); } @implementation OCamlValue - initWithValue:(long)v { - [super init]; - _v = v; - caml_register_global_root((value *)&_v); - return self; + [super init]; + _v = v; + caml_register_global_root((value *)&_v); + return self; } - (long)count @@ -354,15 +354,15 @@ void *getField(value *vP, long index, char type) - (long)value { - // Unsafe to use! - return _v; + // Unsafe to use! + return _v; } - (void)dealloc { - _v = Val_unit; + _v = Val_unit; caml_remove_global_root((value *)&_v); - [super dealloc]; + [super dealloc]; } @end @@ -384,24 +384,24 @@ void reportExn(const char *msg) { // FIXME! Claim is that value conversion must also happen in the OCaml thread... value doCallback (value c, int argcount, value v1, value v2, value v3, BOOL exitOnException) { - // NSLog(@"*** doCallback: (%d) -- trying to acquire global lock", pthread_self()); - CallState cs; - cs.opCode = OldCall; - cs.exception = NULL; - cs.call = c; - cs.a1 = v1; - cs.a2 = v2; - cs.a3 = v3; - cs.argCount = argcount; - @try { - return _passCall(&cs); - } @catch (NSException *ex) { - if (exitOnException) { - reportExn(cs.exception); - exit(1); - } - @throw ex; - } + // NSLog(@"*** doCallback: (%d) -- trying to acquire global lock", pthread_self()); + CallState cs; + cs.opCode = OldCall; + cs.exception = NULL; + cs.call = c; + cs.a1 = v1; + cs.a2 = v2; + cs.a3 = v3; + cs.argCount = argcount; + @try { + return _passCall(&cs); + } @catch (NSException *ex) { + if (exitOnException) { + reportExn(cs.exception); + exit(1); + } + @throw ex; + } } value Callback_checkexn(value c,value v) { diff --git a/src/uimacnew/English.lproj/MainMenu.nib/classes.nib b/src/uimacnew/English.lproj/MainMenu.nib/classes.nib index 8c06bbc..1eb9865 100644 --- a/src/uimacnew/English.lproj/MainMenu.nib/classes.nib +++ b/src/uimacnew/English.lproj/MainMenu.nib/classes.nib @@ -2,266 +2,266 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>IBClasses</key> - <array> - <dict> - <key>CLASS</key> - <string>NSSegmentedControl</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>SUPERCLASS</key> - <string>NSControl</string> - </dict> - <dict> - <key>CLASS</key> - <string>NSOutlineView</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>SUPERCLASS</key> - <string>NSTableView</string> - </dict> - <dict> - <key>CLASS</key> - <string>ProfileTableView</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>OUTLETS</key> - <dict> - <key>myController</key> - <string>MyController</string> - </dict> - <key>SUPERCLASS</key> - <string>NSTableView</string> - </dict> - <dict> - <key>CLASS</key> - <string>ProfileController</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>OUTLETS</key> - <dict> - <key>tableView</key> - <string>NSTableView</string> - </dict> - <key>SUPERCLASS</key> - <string>NSObject</string> - </dict> - <dict> - <key>CLASS</key> - <string>NotificationController</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>SUPERCLASS</key> - <string>NSObject</string> - </dict> - <dict> - <key>ACTIONS</key> - <dict> - <key>anyEnter</key> - <string>id</string> - <key>localClick</key> - <string>id</string> - <key>remoteClick</key> - <string>id</string> - </dict> - <key>CLASS</key> - <string>PreferencesController</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>OUTLETS</key> - <dict> - <key>firstRootText</key> - <string>NSTextField</string> - <key>localButtonCell</key> - <string>NSButtonCell</string> - <key>profileNameText</key> - <string>NSTextField</string> - <key>remoteButtonCell</key> - <string>NSButtonCell</string> - <key>secondRootHost</key> - <string>NSTextField</string> - <key>secondRootText</key> - <string>NSTextField</string> - <key>secondRootUser</key> - <string>NSTextField</string> - </dict> - <key>SUPERCLASS</key> - <string>NSObject</string> - </dict> - <dict> - <key>ACTIONS</key> - <dict> - <key>copyLR</key> - <string>id</string> - <key>copyRL</key> - <string>id</string> - <key>forceNewer</key> - <string>id</string> - <key>forceOlder</key> - <string>id</string> - <key>ignoreExt</key> - <string>id</string> - <key>ignoreName</key> - <string>id</string> - <key>ignorePath</key> - <string>id</string> - <key>leaveAlone</key> - <string>id</string> - <key>merge</key> - <string>id</string> - <key>revert</key> - <string>id</string> - <key>selectConflicts</key> - <string>id</string> - <key>showDiff</key> - <string>id</string> - </dict> - <key>CLASS</key> - <string>FirstResponder</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>SUPERCLASS</key> - <string>NSObject</string> - </dict> - <dict> - <key>CLASS</key> - <string>MessageProgressIndicator</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>SUPERCLASS</key> - <string>NSProgressIndicator</string> - </dict> - <dict> - <key>ACTIONS</key> - <dict> - <key>cancelProfileButton</key> - <string>id</string> - <key>cltoolNoButton</key> - <string>id</string> - <key>cltoolYesButton</key> - <string>id</string> - <key>createButton</key> - <string>id</string> - <key>endPasswordWindow</key> - <string>id</string> - <key>installCommandLineTool</key> - <string>id</string> - <key>onlineHelp</key> - <string>id</string> - <key>openButton</key> - <string>id</string> - <key>raiseAboutWindow</key> - <string>id</string> - <key>raiseCltoolWindow</key> - <string>id</string> - <key>raiseWindow</key> - <string>NSWindow</string> - <key>rescan</key> - <string>id</string> - <key>restartButton</key> - <string>id</string> - <key>saveProfileButton</key> - <string>id</string> - <key>syncButton</key> - <string>id</string> - <key>tableModeChanged</key> - <string>id</string> - </dict> - <key>CLASS</key> - <string>MyController</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>OUTLETS</key> - <dict> - <key>ConnectingView</key> - <string>NSView</string> - <key>aboutWindow</key> - <string>NSWindow</string> - <key>chooseProfileView</key> - <string>NSView</string> - <key>cltoolPref</key> - <string>NSButton</string> - <key>cltoolWindow</key> - <string>NSWindow</string> - <key>detailsTextView</key> - <string>NSTextView</string> - <key>diffView</key> - <string>NSTextView</string> - <key>diffWindow</key> - <string>NSWindow</string> - <key>mainWindow</key> - <string>NSWindow</string> - <key>notificationController</key> - <string>NotificationController</string> - <key>passwordCancelButton</key> - <string>NSButton</string> - <key>passwordPrompt</key> - <string>NSTextField</string> - <key>passwordText</key> - <string>NSTextField</string> - <key>passwordWindow</key> - <string>NSWindow</string> - <key>preferencesController</key> - <string>PreferencesController</string> - <key>preferencesView</key> - <string>NSView</string> - <key>profileController</key> - <string>ProfileController</string> - <key>progressBar</key> - <string>NSProgressIndicator</string> - <key>statusText</key> - <string>NSTextField</string> - <key>tableModeSelector</key> - <string>NSSegmentedControl</string> - <key>tableView</key> - <string>ReconTableView</string> - <key>updatesText</key> - <string>NSTextField</string> - <key>updatesView</key> - <string>NSView</string> - <key>versionText</key> - <string>NSTextField</string> - </dict> - <key>SUPERCLASS</key> - <string>NSObject</string> - </dict> - <dict> - <key>ACTIONS</key> - <dict> - <key>copyLR</key> - <string>id</string> - <key>copyRL</key> - <string>id</string> - <key>forceNewer</key> - <string>id</string> - <key>forceOlder</key> - <string>id</string> - <key>ignoreExt</key> - <string>id</string> - <key>ignoreName</key> - <string>id</string> - <key>ignorePath</key> - <string>id</string> - <key>leaveAlone</key> - <string>id</string> - <key>merge</key> - <string>id</string> - <key>revert</key> - <string>id</string> - <key>selectConflicts</key> - <string>id</string> - <key>showDiff</key> - <string>id</string> - </dict> - <key>CLASS</key> - <string>ReconTableView</string> - <key>LANGUAGE</key> - <string>ObjC</string> - <key>SUPERCLASS</key> - <string>NSOutlineView</string> - </dict> - </array> - <key>IBVersion</key> - <string>1</string> + <key>IBClasses</key> + <array> + <dict> + <key>CLASS</key> + <string>NSSegmentedControl</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSControl</string> + </dict> + <dict> + <key>CLASS</key> + <string>NSOutlineView</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSTableView</string> + </dict> + <dict> + <key>CLASS</key> + <string>ProfileTableView</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>OUTLETS</key> + <dict> + <key>myController</key> + <string>MyController</string> + </dict> + <key>SUPERCLASS</key> + <string>NSTableView</string> + </dict> + <dict> + <key>CLASS</key> + <string>ProfileController</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>OUTLETS</key> + <dict> + <key>tableView</key> + <string>NSTableView</string> + </dict> + <key>SUPERCLASS</key> + <string>NSObject</string> + </dict> + <dict> + <key>CLASS</key> + <string>NotificationController</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSObject</string> + </dict> + <dict> + <key>ACTIONS</key> + <dict> + <key>anyEnter</key> + <string>id</string> + <key>localClick</key> + <string>id</string> + <key>remoteClick</key> + <string>id</string> + </dict> + <key>CLASS</key> + <string>PreferencesController</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>OUTLETS</key> + <dict> + <key>firstRootText</key> + <string>NSTextField</string> + <key>localButtonCell</key> + <string>NSButtonCell</string> + <key>profileNameText</key> + <string>NSTextField</string> + <key>remoteButtonCell</key> + <string>NSButtonCell</string> + <key>secondRootHost</key> + <string>NSTextField</string> + <key>secondRootText</key> + <string>NSTextField</string> + <key>secondRootUser</key> + <string>NSTextField</string> + </dict> + <key>SUPERCLASS</key> + <string>NSObject</string> + </dict> + <dict> + <key>ACTIONS</key> + <dict> + <key>copyLR</key> + <string>id</string> + <key>copyRL</key> + <string>id</string> + <key>forceNewer</key> + <string>id</string> + <key>forceOlder</key> + <string>id</string> + <key>ignoreExt</key> + <string>id</string> + <key>ignoreName</key> + <string>id</string> + <key>ignorePath</key> + <string>id</string> + <key>leaveAlone</key> + <string>id</string> + <key>merge</key> + <string>id</string> + <key>revert</key> + <string>id</string> + <key>selectConflicts</key> + <string>id</string> + <key>showDiff</key> + <string>id</string> + </dict> + <key>CLASS</key> + <string>FirstResponder</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSObject</string> + </dict> + <dict> + <key>CLASS</key> + <string>MessageProgressIndicator</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSProgressIndicator</string> + </dict> + <dict> + <key>ACTIONS</key> + <dict> + <key>cancelProfileButton</key> + <string>id</string> + <key>cltoolNoButton</key> + <string>id</string> + <key>cltoolYesButton</key> + <string>id</string> + <key>createButton</key> + <string>id</string> + <key>endPasswordWindow</key> + <string>id</string> + <key>installCommandLineTool</key> + <string>id</string> + <key>onlineHelp</key> + <string>id</string> + <key>openButton</key> + <string>id</string> + <key>raiseAboutWindow</key> + <string>id</string> + <key>raiseCltoolWindow</key> + <string>id</string> + <key>raiseWindow</key> + <string>NSWindow</string> + <key>rescan</key> + <string>id</string> + <key>restartButton</key> + <string>id</string> + <key>saveProfileButton</key> + <string>id</string> + <key>syncButton</key> + <string>id</string> + <key>tableModeChanged</key> + <string>id</string> + </dict> + <key>CLASS</key> + <string>MyController</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>OUTLETS</key> + <dict> + <key>ConnectingView</key> + <string>NSView</string> + <key>aboutWindow</key> + <string>NSWindow</string> + <key>chooseProfileView</key> + <string>NSView</string> + <key>cltoolPref</key> + <string>NSButton</string> + <key>cltoolWindow</key> + <string>NSWindow</string> + <key>detailsTextView</key> + <string>NSTextView</string> + <key>diffView</key> + <string>NSTextView</string> + <key>diffWindow</key> + <string>NSWindow</string> + <key>mainWindow</key> + <string>NSWindow</string> + <key>notificationController</key> + <string>NotificationController</string> + <key>passwordCancelButton</key> + <string>NSButton</string> + <key>passwordPrompt</key> + <string>NSTextField</string> + <key>passwordText</key> + <string>NSTextField</string> + <key>passwordWindow</key> + <string>NSWindow</string> + <key>preferencesController</key> + <string>PreferencesController</string> + <key>preferencesView</key> + <string>NSView</string> + <key>profileController</key> + <string>ProfileController</string> + <key>progressBar</key> + <string>NSProgressIndicator</string> + <key>statusText</key> + <string>NSTextField</string> + <key>tableModeSelector</key> + <string>NSSegmentedControl</string> + <key>tableView</key> + <string>ReconTableView</string> + <key>updatesText</key> + <string>NSTextField</string> + <key>updatesView</key> + <string>NSView</string> + <key>versionText</key> + <string>NSTextField</string> + </dict> + <key>SUPERCLASS</key> + <string>NSObject</string> + </dict> + <dict> + <key>ACTIONS</key> + <dict> + <key>copyLR</key> + <string>id</string> + <key>copyRL</key> + <string>id</string> + <key>forceNewer</key> + <string>id</string> + <key>forceOlder</key> + <string>id</string> + <key>ignoreExt</key> + <string>id</string> + <key>ignoreName</key> + <string>id</string> + <key>ignorePath</key> + <string>id</string> + <key>leaveAlone</key> + <string>id</string> + <key>merge</key> + <string>id</string> + <key>revert</key> + <string>id</string> + <key>selectConflicts</key> + <string>id</string> + <key>showDiff</key> + <string>id</string> + </dict> + <key>CLASS</key> + <string>ReconTableView</string> + <key>LANGUAGE</key> + <string>ObjC</string> + <key>SUPERCLASS</key> + <string>NSOutlineView</string> + </dict> + </array> + <key>IBVersion</key> + <string>1</string> </dict> </plist> diff --git a/src/uimacnew/English.lproj/MainMenu.nib/info.nib b/src/uimacnew/English.lproj/MainMenu.nib/info.nib index 51d240e..fa90620 100644 --- a/src/uimacnew/English.lproj/MainMenu.nib/info.nib +++ b/src/uimacnew/English.lproj/MainMenu.nib/info.nib @@ -2,25 +2,25 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>IBFramework Version</key> - <string>677</string> - <key>IBLastKnownRelativeProjectPath</key> - <string>../uimacnew.xcodeproj</string> - <key>IBOldestOS</key> - <integer>5</integer> - <key>IBOpenObjects</key> - <array> - <integer>198</integer> - <integer>29</integer> - <integer>197</integer> - <integer>423</integer> - <integer>2</integer> - <integer>307</integer> - <integer>402</integer> - </array> - <key>IBSystem Version</key> - <string>9L30</string> - <key>targetFramework</key> - <string>IBCocoaFramework</string> + <key>IBFramework Version</key> + <string>677</string> + <key>IBLastKnownRelativeProjectPath</key> + <string>../uimacnew.xcodeproj</string> + <key>IBOldestOS</key> + <integer>5</integer> + <key>IBOpenObjects</key> + <array> + <integer>198</integer> + <integer>29</integer> + <integer>197</integer> + <integer>423</integer> + <integer>2</integer> + <integer>307</integer> + <integer>402</integer> + </array> + <key>IBSystem Version</key> + <string>9L30</string> + <key>targetFramework</key> + <string>IBCocoaFramework</string> </dict> </plist> diff --git a/src/uimacnew/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h b/src/uimacnew/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h index fb70509..22ccf5e 100644 --- a/src/uimacnew/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h +++ b/src/uimacnew/Growl.framework/Versions/A/Headers/GrowlApplicationBridge-Carbon.h @@ -53,170 +53,170 @@ __BEGIN_DECLS * @field growlNotificationTimedOut Called when a Growl notification timed out. */ struct Growl_Delegate { - /* @discussion This should be sizeof(struct Growl_Delegate). - */ - size_t size; - - /*All of these attributes are optional. - *Optional attributes can be NULL; required attributes that - * are NULL cause setting the Growl delegate to fail. - *XXX - move optional/required status into the discussion for each field - */ - - /* This name is used both internally and in the Growl preferences. - * - * This should remain stable between different versions and incarnations of - * your application. - * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and - * "SurfWriter Lite" are not. - * - * This can be <code>NULL</code> if it is provided elsewhere, namely in an - * auto-discoverable plist file in your app bundle - * (XXX refer to more information on that) or in registrationDictionary. - */ - CFStringRef applicationName; - - /* - * Must contain at least these keys: - * GROWL_NOTIFICATIONS_ALL (CFArray): - * Contains the names of all notifications your application may post. - * - * Can also contain these keys: - * GROWL_NOTIFICATIONS_DEFAULT (CFArray): - * Names of notifications that should be enabled by default. - * If omitted, GROWL_NOTIFICATIONS_ALL will be used. - * GROWL_APP_NAME (CFString): - * Same as the applicationName member of this structure. - * If both are present, the applicationName member shall prevail. - * If this key is present, you may omit applicationName (set it to <code>NULL</code>). - * GROWL_APP_ICON (CFData): - * Same as the iconData member of this structure. - * If both are present, the iconData member shall prevail. - * If this key is present, you may omit iconData (set it to <code>NULL</code>). - * - * If you change the contents of this dictionary after setting the delegate, - * be sure to call Growl_Reregister. - * - * This can be <code>NULL</code> if you have an auto-discoverable plist file in your app - * bundle. (XXX refer to more information on that) - */ - CFDictionaryRef registrationDictionary; - - /* The data can be in any format supported by NSImage. As of - * Mac OS X 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and - * PICT formats. - * - * If this is not supplied, Growl will look up your application's icon by - * its application name. - */ - CFDataRef applicationIconData; - - /* Installer display attributes - * - * These four attributes are used by the Growl installer, if this framework - * supports it. - * For any of these being <code>NULL</code>, a localised default will be - * supplied. - */ - - /* If this is <code>NULL</code>, Growl will use a default, - * localized title. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlInstallationWindowTitle; - /* This information may be as long or short as desired (the - * window will be sized to fit it). If Growl is not installed, it will - * be displayed to the user as an explanation of what Growl is and what - * it can do in your application. - * It should probably note that no download is required to install. - * - * If this is <code>NULL</code>, Growl will use a default, localized - * explanation. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlInstallationInformation; - /* If this is <code>NULL</code>, Growl will use a default, - * localized title. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlUpdateWindowTitle; - /* This information may be as long or short as desired (the - * window will be sized to fit it). If an older version of Growl is - * installed, it will be displayed to the user as an explanation that an - * updated version of Growl is included in your application and - * no download is required. - * - * If this is <code>NULL</code>, Growl will use a default, localized - * explanation. - * - * Only used if you're using Growl-WithInstaller.framework. Otherwise, - * this member is ignored. - */ - CFStringRef growlUpdateInformation; - - /* This member is provided for use by your retain and release - * callbacks (see below). - * - * GrowlApplicationBridge never directly uses this member. Instead, it - * calls your retain callback (if non-<code>NULL</code>) and your release - * callback (if non-<code>NULL</code>). - */ - unsigned referenceCount; - - //Functions. Currently all of these are optional (any of them can be NULL). - - /* When you call Growl_SetDelegate(newDelegate), it will call - * oldDelegate->release(oldDelegate), and then it will call - * newDelegate->retain(newDelegate), and the return value from retain - * is what will be set as the delegate. - * (This means that this member works like CFRetain and -[NSObject retain].) - * This member is optional (it can be <code>NULL</code>). - * For a delegate allocated with malloc, this member would be - * <code>NULL</code>. - * @result A delegate to which GrowlApplicationBridge holds a reference. - */ - void *(*retain)(void *); - /* When you call Growl_SetDelegate(newDelegate), it will call - * oldDelegate->release(oldDelegate), and then it will call - * newDelegate->retain(newDelegate), and the return value from retain - * is what will be set as the delegate. - * (This means that this member works like CFRelease and - * -[NSObject release].) - * This member is optional (it can be NULL). - * For a delegate allocated with malloc, this member might be - * <code>free</code>(3). - */ - void (*release)(void *); - - /* Informs the delegate that Growl (specifically, the GrowlHelperApp) was - * launched successfully (or was already running). The application can - * take actions with the knowledge that Growl is installed and functional. - */ - void (*growlIsReady)(void); - - /* Informs the delegate that a Growl notification was clicked. It is only - * sent for notifications sent with a non-<code>NULL</code> clickContext, - * so if you want to receive a message when a notification is clicked, - * clickContext must not be <code>NULL</code> when calling - * Growl_PostNotification or - * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. - */ - void (*growlNotificationWasClicked)(CFPropertyListRef clickContext); - - /* Informs the delegate that a Growl notification timed out. It is only - * sent for notifications sent with a non-<code>NULL</code> clickContext, - * so if you want to receive a message when a notification is clicked, - * clickContext must not be <code>NULL</code> when calling - * Growl_PostNotification or - * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. - */ - void (*growlNotificationTimedOut)(CFPropertyListRef clickContext); + /* @discussion This should be sizeof(struct Growl_Delegate). + */ + size_t size; + + /*All of these attributes are optional. + *Optional attributes can be NULL; required attributes that + * are NULL cause setting the Growl delegate to fail. + *XXX - move optional/required status into the discussion for each field + */ + + /* This name is used both internally and in the Growl preferences. + * + * This should remain stable between different versions and incarnations of + * your application. + * For example, "SurfWriter" is a good app name, whereas "SurfWriter 2.0" and + * "SurfWriter Lite" are not. + * + * This can be <code>NULL</code> if it is provided elsewhere, namely in an + * auto-discoverable plist file in your app bundle + * (XXX refer to more information on that) or in registrationDictionary. + */ + CFStringRef applicationName; + + /* + * Must contain at least these keys: + * GROWL_NOTIFICATIONS_ALL (CFArray): + * Contains the names of all notifications your application may post. + * + * Can also contain these keys: + * GROWL_NOTIFICATIONS_DEFAULT (CFArray): + * Names of notifications that should be enabled by default. + * If omitted, GROWL_NOTIFICATIONS_ALL will be used. + * GROWL_APP_NAME (CFString): + * Same as the applicationName member of this structure. + * If both are present, the applicationName member shall prevail. + * If this key is present, you may omit applicationName (set it to <code>NULL</code>). + * GROWL_APP_ICON (CFData): + * Same as the iconData member of this structure. + * If both are present, the iconData member shall prevail. + * If this key is present, you may omit iconData (set it to <code>NULL</code>). + * + * If you change the contents of this dictionary after setting the delegate, + * be sure to call Growl_Reregister. + * + * This can be <code>NULL</code> if you have an auto-discoverable plist file in your app + * bundle. (XXX refer to more information on that) + */ + CFDictionaryRef registrationDictionary; + + /* The data can be in any format supported by NSImage. As of + * Mac OS X 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and + * PICT formats. + * + * If this is not supplied, Growl will look up your application's icon by + * its application name. + */ + CFDataRef applicationIconData; + + /* Installer display attributes + * + * These four attributes are used by the Growl installer, if this framework + * supports it. + * For any of these being <code>NULL</code>, a localised default will be + * supplied. + */ + + /* If this is <code>NULL</code>, Growl will use a default, + * localized title. + * + * Only used if you're using Growl-WithInstaller.framework. Otherwise, + * this member is ignored. + */ + CFStringRef growlInstallationWindowTitle; + /* This information may be as long or short as desired (the + * window will be sized to fit it). If Growl is not installed, it will + * be displayed to the user as an explanation of what Growl is and what + * it can do in your application. + * It should probably note that no download is required to install. + * + * If this is <code>NULL</code>, Growl will use a default, localized + * explanation. + * + * Only used if you're using Growl-WithInstaller.framework. Otherwise, + * this member is ignored. + */ + CFStringRef growlInstallationInformation; + /* If this is <code>NULL</code>, Growl will use a default, + * localized title. + * + * Only used if you're using Growl-WithInstaller.framework. Otherwise, + * this member is ignored. + */ + CFStringRef growlUpdateWindowTitle; + /* This information may be as long or short as desired (the + * window will be sized to fit it). If an older version of Growl is + * installed, it will be displayed to the user as an explanation that an + * updated version of Growl is included in your application and + * no download is required. + * + * If this is <code>NULL</code>, Growl will use a default, localized + * explanation. + * + * Only used if you're using Growl-WithInstaller.framework. Otherwise, + * this member is ignored. + */ + CFStringRef growlUpdateInformation; + + /* This member is provided for use by your retain and release + * callbacks (see below). + * + * GrowlApplicationBridge never directly uses this member. Instead, it + * calls your retain callback (if non-<code>NULL</code>) and your release + * callback (if non-<code>NULL</code>). + */ + unsigned referenceCount; + + //Functions. Currently all of these are optional (any of them can be NULL). + + /* When you call Growl_SetDelegate(newDelegate), it will call + * oldDelegate->release(oldDelegate), and then it will call + * newDelegate->retain(newDelegate), and the return value from retain + * is what will be set as the delegate. + * (This means that this member works like CFRetain and -[NSObject retain].) + * This member is optional (it can be <code>NULL</code>). + * For a delegate allocated with malloc, this member would be + * <code>NULL</code>. + * @result A delegate to which GrowlApplicationBridge holds a reference. + */ + void *(*retain)(void *); + /* When you call Growl_SetDelegate(newDelegate), it will call + * oldDelegate->release(oldDelegate), and then it will call + * newDelegate->retain(newDelegate), and the return value from retain + * is what will be set as the delegate. + * (This means that this member works like CFRelease and + * -[NSObject release].) + * This member is optional (it can be NULL). + * For a delegate allocated with malloc, this member might be + * <code>free</code>(3). + */ + void (*release)(void *); + + /* Informs the delegate that Growl (specifically, the GrowlHelperApp) was + * launched successfully (or was already running). The application can + * take actions with the knowledge that Growl is installed and functional. + */ + void (*growlIsReady)(void); + + /* Informs the delegate that a Growl notification was clicked. It is only + * sent for notifications sent with a non-<code>NULL</code> clickContext, + * so if you want to receive a message when a notification is clicked, + * clickContext must not be <code>NULL</code> when calling + * Growl_PostNotification or + * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. + */ + void (*growlNotificationWasClicked)(CFPropertyListRef clickContext); + + /* Informs the delegate that a Growl notification timed out. It is only + * sent for notifications sent with a non-<code>NULL</code> clickContext, + * so if you want to receive a message when a notification is clicked, + * clickContext must not be <code>NULL</code> when calling + * Growl_PostNotification or + * Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext. + */ + void (*growlNotificationTimedOut)(CFPropertyListRef clickContext); }; /*! @struct Growl_Notification @@ -234,95 +234,95 @@ struct Growl_Delegate { * @field clickCallback A callback to call when the notification is clicked. */ struct Growl_Notification { - /* This should be sizeof(struct Growl_Notification). - */ - size_t size; - - /* The notification name distinguishes one type of - * notification from another. The name should be human-readable, as it - * will be displayed in the Growl preference pane. - * - * The name is used in the GROWL_NOTIFICATIONS_ALL and - * GROWL_NOTIFICATIONS_DEFAULT arrays in the registration dictionary, and - * in this member of the Growl_Notification structure. - */ - CFStringRef name; - - /* A notification's title describes the notification briefly. - * It should be easy to read quickly by the user. - */ - CFStringRef title; - - /* The description supplements the title with more - * information. It is usually longer and sometimes involves a list of - * subjects. For example, for a 'Download complete' notification, the - * description might have one filename per line. GrowlMail in Growl 0.6 - * uses a description of '%d new mail(s)' (formatted with the number of - * messages). - */ - CFStringRef description; - - /* The notification icon usually indicates either what - * happened (it may have the same icon as e.g. a toolbar item that - * started the process that led to the notification), or what it happened - * to (e.g. a document icon). - * - * The icon data is optional, so it can be <code>NULL</code>. In that - * case, the application icon is used alone. Not all displays support - * icons. - * - * The data can be in any format supported by NSImage. As of Mac OS X - * 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT form - * ats. - */ - CFDataRef iconData; - - /* Priority is new in Growl 0.6, and is represented as a - * signed integer from -2 to +2. 0 is Normal priority, -2 is Very Low - * priority, and +2 is Very High priority. - * - * Not all displays support priority. If you do not wish to assign a - * priority to your notification, assign 0. - */ - signed int priority; - - /* These bits are not used in Growl 0.6. Set them to 0. - */ - unsigned reserved: 31; - - /* When the sticky bit is clear, in most displays, - * notifications disappear after a certain amount of time. Sticky - * notifications, however, remain on-screen until the user dismisses them - * explicitly, usually by clicking them. - * - * Sticky notifications were introduced in Growl 0.6. Most notifications - * should not be sticky. Not all displays support sticky notifications, - * and the user may choose in Growl's preference pane to force the - * notification to be sticky or non-sticky, in which case the sticky bit - * in the notification will be ignored. - */ - unsigned isSticky: 1; - - /* If this is not <code>NULL</code>, and your click callback - * is not <code>NULL</code> either, this will be passed to the callback - * when your notification is clicked by the user. - * - * Click feedback was introduced in Growl 0.6, and it is optional. Not - * all displays support click feedback. - */ - CFPropertyListRef clickContext; - - /* If this is not <code>NULL</code>, it will be called instead - * of the Growl delegate's click callback when clickContext is - * non-<code>NULL</code> and the notification is clicked on by the user. - * - * Click feedback was introduced in Growl 0.6, and it is optional. Not - * all displays support click feedback. - * - * The per-notification click callback is not yet supported as of Growl - * 0.7. - */ - void (*clickCallback)(CFPropertyListRef clickContext); + /* This should be sizeof(struct Growl_Notification). + */ + size_t size; + + /* The notification name distinguishes one type of + * notification from another. The name should be human-readable, as it + * will be displayed in the Growl preference pane. + * + * The name is used in the GROWL_NOTIFICATIONS_ALL and + * GROWL_NOTIFICATIONS_DEFAULT arrays in the registration dictionary, and + * in this member of the Growl_Notification structure. + */ + CFStringRef name; + + /* A notification's title describes the notification briefly. + * It should be easy to read quickly by the user. + */ + CFStringRef title; + + /* The description supplements the title with more + * information. It is usually longer and sometimes involves a list of + * subjects. For example, for a 'Download complete' notification, the + * description might have one filename per line. GrowlMail in Growl 0.6 + * uses a description of '%d new mail(s)' (formatted with the number of + * messages). + */ + CFStringRef description; + + /* The notification icon usually indicates either what + * happened (it may have the same icon as e.g. a toolbar item that + * started the process that led to the notification), or what it happened + * to (e.g. a document icon). + * + * The icon data is optional, so it can be <code>NULL</code>. In that + * case, the application icon is used alone. Not all displays support + * icons. + * + * The data can be in any format supported by NSImage. As of Mac OS X + * 10.3, this includes the .icns, TIFF, JPEG, GIF, PNG, PDF, and PICT form + * ats. + */ + CFDataRef iconData; + + /* Priority is new in Growl 0.6, and is represented as a + * signed integer from -2 to +2. 0 is Normal priority, -2 is Very Low + * priority, and +2 is Very High priority. + * + * Not all displays support priority. If you do not wish to assign a + * priority to your notification, assign 0. + */ + signed int priority; + + /* These bits are not used in Growl 0.6. Set them to 0. + */ + unsigned reserved: 31; + + /* When the sticky bit is clear, in most displays, + * notifications disappear after a certain amount of time. Sticky + * notifications, however, remain on-screen until the user dismisses them + * explicitly, usually by clicking them. + * + * Sticky notifications were introduced in Growl 0.6. Most notifications + * should not be sticky. Not all displays support sticky notifications, + * and the user may choose in Growl's preference pane to force the + * notification to be sticky or non-sticky, in which case the sticky bit + * in the notification will be ignored. + */ + unsigned isSticky: 1; + + /* If this is not <code>NULL</code>, and your click callback + * is not <code>NULL</code> either, this will be passed to the callback + * when your notification is clicked by the user. + * + * Click feedback was introduced in Growl 0.6, and it is optional. Not + * all displays support click feedback. + */ + CFPropertyListRef clickContext; + + /* If this is not <code>NULL</code>, it will be called instead + * of the Growl delegate's click callback when clickContext is + * non-<code>NULL</code> and the notification is clicked on by the user. + * + * Click feedback was introduced in Growl 0.6, and it is optional. Not + * all displays support click feedback. + * + * The per-notification click callback is not yet supported as of Growl + * 0.7. + */ + void (*clickCallback)(CFPropertyListRef clickContext); }; #pragma mark - @@ -336,24 +336,24 @@ struct Growl_Notification { * referenceCount (which will be set to 1). */ #define InitGrowlDelegate(delegate) \ - do { \ - if (delegate) { \ - (delegate)->size = sizeof(struct Growl_Delegate); \ - (delegate)->applicationName = NULL; \ - (delegate)->registrationDictionary = NULL; \ - (delegate)->applicationIconData = NULL; \ - (delegate)->growlInstallationWindowTitle = NULL; \ - (delegate)->growlInstallationInformation = NULL; \ - (delegate)->growlUpdateWindowTitle = NULL; \ - (delegate)->growlUpdateInformation = NULL; \ - (delegate)->referenceCount = 1U; \ - (delegate)->retain = NULL; \ - (delegate)->release = NULL; \ - (delegate)->growlIsReady = NULL; \ - (delegate)->growlNotificationWasClicked = NULL; \ - (delegate)->growlNotificationTimedOut = NULL; \ - } \ - } while(0) + do { \ + if (delegate) { \ + (delegate)->size = sizeof(struct Growl_Delegate); \ + (delegate)->applicationName = NULL; \ + (delegate)->registrationDictionary = NULL; \ + (delegate)->applicationIconData = NULL; \ + (delegate)->growlInstallationWindowTitle = NULL; \ + (delegate)->growlInstallationInformation = NULL; \ + (delegate)->growlUpdateWindowTitle = NULL; \ + (delegate)->growlUpdateInformation = NULL; \ + (delegate)->referenceCount = 1U; \ + (delegate)->retain = NULL; \ + (delegate)->release = NULL; \ + (delegate)->growlIsReady = NULL; \ + (delegate)->growlNotificationWasClicked = NULL; \ + (delegate)->growlNotificationTimedOut = NULL; \ + } \ + } while(0) /*! @defined InitGrowlNotification * @abstract Callable macro. Initializes a Growl notification structure to defaults. @@ -363,19 +363,19 @@ struct Growl_Notification { * <code>sizeof(struct Growl_Notification)</code>). */ #define InitGrowlNotification(notification) \ - do { \ - if (notification) { \ - (notification)->size = sizeof(struct Growl_Notification); \ - (notification)->name = NULL; \ - (notification)->title = NULL; \ - (notification)->description = NULL; \ - (notification)->iconData = NULL; \ - (notification)->priority = 0; \ - (notification)->reserved = 0U; \ - (notification)->isSticky = false; \ - (notification)->clickContext = NULL; \ - } \ - } while(0) + do { \ + if (notification) { \ + (notification)->size = sizeof(struct Growl_Notification); \ + (notification)->name = NULL; \ + (notification)->title = NULL; \ + (notification)->description = NULL; \ + (notification)->iconData = NULL; \ + (notification)->priority = 0; \ + (notification)->reserved = 0U; \ + (notification)->isSticky = false; \ + (notification)->clickContext = NULL; \ + } \ + } while(0) #pragma mark - #pragma mark Public API @@ -493,13 +493,13 @@ void Growl_PostNotificationWithDictionary(CFDictionaryRef userInfo); */ void Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext( /*inhale*/ - CFStringRef title, - CFStringRef description, - CFStringRef notificationName, - CFDataRef iconData, - signed int priority, - Boolean isSticky, - CFPropertyListRef clickContext); + CFStringRef title, + CFStringRef description, + CFStringRef notificationName, + CFDataRef iconData, + signed int priority, + Boolean isSticky, + CFPropertyListRef clickContext); #pragma mark - diff --git a/src/uimacnew/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h b/src/uimacnew/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h index 7ac315a..bb78756 100644 --- a/src/uimacnew/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h +++ b/src/uimacnew/Growl.framework/Versions/A/Headers/GrowlApplicationBridge.h @@ -135,12 +135,12 @@ * @param clickContext A context passed back to the Growl delegate if it implements -(void)growlNotificationWasClicked: and the notification is clicked. Not all display plugins support clicking. The clickContext must be plist-encodable (completely of <code>NSString</code>, <code>NSArray</code>, <code>NSNumber</code>, <code>NSDictionary</code>, and <code>NSData</code> types). */ + (void) notifyWithTitle:(NSString *)title - description:(NSString *)description - notificationName:(NSString *)notifName - iconData:(NSData *)iconData - priority:(signed int)priority - isSticky:(BOOL)isSticky - clickContext:(id)clickContext; + description:(NSString *)description + notificationName:(NSString *)notifName + iconData:(NSData *)iconData + priority:(signed int)priority + isSticky:(BOOL)isSticky + clickContext:(id)clickContext; /*! * @method notifyWithTitle:description:notificationName:iconData:priority:isSticky:clickContext:identifier: @@ -168,13 +168,13 @@ * @param identifier An identifier for this notification. Notifications with equal identifiers are coalesced. */ + (void) notifyWithTitle:(NSString *)title - description:(NSString *)description - notificationName:(NSString *)notifName - iconData:(NSData *)iconData - priority:(signed int)priority - isSticky:(BOOL)isSticky - clickContext:(id)clickContext - identifier:(NSString *)identifier; + description:(NSString *)description + notificationName:(NSString *)notifName + iconData:(NSData *)iconData + priority:(signed int)priority + isSticky:(BOOL)isSticky + clickContext:(id)clickContext + identifier:(NSString *)identifier; /*! @method notifyWithDictionary: * @abstract Notifies using a userInfo dictionary suitable for passing to diff --git a/src/uimacnew/Growl.framework/Versions/A/Resources/Info.plist b/src/uimacnew/Growl.framework/Versions/A/Resources/Info.plist index 0444144..2442bea 100644 --- a/src/uimacnew/Growl.framework/Versions/A/Resources/Info.plist +++ b/src/uimacnew/Growl.framework/Versions/A/Resources/Info.plist @@ -2,23 +2,23 @@ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>Growl</string> - <key>CFBundleIdentifier</key> - <string>com.growl.growlframework</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>FMWK</string> - <key>CFBundleShortVersionString</key> - <string>0.7.3</string> - <key>CFBundleSignature</key> - <string>GRRR</string> - <key>CFBundleVersion</key> - <string>0.7.3</string> - <key>NSPrincipalClass</key> - <string>GrowlApplicationBridge</string> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>Growl</string> + <key>CFBundleIdentifier</key> + <string>com.growl.growlframework</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>FMWK</string> + <key>CFBundleShortVersionString</key> + <string>0.7.3</string> + <key>CFBundleSignature</key> + <string>GRRR</string> + <key>CFBundleVersion</key> + <string>0.7.3</string> + <key>NSPrincipalClass</key> + <string>GrowlApplicationBridge</string> </dict> </plist> diff --git a/src/uimacnew/ImageAndTextCell.m b/src/uimacnew/ImageAndTextCell.m index 34be861..0b88b00 100644 --- a/src/uimacnew/ImageAndTextCell.m +++ b/src/uimacnew/ImageAndTextCell.m @@ -1,44 +1,44 @@ /* - ImageAndTextCell.m - Copyright (c) 2001-2004, Apple Computer, Inc., all rights reserved. - Author: Chuck Pisula + ImageAndTextCell.m + Copyright (c) 2001-2004, Apple Computer, Inc., all rights reserved. + Author: Chuck Pisula - Milestones: - Initially created 3/1/01 + Milestones: + Initially created 3/1/01 Subclass of NSTextFieldCell which can display text and an image simultaneously. */ /* IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in - consideration of your agreement to the following terms, and your use, installation, - modification or redistribution of this Apple software constitutes acceptance of these - terms. If you do not agree with these terms, please do not use, install, modify or + consideration of your agreement to the following terms, and your use, installation, + modification or redistribution of this Apple software constitutes acceptance of these + terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject to these - terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in - this original Apple software (the "Apple Software"), to use, reproduce, modify and - redistribute the Apple Software, with or without modifications, in source and/or binary - forms; provided that if you redistribute the Apple Software in its entirety and without - modifications, you must retain this notice and the following text and disclaimers in all - such redistributions of the Apple Software. Neither the name, trademarks, service marks - or logos of Apple Computer, Inc. may be used to endorse or promote products derived from + + In consideration of your agreement to abide by the following terms, and subject to these + terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in + this original Apple software (the "Apple Software"), to use, reproduce, modify and + redistribute the Apple Software, with or without modifications, in source and/or binary + forms; provided that if you redistribute the Apple Software in its entirety and without + modifications, you must retain this notice and the following text and disclaimers in all + such redistributions of the Apple Software. Neither the name, trademarks, service marks + or logos of Apple Computer, Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple - herein, including but not limited to any patent rights that may be infringed by your + herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, - EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, - MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS + + The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, + EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, - REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND - WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR + + IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, + REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND + WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -128,4 +128,3 @@ typedef int NSInteger; } @end - diff --git a/src/uimacnew/Info.plist b/src/uimacnew/Info.plist index a5e921d..0876dd0 100644 --- a/src/uimacnew/Info.plist +++ b/src/uimacnew/Info.plist @@ -2,31 +2,31 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>CFBundleName</key> - <string>Unison</string> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>Unison</string> - <key>CFBundleIconFile</key> - <string>Unison.icns</string> - <key>CFBundleIdentifier</key> - <string>edu.upenn.cis.Unison</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleShortVersionString</key> - <string>$(MARKETING_VERSION)</string> - <key>CFBundleGetInfoString</key> - <string>${MARKETING_VERSION}, ©1999-2007, licensed under GNU GPL.</string> - <key>NSHumanReadableCopyright</key> - <string>©1999-2010, licensed under GNU GPL v3.</string> - <key>NSMainNibFile</key> - <string>MainMenu</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> + <key>CFBundleName</key> + <string>Unison</string> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>Unison</string> + <key>CFBundleIconFile</key> + <string>Unison.icns</string> + <key>CFBundleIdentifier</key> + <string>edu.upenn.cis.Unison</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleShortVersionString</key> + <string>$(MARKETING_VERSION)</string> + <key>CFBundleGetInfoString</key> + <string>${MARKETING_VERSION}, ©1999-2007, licensed under GNU GPL.</string> + <key>NSHumanReadableCopyright</key> + <string>©1999-2010, licensed under GNU GPL v3.</string> + <key>NSMainNibFile</key> + <string>MainMenu</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> </dict> </plist> diff --git a/src/uimacnew/Info.plist.template b/src/uimacnew/Info.plist.template index 5db2a1d..2de3eff 100644 --- a/src/uimacnew/Info.plist.template +++ b/src/uimacnew/Info.plist.template @@ -2,33 +2,33 @@ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>CFBundleName</key> - <string>Unison</string> - <key>CFBundleDevelopmentRegion</key> - <string>English</string> - <key>CFBundleExecutable</key> - <string>Unison</string> - <key>CFBundleIconFile</key> - <string>Unison.icns</string> - <key>CFBundleIdentifier</key> - <string>edu.upenn.cis.Unison</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>@@VERSION@@</string> - <key>CFBundleShortVersionString</key> - <string>@@VERSION@@</string> - <key>CFBundleGetInfoString</key> - <string>@@VERSION@@. ©1999-2014, licensed under GNU GPL.</string> - <key>NSHumanReadableCopyright</key> - <string>©1999-2014, licensed under GNU GPL.</string> - <key>NSMainNibFile</key> - <string>MainMenu</string> - <key>NSPrincipalClass</key> - <string>NSApplication</string> + <key>CFBundleName</key> + <string>Unison</string> + <key>CFBundleDevelopmentRegion</key> + <string>English</string> + <key>CFBundleExecutable</key> + <string>Unison</string> + <key>CFBundleIconFile</key> + <string>Unison.icns</string> + <key>CFBundleIdentifier</key> + <string>edu.upenn.cis.Unison</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleSignature</key> + <string>????</string> + <key>CFBundleVersion</key> + <string>@@VERSION@@</string> + <key>CFBundleShortVersionString</key> + <string>@@VERSION@@</string> + <key>CFBundleGetInfoString</key> + <string>@@VERSION@@. ©1999-2014, licensed under GNU GPL.</string> + <key>NSHumanReadableCopyright</key> + <string>©1999-2014, licensed under GNU GPL.</string> + <key>NSMainNibFile</key> + <string>MainMenu</string> + <key>NSPrincipalClass</key> + <string>NSApplication</string> </dict> </plist> diff --git a/src/uimacnew/MyController.h b/src/uimacnew/MyController.h index 620802d..0e21fe8 100644 --- a/src/uimacnew/MyController.h +++ b/src/uimacnew/MyController.h @@ -45,11 +45,11 @@ IBOutlet NotificationController *notificationController; BOOL syncable; - BOOL duringSync; + BOOL duringSync; BOOL afterSync; NSMutableArray *reconItems; - ParentReconItem *rootItem; + ParentReconItem *rootItem; OCamlValue *preconn; BOOL doneFirstDiff; @@ -109,4 +109,3 @@ - (float)toolbarHeightForWindow:(NSWindow *)window; @end - diff --git a/src/uimacnew/MyController.m b/src/uimacnew/MyController.m index 6e2699b..a966c93 100644 --- a/src/uimacnew/MyController.m +++ b/src/uimacnew/MyController.m @@ -43,16 +43,16 @@ static int doAsk = 2; - (id)init { if (([super init])) { - + /* Initialize locals */ me = self; doneFirstDiff = NO; - + /* By default, invite user to install cltool */ int pref = [[NSUserDefaults standardUserDefaults] - integerForKey:@"CheckCltool"]; + integerForKey:@"CheckCltool"]; if (pref==unset) - [[NSUserDefaults standardUserDefaults] + [[NSUserDefaults standardUserDefaults] setInteger:doAsk forKey:@"CheckCltool"]; } @@ -64,45 +64,45 @@ static int doAsk = 2; // Window positioning NSRect screenFrame = [[mainWindow screen] visibleFrame]; [mainWindow cascadeTopLeftFromPoint: - NSMakePoint(screenFrame.origin.x, + NSMakePoint(screenFrame.origin.x, screenFrame.origin.y+screenFrame.size.height)]; - + blankView = [[NSView alloc] init]; - + /* Double clicking in the profile list will open the profile */ [[profileController tableView] setTarget:self]; [[profileController tableView] setDoubleAction:@selector(openButton:)]; - [tableView setAutoresizesOutlineColumn:NO]; + [tableView setAutoresizesOutlineColumn:NO]; - // use combo-cell for path + // use combo-cell for path [[tableView tableColumnWithIdentifier:@"path"] setDataCell:[[[ImageAndTextCell alloc] init] autorelease]]; - // Custom progress cell - ProgressCell *progressCell = [[[ProgressCell alloc] init] autorelease]; - [[tableView tableColumnWithIdentifier:@"percentTransferred"] setDataCell:progressCell]; - + // Custom progress cell + ProgressCell *progressCell = [[[ProgressCell alloc] init] autorelease]; + [[tableView tableColumnWithIdentifier:@"percentTransferred"] setDataCell:progressCell]; + /* Set up the version string in the about box. We use a custom about box just because PRCS doesn't seem capable of getting the version into the InfoPlist.strings file; otherwise we'd use the standard about box. */ [versionText setStringValue:ocamlCall("S", "unisonGetVersion")]; - + /* Command-line processing */ OCamlValue *clprofile = (id)ocamlCall("@", "unisonInit0"); - + /* Add toolbar */ - toolbar = [[[UnisonToolbar alloc] + toolbar = [[[UnisonToolbar alloc] initWithIdentifier: @"unisonToolbar" :self :tableView] autorelease]; [mainWindow setToolbar: toolbar]; - [toolbar takeTableModeView:tableModeSelector]; - [self initTableMode]; - + [toolbar takeTableModeView:tableModeSelector]; + [self initTableMode]; + /* Set up the first window the user will see */ if (clprofile) { /* A profile name was given on the command line */ - NSString *profileName = [clprofile getField:0 withType:'S']; + NSString *profileName = [clprofile getField:0 withType:'S']; [self profileSelected:profileName]; /* If invoked from terminal we need to bring the app to the front */ @@ -138,8 +138,8 @@ static int doAsk = 2; [mainWindow setContentMaxSize:NSMakeSize(FLT_MAX, FLT_MAX)]; [mainWindow setContentView:chooseProfileView]; [toolbar setView:@"chooseProfileView"]; - [mainWindow setTitle:@"Unison"]; - + [mainWindow setTitle:@"Unison"]; + // profiles get keyboard input [mainWindow makeFirstResponder:[profileController tableView]]; [chooseProfileView display]; @@ -211,27 +211,27 @@ static int doAsk = 2; - (void)updateToolbar { - [toolbar validateVisibleItems]; - [tableModeSelector setEnabled:((syncable && !duringSync) || afterSync)]; + [toolbar validateVisibleItems]; + [tableModeSelector setEnabled:((syncable && !duringSync) || afterSync)]; - // Why? + // Why? [updatesView setNeedsDisplay:YES]; } - (void)updateTableViewWithReset:(BOOL)shouldResetSelection { - [tableView reloadData]; - if (shouldResetSelection) { - [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; - shouldResetSelection = NO; - } - [updatesView setNeedsDisplay:YES]; + [tableView reloadData]; + if (shouldResetSelection) { + [tableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; + shouldResetSelection = NO; + } + [updatesView setNeedsDisplay:YES]; } - (void)updateProgressBar:(NSNumber *)newProgress { - // NSLog(@"Updating progress bar: %i - %i", (int)[newProgress doubleValue], (int)[progressBar doubleValue]); - [progressBar incrementBy:([newProgress doubleValue] - [progressBar doubleValue])]; + // NSLog(@"Updating progress bar: %i - %i", (int)[newProgress doubleValue], (int)[progressBar doubleValue]); + [progressBar incrementBy:([newProgress doubleValue] - [progressBar doubleValue])]; } - (void)updateTableViewSelection @@ -243,7 +243,7 @@ static int doAsk = 2; - (void)outlineViewSelectionDidChange:(NSNotification *)note { - [self updateTableViewSelection]; + [self updateTableViewSelection]; } - (void)connect:(NSString *)profileName @@ -263,12 +263,12 @@ static int doAsk = 2; [ConnectingView display]; syncable = NO; - afterSync = NO; - - [self updateToolbar]; - - // will spawn thread on OCaml side and callback when complete - (void)ocamlCall("xS", "unisonInit1", profileName); + afterSync = NO; + + [self updateToolbar]; + + // will spawn thread on OCaml side and callback when complete + (void)ocamlCall("xS", "unisonInit1", profileName); } CAMLprim value unisonInit1Complete(value v) @@ -276,38 +276,38 @@ CAMLprim value unisonInit1Complete(value v) id pool = [[NSAutoreleasePool alloc] init]; if (v == Val_unit) { NSLog(@"Connected."); - [me->preconn release]; - me->preconn = NULL; - [me performSelectorOnMainThread:@selector(afterOpen:) withObject:nil waitUntilDone:FALSE]; + [me->preconn release]; + me->preconn = NULL; + [me performSelectorOnMainThread:@selector(afterOpen:) withObject:nil waitUntilDone:FALSE]; } else { - // prompting required - me->preconn = [[OCamlValue alloc] initWithValue:Field(v,0)]; // value of Some - [me performSelectorOnMainThread:@selector(unisonInit1Complete:) withObject:nil waitUntilDone:FALSE]; - } + // prompting required + me->preconn = [[OCamlValue alloc] initWithValue:Field(v,0)]; // value of Some + [me performSelectorOnMainThread:@selector(unisonInit1Complete:) withObject:nil waitUntilDone:FALSE]; + } [pool release]; return Val_unit; } - (void)unisonInit1Complete:(id)ignore { - @try { - OCamlValue *prompt = ocamlCall("@@", "openConnectionPrompt", preconn); - if (!prompt) { - // turns out, no prompt needed, but must finish opening connection - ocamlCall("x@", "openConnectionEnd", preconn); - NSLog(@"Connected."); - waitingForPassword = NO; - [self afterOpen]; - return; - } - waitingForPassword = YES; - - [self raisePasswordWindow:[prompt getField:0 withType:'S']]; - } @catch (NSException *ex) { - NSRunAlertPanel(@"Connection Error", [ex description], @"OK", nil, nil); - [self chooseProfiles]; - return; - } + @try { + OCamlValue *prompt = ocamlCall("@@", "openConnectionPrompt", preconn); + if (!prompt) { + // turns out, no prompt needed, but must finish opening connection + ocamlCall("x@", "openConnectionEnd", preconn); + NSLog(@"Connected."); + waitingForPassword = NO; + [self afterOpen]; + return; + } + waitingForPassword = YES; + + [self raisePasswordWindow:[prompt getField:0 withType:'S']]; + } @catch (NSException *ex) { + NSRunAlertPanel(@"Connection Error", [ex description], @"OK", nil, nil); + [self chooseProfiles]; + return; + } NSLog(@"Connected."); } @@ -337,33 +337,33 @@ CAMLprim value unisonInit1Complete(value v) if ((long)ocamlCall("iS", "unisonAuthenticityMsg", prompt)) { int i = NSRunAlertPanel(@"New host",prompt,@"Yes",@"No",nil); if (i == NSAlertDefaultReturn) { - ocamlCall("x@s", "openConnectionReply", preconn, "yes"); - prompt = ocamlCall("S@", "openConnectionPrompt", preconn); + ocamlCall("x@s", "openConnectionReply", preconn, "yes"); + prompt = ocamlCall("S@", "openConnectionPrompt", preconn); if (!prompt) { // all done with prompts, finish opening connection - ocamlCall("x@", "openConnectionEnd", preconn); + ocamlCall("x@", "openConnectionEnd", preconn); waitingForPassword = NO; [self afterOpen]; return; } else { - [self raisePasswordWindow:[NSString + [self raisePasswordWindow:[NSString stringWithUTF8String:String_val(Field(prompt,0))]]; return; } } if (i == NSAlertAlternateReturn) { - ocamlCall("x@", "openConnectionCancel", preconn); + ocamlCall("x@", "openConnectionCancel", preconn); return; } else { NSLog(@"Unrecognized response '%d' from NSRunAlertPanel",i); - ocamlCall("x@", "openConnectionCancel", preconn); + ocamlCall("x@", "openConnectionCancel", preconn); return; } } NSLog(@"Unrecognized message from ssh: %@",prompt); - ocamlCall("x@", "openConnectionCancel", preconn); + ocamlCall("x@", "openConnectionCancel", preconn); } // The password window will invoke this when Enter occurs, b/c we @@ -381,37 +381,37 @@ CAMLprim value unisonInit1Complete(value v) [passwordWindow orderOut:self]; [NSApp endSheet:passwordWindow]; if ([sender isEqualTo:passwordCancelButton]) { - ocamlCall("x@", "openConnectionCancel", preconn); + ocamlCall("x@", "openConnectionCancel", preconn); [self chooseProfiles]; return; } NSString *password = [passwordText stringValue]; - ocamlCall("x@S", "openConnectionReply", preconn, password); + ocamlCall("x@S", "openConnectionReply", preconn, password); OCamlValue *prompt = ocamlCall("@@", "openConnectionPrompt", preconn); if (!prompt) { // all done with prompts, finish opening connection - ocamlCall("x@", "openConnectionEnd", preconn); + ocamlCall("x@", "openConnectionEnd", preconn); waitingForPassword = NO; [self afterOpen]; } else { - [self raisePasswordWindow:[prompt getField:0 withType:'S']]; + [self raisePasswordWindow:[prompt getField:0 withType:'S']]; } } - (void)afterOpen:(id)ignore { - [self afterOpen]; + [self afterOpen]; } - (void)afterOpen { if (waitingForPassword) return; // move to updates window after clearing it - [self updateReconItems:nil]; - [progressBar setDoubleValue:0.0]; - [progressBar stopAnimation:self]; + [self updateReconItems:nil]; + [progressBar setDoubleValue:0.0]; + [progressBar stopAnimation:self]; // [self clearDetails]; [mainWindow setContentView:blankView]; [self resizeWindowToSize:[updatesView frame].size]; @@ -425,55 +425,55 @@ CAMLprim value unisonInit1Complete(value v) afterSync = NO; [tableView deselectAll:self]; - [self updateToolbar]; - [self updateProgressBar:[NSNumber numberWithDouble:0.0]]; - + [self updateToolbar]; + [self updateProgressBar:[NSNumber numberWithDouble:0.0]]; + // this should depend on the number of reconitems, and is now done // in updateReconItems: // reconItems table gets keyboard input //[mainWindow makeFirstResponder:tableView]; [tableView scrollRowToVisible:0]; - [preconn release]; + [preconn release]; preconn = nil; // so old preconn can be garbage collected - // This will run in another thread spawned in OCaml and will return immediately - // We'll get a call back to unisonInit2Complete() when it is complete - ocamlCall("x", "unisonInit2"); + // This will run in another thread spawned in OCaml and will return immediately + // We'll get a call back to unisonInit2Complete() when it is complete + ocamlCall("x", "unisonInit2"); } - (void)afterUpdate:(id)retainedReconItems { - // NSLog(@"In afterUpdate:..."); + // NSLog(@"In afterUpdate:..."); [self updateReconItems:retainedReconItems]; - [retainedReconItems release]; + [retainedReconItems release]; [notificationController updateFinishedFor:[self profile]]; // label the left and right columns with the roots - NSString *leftHost = [(NSString *)ocamlCall("S", "unisonFirstRootString") trim]; - NSString *rightHost = [(NSString *)ocamlCall("S", "unisonSecondRootString") trim]; - /* + NSString *leftHost = [(NSString *)ocamlCall("S", "unisonFirstRootString") trim]; + NSString *rightHost = [(NSString *)ocamlCall("S", "unisonSecondRootString") trim]; + /* [[[tableView tableColumnWithIdentifier:@"left"] headerCell] setObjectValue:lefthost]; [[[tableView tableColumnWithIdentifier:@"right"] headerCell] setObjectValue:rightHost]; */ - [mainWindow setTitle: [NSString stringWithFormat:@"Unison: %@ (%@ <-> %@)", - [self profile], leftHost, rightHost]]; - - // initial sort - [tableView setSortDescriptors:[NSArray arrayWithObjects: - [[tableView tableColumnWithIdentifier:@"fileSizeString"] sortDescriptorPrototype], - [[tableView tableColumnWithIdentifier:@"path"] sortDescriptorPrototype], - nil]]; + [mainWindow setTitle: [NSString stringWithFormat:@"Unison: %@ (%@ <-> %@)", + [self profile], leftHost, rightHost]]; - [self updateTableViewWithReset:([reconItems count] > 0)]; - [self updateToolbar]; + // initial sort + [tableView setSortDescriptors:[NSArray arrayWithObjects: + [[tableView tableColumnWithIdentifier:@"fileSizeString"] sortDescriptorPrototype], + [[tableView tableColumnWithIdentifier:@"path"] sortDescriptorPrototype], + nil]]; + + [self updateTableViewWithReset:([reconItems count] > 0)]; + [self updateToolbar]; } CAMLprim value unisonInit2Complete(value v) { id pool = [[NSAutoreleasePool alloc] init]; - [me performSelectorOnMainThread:@selector(afterUpdate:) withObject:[[OCamlValue alloc] initWithValue:v] waitUntilDone:FALSE]; + [me performSelectorOnMainThread:@selector(afterUpdate:) withObject:[[OCamlValue alloc] initWithValue:v] waitUntilDone:FALSE]; [pool release]; return Val_unit; } @@ -483,12 +483,12 @@ CAMLprim value unisonInit2Complete(value v) [tableView setEditable:NO]; syncable = NO; duringSync = YES; - - [self updateToolbar]; - - // This will run in another thread spawned in OCaml and will return immediately - // We'll get a call back to syncComplete() when it is complete - ocamlCall("x", "unisonSynchronize"); + + [self updateToolbar]; + + // This will run in another thread spawned in OCaml and will return immediately + // We'll get a call back to syncComplete() when it is complete + ocamlCall("x", "unisonSynchronize"); } - (void)afterSync:(id)ignore @@ -497,21 +497,21 @@ CAMLprim value unisonInit2Complete(value v) duringSync = NO; afterSync = YES; [self updateToolbar]; - + int i; for (i = 0; i < [reconItems count]; i++) { [[reconItems objectAtIndex:i] resetProgress]; } - [self updateTableViewSelection]; - - [self updateTableViewWithReset:FALSE]; + [self updateTableViewSelection]; + + [self updateTableViewWithReset:FALSE]; } CAMLprim value syncComplete() { id pool = [[NSAutoreleasePool alloc] init]; - [me performSelectorOnMainThread:@selector(afterSync:) withObject:nil waitUntilDone:FALSE]; + [me performSelectorOnMainThread:@selector(afterSync:) withObject:nil waitUntilDone:FALSE]; [pool release]; return Val_unit; } @@ -519,26 +519,26 @@ CAMLprim value syncComplete() // A function called from ocaml - (void)reloadTable:(NSNumber *)i { - // NSLog(@"*** ReloadTable: %i", [i intValue]); + // NSLog(@"*** ReloadTable: %i", [i intValue]); [[reconItems objectAtIndex:[i intValue]] resetProgress]; - [self updateTableViewWithReset:FALSE]; + [self updateTableViewWithReset:FALSE]; } CAMLprim value reloadTable(value row) { id pool = [[NSAutoreleasePool alloc] init]; - // NSLog(@"OCaml says... ReloadTable: %i", Int_val(row)); - NSNumber *num = [[NSNumber alloc] initWithInt:Int_val(row)]; - [me performSelectorOnMainThread:@selector(reloadTable:) withObject:num waitUntilDone:FALSE]; - [num release]; + // NSLog(@"OCaml says... ReloadTable: %i", Int_val(row)); + NSNumber *num = [[NSNumber alloc] initWithInt:Int_val(row)]; + [me performSelectorOnMainThread:@selector(reloadTable:) withObject:num waitUntilDone:FALSE]; + [num release]; [pool release]; return Val_unit; } - (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item { - if (item == nil) item = rootItem; - return [[item children] count]; + if (item == nil) item = rootItem; + return [[item children] count]; } - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item { @@ -546,60 +546,60 @@ CAMLprim value reloadTable(value row) } - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item { - if (item == nil) item = rootItem; - return [[item children] objectAtIndex:index]; + if (item == nil) item = rootItem; + return [[item children] objectAtIndex:index]; } - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { NSString *identifier = [tableColumn identifier]; - if (item == nil) item = rootItem; + if (item == nil) item = rootItem; - if ([identifier isEqualToString:@"percentTransferred"] && (!duringSync && !afterSync)) return nil; + if ([identifier isEqualToString:@"percentTransferred"] && (!duringSync && !afterSync)) return nil; - return [item valueForKey:identifier]; + return [item valueForKey:identifier]; } static NSDictionary *_SmallGreyAttributes = nil; -- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { - NSString *identifier = [tableColumn identifier]; +- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { + NSString *identifier = [tableColumn identifier]; if ([identifier isEqualToString:@"path"]) { - // The file icon - [(ImageAndTextCell*)cell setImage:[item fileIcon]]; - - // For parents, format the file count into the text - long fileCount = [item fileCount]; - if (fileCount > 1) { - NSString *countString = [NSString stringWithFormat:@" (%ld files)", fileCount]; - NSString *fullString = [(NSString *)[cell objectValue] stringByAppendingString:countString]; - NSMutableAttributedString *as = [[NSMutableAttributedString alloc] initWithString:fullString]; - - if (!_SmallGreyAttributes) { - NSColor *txtColor = [NSColor grayColor]; - NSFont *txtFont = [NSFont systemFontOfSize:9.0]; - _SmallGreyAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:txtFont, - NSFontAttributeName, txtColor, NSForegroundColorAttributeName, nil] retain]; - } - [as setAttributes:_SmallGreyAttributes range:NSMakeRange([fullString length] - [countString length], [countString length])]; - [cell setAttributedStringValue:as]; - [as release]; - } + // The file icon + [(ImageAndTextCell*)cell setImage:[item fileIcon]]; + + // For parents, format the file count into the text + long fileCount = [item fileCount]; + if (fileCount > 1) { + NSString *countString = [NSString stringWithFormat:@" (%ld files)", fileCount]; + NSString *fullString = [(NSString *)[cell objectValue] stringByAppendingString:countString]; + NSMutableAttributedString *as = [[NSMutableAttributedString alloc] initWithString:fullString]; + + if (!_SmallGreyAttributes) { + NSColor *txtColor = [NSColor grayColor]; + NSFont *txtFont = [NSFont systemFontOfSize:9.0]; + _SmallGreyAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:txtFont, + NSFontAttributeName, txtColor, NSForegroundColorAttributeName, nil] retain]; + } + [as setAttributes:_SmallGreyAttributes range:NSMakeRange([fullString length] - [countString length], [countString length])]; + [cell setAttributedStringValue:as]; + [as release]; + } } else if ([identifier isEqualToString:@"percentTransferred"]) { - [(ProgressCell*)cell setIcon:[item direction]]; - [(ProgressCell*)cell setStatusString:[item progressString]]; - [(ProgressCell*)cell setIsActive:[item isKindOfClass:[LeafReconItem class]]]; + [(ProgressCell*)cell setIcon:[item direction]]; + [(ProgressCell*)cell setStatusString:[item progressString]]; + [(ProgressCell*)cell setIsActive:[item isKindOfClass:[LeafReconItem class]]]; } } -- (void)outlineView:(NSOutlineView *)outlineView +- (void)outlineView:(NSOutlineView *)outlineView sortDescriptorsDidChange:(NSArray *)oldDescriptors { - NSArray *originalSelection = [outlineView selectedObjects]; - - // do we want to catch case of object changes to allow resort in same direction for progress / direction? - // Could check if our objects change and if the first item at the head of new and old were the same - [rootItem sortUsingDescriptors:[outlineView sortDescriptors]]; - [outlineView reloadData]; - [outlineView setSelectedObjects:originalSelection]; + NSArray *originalSelection = [outlineView selectedObjects]; + + // do we want to catch case of object changes to allow resort in same direction for progress / direction? + // Could check if our objects change and if the first item at the head of new and old were the same + [rootItem sortUsingDescriptors:[outlineView sortDescriptors]]; + [outlineView reloadData]; + [outlineView setSelectedObjects:originalSelection]; } // Delegate methods @@ -615,93 +615,93 @@ static NSDictionary *_SmallGreyAttributes = nil; - (int)tableMode { - return [tableModeSelector selectedSegment]; + return [tableModeSelector selectedSegment]; } - (IBAction)tableModeChanged:(id)sender { - [[NSUserDefaults standardUserDefaults] setInteger:[self tableMode]+1 forKey:@"TableLayout"]; - [self updateForChangedItems]; + [[NSUserDefaults standardUserDefaults] setInteger:[self tableMode]+1 forKey:@"TableLayout"]; + [self updateForChangedItems]; } - (void)initTableMode { - int mode = [[NSUserDefaults standardUserDefaults] integerForKey:@"TableLayout"] - 1; - if (mode == -1) mode = 1; - [tableModeSelector setSelectedSegment:mode]; + int mode = [[NSUserDefaults standardUserDefaults] integerForKey:@"TableLayout"] - 1; + if (mode == -1) mode = 1; + [tableModeSelector setSelectedSegment:mode]; } - (void)updateReconItems:(OCamlValue *)caml_reconItems { [reconItems release]; reconItems = [[NSMutableArray alloc] init]; - long i, n =[caml_reconItems count]; + long i, n =[caml_reconItems count]; for (i=0; i<n; i++) { - LeafReconItem *item = [[LeafReconItem alloc] initWithRiAndIndex:(id)[caml_reconItems getField:i withType:'@'] index:i]; + LeafReconItem *item = [[LeafReconItem alloc] initWithRiAndIndex:(id)[caml_reconItems getField:i withType:'@'] index:i]; [reconItems addObject:item]; - [item release]; + [item release]; } - [self updateForChangedItems]; + [self updateForChangedItems]; } - (void)expandConflictedParent:(ParentReconItem *)parent { - if ([parent hasConflictedChildren]) { - // NSLog(@"Expanding conflictedParent: %@", [parent fullPath]); - [tableView expandItem:parent expandChildren:NO]; - NSArray *children = [parent children]; - int i = 0, count = [children count]; - for (;i < count; i++) { - id child = [children objectAtIndex:i]; - if ([child isKindOfClass:[ParentReconItem class]]) [self expandConflictedParent:child]; - } - } + if ([parent hasConflictedChildren]) { + // NSLog(@"Expanding conflictedParent: %@", [parent fullPath]); + [tableView expandItem:parent expandChildren:NO]; + NSArray *children = [parent children]; + int i = 0, count = [children count]; + for (;i < count; i++) { + id child = [children objectAtIndex:i]; + if ([child isKindOfClass:[ParentReconItem class]]) [self expandConflictedParent:child]; + } + } } - (void)updateForChangedItems { - int tableMode = [self tableMode]; - - [rootItem release]; - ParentReconItem *root = rootItem = [[ParentReconItem alloc] init]; - - if (tableMode != 0 && [reconItems count]) { - // Special roll-up root item for outline displays - root = [[ParentReconItem alloc] init]; - [rootItem addChild:root nested:NO]; - [root setPath:@"All Changes..."]; - [root setFullPath:@""]; - [root release]; - } - + int tableMode = [self tableMode]; + + [rootItem release]; + ParentReconItem *root = rootItem = [[ParentReconItem alloc] init]; + + if (tableMode != 0 && [reconItems count]) { + // Special roll-up root item for outline displays + root = [[ParentReconItem alloc] init]; + [rootItem addChild:root nested:NO]; + [root setPath:@"All Changes..."]; + [root setFullPath:@""]; + [root release]; + } + int j = 0, n =[reconItems count]; for (; j<n; j++) { - [root addChild:[reconItems objectAtIndex:j] nested:(tableMode != 0)]; + [root addChild:[reconItems objectAtIndex:j] nested:(tableMode != 0)]; } - - if (tableMode == 1) [root collapseParentsWithSingleChildren:YES]; - - [tableView reloadData]; - - if (NO) { - // Pre-expand entire tree - int i = [[rootItem children] count]; - while (i--) { - [tableView expandItem:[[rootItem children] objectAtIndex:i] expandChildren:YES]; - } - } else if (tableMode != 0) { - // Always open root node - [tableView expandItem:rootItem expandChildren:NO]; - - // then smart expand to reveal conflicts / changes in direction - [self expandConflictedParent:root]; - - // then open more levels if we can do so without causing scrolling - [tableView expandChildrenIfSpace]; - } - + + if (tableMode == 1) [root collapseParentsWithSingleChildren:YES]; + + [tableView reloadData]; + + if (NO) { + // Pre-expand entire tree + int i = [[rootItem children] count]; + while (i--) { + [tableView expandItem:[[rootItem children] objectAtIndex:i] expandChildren:YES]; + } + } else if (tableMode != 0) { + // Always open root node + [tableView expandItem:rootItem expandChildren:NO]; + + // then smart expand to reveal conflicts / changes in direction + [self expandConflictedParent:root]; + + // then open more levels if we can do so without causing scrolling + [tableView expandChildrenIfSpace]; + } + // Make sure details get updated (or cleared) - [self updateTableViewSelection]; + [self updateTableViewSelection]; // Only enable sync if there are reconitems if ([reconItems count]>0) { @@ -715,17 +715,17 @@ static NSDictionary *_SmallGreyAttributes = nil; else { [tableView setEditable:NO]; afterSync = YES; // rescan should be enabled - + // reconItems table no longer gets keyboard input [mainWindow makeFirstResponder:nil]; } - [self updateToolbar]; + [self updateToolbar]; } - (id)updateForIgnore:(id)item { long j = (long)ocamlCall("ii", "unisonUpdateForIgnore", [reconItems indexOfObjectIdenticalTo:item]); - NSLog(@"Updating for ignore..."); + NSLog(@"Updating for ignore..."); [self updateReconItems:(OCamlValue *)ocamlCall("@", "unisonState")]; return [reconItems objectAtIndex:j]; } @@ -734,17 +734,17 @@ static NSDictionary *_SmallGreyAttributes = nil; CAMLprim value displayStatus(value s) { id pool = [[NSAutoreleasePool alloc] init]; - NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; + NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; // NSLog(@"displayStatus: %@", str); [me performSelectorOnMainThread:@selector(statusTextSet:) withObject:str waitUntilDone:FALSE]; - [str release]; + [str release]; [pool release]; return Val_unit; } - (void)statusTextSet:(NSString *)s { /* filter out strings with # reconitems, and empty strings */ - if (!NSEqualRanges([s rangeOfString:@"reconitems"], + if (!NSEqualRanges([s rangeOfString:@"reconitems"], NSMakeRange(NSNotFound,0))) return; [statusText setStringValue:s]; } @@ -753,10 +753,10 @@ CAMLprim value displayStatus(value s) CAMLprim value displayGlobalProgress(value p) { id pool = [[NSAutoreleasePool alloc] init]; - NSNumber *num = [[NSNumber alloc] initWithDouble:Double_val(p)]; - [me performSelectorOnMainThread:@selector(updateProgressBar:) - withObject:num waitUntilDone:FALSE]; - [num release]; + NSNumber *num = [[NSNumber alloc] initWithDouble:Double_val(p)]; + [me performSelectorOnMainThread:@selector(updateProgressBar:) + withObject:num waitUntilDone:FALSE]; + [num release]; [pool release]; return Val_unit; } @@ -765,10 +765,10 @@ CAMLprim value displayGlobalProgress(value p) CAMLprim value displayDiff(value s, value s2) { id pool = [[NSAutoreleasePool alloc] init]; - [me performSelectorOnMainThread:@selector(diffViewTextSet:) - withObject:[NSArray arrayWithObjects:[NSString stringWithUTF8String:String_val(s)], - [NSString stringWithUTF8String:String_val(s2)], nil] - waitUntilDone:FALSE]; + [me performSelectorOnMainThread:@selector(diffViewTextSet:) + withObject:[NSArray arrayWithObjects:[NSString stringWithUTF8String:String_val(s)], + [NSString stringWithUTF8String:String_val(s2)], nil] + waitUntilDone:FALSE]; [pool release]; return Val_unit; } @@ -779,15 +779,15 @@ CAMLprim value displayDiffErr(value s) id pool = [[NSAutoreleasePool alloc] init]; NSString * str = [NSString stringWithUTF8String:String_val(s)]; str = [[str componentsSeparatedByString:@"\n"] componentsJoinedByString:@" "]; - [me->statusText performSelectorOnMainThread:@selector(setStringValue:) - withObject:str waitUntilDone:FALSE]; + [me->statusText performSelectorOnMainThread:@selector(setStringValue:) + withObject:str waitUntilDone:FALSE]; [pool release]; return Val_unit; } - (void)diffViewTextSet:(NSArray *)args { - [self diffViewTextSet:[args objectAtIndex:0] bodyText:[args objectAtIndex:1]]; + [self diffViewTextSet:[args objectAtIndex:0] bodyText:[args objectAtIndex:1]]; } - (void)diffViewTextSet:(NSString *)title bodyText:(NSString *)body { @@ -803,17 +803,17 @@ CAMLprim value displayDiffErr(value s) float mainOriginX = [mainWindow frame].origin.x; float mainOriginY = [mainWindow frame].origin.y; float mainWidth = [mainWindow frame].size.width; - float mainHeight = [mainWindow frame].size.height; + float mainHeight = [mainWindow frame].size.height; float diffWidth = [diffWindow frame].size.width; float diffX = mainOriginX+mainWidth; float maxX = screenOriginX+screenWidth-diffWidth; if (diffX > maxX) diffX = maxX; float diffY = mainOriginY + mainHeight; - + NSPoint diffOrigin = NSMakePoint(diffX,diffY); [diffWindow cascadeTopLeftFromPoint:diffOrigin]; - + doneFirstDiff = YES; } [diffWindow orderFront:nil]; @@ -821,10 +821,10 @@ CAMLprim value displayDiffErr(value s) - (void)displayDetails:(ReconItem *)item { - [detailsTextView setFont:[NSFont fontWithName:@"Monaco" size:10]]; - NSString *text = [item details]; - if (!text) text = @""; - [detailsTextView setString:text]; + [detailsTextView setFont:[NSFont fontWithName:@"Monaco" size:10]]; + NSString *text = [item details]; + if (!text) text = @""; + [detailsTextView setString:text]; } - (void)clearDetails @@ -835,7 +835,7 @@ CAMLprim value displayDiffErr(value s) - (IBAction)raiseCltoolWindow:(id)sender { int pref = [[NSUserDefaults standardUserDefaults] - integerForKey:@"CheckCltool"]; + integerForKey:@"CheckCltool"]; if (pref==doAsk) [cltoolPref setState:NSOffState]; else @@ -847,10 +847,10 @@ CAMLprim value displayDiffErr(value s) - (IBAction)cltoolYesButton:(id)sender; { if ([cltoolPref state]==NSOnState) - [[NSUserDefaults standardUserDefaults] + [[NSUserDefaults standardUserDefaults] setInteger:dontAsk forKey:@"CheckCltool"]; else - [[NSUserDefaults standardUserDefaults] + [[NSUserDefaults standardUserDefaults] setInteger:doAsk forKey:@"CheckCltool"]; [self installCommandLineTool:self]; @@ -860,10 +860,10 @@ CAMLprim value displayDiffErr(value s) - (IBAction)cltoolNoButton:(id)sender; { if ([cltoolPref state]==NSOnState) - [[NSUserDefaults standardUserDefaults] + [[NSUserDefaults standardUserDefaults] setInteger:dontAsk forKey:@"CheckCltool"]; else - [[NSUserDefaults standardUserDefaults] + [[NSUserDefaults standardUserDefaults] setInteger:doAsk forKey:@"CheckCltool"]; [cltoolWindow close]; @@ -879,10 +879,10 @@ CAMLprim value displayDiffErr(value s) NSRect screenFrame = [[mainWindow screen] visibleFrame]; NSRect mainWindowFrame = [mainWindow frame]; NSRect theWindowFrame = [theWindow frame]; - - float winX = mainWindowFrame.origin.x + + + float winX = mainWindowFrame.origin.x + (mainWindowFrame.size.width - theWindowFrame.size.width)/2; - float winY = mainWindowFrame.origin.y + + float winY = mainWindowFrame.origin.y + (mainWindowFrame.size.height + theWindowFrame.size.height)/2; if (winX<screenFrame.origin.x) winX=screenFrame.origin.x; @@ -896,7 +896,7 @@ CAMLprim value displayDiffErr(value s) [theWindow cascadeTopLeftFromPoint: NSMakePoint(winX,winY)]; - + [theWindow makeKeyAndOrderFront:nil]; } @@ -912,7 +912,7 @@ CAMLprim value displayDiffErr(value s) - (IBAction)installCommandLineTool:(id)sender { /* Install the command-line tool in /usr/bin/unison. - Requires root privilege, so we ask for it and + Requires root privilege, so we ask for it and pass the task off to /bin/sh. */ OSStatus myStatus; @@ -920,12 +920,12 @@ CAMLprim value displayDiffErr(value s) AuthorizationFlags myFlags = kAuthorizationFlagDefaults; AuthorizationRef myAuthorizationRef; myStatus = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, - myFlags, &myAuthorizationRef); + myFlags, &myAuthorizationRef); if (myStatus != errAuthorizationSuccess) return; { AuthorizationItem myItems = {kAuthorizationRightExecute, 0, - NULL, 0}; + NULL, 0}; AuthorizationRights myRights = {1, &myItems}; myFlags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | @@ -943,8 +943,8 @@ CAMLprim value displayDiffErr(value s) // [bundle pathForResource:@"cltool" ofType:nil]; if (exec_path == nil) return; - char *args[] = { "-f", (char *)[exec_path UTF8String], - "/usr/bin/unison", NULL }; + char *args[] = { "-f", (char *)[exec_path UTF8String], + "/usr/bin/unison", NULL }; myFlags = kAuthorizationFlagDefaults; myStatus = AuthorizationExecuteWithPrivileges @@ -956,7 +956,7 @@ CAMLprim value displayDiffErr(value s) /* if (myStatus == errAuthorizationCanceled) NSLog(@"The attempt was canceled\n"); - else if (myStatus) + else if (myStatus) NSLog(@"There was an authorization error: %ld\n", myStatus); */ } @@ -1020,10 +1020,10 @@ CAMLprim value displayDiffErr(value s) CAMLprim value fatalError(value s) { - NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; + NSString *str = [[NSString alloc] initWithUTF8String:String_val(s)]; [me performSelectorOnMainThread:@selector(fatalError:) withObject:str waitUntilDone:FALSE]; - [str release]; + [str release]; return Val_unit; } @@ -1037,9 +1037,9 @@ CAMLprim value fatalError(value s) @implementation NSString (_UnisonUtil) - (NSString *)trim { - NSCharacterSet *ws = [NSCharacterSet whitespaceCharacterSet]; - int len = [self length], i = len; - while (i && [ws characterIsMember:[self characterAtIndex:i-1]]) i--; - return (i == len) ? self : [self substringToIndex:i]; + NSCharacterSet *ws = [NSCharacterSet whitespaceCharacterSet]; + int len = [self length], i = len; + while (i && [ws characterIsMember:[self characterAtIndex:i-1]]) i--; + return (i == len) ? self : [self substringToIndex:i]; } @end diff --git a/src/uimacnew/PreferencesController.m b/src/uimacnew/PreferencesController.m index 3016e98..f1e1ede 100644 --- a/src/uimacnew/PreferencesController.m +++ b/src/uimacnew/PreferencesController.m @@ -54,7 +54,7 @@ return NO; } } - ocamlCall("xSSS", "unisonProfileInit", profileName, firstRoot, secondRoot); + ocamlCall("xSSS", "unisonProfileInit", profileName, firstRoot, secondRoot); return YES; } diff --git a/src/uimacnew/ProfileController.m b/src/uimacnew/ProfileController.m index c6ebb98..94ec172 100644 --- a/src/uimacnew/ProfileController.m +++ b/src/uimacnew/ProfileController.m @@ -20,11 +20,11 @@ NSString *unisonDirectory() #endif unsigned int count = [files count]; unsigned int i,j; - + [profiles release]; profiles = [[NSMutableArray alloc] init]; defaultIndex = -1; - + for (i = j = 0; i < count; i++) { NSString *file = [files objectAtIndex:i]; if ([[file pathExtension] isEqualTo:@"prf"]) { diff --git a/src/uimacnew/ProfileTableView.m b/src/uimacnew/ProfileTableView.m index 7a3c1e1..eea7b91 100644 --- a/src/uimacnew/ProfileTableView.m +++ b/src/uimacnew/ProfileTableView.m @@ -24,7 +24,7 @@ /* Override default highlight colour to match ReconTableView */ - (id)_highlightColorForCell:(NSCell *)cell -{ +{ if(([[self window] firstResponder] == self) && [[self window] isMainWindow] && [[self window] isKeyWindow]) diff --git a/src/uimacnew/ProgressCell.h b/src/uimacnew/ProgressCell.h index 0d17652..c2ef4ad 100644 --- a/src/uimacnew/ProgressCell.h +++ b/src/uimacnew/ProgressCell.h @@ -2,12 +2,12 @@ @interface ProgressCell : NSCell { - float _minVal, _maxVal; // defaults to 0.0, 100.0 - BOOL _isActive; - BOOL _useFullView; // default: NO - BOOL _isError; // default: NO - NSImage *_icon; - NSString *_statusString; + float _minVal, _maxVal; // defaults to 0.0, 100.0 + BOOL _isActive; + BOOL _useFullView; // default: NO + BOOL _isError; // default: NO + NSImage *_icon; + NSString *_statusString; } - (void)setStatusString:(NSString *)string; - (void)setIcon:(NSImage *)image; diff --git a/src/uimacnew/ProgressCell.m b/src/uimacnew/ProgressCell.m index ce56406..011e164 100644 --- a/src/uimacnew/ProgressCell.m +++ b/src/uimacnew/ProgressCell.m @@ -1,8 +1,8 @@ /****************************************************************************** * Copyright 2008 (see file COPYING for more information) * - * Loosely based on TorrentCell from Transmission (.png files are from - * the original). + * Loosely based on TorrentCell from Transmission (.png files are from + * the original). *****************************************************************************/ #import "ProgressCell.h" @@ -10,56 +10,56 @@ #define BAR_HEIGHT 12.0 static NSImage *_ProgressWhite, *_ProgressBlue, *_ProgressGray, *_ProgressGreen, - *_ProgressAdvanced, *_ProgressEndWhite, *_ProgressEndBlue, - *_ProgressEndGray, *_ProgressEndGreen, *_ProgressLightGreen, - *_ProgressEndAdvanced, * _ErrorImage; + *_ProgressAdvanced, *_ProgressEndWhite, *_ProgressEndBlue, + *_ProgressEndGray, *_ProgressEndGreen, *_ProgressLightGreen, + *_ProgressEndAdvanced, * _ErrorImage; static NSSize ZeroSize; @implementation ProgressCell + (void) initialize { - NSSize startSize = NSMakeSize(100.0, BAR_HEIGHT); - ZeroSize = NSMakeSize(0.0, 0.0); - - _ProgressWhite = [NSImage imageNamed: @"ProgressBarWhite.png"]; - [_ProgressWhite setScalesWhenResized: YES]; - - _ProgressBlue = [NSImage imageNamed: @"ProgressBarBlue.png"]; - [_ProgressBlue setScalesWhenResized: YES]; - [_ProgressBlue setSize: startSize]; - - _ProgressGray = [NSImage imageNamed: @"ProgressBarGray.png"]; - [_ProgressGray setScalesWhenResized: YES]; - [_ProgressGray setSize: startSize]; - - _ProgressGreen = [NSImage imageNamed: @"ProgressBarGreen.png"]; - [_ProgressGreen setScalesWhenResized: YES]; - - _ProgressLightGreen = [NSImage imageNamed: @"ProgressBarLightGreen.png"]; - [_ProgressLightGreen setScalesWhenResized: YES]; - - _ProgressAdvanced = [NSImage imageNamed: @"ProgressBarAdvanced.png"]; - [_ProgressAdvanced setScalesWhenResized: YES]; - - _ProgressEndWhite = [NSImage imageNamed: @"ProgressBarEndWhite.png"]; - _ProgressEndBlue = [NSImage imageNamed: @"ProgressBarEndBlue.png"]; - _ProgressEndGray = [NSImage imageNamed: @"ProgressBarEndGray.png"]; - _ProgressEndGreen = [NSImage imageNamed: @"ProgressBarEndGreen.png"]; - _ProgressEndAdvanced = [NSImage imageNamed: @"ProgressBarEndAdvanced.png"]; - - _ErrorImage = [[NSImage imageNamed: @"Error.tiff"] copy]; - [_ErrorImage setFlipped: YES]; + NSSize startSize = NSMakeSize(100.0, BAR_HEIGHT); + ZeroSize = NSMakeSize(0.0, 0.0); + + _ProgressWhite = [NSImage imageNamed: @"ProgressBarWhite.png"]; + [_ProgressWhite setScalesWhenResized: YES]; + + _ProgressBlue = [NSImage imageNamed: @"ProgressBarBlue.png"]; + [_ProgressBlue setScalesWhenResized: YES]; + [_ProgressBlue setSize: startSize]; + + _ProgressGray = [NSImage imageNamed: @"ProgressBarGray.png"]; + [_ProgressGray setScalesWhenResized: YES]; + [_ProgressGray setSize: startSize]; + + _ProgressGreen = [NSImage imageNamed: @"ProgressBarGreen.png"]; + [_ProgressGreen setScalesWhenResized: YES]; + + _ProgressLightGreen = [NSImage imageNamed: @"ProgressBarLightGreen.png"]; + [_ProgressLightGreen setScalesWhenResized: YES]; + + _ProgressAdvanced = [NSImage imageNamed: @"ProgressBarAdvanced.png"]; + [_ProgressAdvanced setScalesWhenResized: YES]; + + _ProgressEndWhite = [NSImage imageNamed: @"ProgressBarEndWhite.png"]; + _ProgressEndBlue = [NSImage imageNamed: @"ProgressBarEndBlue.png"]; + _ProgressEndGray = [NSImage imageNamed: @"ProgressBarEndGray.png"]; + _ProgressEndGreen = [NSImage imageNamed: @"ProgressBarEndGreen.png"]; + _ProgressEndAdvanced = [NSImage imageNamed: @"ProgressBarEndAdvanced.png"]; + + _ErrorImage = [[NSImage imageNamed: @"Error.tiff"] copy]; + [_ErrorImage setFlipped: YES]; } - (id)init { - self = [super init]; - _minVal = 0.0; - _maxVal = 100.0; - _isActive = YES; + self = [super init]; + _minVal = 0.0; + _maxVal = 100.0; + _isActive = YES; - return self; + return self; } // BCP: Removed (11/09) per Onne Gorter @@ -76,7 +76,7 @@ static NSSize ZeroSize; // [_statusString autorelease]; // _statusString = [string retain]; // Added: - _statusString = string; + _statusString = string; } - (void)setIcon:(NSImage *)image @@ -85,19 +85,19 @@ static NSSize ZeroSize; // [_icon autorelease]; // _icon = [image retain]; // Added: - _icon = image; + _icon = image; } - (void)setIsActive:(BOOL)yn { - _isActive = yn; + _isActive = yn; } - (void)drawBarImage:(NSImage *)barImage width:(float)width point:(NSPoint)point { if (width <= 0.0) return; - + if ([barImage size].width < width) [barImage setSize: NSMakeSize(width * 2.0, BAR_HEIGHT)]; @@ -106,43 +106,43 @@ static NSSize ZeroSize; - (void)drawBar:(float)width point:(NSPoint)point { - id objectValue = [self objectValue]; - if (!objectValue) return; - + id objectValue = [self objectValue]; + if (!objectValue) return; + float value = [objectValue floatValue]; - float progress = (value - _minVal)/ (_maxVal - _minVal); + float progress = (value - _minVal)/ (_maxVal - _minVal); width -= 2.0; float completedWidth, remainingWidth = 0.0; - + //bar images and widths NSImage * barLeftEnd, * barRightEnd, * barComplete, * barRemaining; - if (progress >= 1.0) { + if (progress >= 1.0) { completedWidth = width; barLeftEnd = _ProgressEndGreen; barRightEnd = _ProgressEndGreen; barComplete = _ProgressGreen; barRemaining = _ProgressLightGreen; - } - else { + } + else { completedWidth = progress * width; remainingWidth = width - completedWidth; - barLeftEnd = (remainingWidth == width) ? _ProgressEndWhite - : ((_isActive) ? _ProgressEndBlue : _ProgressEndGray); - barRightEnd = (completedWidth < width) ? _ProgressEndWhite - : ((_isActive) ? _ProgressEndBlue : _ProgressEndGray); + barLeftEnd = (remainingWidth == width) ? _ProgressEndWhite + : ((_isActive) ? _ProgressEndBlue : _ProgressEndGray); + barRightEnd = (completedWidth < width) ? _ProgressEndWhite + : ((_isActive) ? _ProgressEndBlue : _ProgressEndGray); barComplete = _isActive ? _ProgressBlue : _ProgressGray; barRemaining = _ProgressWhite; } - + [barLeftEnd compositeToPoint: point operation: NSCompositeSourceOver]; - + point.x += 1.0; [self drawBarImage: barComplete width: completedWidth point: point]; - + point.x += completedWidth; [self drawBarImage: barRemaining width: remainingWidth point: point]; - + point.x += remainingWidth; [barRightEnd compositeToPoint: point operation: NSCompositeSourceOver]; } @@ -151,49 +151,49 @@ static NSSize ZeroSize; { NSPoint pen = cellFrame.origin; const float PADDING = 3.0; - - // progress bar - pen.y += PADDING + BAR_HEIGHT; - float mainWidth = cellFrame.size.width; - float barWidth = mainWidth; - [self drawBar: barWidth point: pen]; - - //icon - NSImage * image = _isError ? _ErrorImage : _icon; - if (image) { + + // progress bar + pen.y += PADDING + BAR_HEIGHT; + float mainWidth = cellFrame.size.width; + float barWidth = mainWidth; + [self drawBar: barWidth point: pen]; + + //icon + NSImage * image = _isError ? _ErrorImage : _icon; + if (image) { NSSize imageSize = [image size]; NSRect imageFrame; - imageFrame.origin = cellFrame.origin; + imageFrame.origin = cellFrame.origin; imageFrame.size = imageSize; imageFrame.origin.x += ceil((cellFrame.size.width - imageSize.width) / 2); imageFrame.origin.y += [view isFlipped] ? - ceil((cellFrame.size.height + imageSize.height) / 2) - : ceil((cellFrame.size.height - imageSize.height) / 2); + ceil((cellFrame.size.height + imageSize.height) / 2) + : ceil((cellFrame.size.height - imageSize.height) / 2); [image compositeToPoint:imageFrame.origin operation:NSCompositeSourceOver]; - } + } - // status string - if (_statusString) { - BOOL highlighted = [self isHighlighted] && [[self highlightColorWithFrame: cellFrame inView: view] + // status string + if (_statusString) { + BOOL highlighted = [self isHighlighted] && [[self highlightColorWithFrame: cellFrame inView: view] isEqual: [NSColor alternateSelectedControlColor]]; - NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; - [paragraphStyle setLineBreakMode: NSLineBreakByTruncatingTail]; - - NSDictionary * statusAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: - highlighted ? [NSColor whiteColor] : [NSColor darkGrayColor], NSForegroundColorAttributeName, - [NSFont boldSystemFontOfSize: 9.0], NSFontAttributeName, - paragraphStyle, NSParagraphStyleAttributeName, nil]; - [paragraphStyle release]; - - NSSize statusSize = [_statusString sizeWithAttributes: statusAttributes]; - pen = cellFrame.origin; - pen.x += (cellFrame.size.width - statusSize.width) * 0.5; - pen.y += (cellFrame.size.height - statusSize.height) * 0.5; - - [_statusString drawInRect: NSMakeRect(pen.x, pen.y, statusSize.width, statusSize.height) - withAttributes: statusAttributes]; - [statusAttributes release]; - } + NSMutableParagraphStyle * paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; + [paragraphStyle setLineBreakMode: NSLineBreakByTruncatingTail]; + + NSDictionary * statusAttributes = [[NSDictionary alloc] initWithObjectsAndKeys: + highlighted ? [NSColor whiteColor] : [NSColor darkGrayColor], NSForegroundColorAttributeName, + [NSFont boldSystemFontOfSize: 9.0], NSFontAttributeName, + paragraphStyle, NSParagraphStyleAttributeName, nil]; + [paragraphStyle release]; + + NSSize statusSize = [_statusString sizeWithAttributes: statusAttributes]; + pen = cellFrame.origin; + pen.x += (cellFrame.size.width - statusSize.width) * 0.5; + pen.y += (cellFrame.size.height - statusSize.height) * 0.5; + + [_statusString drawInRect: NSMakeRect(pen.x, pen.y, statusSize.width, statusSize.height) + withAttributes: statusAttributes]; + [statusAttributes release]; + } } @end diff --git a/src/uimacnew/ReconItem.h b/src/uimacnew/ReconItem.h index 299b8b7..fd9024b 100644 --- a/src/uimacnew/ReconItem.h +++ b/src/uimacnew/ReconItem.h @@ -6,7 +6,7 @@ @interface ReconItem : NSObject { - ReconItem *parent; + ReconItem *parent; NSString *path; NSString *fullPath; BOOL selected; @@ -71,8 +71,8 @@ @interface ParentReconItem : ReconItem { - NSMutableArray *_children; - long fileCount; + NSMutableArray *_children; + long fileCount; } - (void)addChild:(ReconItem *)item nested:(BOOL)useNesting; - (void)sortUsingDescriptors:(NSArray *)sortDescriptors; diff --git a/src/uimacnew/ReconItem.m b/src/uimacnew/ReconItem.m index d684bd2..653bd3e 100644 --- a/src/uimacnew/ReconItem.m +++ b/src/uimacnew/ReconItem.m @@ -6,12 +6,12 @@ @implementation ReconItem - init { - [super init]; - selected = NO; // NB only used/updated during sorts. Not a - // reliable indicator of whether item is selected - fileSize = -1.; - bytesTransferred = -1.; - return self; + [super init]; + selected = NO; // NB only used/updated during sorts. Not a + // reliable indicator of whether item is selected + fileSize = -1.; + bytesTransferred = -1.; + return self; } - (void)dealloc @@ -20,28 +20,28 @@ [fullPath release]; // [direction release]; // assuming retained by cache, so not retained // [directionSortString release]; // no retain/release necessary because is constant - [super dealloc]; + [super dealloc]; } -- (ReconItem *)parent +- (ReconItem *)parent { - return parent; + return parent; } - (void)setParent:(ReconItem *)p { - parent = p; + parent = p; } - (void)willChange { - // propagate up parent chain - [parent willChange]; + // propagate up parent chain + [parent willChange]; } - (NSArray *)children { - return nil; + return nil; } - (BOOL)selected @@ -61,28 +61,28 @@ - (void)setPath:(NSString *)aPath { - [path autorelease]; - path = [aPath retain]; - - // invalidate - [fullPath autorelease]; - fullPath = nil; + [path autorelease]; + path = [aPath retain]; + + // invalidate + [fullPath autorelease]; + fullPath = nil; } - (NSString *)fullPath { - if (!fullPath) { - NSString *parentPath = [parent fullPath]; - [self setFullPath:(([parentPath length] > 0) ? [parentPath stringByAppendingFormat:@"/%@", path] : path)]; - } + if (!fullPath) { + NSString *parentPath = [parent fullPath]; + [self setFullPath:(([parentPath length] > 0) ? [parentPath stringByAppendingFormat:@"/%@", path] : path)]; + } return fullPath; } - (void)setFullPath:(NSString *)p { - [fullPath autorelease]; - fullPath = [p retain]; + [fullPath autorelease]; + fullPath = [p retain]; } - (NSString *)left @@ -99,139 +99,139 @@ static NSMutableDictionary *_ChangeIconsByType = nil; - (NSImage *)changeIconFor:(NSString *)type other:(NSString *)other { - if (![type length]) { - if ([other isEqual:@"Created"]) { - type = @"Absent"; - } else if ([other length]) { - type = @"Unmodified"; - } else - return nil; - } - - NSImage *result = [_ChangeIconsByType objectForKey:type]; - if (!result) { - NSString *imageName = [NSString stringWithFormat:@"Change_%@.png", type]; - result = [NSImage imageNamed:imageName]; - if (!_ChangeIconsByType) _ChangeIconsByType = [[NSMutableDictionary alloc] init]; - [_ChangeIconsByType setObject:result forKey:type]; - } - return result; + if (![type length]) { + if ([other isEqual:@"Created"]) { + type = @"Absent"; + } else if ([other length]) { + type = @"Unmodified"; + } else + return nil; + } + + NSImage *result = [_ChangeIconsByType objectForKey:type]; + if (!result) { + NSString *imageName = [NSString stringWithFormat:@"Change_%@.png", type]; + result = [NSImage imageNamed:imageName]; + if (!_ChangeIconsByType) _ChangeIconsByType = [[NSMutableDictionary alloc] init]; + [_ChangeIconsByType setObject:result forKey:type]; + } + return result; } - (NSImage *)leftIcon { - return [self changeIconFor:[self left] other:[self right]]; + return [self changeIconFor:[self left] other:[self right]]; } - (NSImage *)rightIcon { - return [self changeIconFor:[self right] other:[self left]]; + return [self changeIconFor:[self right] other:[self left]]; } - (double)computeFileSize { - return 0.; + return 0.; } - (double)bytesTransferred { - return 0.; + return 0.; } - (long)fileCount { - return 1; + return 1; } - (double)fileSize { - if (fileSize == -1.) fileSize = [self computeFileSize]; - return fileSize; + if (fileSize == -1.) fileSize = [self computeFileSize]; + return fileSize; } - (NSString *)formatFileSize:(double)size { - if (size == 0) return @"--"; - if (size < 1024) return @"< 1KB"; // return [NSString stringWithFormat:@"%i bytes", size]; - size /= 1024; - if (size < 1024) return [NSString stringWithFormat:@"%i KB", (int)size]; - size /= 1024; - if (size < 1024) return [NSString stringWithFormat:@"%1.1f MB", size]; - size = size / 1024; - return [NSString stringWithFormat:@"%1.1f GB", size]; + if (size == 0) return @"--"; + if (size < 1024) return @"< 1KB"; // return [NSString stringWithFormat:@"%i bytes", size]; + size /= 1024; + if (size < 1024) return [NSString stringWithFormat:@"%i KB", (int)size]; + size /= 1024; + if (size < 1024) return [NSString stringWithFormat:@"%1.1f MB", size]; + size = size / 1024; + return [NSString stringWithFormat:@"%1.1f GB", size]; } - (NSString *)fileSizeString { - return [self formatFileSize:[self fileSize]]; + return [self formatFileSize:[self fileSize]]; } - (NSString *)bytesTransferredString { - return [self formatFileSize:[self bytesTransferred]]; + return [self formatFileSize:[self bytesTransferred]]; } - (NSNumber *)percentTransferred { - double size = [self computeFileSize]; - return (size > 0) ? [NSNumber numberWithDouble:([self bytesTransferred] / (size) * 100.0)] - : nil; + double size = [self computeFileSize]; + return (size > 0) ? [NSNumber numberWithDouble:([self bytesTransferred] / (size) * 100.0)] + : nil; } static NSMutableDictionary *_iconsByExtension = nil; - (NSImage *)iconForExtension:(NSString *)extension { - NSImage *icon = [_iconsByExtension objectForKey:extension]; - if (!_iconsByExtension) _iconsByExtension = [[NSMutableDictionary alloc] init]; - if (!icon) { - icon = [[NSWorkspace sharedWorkspace] iconForFileType:extension]; - [icon setSize:NSMakeSize(16.0, 16.0)]; - [_iconsByExtension setObject:icon forKey:extension]; - } - return icon; + NSImage *icon = [_iconsByExtension objectForKey:extension]; + if (!_iconsByExtension) _iconsByExtension = [[NSMutableDictionary alloc] init]; + if (!icon) { + icon = [[NSWorkspace sharedWorkspace] iconForFileType:extension]; + [icon setSize:NSMakeSize(16.0, 16.0)]; + [_iconsByExtension setObject:icon forKey:extension]; + } + return icon; } - (NSImage *)fileIcon { - return [self iconForExtension:NSFileTypeForHFSTypeCode(kOpenFolderIcon)]; + return [self iconForExtension:NSFileTypeForHFSTypeCode(kOpenFolderIcon)]; } - (NSString *)dirString { - return @"<-?->"; + return @"<-?->"; } - (NSImage *)direction { - if (direction) return direction; + if (direction) return direction; NSString * dirString = [self dirString]; BOOL changedFromDefault = [self changedFromDefault]; - + if ([dirString isEqual:@"<-?->"]) { if (changedFromDefault | resolved) { direction = [NSImage imageNamed: @"table-skip.tif"]; - directionSortString = @"3"; - } + directionSortString = @"3"; + } else { direction = [NSImage imageNamed: @"table-conflict.tif"]; - directionSortString = @"2"; + directionSortString = @"2"; } } - + else if ([dirString isEqual:@"---->"]) { if (changedFromDefault) { direction = [NSImage imageNamed: @"table-right-blue.tif"]; directionSortString = @"6"; } - else { + else { direction = [NSImage imageNamed: @"table-right-green.tif"]; directionSortString = @"8"; } } - + else if ([dirString isEqual:@"<----"]) { if (changedFromDefault) { direction = [NSImage imageNamed: @"table-left-blue.tif"]; @@ -247,17 +247,17 @@ static NSMutableDictionary *_iconsByExtension = nil; direction = [NSImage imageNamed: @"table-merge.tif"]; directionSortString = @"4"; } - - else if ([dirString isEqual:@"<--->"]) { - direction = [NSImage imageNamed: @"table-mixed.tif"]; - directionSortString = @"9"; - } + + else if ([dirString isEqual:@"<--->"]) { + direction = [NSImage imageNamed: @"table-mixed.tif"]; + directionSortString = @"9"; + } else { direction = [NSImage imageNamed: @"table-error.tif"]; directionSortString = @"1"; } - + [direction retain]; return direction; } @@ -306,13 +306,13 @@ static NSMutableDictionary *_iconsByExtension = nil; { switch (action) { case 'I': - ocamlCall("xS", "unisonIgnorePath", [self fullPath]); + ocamlCall("xS", "unisonIgnorePath", [self fullPath]); break; case 'E': - ocamlCall("xS", "unisonIgnoreExt", [self path]); + ocamlCall("xS", "unisonIgnoreExt", [self path]); break; case 'N': - ocamlCall("xS", "unisonIgnoreName", [self path]); + ocamlCall("xS", "unisonIgnoreName", [self path]); break; default: NSLog(@"ReconItem.doIgnore : unknown ignore"); @@ -373,13 +373,13 @@ static NSMutableDictionary *_iconsByExtension = nil; - (NSString *)progress { - return nil; + return nil; } - (BOOL)transferInProgress { - double soFar = [self bytesTransferred]; - return (soFar > 0) && (soFar < [self fileSize]); + double soFar = [self bytesTransferred]; + return (soFar > 0) && (soFar < [self fileSize]); } - (void)resetProgress @@ -388,16 +388,16 @@ static NSMutableDictionary *_iconsByExtension = nil; - (NSString *)progressString { - NSString *progress = [self progress]; - if ([progress length] == 0. || [progress hasSuffix:@"%"]) - progress = [self transferInProgress] ? [self bytesTransferredString] : @""; - else if ([progress isEqual:@"done"]) progress = @""; - return progress; + NSString *progress = [self progress]; + if ([progress length] == 0. || [progress hasSuffix:@"%"]) + progress = [self transferInProgress] ? [self bytesTransferredString] : @""; + else if ([progress isEqual:@"done"]) progress = @""; + return progress; } - (NSString *)details { - return nil; + return nil; } - (NSString *)updateDetails @@ -407,17 +407,17 @@ static NSMutableDictionary *_iconsByExtension = nil; - (BOOL)isConflict { - return NO; + return NO; } - (BOOL)changedFromDefault { - return NO; + return NO; } - (void)revertDirection { - [self willChange]; + [self willChange]; [direction release]; direction = nil; resolved = NO; @@ -425,7 +425,7 @@ static NSMutableDictionary *_iconsByExtension = nil; - (BOOL)canDiff { - return NO; + return NO; } - (void)showDiffs @@ -434,7 +434,7 @@ static NSMutableDictionary *_iconsByExtension = nil; - (ReconItem *)collapseParentsWithSingleChildren:(BOOL)isRoot { - return self; + return self; } @end @@ -446,7 +446,7 @@ static NSMutableDictionary *_iconsByExtension = nil; { [super init]; ri = [v retain]; - index = i; + index = i; resolved = NO; directionSortString = @""; return self; @@ -459,7 +459,7 @@ static NSMutableDictionary *_iconsByExtension = nil; [right release]; [progress release]; [details release]; - + [super dealloc]; } @@ -472,13 +472,13 @@ static NSMutableDictionary *_iconsByExtension = nil; - (NSString *)left { if (!left) left = [(NSString *)ocamlCall("S@", "unisonRiToLeft", ri) retain]; - return left; + return left; } - (NSString *)right { - if (!right) right = [(NSString *)ocamlCall("S@", "unisonRiToRight", ri) retain]; - return right; + if (!right) right = [(NSString *)ocamlCall("S@", "unisonRiToRight", ri) retain]; + return right; } - (double)computeFileSize @@ -488,58 +488,58 @@ static NSMutableDictionary *_iconsByExtension = nil; - (double)bytesTransferred { - if (bytesTransferred == -1.) { - // need to force to fileSize if done, otherwise may not match up to 100% - bytesTransferred = ([[self progress] isEqual:@"done"]) ? [self fileSize] + if (bytesTransferred == -1.) { + // need to force to fileSize if done, otherwise may not match up to 100% + bytesTransferred = ([[self progress] isEqual:@"done"]) ? [self fileSize] : [(NSNumber*)ocamlCall("N@", "unisonRiToBytesTransferred", ri) doubleValue]; - } - return bytesTransferred; + } + return bytesTransferred; } - (NSImage *)fileIcon { - NSString *extension = [[self path] pathExtension]; - - if ([@"" isEqual:extension]) { - NSString *type = (NSString *)ocamlCall("S@", "unisonRiToFileType", ri); - extension = [type isEqual:@"dir"] - ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) - : NSFileTypeForHFSTypeCode(kGenericDocumentIcon); - } - return [self iconForExtension:extension]; + NSString *extension = [[self path] pathExtension]; + + if ([@"" isEqual:extension]) { + NSString *type = (NSString *)ocamlCall("S@", "unisonRiToFileType", ri); + extension = [type isEqual:@"dir"] + ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) + : NSFileTypeForHFSTypeCode(kGenericDocumentIcon); + } + return [self iconForExtension:extension]; } - (NSString *)dirString { - return (NSString *)ocamlCall("S@", "unisonRiToDirection", ri); + return (NSString *)ocamlCall("S@", "unisonRiToDirection", ri); } - (void)setDirection:(char *)d { - [self willChange]; + [self willChange]; [super setDirection:d]; - ocamlCall("x@", d, ri); + ocamlCall("x@", d, ri); } - (NSString *)progress { if (!progress) { - progress = [(NSString *)ocamlCall("S@", "unisonRiToProgress", ri) retain]; - if ([progress isEqual:@"FAILED"]) [self updateDetails]; + progress = [(NSString *)ocamlCall("S@", "unisonRiToProgress", ri) retain]; + if ([progress isEqual:@"FAILED"]) [self updateDetails]; } - return progress; + return progress; } - (void)resetProgress { // Get rid of the memoized progress because we expect it to change - [self willChange]; - bytesTransferred = -1.; + [self willChange]; + bytesTransferred = -1.; [progress release]; - - // Force update now so we get the result while the OCaml thread is available - // [self progress]; - // [self bytesTransferred]; + + // Force update now so we get the result while the OCaml thread is available + // [self progress]; + // [self bytesTransferred]; progress = nil; } @@ -551,35 +551,35 @@ static NSMutableDictionary *_iconsByExtension = nil; - (NSString *)updateDetails { - [details autorelease]; - details = [(NSString *)ocamlCall("S@", "unisonRiToDetails", ri) retain]; + [details autorelease]; + details = [(NSString *)ocamlCall("S@", "unisonRiToDetails", ri) retain]; return details; } - (BOOL)isConflict { - return ((long)ocamlCall("i@", "unisonRiIsConflict", ri) ? YES : NO); + return ((long)ocamlCall("i@", "unisonRiIsConflict", ri) ? YES : NO); } - (BOOL)changedFromDefault { - return ((long)ocamlCall("i@", "changedFromDefault", ri) ? YES : NO); + return ((long)ocamlCall("i@", "changedFromDefault", ri) ? YES : NO); } - (void)revertDirection { - ocamlCall("x@", "unisonRiRevert", ri); - [super revertDirection]; + ocamlCall("x@", "unisonRiRevert", ri); + [super revertDirection]; } - (BOOL)canDiff { - return ((long)ocamlCall("i@", "canDiff", ri) ? YES : NO); + return ((long)ocamlCall("i@", "canDiff", ri) ? YES : NO); } - (void)showDiffs { - ocamlCall("x@i", "runShowDiffs", ri, index); + ocamlCall("x@i", "runShowDiffs", ri, index); } @end @@ -590,19 +590,19 @@ static NSMutableDictionary *_iconsByExtension = nil; @implementation NSImage (TintedImage) -- (NSImage *)tintedImageWithColor:(NSColor *) tint operation:(NSCompositingOperation) op +- (NSImage *)tintedImageWithColor:(NSColor *) tint operation:(NSCompositingOperation) op { - NSSize size = [self size]; - NSRect imageBounds = NSMakeRect(0, 0, size.width, size.height); - NSImage *newImage = [[NSImage alloc] initWithSize:size]; - - [newImage lockFocus]; - [self compositeToPoint:NSZeroPoint operation:NSCompositeSourceOver]; - [tint set]; - NSRectFillUsingOperation(imageBounds, op); - [newImage unlockFocus]; - - return [newImage autorelease]; + NSSize size = [self size]; + NSRect imageBounds = NSMakeRect(0, 0, size.width, size.height); + NSImage *newImage = [[NSImage alloc] initWithSize:size]; + + [newImage lockFocus]; + [self compositeToPoint:NSZeroPoint operation:NSCompositeSourceOver]; + [tint set]; + NSRectFillUsingOperation(imageBounds, op); + [newImage unlockFocus]; + + return [newImage autorelease]; } @end @@ -610,230 +610,229 @@ static NSMutableDictionary *_iconsByExtension = nil; // ---- Parent nodes in grouped items @implementation ParentReconItem -- init +- init { - [super init]; - _children = [[NSMutableArray alloc] init]; - return self; + [super init]; + _children = [[NSMutableArray alloc] init]; + return self; } - initWithPath:(NSString *)aPath { - [self init]; - path = [aPath retain]; - return self; + [self init]; + path = [aPath retain]; + return self; } - (void)dealloc { - [_children release]; - [super dealloc]; + [_children release]; + [super dealloc]; } - (NSArray *)children; { - return _children; + return _children; } - (void)addChild:(ReconItem *)item pathArray:(NSArray *)pathArray level:(int)level { - NSString *element = [pathArray count] ? [pathArray objectAtIndex:level] : @""; - - // if we're at the leaf of the path, then add the item - if (((0 == [pathArray count]) && (0 == level)) || (level == [pathArray count]-1)) { - [item setParent:self]; - [item setPath:element]; - [_children addObject:item]; - return; - } - - // find / add matching parent node - ReconItem *last = [_children lastObject]; - if (last == nil || ![last isKindOfClass:[ParentReconItem class]] || ![[last path] isEqual:element]) { - last = [[ParentReconItem alloc] initWithPath:element]; - [last setParent:self]; - [_children addObject:last]; - [last release]; - } - - [(ParentReconItem *)last addChild:item pathArray:pathArray level:level+1]; + NSString *element = [pathArray count] ? [pathArray objectAtIndex:level] : @""; + + // if we're at the leaf of the path, then add the item + if (((0 == [pathArray count]) && (0 == level)) || (level == [pathArray count]-1)) { + [item setParent:self]; + [item setPath:element]; + [_children addObject:item]; + return; + } + + // find / add matching parent node + ReconItem *last = [_children lastObject]; + if (last == nil || ![last isKindOfClass:[ParentReconItem class]] || ![[last path] isEqual:element]) { + last = [[ParentReconItem alloc] initWithPath:element]; + [last setParent:self]; + [_children addObject:last]; + [last release]; + } + + [(ParentReconItem *)last addChild:item pathArray:pathArray level:level+1]; } - (void)addChild:(ReconItem *)item nested:(BOOL)nested { - [item setPath:nil]; // invalidate/reset - - if (nested) { - [self addChild:item pathArray:[[item path] pathComponents] level:0]; - } else { - [item setParent:self]; - [_children addObject:item]; - } + [item setPath:nil]; // invalidate/reset + + if (nested) { + [self addChild:item pathArray:[[item path] pathComponents] level:0]; + } else { + [item setParent:self]; + [_children addObject:item]; + } } - (void)sortUsingDescriptors:(NSArray *)sortDescriptors { - // sort our children - [_children sortUsingDescriptors:sortDescriptors]; - - // then have them sort theirs - int i = [_children count]; - while (i--) { - id child = [_children objectAtIndex:i]; - if ([child isKindOfClass:[ParentReconItem class]]) [child sortUsingDescriptors:sortDescriptors]; - } + // sort our children + [_children sortUsingDescriptors:sortDescriptors]; + + // then have them sort theirs + int i = [_children count]; + while (i--) { + id child = [_children objectAtIndex:i]; + if ([child isKindOfClass:[ParentReconItem class]]) [child sortUsingDescriptors:sortDescriptors]; + } } - (ReconItem *)collapseParentsWithSingleChildren:(BOOL)isRoot { - // replace ourselves? - if (!isRoot && [_children count] == 1) { - ReconItem *child = [_children lastObject]; - [child setPath:[path stringByAppendingFormat:@"/%@", [child path]]]; - return [child collapseParentsWithSingleChildren:NO]; - } - - // recurse - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - ReconItem *replacement = [child collapseParentsWithSingleChildren:NO]; - if (child != replacement) { - [_children replaceObjectAtIndex:i withObject:replacement]; - [replacement setParent:self]; - } - } - return self; + // replace ourselves? + if (!isRoot && [_children count] == 1) { + ReconItem *child = [_children lastObject]; + [child setPath:[path stringByAppendingFormat:@"/%@", [child path]]]; + return [child collapseParentsWithSingleChildren:NO]; + } + + // recurse + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + ReconItem *replacement = [child collapseParentsWithSingleChildren:NO]; + if (child != replacement) { + [_children replaceObjectAtIndex:i withObject:replacement]; + [replacement setParent:self]; + } + } + return self; } - (void)willChange { - // invalidate child-based state - // Assuming caches / constant, so not retained / released - // [direction autorelease]; - // [directionSortString autorelease]; - direction = nil; - directionSortString = nil; - bytesTransferred = -1.; - // fileSize = -1; + // invalidate child-based state + // Assuming caches / constant, so not retained / released + // [direction autorelease]; + // [directionSortString autorelease]; + direction = nil; + directionSortString = nil; + bytesTransferred = -1.; + // fileSize = -1; // resolved = NO; - // propagate up parent chain - [parent willChange]; + // propagate up parent chain + [parent willChange]; } // Propagation methods - (void)doAction:(unichar)action { - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - [child doAction:action]; - } + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + [child doAction:action]; + } } - (void)doIgnore:(unichar)action { - // handle Path ignores at this level, name and extension at the child nodes - if (action == 'I') { - [super doIgnore:'I']; - } else { - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - [child doIgnore:action]; - } - } + // handle Path ignores at this level, name and extension at the child nodes + if (action == 'I') { + [super doIgnore:'I']; + } else { + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + [child doIgnore:action]; + } + } } // Rollup methods - (long)fileCount { - if (fileCount == 0) { - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - fileCount += [child fileCount]; - } - } - return fileCount; + if (fileCount == 0) { + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + fileCount += [child fileCount]; + } + } + return fileCount; } - (double)computeFileSize { - double size = 0; - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - size += [child fileSize]; - } - return size; + double size = 0; + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + size += [child fileSize]; + } + return size; } - (double)bytesTransferred { - if (bytesTransferred == -1.) { - bytesTransferred = 0.; - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - bytesTransferred += [child bytesTransferred]; - } - } - return bytesTransferred; + if (bytesTransferred == -1.) { + bytesTransferred = 0.; + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + bytesTransferred += [child bytesTransferred]; + } + } + return bytesTransferred; } - (NSString *)dirString { - NSString *rollup = nil; - int i = [_children count]; - while (i--) { - ReconItem *child = [_children objectAtIndex:i]; - NSString *dirString = [child dirString]; - if (!rollup || [dirString isEqual:rollup]) { - rollup = dirString; - } else { - // conflict - if ([dirString isEqual:@"---->"] || [dirString isEqual:@"<----"] || [dirString isEqual:@"<--->"]) { - if ([rollup isEqual:@"---->"] || [rollup isEqual:@"<----"] || [rollup isEqual:@"<--->"]) { - rollup = @"<--->"; - } - } else { - rollup = @"<-?->"; - } - } - } - // NSLog(@"dirString for %@: %@", path, rollup); - return rollup; + NSString *rollup = nil; + int i = [_children count]; + while (i--) { + ReconItem *child = [_children objectAtIndex:i]; + NSString *dirString = [child dirString]; + if (!rollup || [dirString isEqual:rollup]) { + rollup = dirString; + } else { + // conflict + if ([dirString isEqual:@"---->"] || [dirString isEqual:@"<----"] || [dirString isEqual:@"<--->"]) { + if ([rollup isEqual:@"---->"] || [rollup isEqual:@"<----"] || [rollup isEqual:@"<--->"]) { + rollup = @"<--->"; + } + } else { + rollup = @"<-?->"; + } + } + } + // NSLog(@"dirString for %@: %@", path, rollup); + return rollup; } - (BOOL)hasConflictedChildren { - NSString *dirString = [self dirString]; - BOOL result = [dirString isEqual:@"<--->"] || [dirString isEqual:@"<-?->"]; - // NSLog(@"hasConflictedChildren (%@): %@: %i", [self path], dirString, result); - return result; + NSString *dirString = [self dirString]; + BOOL result = [dirString isEqual:@"<--->"] || [dirString isEqual:@"<-?->"]; + // NSLog(@"hasConflictedChildren (%@): %@: %i", [self path], dirString, result); + return result; } static NSMutableDictionary *_parentImages = nil; static NSColor *_veryLightGreyColor = nil; - (NSImage *)direction { - if (!_parentImages) { - _parentImages = [[NSMutableDictionary alloc] init]; - _veryLightGreyColor = [[NSColor colorWithCalibratedRed:0.7 green:0.7 blue:0.7 alpha:1.0] retain]; - } - NSImage *baseImage = [super direction]; - NSImage *parentImage = [_parentImages objectForKey:baseImage]; - if (!parentImage) { - // make parent images a grey version of the leaf images - parentImage = [baseImage tintedImageWithColor:_veryLightGreyColor operation:NSCompositeSourceIn]; - [_parentImages setObject:parentImage forKey:baseImage]; - } - return parentImage; + if (!_parentImages) { + _parentImages = [[NSMutableDictionary alloc] init]; + _veryLightGreyColor = [[NSColor colorWithCalibratedRed:0.7 green:0.7 blue:0.7 alpha:1.0] retain]; + } + NSImage *baseImage = [super direction]; + NSImage *parentImage = [_parentImages objectForKey:baseImage]; + if (!parentImage) { + // make parent images a grey version of the leaf images + parentImage = [baseImage tintedImageWithColor:_veryLightGreyColor operation:NSCompositeSourceIn]; + [_parentImages setObject:parentImage forKey:baseImage]; + } + return parentImage; } @end - diff --git a/src/uimacnew/ReconTableView.h b/src/uimacnew/ReconTableView.h index 78af854..1fc5a66 100644 --- a/src/uimacnew/ReconTableView.h +++ b/src/uimacnew/ReconTableView.h @@ -1,6 +1,6 @@ // // ReconTableView.h -// +// // NSTableView extended to handle additional keyboard events for the reconcile window. // The keyDown: method is redefined. // diff --git a/src/uimacnew/ReconTableView.m b/src/uimacnew/ReconTableView.m index 0de94c6..a4df8b0 100644 --- a/src/uimacnew/ReconTableView.m +++ b/src/uimacnew/ReconTableView.m @@ -14,71 +14,71 @@ - (NSArray *)selectedObjects { - NSMutableArray *result = [NSMutableArray array]; + NSMutableArray *result = [NSMutableArray array]; NSIndexSet *set = [self selectedRowIndexes]; NSUInteger index = [set firstIndex]; while (index != NSNotFound) { [result addObject:[self itemAtRow:index]]; index = [set indexGreaterThanIndex: index]; } - return result; + return result; } - (void)setSelectedObjects:(NSArray *)selectedObjects { - NSMutableIndexSet *set = [NSMutableIndexSet indexSet]; - int i = [selectedObjects count]; - while (i--) { - int index = [self rowForItem:[selectedObjects objectAtIndex:i]]; - if (index >= 0) [set addIndex:index]; - } - [self selectRowIndexes:set byExtendingSelection:NO]; + NSMutableIndexSet *set = [NSMutableIndexSet indexSet]; + int i = [selectedObjects count]; + while (i--) { + int index = [self rowForItem:[selectedObjects objectAtIndex:i]]; + if (index >= 0) [set addIndex:index]; + } + [self selectRowIndexes:set byExtendingSelection:NO]; } - (NSEnumerator *)selectedObjectEnumerator { - return [[self selectedObjects] objectEnumerator]; + return [[self selectedObjects] objectEnumerator]; } -- (int)rowCapacityWithoutScrolling +- (int)rowCapacityWithoutScrolling { - float bodyHeight = [self visibleRect].size.height; - bodyHeight -= [[self headerView] visibleRect].size.height; - return bodyHeight / ([self rowHeight] + 2.0); + float bodyHeight = [self visibleRect].size.height; + bodyHeight -= [[self headerView] visibleRect].size.height; + return bodyHeight / ([self rowHeight] + 2.0); } - (BOOL)_canAcceptRowCountWithoutScrolling:(int)rows { - return ([self numberOfRows] + rows) <= [self rowCapacityWithoutScrolling]; + return ([self numberOfRows] + rows) <= [self rowCapacityWithoutScrolling]; } - (BOOL)_expandChildrenIfSpace:(id)parent level:(int)level { - BOOL didExpand = NO; - id dataSource = [self dataSource]; - int count = [dataSource outlineView:self numberOfChildrenOfItem:parent]; - if (level == 0) { - if (count && ([self isItemExpanded:parent] || [self _canAcceptRowCountWithoutScrolling:count])) { - [self expandItem:parent expandChildren:NO]; - didExpand = YES; - } - } else { - // try expanding each of our children. If all expand, then return YES, - // indicating that it may be worth trying the next level - int i; - for (i=0; i < count; i++) { - id child = [dataSource outlineView:self child:i ofItem:parent]; - didExpand = [self _expandChildrenIfSpace:child level:level-1] || didExpand; - } - } - - return didExpand; + BOOL didExpand = NO; + id dataSource = [self dataSource]; + int count = [dataSource outlineView:self numberOfChildrenOfItem:parent]; + if (level == 0) { + if (count && ([self isItemExpanded:parent] || [self _canAcceptRowCountWithoutScrolling:count])) { + [self expandItem:parent expandChildren:NO]; + didExpand = YES; + } + } else { + // try expanding each of our children. If all expand, then return YES, + // indicating that it may be worth trying the next level + int i; + for (i=0; i < count; i++) { + id child = [dataSource outlineView:self child:i ofItem:parent]; + didExpand = [self _expandChildrenIfSpace:child level:level-1] || didExpand; + } + } + + return didExpand; } - (void)expandChildrenIfSpace { - int level = 1; - while ([self _expandChildrenIfSpace:nil level:level]) level++; + int level = 1; + while ([self _expandChildrenIfSpace:nil level:level]) level++; } @end @@ -116,14 +116,14 @@ else if (action == @selector(showDiff:)) { if ((!editable) || (!([self numberOfSelectedRows]==1))) return NO; - else return [self canDiffSelection]; + else return [self canDiffSelection]; } else return YES; } - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - return [self validateItem:[menuItem action]]; + return [self validateItem:[menuItem action]]; } - (BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem @@ -134,10 +134,10 @@ - (void)doIgnore:(unichar)c { NSEnumerator *e = [self selectedObjectEnumerator]; - ReconItem *item, *last = nil; + ReconItem *item, *last = nil; while (item = [e nextObject]) { [item doIgnore:c]; - last = item; + last = item; } if (last) { // something was selected MyController* controller = (MyController*) [self dataSource]; @@ -166,14 +166,14 @@ { int numSelected = 0; NSEnumerator *e = [self selectedObjectEnumerator]; - ReconItem *item, *last = nil; + ReconItem *item, *last = nil; while (item = [e nextObject]) { numSelected++; [item doAction:c]; - last = item; + last = item; } if (numSelected>0) { - int nextRow = [self rowForItem:last] + 1; + int nextRow = [self rowForItem:last] + 1; if (numSelected == 1 && [self numberOfRows] > nextRow && c!='d') { // Move to next row, unless already at last row, or if more than one row selected [self selectRowIndexes:[NSIndexSet indexSetWithIndex:nextRow] byExtendingSelection:NO]; @@ -215,7 +215,7 @@ NSMutableArray *reconItems = [controller reconItems]; int i = 0; for (; i < [reconItems count]; i++) { - ReconItem *item = [reconItems objectAtIndex:i]; + ReconItem *item = [reconItems objectAtIndex:i]; if ([item isConflict]) [self selectRowIndexes:[NSIndexSet indexSetWithIndex:[self rowForItem:item]] byExtendingSelection:YES]; } @@ -276,17 +276,17 @@ { BOOL canDiff = YES; NSEnumerator *e = [self selectedObjectEnumerator]; - ReconItem *item; + ReconItem *item; while (item = [e nextObject]) { if (![item canDiff]) canDiff= NO; - } + } return canDiff; } -/* Override default highlight colour because it's hard to see the +/* Override default highlight colour because it's hard to see the conflict/resolution icons */ - (id)_highlightColorForCell:(NSCell *)cell -{ +{ if(([[self window] firstResponder] == self) && [[self window] isMainWindow] && [[self window] isKeyWindow]) diff --git a/src/uimacnew/UnisonToolbar.h b/src/uimacnew/UnisonToolbar.h index d7a23ae..ba67d6b 100644 --- a/src/uimacnew/UnisonToolbar.h +++ b/src/uimacnew/UnisonToolbar.h @@ -1,6 +1,6 @@ // // UnisonToolbar.h -// +// // Extended NSToolbar with several views // // Created by Ben Willmore on Sun March 12 2006. @@ -16,10 +16,10 @@ <NSToolbarDelegate> #endif { - ReconTableView* tableView; - MyController* myController; - NSString* currentView; - NSView* tableModeView; + ReconTableView* tableView; + MyController* myController; + NSString* currentView; + NSView* tableModeView; } - initWithIdentifier:(NSString *) identifier :(MyController *) aController :(ReconTableView *) aTableView; diff --git a/src/uimacnew/UnisonToolbar.m b/src/uimacnew/UnisonToolbar.m index 6030915..ab6ee91 100644 --- a/src/uimacnew/UnisonToolbar.m +++ b/src/uimacnew/UnisonToolbar.m @@ -1,6 +1,6 @@ // // UnisonToolbar.h -// +// // Extended NSToolbar with several views // // Created by Ben Willmore on Sun March 12 2006. @@ -30,12 +30,12 @@ static NSString* TableModeIdentifier = @"TableMode"; - initWithIdentifier:(NSString *) identifier :(MyController *) aController :(ReconTableView *) aTableView { if ((self = [super initWithIdentifier: identifier])) { - [self setAllowsUserCustomization: NO]; - [self setAutosavesConfiguration: NO]; - [self setDelegate: self]; - myController = aController; - tableView = aTableView; - currentView = @""; + [self setAllowsUserCustomization: NO]; + [self setAutosavesConfiguration: NO]; + [self setDelegate: self]; + myController = aController; + tableView = aTableView; + currentView = @""; } return self; @@ -43,44 +43,44 @@ static NSString* TableModeIdentifier = @"TableMode"; - (void)takeTableModeView:(NSView *)view { - tableModeView = [view retain]; - [view setHidden:YES]; + tableModeView = [view retain]; + [view setHidden:YES]; } - (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted { NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease]; if ([itemIdent isEqual: QuitItemIdentifier]) { - [toolbarItem setLabel: @"Quit"]; - [toolbarItem setImage: [NSImage imageNamed: @"quit.tif"]]; - [toolbarItem setTarget:NSApp]; - [toolbarItem setAction:@selector(terminate:)]; - } - else if ([itemIdent isEqual: OpenItemIdentifier]) { + [toolbarItem setLabel: @"Quit"]; + [toolbarItem setImage: [NSImage imageNamed: @"quit.tif"]]; + [toolbarItem setTarget:NSApp]; + [toolbarItem setAction:@selector(terminate:)]; + } + else if ([itemIdent isEqual: OpenItemIdentifier]) { [toolbarItem setLabel: @"Open"]; [toolbarItem setImage: [NSImage imageNamed: @"go.tif"]]; [toolbarItem setTarget:myController]; [toolbarItem setAction:@selector(openButton:)]; } - else if ([itemIdent isEqual: NewItemIdentifier]) { + else if ([itemIdent isEqual: NewItemIdentifier]) { [toolbarItem setLabel: @"New"]; [toolbarItem setImage: [NSImage imageNamed: @"add.tif"]]; [toolbarItem setTarget:myController]; [toolbarItem setAction:@selector(createButton:)]; } - else if ([itemIdent isEqual: CancelItemIdentifier]) { + else if ([itemIdent isEqual: CancelItemIdentifier]) { [toolbarItem setLabel: @"Cancel"]; [toolbarItem setImage: [NSImage imageNamed: @"restart.tif"]]; [toolbarItem setTarget:myController]; [toolbarItem setAction:@selector(chooseProfiles)]; } - else if ([itemIdent isEqual: SaveItemIdentifier]) { + else if ([itemIdent isEqual: SaveItemIdentifier]) { [toolbarItem setLabel: @"Save"]; [toolbarItem setImage: [NSImage imageNamed: @"save.tif"]]; [toolbarItem setTarget:myController]; [toolbarItem setAction:@selector(saveProfileButton:)]; - } - else if ([itemIdent isEqual: GoItemIdentifier]) { + } + else if ([itemIdent isEqual: GoItemIdentifier]) { [toolbarItem setLabel: @"Go"]; [toolbarItem setImage: [NSImage imageNamed: @"go.tif"]]; [toolbarItem setTarget:myController]; @@ -108,63 +108,63 @@ static NSString* TableModeIdentifier = @"TableMode"; [toolbarItem setLabel: @"Merge"]; [toolbarItem setImage: [NSImage imageNamed: @"merge.tif"]]; [toolbarItem setTarget:tableView]; - [toolbarItem setAction:@selector(merge:)]; + [toolbarItem setAction:@selector(merge:)]; } - else if ([itemIdent isEqual: LToRItemIdentifier]) { + else if ([itemIdent isEqual: LToRItemIdentifier]) { [toolbarItem setLabel: @"Left to right"]; [toolbarItem setImage: [NSImage imageNamed: @"right.tif"]]; [toolbarItem setTarget:tableView]; [toolbarItem setAction:@selector(copyLR:)]; - } - else if ([itemIdent isEqual: SkipItemIdentifier]) { + } + else if ([itemIdent isEqual: SkipItemIdentifier]) { [toolbarItem setLabel: @"Skip"]; [toolbarItem setImage: [NSImage imageNamed: @"skip.tif"]]; [toolbarItem setTarget:tableView]; [toolbarItem setAction:@selector(leaveAlone:)]; - } - else if ([itemIdent isEqual: DiffItemIdentifier]) { + } + else if ([itemIdent isEqual: DiffItemIdentifier]) { [toolbarItem setLabel: @"Diff"]; [toolbarItem setImage: [NSImage imageNamed: @"diff.tif"]]; [toolbarItem setTarget:tableView]; [toolbarItem setAction:@selector(showDiff:)]; - } - else if ([itemIdent isEqual: TableModeIdentifier]) { - [toolbarItem setLabel:@"Layout"]; - [toolbarItem setToolTip:@"Switch table nesting"]; - [tableModeView setHidden:NO]; - [toolbarItem setView:tableModeView]; - [toolbarItem setMinSize:NSMakeSize(NSWidth([tableModeView frame]),NSHeight([tableModeView frame])+10)]; - [toolbarItem setMaxSize:NSMakeSize(NSWidth([tableModeView frame]),NSHeight([tableModeView frame])+10)]; - } - - return toolbarItem; + } + else if ([itemIdent isEqual: TableModeIdentifier]) { + [toolbarItem setLabel:@"Layout"]; + [toolbarItem setToolTip:@"Switch table nesting"]; + [tableModeView setHidden:NO]; + [toolbarItem setView:tableModeView]; + [toolbarItem setMinSize:NSMakeSize(NSWidth([tableModeView frame]),NSHeight([tableModeView frame])+10)]; + [toolbarItem setMaxSize:NSMakeSize(NSWidth([tableModeView frame]),NSHeight([tableModeView frame])+10)]; + } + + return toolbarItem; } - (NSArray *) itemIdentifiersForView: (NSString *) whichView { if ([whichView isEqual: @"chooseProfileView"]) { - return [NSArray arrayWithObjects: QuitItemIdentifier, NewItemIdentifier, OpenItemIdentifier, nil]; - } - else if ([whichView isEqual: @"preferencesView"]) { - return [NSArray arrayWithObjects: QuitItemIdentifier, SaveItemIdentifier, CancelItemIdentifier, nil]; - } - else if ([whichView isEqual: @"ConnectingView"]) { - return [NSArray arrayWithObjects: QuitItemIdentifier, nil]; - } - else if ([whichView isEqual: @"updatesView"]) { - return [NSArray arrayWithObjects: QuitItemIdentifier, - RestartItemIdentifier, - NSToolbarSeparatorItemIdentifier, - GoItemIdentifier, - RescanItemIdentifier, - NSToolbarSeparatorItemIdentifier, - RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, - SkipItemIdentifier, NSToolbarSeparatorItemIdentifier, - DiffItemIdentifier, - TableModeIdentifier, nil]; - } - else { - return [NSArray arrayWithObjects: QuitItemIdentifier, Nil]; - } + return [NSArray arrayWithObjects: QuitItemIdentifier, NewItemIdentifier, OpenItemIdentifier, nil]; + } + else if ([whichView isEqual: @"preferencesView"]) { + return [NSArray arrayWithObjects: QuitItemIdentifier, SaveItemIdentifier, CancelItemIdentifier, nil]; + } + else if ([whichView isEqual: @"ConnectingView"]) { + return [NSArray arrayWithObjects: QuitItemIdentifier, nil]; + } + else if ([whichView isEqual: @"updatesView"]) { + return [NSArray arrayWithObjects: QuitItemIdentifier, + RestartItemIdentifier, + NSToolbarSeparatorItemIdentifier, + GoItemIdentifier, + RescanItemIdentifier, + NSToolbarSeparatorItemIdentifier, + RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, + SkipItemIdentifier, NSToolbarSeparatorItemIdentifier, + DiffItemIdentifier, + TableModeIdentifier, nil]; + } + else { + return [NSArray arrayWithObjects: QuitItemIdentifier, Nil]; + } } - (NSArray *) toolbarDefaultItemIdentifiers: (NSToolbar *) toolbar { @@ -172,44 +172,44 @@ static NSString* TableModeIdentifier = @"TableMode"; } - (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar { - return [NSArray arrayWithObjects: QuitItemIdentifier, OpenItemIdentifier, NewItemIdentifier, - CancelItemIdentifier, SaveItemIdentifier, - GoItemIdentifier, RestartItemIdentifier, RescanItemIdentifier, - RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, - SkipItemIdentifier, DiffItemIdentifier, - NSToolbarSeparatorItemIdentifier, nil]; + return [NSArray arrayWithObjects: QuitItemIdentifier, OpenItemIdentifier, NewItemIdentifier, + CancelItemIdentifier, SaveItemIdentifier, + GoItemIdentifier, RestartItemIdentifier, RescanItemIdentifier, + RToLItemIdentifier, MergeItemIdentifier, LToRItemIdentifier, + SkipItemIdentifier, DiffItemIdentifier, + NSToolbarSeparatorItemIdentifier, nil]; } - (void) setView: (NSString *) whichView { - if ([whichView isEqual:currentView]) return; - - currentView = whichView; - - int i; - NSArray *identifiers; - NSString *oldIdentifier; - NSString *newIdentifier; - - identifiers=[self itemIdentifiersForView:whichView]; - for (i=0; i<[identifiers count]; i++) { - newIdentifier = [identifiers objectAtIndex:i]; - if (i<[[self items] count]) { - oldIdentifier = [[[self items] objectAtIndex:i] itemIdentifier]; - if ([newIdentifier isEqual: oldIdentifier] ) { - [[[self items] objectAtIndex:i] setEnabled:YES]; - } - else { - [self removeItemAtIndex:i]; - [self insertItemWithItemIdentifier:newIdentifier atIndex:i]; - } - } - else { - [self insertItemWithItemIdentifier:newIdentifier atIndex:i]; - } - } - while ([[self items] count] > [identifiers count]) { - [self removeItemAtIndex:[identifiers count]]; - } + if ([whichView isEqual:currentView]) return; + + currentView = whichView; + + int i; + NSArray *identifiers; + NSString *oldIdentifier; + NSString *newIdentifier; + + identifiers=[self itemIdentifiersForView:whichView]; + for (i=0; i<[identifiers count]; i++) { + newIdentifier = [identifiers objectAtIndex:i]; + if (i<[[self items] count]) { + oldIdentifier = [[[self items] objectAtIndex:i] itemIdentifier]; + if ([newIdentifier isEqual: oldIdentifier] ) { + [[[self items] objectAtIndex:i] setEnabled:YES]; + } + else { + [self removeItemAtIndex:i]; + [self insertItemWithItemIdentifier:newIdentifier atIndex:i]; + } + } + else { + [self insertItemWithItemIdentifier:newIdentifier atIndex:i]; + } + } + while ([[self items] count] > [identifiers count]) { + [self removeItemAtIndex:[identifiers count]]; + } } @end diff --git a/src/uimacnew/main.m b/src/uimacnew/main.m index 13084a6..668a287 100644 --- a/src/uimacnew/main.m +++ b/src/uimacnew/main.m @@ -13,7 +13,7 @@ int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; int i; - + /* When you click-start or use the open command, the program is invoked with a command-line arg of the form -psn_XXXXXXXXX. The XXXXXXXX is a "process serial number" and it seems to be important for Carbon programs. We need @@ -24,9 +24,9 @@ int main(int argc, const char *argv[]) argc--; argv[1] = NULL; } - - [Bridge startup:argv]; - + + [Bridge startup:argv]; + /* Check for invocations that don't start up the gui */ for (i=1; i<argc; i++) { if (!strcmp(argv[i],"-doc") || @@ -35,19 +35,19 @@ int main(int argc, const char *argv[]) !strcmp(argv[i],"-server") || !strcmp(argv[i],"-socket") || !strcmp(argv[i],"-ui")) { - NSLog(@"Calling nonGuiStartup"); - @try { - ocamlCall("x", "unisonNonGuiStartup"); - } @catch (NSException *ex) { - NSLog(@"Uncaught exception: %@", [ex reason]); - exit(1); - } + NSLog(@"Calling nonGuiStartup"); + @try { + ocamlCall("x", "unisonNonGuiStartup"); + } @catch (NSException *ex) { + NSLog(@"Uncaught exception: %@", [ex reason]); + exit(1); + } /* If we get here without exiting first, the non GUI startup detected a -ui graphic or command-line profile, and we should in fact start the GUI. */ } } - - /* go! */ + + /* go! */ [pool release]; return NSApplicationMain(argc, argv); } diff --git a/src/uimacnew/uimacnew.xcodeproj/project.pbxproj b/src/uimacnew/uimacnew.xcodeproj/project.pbxproj index 9f9a5cf..1a75f2e 100644 --- a/src/uimacnew/uimacnew.xcodeproj/project.pbxproj +++ b/src/uimacnew/uimacnew.xcodeproj/project.pbxproj @@ -1,746 +1,746 @@ // !$*UTF8*$! { - archiveVersion = 1; - classes = { - }; - objectVersion = 42; - objects = { + archiveVersion = 1; + classes = { + }; + objectVersion = 42; + objects = { /* Begin PBXAggregateTarget section */ - 2A124E780DE1C48400524237 /* Create ExternalSettings */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 2A124E7C0DE1C4A200524237 /* Build configuration list for PBXAggregateTarget "Create ExternalSettings" */; - buildPhases = ( - 2A124E7E0DE1C4BE00524237 /* Run Script (version, ocaml lib dir) */, - ); - dependencies = ( - ); - name = "Create ExternalSettings"; - productName = "Create ExternalSettings"; - }; + 2A124E780DE1C48400524237 /* Create ExternalSettings */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 2A124E7C0DE1C4A200524237 /* Build configuration list for PBXAggregateTarget "Create ExternalSettings" */; + buildPhases = ( + 2A124E7E0DE1C4BE00524237 /* Run Script (version, ocaml lib dir) */, + ); + dependencies = ( + ); + name = "Create ExternalSettings"; + productName = "Create ExternalSettings"; + }; /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ - 2A3C3F3309922A8000E404E9 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2A3C3F3209922A8000E404E9 /* Growl.framework */; }; - 2A3C3F7D09922D4900E404E9 /* NotificationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A3C3F7B09922D4900E404E9 /* NotificationController.m */; }; - 2A3C3FAE0992323F00E404E9 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A3C3F3209922A8000E404E9 /* Growl.framework */; }; - 2E282CC80D9AE2B000439D01 /* unison-blob.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 2E282CC70D9AE2B000439D01 /* unison-blob.o */; }; - 44042CB60BE4FC9B00A6BBB2 /* ProgressCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */; }; - 44042D1B0BE52AED00A6BBB2 /* ProgressBarAdvanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */; }; - 44042D1C0BE52AEE00A6BBB2 /* ProgressBarBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */; }; - 44042D1D0BE52AEE00A6BBB2 /* ProgressBarEndAdvanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */; }; - 44042D1E0BE52AEE00A6BBB2 /* ProgressBarEndBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */; }; - 44042D1F0BE52AEE00A6BBB2 /* ProgressBarEndGray.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */; }; - 44042D200BE52AEE00A6BBB2 /* ProgressBarEndGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */; }; - 44042D210BE52AEE00A6BBB2 /* ProgressBarEndWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */; }; - 44042D220BE52AEE00A6BBB2 /* ProgressBarGray.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */; }; - 44042D230BE52AEE00A6BBB2 /* ProgressBarGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */; }; - 44042D240BE52AEE00A6BBB2 /* ProgressBarLightGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */; }; - 44042D250BE52AEE00A6BBB2 /* ProgressBarWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */; }; - 440EEAF30C03EC3D00ACAAB0 /* Change_Created.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */; }; - 440EEAF90C03F0B800ACAAB0 /* Change_Deleted.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */; }; - 440EEAFA0C03F0B800ACAAB0 /* Change_Modified.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */; }; - 440EEAFB0C03F0B800ACAAB0 /* Change_PropsChanged.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */; }; - 445A291B0BFA5B3300E4E641 /* Outline-Deep.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */; }; - 445A29270BFA5C1200E4E641 /* Outline-Flat.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A29260BFA5C1200E4E641 /* Outline-Flat.png */; }; - 445A29290BFA5C1B00E4E641 /* Outline-Flattened.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */; }; - 445A2A5E0BFAB6C300E4E641 /* ImageAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */; }; - 449F03E10BE00DE9003F15C8 /* Bridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 449F03DF0BE00DE9003F15C8 /* Bridge.m */; }; - 44A794A10BE16C380069680C /* ExceptionHandling.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44A794A00BE16C380069680C /* ExceptionHandling.framework */; }; - 44A797F40BE3F9B70069680C /* table-mixed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 44A797F10BE3F9B70069680C /* table-mixed.tif */; }; - 44F472B10C0DB735006428EF /* Change_Absent.png in Resources */ = {isa = PBXBuildFile; fileRef = 44F472AF0C0DB735006428EF /* Change_Absent.png */; }; - 44F472B20C0DB735006428EF /* Change_Unmodified.png in Resources */ = {isa = PBXBuildFile; fileRef = 44F472B00C0DB735006428EF /* Change_Unmodified.png */; }; - 69C625E60664EC3300B3C46A /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; - 69C625E70664EC3300B3C46A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; - 69C625E80664EC3300B3C46A /* Unison.icns in Resources */ = {isa = PBXBuildFile; fileRef = 69C625CA0664E94E00B3C46A /* Unison.icns */; }; - 69C625EA0664EC3300B3C46A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; - 69C625EB0664EC3300B3C46A /* MyController.m in Sources */ = {isa = PBXBuildFile; fileRef = 69660DC704F08CC100CF23A4 /* MyController.m */; }; - 69C625EC0664EC3300B3C46A /* ProfileController.m in Sources */ = {isa = PBXBuildFile; fileRef = 690F564504F11EC300CF23A4 /* ProfileController.m */; }; - 69C625ED0664EC3300B3C46A /* ReconItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */; }; - 69C625EE0664EC3300B3C46A /* ReconTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 69BA7DA904FD695200CF23A4 /* ReconTableView.m */; }; - 69C625EF0664EC3300B3C46A /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 697985CE050CFA2D00CF23A4 /* PreferencesController.m */; }; - 69C625F00664EC3300B3C46A /* ProfileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 691CE181051BB44A00CF23A4 /* ProfileTableView.m */; }; - 69C625F20664EC3300B3C46A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; - 69E407BA07EB95AA00D37AA1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69E407B907EB95AA00D37AA1 /* Security.framework */; }; - B518071C09D6652100B1B21F /* add.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071209D6652100B1B21F /* add.tif */; }; - B518071D09D6652100B1B21F /* diff.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071309D6652100B1B21F /* diff.tif */; }; - B518071E09D6652100B1B21F /* go.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071409D6652100B1B21F /* go.tif */; }; - B518071F09D6652100B1B21F /* left.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071509D6652100B1B21F /* left.tif */; }; - B518072009D6652100B1B21F /* merge.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071609D6652100B1B21F /* merge.tif */; }; - B518072109D6652100B1B21F /* quit.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071709D6652100B1B21F /* quit.tif */; }; - B518072209D6652100B1B21F /* restart.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071809D6652100B1B21F /* restart.tif */; }; - B518072309D6652100B1B21F /* right.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071909D6652100B1B21F /* right.tif */; }; - B518072409D6652100B1B21F /* save.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071A09D6652100B1B21F /* save.tif */; }; - B518072509D6652100B1B21F /* skip.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071B09D6652100B1B21F /* skip.tif */; }; - B554004109C4E5AA0089E1C3 /* UnisonToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */; }; - B5B44C1909DF61A4000DC7AF /* table-conflict.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1109DF61A4000DC7AF /* table-conflict.tif */; }; - B5B44C1A09DF61A4000DC7AF /* table-error.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1209DF61A4000DC7AF /* table-error.tif */; }; - B5B44C1B09DF61A4000DC7AF /* table-left-blue.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */; }; - B5B44C1C09DF61A4000DC7AF /* table-left-green.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1409DF61A4000DC7AF /* table-left-green.tif */; }; - B5B44C1D09DF61A4000DC7AF /* table-merge.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1509DF61A4000DC7AF /* table-merge.tif */; }; - B5B44C1E09DF61A4000DC7AF /* table-right-blue.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */; }; - B5B44C1F09DF61A4000DC7AF /* table-right-green.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1709DF61A4000DC7AF /* table-right-green.tif */; }; - B5B44C2009DF61A4000DC7AF /* table-skip.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1809DF61A4000DC7AF /* table-skip.tif */; }; - B5E03B3909E38B9E0058C7B9 /* rescan.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5E03B3809E38B9E0058C7B9 /* rescan.tif */; }; + 2A3C3F3309922A8000E404E9 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 2A3C3F3209922A8000E404E9 /* Growl.framework */; }; + 2A3C3F7D09922D4900E404E9 /* NotificationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A3C3F7B09922D4900E404E9 /* NotificationController.m */; }; + 2A3C3FAE0992323F00E404E9 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A3C3F3209922A8000E404E9 /* Growl.framework */; }; + 2E282CC80D9AE2B000439D01 /* unison-blob.o in Frameworks */ = {isa = PBXBuildFile; fileRef = 2E282CC70D9AE2B000439D01 /* unison-blob.o */; }; + 44042CB60BE4FC9B00A6BBB2 /* ProgressCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */; }; + 44042D1B0BE52AED00A6BBB2 /* ProgressBarAdvanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */; }; + 44042D1C0BE52AEE00A6BBB2 /* ProgressBarBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */; }; + 44042D1D0BE52AEE00A6BBB2 /* ProgressBarEndAdvanced.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */; }; + 44042D1E0BE52AEE00A6BBB2 /* ProgressBarEndBlue.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */; }; + 44042D1F0BE52AEE00A6BBB2 /* ProgressBarEndGray.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */; }; + 44042D200BE52AEE00A6BBB2 /* ProgressBarEndGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */; }; + 44042D210BE52AEE00A6BBB2 /* ProgressBarEndWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */; }; + 44042D220BE52AEE00A6BBB2 /* ProgressBarGray.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */; }; + 44042D230BE52AEE00A6BBB2 /* ProgressBarGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */; }; + 44042D240BE52AEE00A6BBB2 /* ProgressBarLightGreen.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */; }; + 44042D250BE52AEE00A6BBB2 /* ProgressBarWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */; }; + 440EEAF30C03EC3D00ACAAB0 /* Change_Created.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */; }; + 440EEAF90C03F0B800ACAAB0 /* Change_Deleted.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */; }; + 440EEAFA0C03F0B800ACAAB0 /* Change_Modified.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */; }; + 440EEAFB0C03F0B800ACAAB0 /* Change_PropsChanged.png in Resources */ = {isa = PBXBuildFile; fileRef = 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */; }; + 445A291B0BFA5B3300E4E641 /* Outline-Deep.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */; }; + 445A29270BFA5C1200E4E641 /* Outline-Flat.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A29260BFA5C1200E4E641 /* Outline-Flat.png */; }; + 445A29290BFA5C1B00E4E641 /* Outline-Flattened.png in Resources */ = {isa = PBXBuildFile; fileRef = 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */; }; + 445A2A5E0BFAB6C300E4E641 /* ImageAndTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */; }; + 449F03E10BE00DE9003F15C8 /* Bridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 449F03DF0BE00DE9003F15C8 /* Bridge.m */; }; + 44A794A10BE16C380069680C /* ExceptionHandling.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 44A794A00BE16C380069680C /* ExceptionHandling.framework */; }; + 44A797F40BE3F9B70069680C /* table-mixed.tif in Resources */ = {isa = PBXBuildFile; fileRef = 44A797F10BE3F9B70069680C /* table-mixed.tif */; }; + 44F472B10C0DB735006428EF /* Change_Absent.png in Resources */ = {isa = PBXBuildFile; fileRef = 44F472AF0C0DB735006428EF /* Change_Absent.png */; }; + 44F472B20C0DB735006428EF /* Change_Unmodified.png in Resources */ = {isa = PBXBuildFile; fileRef = 44F472B00C0DB735006428EF /* Change_Unmodified.png */; }; + 69C625E60664EC3300B3C46A /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; }; + 69C625E70664EC3300B3C46A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; }; + 69C625E80664EC3300B3C46A /* Unison.icns in Resources */ = {isa = PBXBuildFile; fileRef = 69C625CA0664E94E00B3C46A /* Unison.icns */; }; + 69C625EA0664EC3300B3C46A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; }; + 69C625EB0664EC3300B3C46A /* MyController.m in Sources */ = {isa = PBXBuildFile; fileRef = 69660DC704F08CC100CF23A4 /* MyController.m */; }; + 69C625EC0664EC3300B3C46A /* ProfileController.m in Sources */ = {isa = PBXBuildFile; fileRef = 690F564504F11EC300CF23A4 /* ProfileController.m */; }; + 69C625ED0664EC3300B3C46A /* ReconItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */; }; + 69C625EE0664EC3300B3C46A /* ReconTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 69BA7DA904FD695200CF23A4 /* ReconTableView.m */; }; + 69C625EF0664EC3300B3C46A /* PreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 697985CE050CFA2D00CF23A4 /* PreferencesController.m */; }; + 69C625F00664EC3300B3C46A /* ProfileTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 691CE181051BB44A00CF23A4 /* ProfileTableView.m */; }; + 69C625F20664EC3300B3C46A /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; + 69E407BA07EB95AA00D37AA1 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69E407B907EB95AA00D37AA1 /* Security.framework */; }; + B518071C09D6652100B1B21F /* add.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071209D6652100B1B21F /* add.tif */; }; + B518071D09D6652100B1B21F /* diff.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071309D6652100B1B21F /* diff.tif */; }; + B518071E09D6652100B1B21F /* go.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071409D6652100B1B21F /* go.tif */; }; + B518071F09D6652100B1B21F /* left.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071509D6652100B1B21F /* left.tif */; }; + B518072009D6652100B1B21F /* merge.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071609D6652100B1B21F /* merge.tif */; }; + B518072109D6652100B1B21F /* quit.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071709D6652100B1B21F /* quit.tif */; }; + B518072209D6652100B1B21F /* restart.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071809D6652100B1B21F /* restart.tif */; }; + B518072309D6652100B1B21F /* right.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071909D6652100B1B21F /* right.tif */; }; + B518072409D6652100B1B21F /* save.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071A09D6652100B1B21F /* save.tif */; }; + B518072509D6652100B1B21F /* skip.tif in Resources */ = {isa = PBXBuildFile; fileRef = B518071B09D6652100B1B21F /* skip.tif */; }; + B554004109C4E5AA0089E1C3 /* UnisonToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */; }; + B5B44C1909DF61A4000DC7AF /* table-conflict.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1109DF61A4000DC7AF /* table-conflict.tif */; }; + B5B44C1A09DF61A4000DC7AF /* table-error.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1209DF61A4000DC7AF /* table-error.tif */; }; + B5B44C1B09DF61A4000DC7AF /* table-left-blue.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */; }; + B5B44C1C09DF61A4000DC7AF /* table-left-green.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1409DF61A4000DC7AF /* table-left-green.tif */; }; + B5B44C1D09DF61A4000DC7AF /* table-merge.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1509DF61A4000DC7AF /* table-merge.tif */; }; + B5B44C1E09DF61A4000DC7AF /* table-right-blue.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */; }; + B5B44C1F09DF61A4000DC7AF /* table-right-green.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1709DF61A4000DC7AF /* table-right-green.tif */; }; + B5B44C2009DF61A4000DC7AF /* table-skip.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5B44C1809DF61A4000DC7AF /* table-skip.tif */; }; + B5E03B3909E38B9E0058C7B9 /* rescan.tif in Resources */ = {isa = PBXBuildFile; fileRef = B5E03B3809E38B9E0058C7B9 /* rescan.tif */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 2A124E7F0DE1C4E400524237 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 2A124E780DE1C48400524237; - remoteInfo = "Create ExternalSettings"; - }; + 2A124E7F0DE1C4E400524237 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; + proxyType = 1; + remoteGlobalIDString = 2A124E780DE1C48400524237; + remoteInfo = "Create ExternalSettings"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - 2A3C3F3709922AA600E404E9 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - 2A3C3F3309922A8000E404E9 /* Growl.framework in CopyFiles */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; + 2A3C3F3709922AA600E404E9 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 2A3C3F3309922A8000E404E9 /* Growl.framework in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; - 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; - 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; }; - 2A3C3F3209922A8000E404E9 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; }; - 2A3C3F7A09922D4900E404E9 /* NotificationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationController.h; sourceTree = "<group>"; }; - 2A3C3F7B09922D4900E404E9 /* NotificationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationController.m; sourceTree = "<group>"; }; - 2E282CC70D9AE2B000439D01 /* unison-blob.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; name = "unison-blob.o"; path = "../unison-blob.o"; sourceTree = SOURCE_ROOT; }; - 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ExternalSettings.xcconfig; sourceTree = "<group>"; }; - 44042CB30BE4FC9B00A6BBB2 /* ProgressCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgressCell.h; sourceTree = "<group>"; }; - 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProgressCell.m; sourceTree = "<group>"; }; - 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarAdvanced.png; path = progressicons/ProgressBarAdvanced.png; sourceTree = "<group>"; }; - 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarBlue.png; path = progressicons/ProgressBarBlue.png; sourceTree = "<group>"; }; - 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndAdvanced.png; path = progressicons/ProgressBarEndAdvanced.png; sourceTree = "<group>"; }; - 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndBlue.png; path = progressicons/ProgressBarEndBlue.png; sourceTree = "<group>"; }; - 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndGray.png; path = progressicons/ProgressBarEndGray.png; sourceTree = "<group>"; }; - 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndGreen.png; path = progressicons/ProgressBarEndGreen.png; sourceTree = "<group>"; }; - 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndWhite.png; path = progressicons/ProgressBarEndWhite.png; sourceTree = "<group>"; }; - 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGray.png; path = progressicons/ProgressBarGray.png; sourceTree = "<group>"; }; - 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGreen.png; path = progressicons/ProgressBarGreen.png; sourceTree = "<group>"; }; - 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarLightGreen.png; path = progressicons/ProgressBarLightGreen.png; sourceTree = "<group>"; }; - 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarWhite.png; path = progressicons/ProgressBarWhite.png; sourceTree = "<group>"; }; - 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Created.png; sourceTree = "<group>"; }; - 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Deleted.png; sourceTree = "<group>"; }; - 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Modified.png; sourceTree = "<group>"; }; - 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_PropsChanged.png; sourceTree = "<group>"; }; - 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Deep.png"; sourceTree = "<group>"; }; - 445A29260BFA5C1200E4E641 /* Outline-Flat.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Flat.png"; sourceTree = "<group>"; }; - 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Flattened.png"; sourceTree = "<group>"; }; - 445A2A5B0BFAB6A100E4E641 /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageAndTextCell.h; sourceTree = "<group>"; }; - 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ImageAndTextCell.m; sourceTree = "<group>"; }; - 449F03DE0BE00DE9003F15C8 /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bridge.h; sourceTree = "<group>"; }; - 449F03DF0BE00DE9003F15C8 /* Bridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Bridge.m; sourceTree = "<group>"; }; - 44A794A00BE16C380069680C /* ExceptionHandling.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExceptionHandling.framework; path = /System/Library/Frameworks/ExceptionHandling.framework; sourceTree = "<absolute>"; }; - 44A797F10BE3F9B70069680C /* table-mixed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-mixed.tif"; sourceTree = "<group>"; }; - 44F472AF0C0DB735006428EF /* Change_Absent.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Absent.png; sourceTree = "<group>"; }; - 44F472B00C0DB735006428EF /* Change_Unmodified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Unmodified.png; sourceTree = "<group>"; }; - 690F564404F11EC300CF23A4 /* ProfileController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileController.h; sourceTree = "<group>"; }; - 690F564504F11EC300CF23A4 /* ProfileController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProfileController.m; sourceTree = "<group>"; }; - 691CE180051BB44A00CF23A4 /* ProfileTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileTableView.h; sourceTree = "<group>"; }; - 691CE181051BB44A00CF23A4 /* ProfileTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProfileTableView.m; sourceTree = "<group>"; }; - 69660DC604F08CC100CF23A4 /* MyController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyController.h; sourceTree = "<group>"; }; - 69660DC704F08CC100CF23A4 /* MyController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MyController.m; sourceTree = "<group>"; }; - 697985CD050CFA2D00CF23A4 /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PreferencesController.h; sourceTree = "<group>"; }; - 697985CE050CFA2D00CF23A4 /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = PreferencesController.m; sourceTree = "<group>"; }; - 69BA7DA804FD695200CF23A4 /* ReconTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReconTableView.h; sourceTree = "<group>"; }; - 69BA7DA904FD695200CF23A4 /* ReconTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReconTableView.m; sourceTree = "<group>"; }; - 69C625CA0664E94E00B3C46A /* Unison.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Unison.icns; sourceTree = "<group>"; }; - 69C625F40664EC3300B3C46A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; - 69C625F50664EC3300B3C46A /* Unison.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Unison.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ReconItem.m; sourceTree = "<group>"; }; - 69D3C6FA04F1CC3700CF23A4 /* ReconItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ReconItem.h; sourceTree = "<group>"; }; - 69E407B907EB95AA00D37AA1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; }; - B518071209D6652100B1B21F /* add.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = add.tif; sourceTree = "<group>"; }; - B518071309D6652100B1B21F /* diff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = diff.tif; sourceTree = "<group>"; }; - B518071409D6652100B1B21F /* go.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = go.tif; sourceTree = "<group>"; }; - B518071509D6652100B1B21F /* left.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = left.tif; sourceTree = "<group>"; }; - B518071609D6652100B1B21F /* merge.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = merge.tif; sourceTree = "<group>"; }; - B518071709D6652100B1B21F /* quit.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = quit.tif; sourceTree = "<group>"; }; - B518071809D6652100B1B21F /* restart.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = restart.tif; sourceTree = "<group>"; }; - B518071909D6652100B1B21F /* right.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = right.tif; sourceTree = "<group>"; }; - B518071A09D6652100B1B21F /* save.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = save.tif; sourceTree = "<group>"; }; - B518071B09D6652100B1B21F /* skip.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = skip.tif; sourceTree = "<group>"; }; - B554003E09C4E5A00089E1C3 /* UnisonToolbar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UnisonToolbar.h; sourceTree = "<group>"; }; - B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UnisonToolbar.m; sourceTree = "<group>"; }; - B5B44C1109DF61A4000DC7AF /* table-conflict.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-conflict.tif"; sourceTree = "<group>"; }; - B5B44C1209DF61A4000DC7AF /* table-error.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-error.tif"; sourceTree = "<group>"; }; - B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-left-blue.tif"; sourceTree = "<group>"; }; - B5B44C1409DF61A4000DC7AF /* table-left-green.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-left-green.tif"; sourceTree = "<group>"; }; - B5B44C1509DF61A4000DC7AF /* table-merge.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-merge.tif"; sourceTree = "<group>"; }; - B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-right-blue.tif"; sourceTree = "<group>"; }; - B5B44C1709DF61A4000DC7AF /* table-right-green.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-right-green.tif"; sourceTree = "<group>"; }; - B5B44C1809DF61A4000DC7AF /* table-skip.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-skip.tif"; sourceTree = "<group>"; }; - B5E03B3809E38B9E0058C7B9 /* rescan.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = rescan.tif; path = toolbar/rescan.tif; sourceTree = "<group>"; }; + 089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; }; + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; + 29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; }; + 2A3C3F3209922A8000E404E9 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; }; + 2A3C3F7A09922D4900E404E9 /* NotificationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NotificationController.h; sourceTree = "<group>"; }; + 2A3C3F7B09922D4900E404E9 /* NotificationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NotificationController.m; sourceTree = "<group>"; }; + 2E282CC70D9AE2B000439D01 /* unison-blob.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; name = "unison-blob.o"; path = "../unison-blob.o"; sourceTree = SOURCE_ROOT; }; + 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ExternalSettings.xcconfig; sourceTree = "<group>"; }; + 44042CB30BE4FC9B00A6BBB2 /* ProgressCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProgressCell.h; sourceTree = "<group>"; }; + 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProgressCell.m; sourceTree = "<group>"; }; + 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarAdvanced.png; path = progressicons/ProgressBarAdvanced.png; sourceTree = "<group>"; }; + 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarBlue.png; path = progressicons/ProgressBarBlue.png; sourceTree = "<group>"; }; + 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndAdvanced.png; path = progressicons/ProgressBarEndAdvanced.png; sourceTree = "<group>"; }; + 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndBlue.png; path = progressicons/ProgressBarEndBlue.png; sourceTree = "<group>"; }; + 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndGray.png; path = progressicons/ProgressBarEndGray.png; sourceTree = "<group>"; }; + 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndGreen.png; path = progressicons/ProgressBarEndGreen.png; sourceTree = "<group>"; }; + 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarEndWhite.png; path = progressicons/ProgressBarEndWhite.png; sourceTree = "<group>"; }; + 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGray.png; path = progressicons/ProgressBarGray.png; sourceTree = "<group>"; }; + 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarGreen.png; path = progressicons/ProgressBarGreen.png; sourceTree = "<group>"; }; + 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarLightGreen.png; path = progressicons/ProgressBarLightGreen.png; sourceTree = "<group>"; }; + 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ProgressBarWhite.png; path = progressicons/ProgressBarWhite.png; sourceTree = "<group>"; }; + 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Created.png; sourceTree = "<group>"; }; + 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Deleted.png; sourceTree = "<group>"; }; + 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Modified.png; sourceTree = "<group>"; }; + 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_PropsChanged.png; sourceTree = "<group>"; }; + 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Deep.png"; sourceTree = "<group>"; }; + 445A29260BFA5C1200E4E641 /* Outline-Flat.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Flat.png"; sourceTree = "<group>"; }; + 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Outline-Flattened.png"; sourceTree = "<group>"; }; + 445A2A5B0BFAB6A100E4E641 /* ImageAndTextCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ImageAndTextCell.h; sourceTree = "<group>"; }; + 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ImageAndTextCell.m; sourceTree = "<group>"; }; + 449F03DE0BE00DE9003F15C8 /* Bridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Bridge.h; sourceTree = "<group>"; }; + 449F03DF0BE00DE9003F15C8 /* Bridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Bridge.m; sourceTree = "<group>"; }; + 44A794A00BE16C380069680C /* ExceptionHandling.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExceptionHandling.framework; path = /System/Library/Frameworks/ExceptionHandling.framework; sourceTree = "<absolute>"; }; + 44A797F10BE3F9B70069680C /* table-mixed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-mixed.tif"; sourceTree = "<group>"; }; + 44F472AF0C0DB735006428EF /* Change_Absent.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Absent.png; sourceTree = "<group>"; }; + 44F472B00C0DB735006428EF /* Change_Unmodified.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Change_Unmodified.png; sourceTree = "<group>"; }; + 690F564404F11EC300CF23A4 /* ProfileController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileController.h; sourceTree = "<group>"; }; + 690F564504F11EC300CF23A4 /* ProfileController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProfileController.m; sourceTree = "<group>"; }; + 691CE180051BB44A00CF23A4 /* ProfileTableView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ProfileTableView.h; sourceTree = "<group>"; }; + 691CE181051BB44A00CF23A4 /* ProfileTableView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ProfileTableView.m; sourceTree = "<group>"; }; + 69660DC604F08CC100CF23A4 /* MyController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyController.h; sourceTree = "<group>"; }; + 69660DC704F08CC100CF23A4 /* MyController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MyController.m; sourceTree = "<group>"; }; + 697985CD050CFA2D00CF23A4 /* PreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PreferencesController.h; sourceTree = "<group>"; }; + 697985CE050CFA2D00CF23A4 /* PreferencesController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = PreferencesController.m; sourceTree = "<group>"; }; + 69BA7DA804FD695200CF23A4 /* ReconTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReconTableView.h; sourceTree = "<group>"; }; + 69BA7DA904FD695200CF23A4 /* ReconTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ReconTableView.m; sourceTree = "<group>"; }; + 69C625CA0664E94E00B3C46A /* Unison.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Unison.icns; sourceTree = "<group>"; }; + 69C625F40664EC3300B3C46A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; + 69C625F50664EC3300B3C46A /* Unison.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Unison.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = ReconItem.m; sourceTree = "<group>"; }; + 69D3C6FA04F1CC3700CF23A4 /* ReconItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ReconItem.h; sourceTree = "<group>"; }; + 69E407B907EB95AA00D37AA1 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; }; + B518071209D6652100B1B21F /* add.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = add.tif; sourceTree = "<group>"; }; + B518071309D6652100B1B21F /* diff.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = diff.tif; sourceTree = "<group>"; }; + B518071409D6652100B1B21F /* go.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = go.tif; sourceTree = "<group>"; }; + B518071509D6652100B1B21F /* left.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = left.tif; sourceTree = "<group>"; }; + B518071609D6652100B1B21F /* merge.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = merge.tif; sourceTree = "<group>"; }; + B518071709D6652100B1B21F /* quit.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = quit.tif; sourceTree = "<group>"; }; + B518071809D6652100B1B21F /* restart.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = restart.tif; sourceTree = "<group>"; }; + B518071909D6652100B1B21F /* right.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = right.tif; sourceTree = "<group>"; }; + B518071A09D6652100B1B21F /* save.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = save.tif; sourceTree = "<group>"; }; + B518071B09D6652100B1B21F /* skip.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = skip.tif; sourceTree = "<group>"; }; + B554003E09C4E5A00089E1C3 /* UnisonToolbar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = UnisonToolbar.h; sourceTree = "<group>"; }; + B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = UnisonToolbar.m; sourceTree = "<group>"; }; + B5B44C1109DF61A4000DC7AF /* table-conflict.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-conflict.tif"; sourceTree = "<group>"; }; + B5B44C1209DF61A4000DC7AF /* table-error.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-error.tif"; sourceTree = "<group>"; }; + B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-left-blue.tif"; sourceTree = "<group>"; }; + B5B44C1409DF61A4000DC7AF /* table-left-green.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-left-green.tif"; sourceTree = "<group>"; }; + B5B44C1509DF61A4000DC7AF /* table-merge.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-merge.tif"; sourceTree = "<group>"; }; + B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-right-blue.tif"; sourceTree = "<group>"; }; + B5B44C1709DF61A4000DC7AF /* table-right-green.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-right-green.tif"; sourceTree = "<group>"; }; + B5B44C1809DF61A4000DC7AF /* table-skip.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "table-skip.tif"; sourceTree = "<group>"; }; + B5E03B3809E38B9E0058C7B9 /* rescan.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = rescan.tif; path = toolbar/rescan.tif; sourceTree = "<group>"; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 69C625F10664EC3300B3C46A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 69C625F20664EC3300B3C46A /* Cocoa.framework in Frameworks */, - 69E407BA07EB95AA00D37AA1 /* Security.framework in Frameworks */, - 2A3C3FAE0992323F00E404E9 /* Growl.framework in Frameworks */, - 44A794A10BE16C380069680C /* ExceptionHandling.framework in Frameworks */, - 2E282CC80D9AE2B000439D01 /* unison-blob.o in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; + 69C625F10664EC3300B3C46A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 69C625F20664EC3300B3C46A /* Cocoa.framework in Frameworks */, + 69E407BA07EB95AA00D37AA1 /* Security.framework in Frameworks */, + 2A3C3FAE0992323F00E404E9 /* Growl.framework in Frameworks */, + 44A794A10BE16C380069680C /* ExceptionHandling.framework in Frameworks */, + 2E282CC80D9AE2B000439D01 /* unison-blob.o in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 19C28FACFE9D520D11CA2CBB /* Products */ = { - isa = PBXGroup; - children = ( - 69C625F50664EC3300B3C46A /* Unison.app */, - ); - name = Products; - sourceTree = "<group>"; - }; - 29B97314FDCFA39411CA2CEA /* uimac */ = { - isa = PBXGroup; - children = ( - B5E03B3809E38B9E0058C7B9 /* rescan.tif */, - 44042D0F0BE52AD700A6BBB2 /* progressicons */, - B5B44C1009DF61A4000DC7AF /* tableicons */, - B518071109D6652000B1B21F /* toolbar */, - 44A795C90BE2B91B0069680C /* Classes */, - 29B97315FDCFA39411CA2CEA /* Other Sources */, - 29B97317FDCFA39411CA2CEA /* Resources */, - 29B97323FDCFA39411CA2CEA /* Frameworks */, - 19C28FACFE9D520D11CA2CBB /* Products */, - 69C625F40664EC3300B3C46A /* Info.plist */, - 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */, - 2E282CB80D9AE16300439D01 /* External objects */, - ); - name = uimac; - sourceTree = "<group>"; - }; - 29B97315FDCFA39411CA2CEA /* Other Sources */ = { - isa = PBXGroup; - children = ( - 29B97316FDCFA39411CA2CEA /* main.m */, - ); - name = "Other Sources"; - sourceTree = "<group>"; - }; - 29B97317FDCFA39411CA2CEA /* Resources */ = { - isa = PBXGroup; - children = ( - 29B97318FDCFA39411CA2CEA /* MainMenu.nib */, - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, - 69C625CA0664E94E00B3C46A /* Unison.icns */, - ); - name = Resources; - sourceTree = "<group>"; - }; - 29B97323FDCFA39411CA2CEA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, - 44A794A00BE16C380069680C /* ExceptionHandling.framework */, - 2A3C3F3209922A8000E404E9 /* Growl.framework */, - 69E407B907EB95AA00D37AA1 /* Security.framework */, - ); - name = Frameworks; - sourceTree = "<group>"; - }; - 2E282CB80D9AE16300439D01 /* External objects */ = { - isa = PBXGroup; - children = ( - 2E282CC70D9AE2B000439D01 /* unison-blob.o */, - ); - name = "External objects"; - sourceTree = "<group>"; - }; - 44042D0F0BE52AD700A6BBB2 /* progressicons */ = { - isa = PBXGroup; - children = ( - 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */, - 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */, - 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */, - 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */, - 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */, - 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */, - 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */, - 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */, - 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */, - 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */, - 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */, - ); - name = progressicons; - sourceTree = "<group>"; - }; - 44A795C90BE2B91B0069680C /* Classes */ = { - isa = PBXGroup; - children = ( - 69660DC604F08CC100CF23A4 /* MyController.h */, - 69660DC704F08CC100CF23A4 /* MyController.m */, - 2A3C3F7A09922D4900E404E9 /* NotificationController.h */, - 2A3C3F7B09922D4900E404E9 /* NotificationController.m */, - 69BA7DA804FD695200CF23A4 /* ReconTableView.h */, - 69BA7DA904FD695200CF23A4 /* ReconTableView.m */, - 69D3C6FA04F1CC3700CF23A4 /* ReconItem.h */, - 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */, - 445A2A5B0BFAB6A100E4E641 /* ImageAndTextCell.h */, - 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */, - 44042CB30BE4FC9B00A6BBB2 /* ProgressCell.h */, - 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */, - 690F564404F11EC300CF23A4 /* ProfileController.h */, - 690F564504F11EC300CF23A4 /* ProfileController.m */, - 697985CD050CFA2D00CF23A4 /* PreferencesController.h */, - 697985CE050CFA2D00CF23A4 /* PreferencesController.m */, - 691CE180051BB44A00CF23A4 /* ProfileTableView.h */, - 691CE181051BB44A00CF23A4 /* ProfileTableView.m */, - B554003E09C4E5A00089E1C3 /* UnisonToolbar.h */, - B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */, - 449F03DE0BE00DE9003F15C8 /* Bridge.h */, - 449F03DF0BE00DE9003F15C8 /* Bridge.m */, - ); - name = Classes; - sourceTree = "<group>"; - }; - B518071109D6652000B1B21F /* toolbar */ = { - isa = PBXGroup; - children = ( - B518071209D6652100B1B21F /* add.tif */, - B518071309D6652100B1B21F /* diff.tif */, - B518071409D6652100B1B21F /* go.tif */, - B518071509D6652100B1B21F /* left.tif */, - B518071609D6652100B1B21F /* merge.tif */, - B518071709D6652100B1B21F /* quit.tif */, - B518071809D6652100B1B21F /* restart.tif */, - B518071909D6652100B1B21F /* right.tif */, - B518071A09D6652100B1B21F /* save.tif */, - B518071B09D6652100B1B21F /* skip.tif */, - ); - path = toolbar; - sourceTree = "<group>"; - }; - B5B44C1009DF61A4000DC7AF /* tableicons */ = { - isa = PBXGroup; - children = ( - 44F472AF0C0DB735006428EF /* Change_Absent.png */, - 44F472B00C0DB735006428EF /* Change_Unmodified.png */, - 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */, - 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */, - 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */, - 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */, - 44A797F10BE3F9B70069680C /* table-mixed.tif */, - B5B44C1109DF61A4000DC7AF /* table-conflict.tif */, - B5B44C1209DF61A4000DC7AF /* table-error.tif */, - B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */, - B5B44C1409DF61A4000DC7AF /* table-left-green.tif */, - B5B44C1509DF61A4000DC7AF /* table-merge.tif */, - B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */, - B5B44C1709DF61A4000DC7AF /* table-right-green.tif */, - B5B44C1809DF61A4000DC7AF /* table-skip.tif */, - 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */, - 445A29260BFA5C1200E4E641 /* Outline-Flat.png */, - 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */, - ); - path = tableicons; - sourceTree = "<group>"; - }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 69C625F50664EC3300B3C46A /* Unison.app */, + ); + name = Products; + sourceTree = "<group>"; + }; + 29B97314FDCFA39411CA2CEA /* uimac */ = { + isa = PBXGroup; + children = ( + B5E03B3809E38B9E0058C7B9 /* rescan.tif */, + 44042D0F0BE52AD700A6BBB2 /* progressicons */, + B5B44C1009DF61A4000DC7AF /* tableicons */, + B518071109D6652000B1B21F /* toolbar */, + 44A795C90BE2B91B0069680C /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + 69C625F40664EC3300B3C46A /* Info.plist */, + 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */, + 2E282CB80D9AE16300439D01 /* External objects */, + ); + name = uimac; + sourceTree = "<group>"; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = "<group>"; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 29B97318FDCFA39411CA2CEA /* MainMenu.nib */, + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */, + 69C625CA0664E94E00B3C46A /* Unison.icns */, + ); + name = Resources; + sourceTree = "<group>"; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, + 44A794A00BE16C380069680C /* ExceptionHandling.framework */, + 2A3C3F3209922A8000E404E9 /* Growl.framework */, + 69E407B907EB95AA00D37AA1 /* Security.framework */, + ); + name = Frameworks; + sourceTree = "<group>"; + }; + 2E282CB80D9AE16300439D01 /* External objects */ = { + isa = PBXGroup; + children = ( + 2E282CC70D9AE2B000439D01 /* unison-blob.o */, + ); + name = "External objects"; + sourceTree = "<group>"; + }; + 44042D0F0BE52AD700A6BBB2 /* progressicons */ = { + isa = PBXGroup; + children = ( + 44042D100BE52AED00A6BBB2 /* ProgressBarAdvanced.png */, + 44042D110BE52AED00A6BBB2 /* ProgressBarBlue.png */, + 44042D120BE52AED00A6BBB2 /* ProgressBarEndAdvanced.png */, + 44042D130BE52AED00A6BBB2 /* ProgressBarEndBlue.png */, + 44042D140BE52AED00A6BBB2 /* ProgressBarEndGray.png */, + 44042D150BE52AED00A6BBB2 /* ProgressBarEndGreen.png */, + 44042D160BE52AED00A6BBB2 /* ProgressBarEndWhite.png */, + 44042D170BE52AED00A6BBB2 /* ProgressBarGray.png */, + 44042D180BE52AED00A6BBB2 /* ProgressBarGreen.png */, + 44042D190BE52AED00A6BBB2 /* ProgressBarLightGreen.png */, + 44042D1A0BE52AED00A6BBB2 /* ProgressBarWhite.png */, + ); + name = progressicons; + sourceTree = "<group>"; + }; + 44A795C90BE2B91B0069680C /* Classes */ = { + isa = PBXGroup; + children = ( + 69660DC604F08CC100CF23A4 /* MyController.h */, + 69660DC704F08CC100CF23A4 /* MyController.m */, + 2A3C3F7A09922D4900E404E9 /* NotificationController.h */, + 2A3C3F7B09922D4900E404E9 /* NotificationController.m */, + 69BA7DA804FD695200CF23A4 /* ReconTableView.h */, + 69BA7DA904FD695200CF23A4 /* ReconTableView.m */, + 69D3C6FA04F1CC3700CF23A4 /* ReconItem.h */, + 69D3C6F904F1CC3700CF23A4 /* ReconItem.m */, + 445A2A5B0BFAB6A100E4E641 /* ImageAndTextCell.h */, + 445A2A5D0BFAB6C300E4E641 /* ImageAndTextCell.m */, + 44042CB30BE4FC9B00A6BBB2 /* ProgressCell.h */, + 44042CB40BE4FC9B00A6BBB2 /* ProgressCell.m */, + 690F564404F11EC300CF23A4 /* ProfileController.h */, + 690F564504F11EC300CF23A4 /* ProfileController.m */, + 697985CD050CFA2D00CF23A4 /* PreferencesController.h */, + 697985CE050CFA2D00CF23A4 /* PreferencesController.m */, + 691CE180051BB44A00CF23A4 /* ProfileTableView.h */, + 691CE181051BB44A00CF23A4 /* ProfileTableView.m */, + B554003E09C4E5A00089E1C3 /* UnisonToolbar.h */, + B554004009C4E5AA0089E1C3 /* UnisonToolbar.m */, + 449F03DE0BE00DE9003F15C8 /* Bridge.h */, + 449F03DF0BE00DE9003F15C8 /* Bridge.m */, + ); + name = Classes; + sourceTree = "<group>"; + }; + B518071109D6652000B1B21F /* toolbar */ = { + isa = PBXGroup; + children = ( + B518071209D6652100B1B21F /* add.tif */, + B518071309D6652100B1B21F /* diff.tif */, + B518071409D6652100B1B21F /* go.tif */, + B518071509D6652100B1B21F /* left.tif */, + B518071609D6652100B1B21F /* merge.tif */, + B518071709D6652100B1B21F /* quit.tif */, + B518071809D6652100B1B21F /* restart.tif */, + B518071909D6652100B1B21F /* right.tif */, + B518071A09D6652100B1B21F /* save.tif */, + B518071B09D6652100B1B21F /* skip.tif */, + ); + path = toolbar; + sourceTree = "<group>"; + }; + B5B44C1009DF61A4000DC7AF /* tableicons */ = { + isa = PBXGroup; + children = ( + 44F472AF0C0DB735006428EF /* Change_Absent.png */, + 44F472B00C0DB735006428EF /* Change_Unmodified.png */, + 440EEAF60C03F0B800ACAAB0 /* Change_Deleted.png */, + 440EEAF70C03F0B800ACAAB0 /* Change_Modified.png */, + 440EEAF80C03F0B800ACAAB0 /* Change_PropsChanged.png */, + 440EEAF20C03EC3D00ACAAB0 /* Change_Created.png */, + 44A797F10BE3F9B70069680C /* table-mixed.tif */, + B5B44C1109DF61A4000DC7AF /* table-conflict.tif */, + B5B44C1209DF61A4000DC7AF /* table-error.tif */, + B5B44C1309DF61A4000DC7AF /* table-left-blue.tif */, + B5B44C1409DF61A4000DC7AF /* table-left-green.tif */, + B5B44C1509DF61A4000DC7AF /* table-merge.tif */, + B5B44C1609DF61A4000DC7AF /* table-right-blue.tif */, + B5B44C1709DF61A4000DC7AF /* table-right-green.tif */, + B5B44C1809DF61A4000DC7AF /* table-skip.tif */, + 445A291A0BFA5B3300E4E641 /* Outline-Deep.png */, + 445A29260BFA5C1200E4E641 /* Outline-Flat.png */, + 445A29280BFA5C1B00E4E641 /* Outline-Flattened.png */, + ); + path = tableicons; + sourceTree = "<group>"; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 69C625DD0664EC3300B3C46A /* uimac */ = { - isa = PBXNativeTarget; - buildConfigurationList = 2A3C3F280992245300E404E9 /* Build configuration list for PBXNativeTarget "uimac" */; - buildPhases = ( - 2E282CBA0D9AE17300439D01 /* Run Script (make unison-blob.o) */, - 69C625E50664EC3300B3C46A /* Resources */, - 69C625E90664EC3300B3C46A /* Sources */, - 69C625F10664EC3300B3C46A /* Frameworks */, - 2A3C3F3709922AA600E404E9 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 2A124E800DE1C4E400524237 /* PBXTargetDependency */, - ); - name = uimac; - productInstallPath = "$(HOME)/Applications"; - productName = uimac; - productReference = 69C625F50664EC3300B3C46A /* Unison.app */; - productType = "com.apple.product-type.application"; - }; + 69C625DD0664EC3300B3C46A /* uimac */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2A3C3F280992245300E404E9 /* Build configuration list for PBXNativeTarget "uimac" */; + buildPhases = ( + 2E282CBA0D9AE17300439D01 /* Run Script (make unison-blob.o) */, + 69C625E50664EC3300B3C46A /* Resources */, + 69C625E90664EC3300B3C46A /* Sources */, + 69C625F10664EC3300B3C46A /* Frameworks */, + 2A3C3F3709922AA600E404E9 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + 2A124E800DE1C4E400524237 /* PBXTargetDependency */, + ); + name = uimac; + productInstallPath = "$(HOME)/Applications"; + productName = uimac; + productReference = 69C625F50664EC3300B3C46A /* Unison.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 29B97313FDCFA39411CA2CEA /* Project object */ = { - isa = PBXProject; - buildConfigurationList = 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */; - compatibilityVersion = "Xcode 2.4"; - hasScannedForEncodings = 1; - mainGroup = 29B97314FDCFA39411CA2CEA /* uimac */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 69C625DD0664EC3300B3C46A /* uimac */, - 2A124E780DE1C48400524237 /* Create ExternalSettings */, - ); - }; + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */; + compatibilityVersion = "Xcode 2.4"; + hasScannedForEncodings = 1; + mainGroup = 29B97314FDCFA39411CA2CEA /* uimac */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 69C625DD0664EC3300B3C46A /* uimac */, + 2A124E780DE1C48400524237 /* Create ExternalSettings */, + ); + }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 69C625E50664EC3300B3C46A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 69C625E60664EC3300B3C46A /* MainMenu.nib in Resources */, - 69C625E70664EC3300B3C46A /* InfoPlist.strings in Resources */, - 69C625E80664EC3300B3C46A /* Unison.icns in Resources */, - B518071C09D6652100B1B21F /* add.tif in Resources */, - B518071D09D6652100B1B21F /* diff.tif in Resources */, - B518071E09D6652100B1B21F /* go.tif in Resources */, - B518071F09D6652100B1B21F /* left.tif in Resources */, - B518072009D6652100B1B21F /* merge.tif in Resources */, - B518072109D6652100B1B21F /* quit.tif in Resources */, - B518072209D6652100B1B21F /* restart.tif in Resources */, - B518072309D6652100B1B21F /* right.tif in Resources */, - B518072409D6652100B1B21F /* save.tif in Resources */, - B518072509D6652100B1B21F /* skip.tif in Resources */, - B5B44C1909DF61A4000DC7AF /* table-conflict.tif in Resources */, - B5B44C1A09DF61A4000DC7AF /* table-error.tif in Resources */, - B5B44C1B09DF61A4000DC7AF /* table-left-blue.tif in Resources */, - B5B44C1C09DF61A4000DC7AF /* table-left-green.tif in Resources */, - B5B44C1D09DF61A4000DC7AF /* table-merge.tif in Resources */, - B5B44C1E09DF61A4000DC7AF /* table-right-blue.tif in Resources */, - B5B44C1F09DF61A4000DC7AF /* table-right-green.tif in Resources */, - B5B44C2009DF61A4000DC7AF /* table-skip.tif in Resources */, - B5E03B3909E38B9E0058C7B9 /* rescan.tif in Resources */, - 44A797F40BE3F9B70069680C /* table-mixed.tif in Resources */, - 44042D1B0BE52AED00A6BBB2 /* ProgressBarAdvanced.png in Resources */, - 44042D1C0BE52AEE00A6BBB2 /* ProgressBarBlue.png in Resources */, - 44042D1D0BE52AEE00A6BBB2 /* ProgressBarEndAdvanced.png in Resources */, - 44042D1E0BE52AEE00A6BBB2 /* ProgressBarEndBlue.png in Resources */, - 44042D1F0BE52AEE00A6BBB2 /* ProgressBarEndGray.png in Resources */, - 44042D200BE52AEE00A6BBB2 /* ProgressBarEndGreen.png in Resources */, - 44042D210BE52AEE00A6BBB2 /* ProgressBarEndWhite.png in Resources */, - 44042D220BE52AEE00A6BBB2 /* ProgressBarGray.png in Resources */, - 44042D230BE52AEE00A6BBB2 /* ProgressBarGreen.png in Resources */, - 44042D240BE52AEE00A6BBB2 /* ProgressBarLightGreen.png in Resources */, - 44042D250BE52AEE00A6BBB2 /* ProgressBarWhite.png in Resources */, - 445A291B0BFA5B3300E4E641 /* Outline-Deep.png in Resources */, - 445A29270BFA5C1200E4E641 /* Outline-Flat.png in Resources */, - 445A29290BFA5C1B00E4E641 /* Outline-Flattened.png in Resources */, - 440EEAF30C03EC3D00ACAAB0 /* Change_Created.png in Resources */, - 440EEAF90C03F0B800ACAAB0 /* Change_Deleted.png in Resources */, - 440EEAFA0C03F0B800ACAAB0 /* Change_Modified.png in Resources */, - 440EEAFB0C03F0B800ACAAB0 /* Change_PropsChanged.png in Resources */, - 44F472B10C0DB735006428EF /* Change_Absent.png in Resources */, - 44F472B20C0DB735006428EF /* Change_Unmodified.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; + 69C625E50664EC3300B3C46A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 69C625E60664EC3300B3C46A /* MainMenu.nib in Resources */, + 69C625E70664EC3300B3C46A /* InfoPlist.strings in Resources */, + 69C625E80664EC3300B3C46A /* Unison.icns in Resources */, + B518071C09D6652100B1B21F /* add.tif in Resources */, + B518071D09D6652100B1B21F /* diff.tif in Resources */, + B518071E09D6652100B1B21F /* go.tif in Resources */, + B518071F09D6652100B1B21F /* left.tif in Resources */, + B518072009D6652100B1B21F /* merge.tif in Resources */, + B518072109D6652100B1B21F /* quit.tif in Resources */, + B518072209D6652100B1B21F /* restart.tif in Resources */, + B518072309D6652100B1B21F /* right.tif in Resources */, + B518072409D6652100B1B21F /* save.tif in Resources */, + B518072509D6652100B1B21F /* skip.tif in Resources */, + B5B44C1909DF61A4000DC7AF /* table-conflict.tif in Resources */, + B5B44C1A09DF61A4000DC7AF /* table-error.tif in Resources */, + B5B44C1B09DF61A4000DC7AF /* table-left-blue.tif in Resources */, + B5B44C1C09DF61A4000DC7AF /* table-left-green.tif in Resources */, + B5B44C1D09DF61A4000DC7AF /* table-merge.tif in Resources */, + B5B44C1E09DF61A4000DC7AF /* table-right-blue.tif in Resources */, + B5B44C1F09DF61A4000DC7AF /* table-right-green.tif in Resources */, + B5B44C2009DF61A4000DC7AF /* table-skip.tif in Resources */, + B5E03B3909E38B9E0058C7B9 /* rescan.tif in Resources */, + 44A797F40BE3F9B70069680C /* table-mixed.tif in Resources */, + 44042D1B0BE52AED00A6BBB2 /* ProgressBarAdvanced.png in Resources */, + 44042D1C0BE52AEE00A6BBB2 /* ProgressBarBlue.png in Resources */, + 44042D1D0BE52AEE00A6BBB2 /* ProgressBarEndAdvanced.png in Resources */, + 44042D1E0BE52AEE00A6BBB2 /* ProgressBarEndBlue.png in Resources */, + 44042D1F0BE52AEE00A6BBB2 /* ProgressBarEndGray.png in Resources */, + 44042D200BE52AEE00A6BBB2 /* ProgressBarEndGreen.png in Resources */, + 44042D210BE52AEE00A6BBB2 /* ProgressBarEndWhite.png in Resources */, + 44042D220BE52AEE00A6BBB2 /* ProgressBarGray.png in Resources */, + 44042D230BE52AEE00A6BBB2 /* ProgressBarGreen.png in Resources */, + 44042D240BE52AEE00A6BBB2 /* ProgressBarLightGreen.png in Resources */, + 44042D250BE52AEE00A6BBB2 /* ProgressBarWhite.png in Resources */, + 445A291B0BFA5B3300E4E641 /* Outline-Deep.png in Resources */, + 445A29270BFA5C1200E4E641 /* Outline-Flat.png in Resources */, + 445A29290BFA5C1B00E4E641 /* Outline-Flattened.png in Resources */, + 440EEAF30C03EC3D00ACAAB0 /* Change_Created.png in Resources */, + 440EEAF90C03F0B800ACAAB0 /* Change_Deleted.png in Resources */, + 440EEAFA0C03F0B800ACAAB0 /* Change_Modified.png in Resources */, + 440EEAFB0C03F0B800ACAAB0 /* Change_PropsChanged.png in Resources */, + 44F472B10C0DB735006428EF /* Change_Absent.png in Resources */, + 44F472B20C0DB735006428EF /* Change_Unmodified.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 2A124E7E0DE1C4BE00524237 /* Run Script (version, ocaml lib dir) */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script (version, ocaml lib dir)"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if [ -x /usr/libexec/path_helper ]; then\n eval `/usr/libexec/path_helper -s`\nfi\nif [ ! -x ${PROJECT_DIR}/../Makefile.ProjectInfo ]; then\n if [ ! -x ${PROJECT_DIR}/../mkProjectInfo ]; then\n cd ${PROJECT_DIR}/..; ocamlc -o mkProjectInfo unix.cma str.cma mkProjectInfo.ml\n fi\n cd ${PROJECT_DIR}/..; ./mkProjectInfo > Makefile.ProjectInfo\nfi\nOCAMLLIBDIR=`ocamlc -v | tail -n -1 | sed -e 's/.* //g' | sed -e 's/\\\\\\/\\\\//g' | tr -d '\\r'`\nsource ${PROJECT_DIR}/../Makefile.ProjectInfo\necho MARKETING_VERSION = $VERSION > ${PROJECT_DIR}/ExternalSettings.xcconfig\necho OCAMLLIBDIR = $OCAMLLIBDIR >> ${PROJECT_DIR}/ExternalSettings.xcconfig"; - }; - 2E282CBA0D9AE17300439D01 /* Run Script (make unison-blob.o) */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script (make unison-blob.o)"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"Building unison-blob.o...\"\nif [ -x /usr/libexec/path_helper ]; then\n eval `/usr/libexec/path_helper -s`\nfi\ncd ${PROJECT_DIR}/..\nmake unison-blob.o\necho \"done\""; - }; + 2A124E7E0DE1C4BE00524237 /* Run Script (version, ocaml lib dir) */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script (version, ocaml lib dir)"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "if [ -x /usr/libexec/path_helper ]; then\n eval `/usr/libexec/path_helper -s`\nfi\nif [ ! -x ${PROJECT_DIR}/../Makefile.ProjectInfo ]; then\n if [ ! -x ${PROJECT_DIR}/../mkProjectInfo ]; then\n cd ${PROJECT_DIR}/..; ocamlc -o mkProjectInfo unix.cma str.cma mkProjectInfo.ml\n fi\n cd ${PROJECT_DIR}/..; ./mkProjectInfo > Makefile.ProjectInfo\nfi\nOCAMLLIBDIR=`ocamlc -v | tail -n -1 | sed -e 's/.* //g' | sed -e 's/\\\\\\/\\\\//g' | tr -d '\\r'`\nsource ${PROJECT_DIR}/../Makefile.ProjectInfo\necho MARKETING_VERSION = $VERSION > ${PROJECT_DIR}/ExternalSettings.xcconfig\necho OCAMLLIBDIR = $OCAMLLIBDIR >> ${PROJECT_DIR}/ExternalSettings.xcconfig"; + }; + 2E282CBA0D9AE17300439D01 /* Run Script (make unison-blob.o) */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script (make unison-blob.o)"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "echo \"Building unison-blob.o...\"\nif [ -x /usr/libexec/path_helper ]; then\n eval `/usr/libexec/path_helper -s`\nfi\ncd ${PROJECT_DIR}/..\nmake unison-blob.o\necho \"done\""; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 69C625E90664EC3300B3C46A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 69C625EA0664EC3300B3C46A /* main.m in Sources */, - 69C625EB0664EC3300B3C46A /* MyController.m in Sources */, - 69C625EC0664EC3300B3C46A /* ProfileController.m in Sources */, - 69C625ED0664EC3300B3C46A /* ReconItem.m in Sources */, - 69C625EE0664EC3300B3C46A /* ReconTableView.m in Sources */, - 69C625EF0664EC3300B3C46A /* PreferencesController.m in Sources */, - 69C625F00664EC3300B3C46A /* ProfileTableView.m in Sources */, - 2A3C3F7D09922D4900E404E9 /* NotificationController.m in Sources */, - B554004109C4E5AA0089E1C3 /* UnisonToolbar.m in Sources */, - 449F03E10BE00DE9003F15C8 /* Bridge.m in Sources */, - 44042CB60BE4FC9B00A6BBB2 /* ProgressCell.m in Sources */, - 445A2A5E0BFAB6C300E4E641 /* ImageAndTextCell.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; + 69C625E90664EC3300B3C46A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 69C625EA0664EC3300B3C46A /* main.m in Sources */, + 69C625EB0664EC3300B3C46A /* MyController.m in Sources */, + 69C625EC0664EC3300B3C46A /* ProfileController.m in Sources */, + 69C625ED0664EC3300B3C46A /* ReconItem.m in Sources */, + 69C625EE0664EC3300B3C46A /* ReconTableView.m in Sources */, + 69C625EF0664EC3300B3C46A /* PreferencesController.m in Sources */, + 69C625F00664EC3300B3C46A /* ProfileTableView.m in Sources */, + 2A3C3F7D09922D4900E404E9 /* NotificationController.m in Sources */, + B554004109C4E5AA0089E1C3 /* UnisonToolbar.m in Sources */, + 449F03E10BE00DE9003F15C8 /* Bridge.m in Sources */, + 44042CB60BE4FC9B00A6BBB2 /* ProgressCell.m in Sources */, + 445A2A5E0BFAB6C300E4E641 /* ImageAndTextCell.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 2A124E800DE1C4E400524237 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 2A124E780DE1C48400524237 /* Create ExternalSettings */; - targetProxy = 2A124E7F0DE1C4E400524237 /* PBXContainerItemProxy */; - }; + 2A124E800DE1C4E400524237 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 2A124E780DE1C48400524237 /* Create ExternalSettings */; + targetProxy = 2A124E7F0DE1C4E400524237 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ - 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 089C165DFE840E0CC02AAC07 /* English */, - ); - name = InfoPlist.strings; - sourceTree = "<group>"; - }; - 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = { - isa = PBXVariantGroup; - children = ( - 29B97319FDCFA39411CA2CEA /* English */, - ); - name = MainMenu.nib; - sourceTree = "<group>"; - }; + 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 089C165DFE840E0CC02AAC07 /* English */, + ); + name = InfoPlist.strings; + sourceTree = "<group>"; + }; + 29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = { + isa = PBXVariantGroup; + children = ( + 29B97319FDCFA39411CA2CEA /* English */, + ); + name = MainMenu.nib; + sourceTree = "<group>"; + }; /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - 2A124E790DE1C48400524237 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - PRODUCT_NAME = "Create ExternalSettings"; - }; - name = Development; - }; - 2A124E7A0DE1C48400524237 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_FIX_AND_CONTINUE = NO; - PRODUCT_NAME = "Create ExternalSettings"; - ZERO_LINK = NO; - }; - name = Deployment; - }; - 2A124E7B0DE1C48400524237 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - PRODUCT_NAME = "Create ExternalSettings"; - }; - name = Default; - }; - 2A3C3F290992245300E404E9 /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64; - COPY_PHASE_STRIP = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(FRAMEWORK_SEARCH_PATHS)", - "$(SRCROOT)", - ); - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_GENERATE_DEBUGGING_SYMBOLS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ""; - NSZombieEnabled = YES; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-L$(OCAMLLIBDIR)", - "-lunix", - "-lthreadsnat", - "-lstr", - "-lbigarray", - "-lasmrun", - ); - PREBINDING = NO; - PRODUCT_NAME = Unison; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - ZERO_LINK = YES; - }; - name = Development; - }; - 2A3C3F2A0992245300E404E9 /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64; - COPY_PHASE_STRIP = YES; - FRAMEWORK_SEARCH_PATHS = ( - "$(FRAMEWORK_SEARCH_PATHS)", - "$(SRCROOT)", - ); - GCC_ENABLE_FIX_AND_CONTINUE = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-L$(OCAMLLIBDIR)", - "-lunix", - "-lthreadsnat", - "-lstr", - "-lbigarray", - "-lasmrun", - ); - PREBINDING = NO; - PRODUCT_NAME = Unison; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - ZERO_LINK = NO; - }; - name = Deployment; - }; - 2A3C3F2B0992245300E404E9 /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)"; - ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64; - FRAMEWORK_SEARCH_PATHS = ( - "$(FRAMEWORK_SEARCH_PATHS)", - "$(SRCROOT)", - ); - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-L$(OCAMLLIBDIR)", - "-lunix", - "-lthreadsnat", - "-lstr", - "-lbigarray", - "-lasmrun", - ); - PREBINDING = NO; - PRODUCT_NAME = Unison; - SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - ZERO_LINK = NO; - }; - name = Default; - }; - 2A3C3F2D0992245300E404E9 /* Development */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; - buildSettings = { - LIBRARY_SEARCH_PATHS = ""; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; - }; - name = Development; - }; - 2A3C3F2E0992245300E404E9 /* Deployment */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; - buildSettings = { - LIBRARY_SEARCH_PATHS = ""; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; - }; - name = Deployment; - }; - 2A3C3F2F0992245300E404E9 /* Default */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; - buildSettings = { - LIBRARY_SEARCH_PATHS = ""; - SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; - USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; - }; - name = Default; - }; + 2A124E790DE1C48400524237 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = "Create ExternalSettings"; + }; + name = Development; + }; + 2A124E7A0DE1C48400524237 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + PRODUCT_NAME = "Create ExternalSettings"; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 2A124E7B0DE1C48400524237 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "Create ExternalSettings"; + }; + name = Default; + }; + 2A3C3F290992245300E404E9 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64; + COPY_PHASE_STRIP = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(FRAMEWORK_SEARCH_PATHS)", + "$(SRCROOT)", + ); + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ""; + NSZombieEnabled = YES; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-L$(OCAMLLIBDIR)", + "-lunix", + "-lthreadsnat", + "-lstr", + "-lbigarray", + "-lasmrun", + ); + PREBINDING = NO; + PRODUCT_NAME = Unison; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = app; + ZERO_LINK = YES; + }; + name = Development; + }; + 2A3C3F2A0992245300E404E9 /* Deployment */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64; + COPY_PHASE_STRIP = YES; + FRAMEWORK_SEARCH_PATHS = ( + "$(FRAMEWORK_SEARCH_PATHS)", + "$(SRCROOT)", + ); + GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_WARN_FOUR_CHARACTER_CONSTANTS = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-L$(OCAMLLIBDIR)", + "-lunix", + "-lthreadsnat", + "-lstr", + "-lbigarray", + "-lasmrun", + ); + PREBINDING = NO; + PRODUCT_NAME = Unison; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = Deployment; + }; + 2A3C3F2B0992245300E404E9 /* Default */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1)"; + ARCHS_STANDARD_64_BIT_PRE_XCODE_3_1 = x86_64; + FRAMEWORK_SEARCH_PATHS = ( + "$(FRAMEWORK_SEARCH_PATHS)", + "$(SRCROOT)", + ); + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(HOME)/Applications"; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ( + "-L$(OCAMLLIBDIR)", + "-lunix", + "-lthreadsnat", + "-lstr", + "-lbigarray", + "-lasmrun", + ); + PREBINDING = NO; + PRODUCT_NAME = Unison; + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk"; + SECTORDER_FLAGS = ""; + WARNING_CFLAGS = ( + "-Wmost", + "-Wno-four-char-constants", + "-Wno-unknown-pragmas", + ); + WRAPPER_EXTENSION = app; + ZERO_LINK = NO; + }; + name = Default; + }; + 2A3C3F2D0992245300E404E9 /* Development */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; + buildSettings = { + LIBRARY_SEARCH_PATHS = ""; + SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; + USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; + }; + name = Development; + }; + 2A3C3F2E0992245300E404E9 /* Deployment */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; + buildSettings = { + LIBRARY_SEARCH_PATHS = ""; + SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; + USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; + }; + name = Deployment; + }; + 2A3C3F2F0992245300E404E9 /* Default */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2E282CCC0D9AE2E800439D01 /* ExternalSettings.xcconfig */; + buildSettings = { + LIBRARY_SEARCH_PATHS = ""; + SDKROOT = /Developer/SDKs/MacOSX10.5.sdk; + USER_HEADER_SEARCH_PATHS = $OCAMLLIBDIR; + }; + name = Default; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 2A124E7C0DE1C4A200524237 /* Build configuration list for PBXAggregateTarget "Create ExternalSettings" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2A124E790DE1C48400524237 /* Development */, - 2A124E7A0DE1C48400524237 /* Deployment */, - 2A124E7B0DE1C48400524237 /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; - 2A3C3F280992245300E404E9 /* Build configuration list for PBXNativeTarget "uimac" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2A3C3F290992245300E404E9 /* Development */, - 2A3C3F2A0992245300E404E9 /* Deployment */, - 2A3C3F2B0992245300E404E9 /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; - 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 2A3C3F2D0992245300E404E9 /* Development */, - 2A3C3F2E0992245300E404E9 /* Deployment */, - 2A3C3F2F0992245300E404E9 /* Default */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; - }; + 2A124E7C0DE1C4A200524237 /* Build configuration list for PBXAggregateTarget "Create ExternalSettings" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A124E790DE1C48400524237 /* Development */, + 2A124E7A0DE1C48400524237 /* Deployment */, + 2A124E7B0DE1C48400524237 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 2A3C3F280992245300E404E9 /* Build configuration list for PBXNativeTarget "uimac" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A3C3F290992245300E404E9 /* Development */, + 2A3C3F2A0992245300E404E9 /* Deployment */, + 2A3C3F2B0992245300E404E9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; + 2A3C3F2C0992245300E404E9 /* Build configuration list for PBXProject "uimacnew" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2A3C3F2D0992245300E404E9 /* Development */, + 2A3C3F2E0992245300E404E9 /* Deployment */, + 2A3C3F2F0992245300E404E9 /* Default */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Default; + }; /* End XCConfigurationList section */ - }; - rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; } diff --git a/src/uitext.ml b/src/uitext.ml index 0f269e8..250c36f 100644 --- a/src/uitext.ml +++ b/src/uitext.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/uitext.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -19,7 +19,7 @@ open Common open Lwt module Body : Uicommon.UI = struct - + let debug = Trace.debug "ui" let dumbtty = @@ -38,7 +38,7 @@ let dumbtty = ^ "recognizes keystrokes as soon as they are typed.)\n\n" ^ "This preference has no effect on the graphical user " ^ "interface.") - + let silent = Prefs.createBool "silent" false "print nothing except error messages" ("When this preference is set to {\\tt true}, the textual user " @@ -59,7 +59,7 @@ let defaultTerminal () = match !cbreakMode with None -> () | Some funs -> funs.System.defaultTerminal () - + let restoreTerminal() = if supportSignals && not (Prefs.read dumbtty) then Sys.set_signal Sys.sigcont Sys.Signal_default; @@ -379,7 +379,7 @@ let interact rilist = (fun () -> displayri ri) in loop [] rilist - + let verifyMerge title text = Printf.printf "%s\n" text; if Prefs.read Globals.batch then @@ -673,7 +673,7 @@ let checkForDangerousPath dangerousPaths = exit Uicommon.fatalExit))] (fun () -> display "Do you really want to proceed? ") end - end + end end let synchronizeOnce ?wantWatcher ?skipRecentFiles pathsOpt = @@ -800,8 +800,8 @@ let rec synchronizeUntilDone () = try int_of_string (Prefs.read Uicommon.repeat) with Failure "int_of_string" -> (* If the 'repeat' pref is not a number, switch modes... *) - if Prefs.read Uicommon.repeat = "watch" then - synchronizePathsFromFilesystemWatcher() + if Prefs.read Uicommon.repeat = "watch" then + synchronizePathsFromFilesystemWatcher() else raise (Util.Fatal ("Value of 'repeat' preference (" ^Prefs.read Uicommon.repeat @@ -842,7 +842,7 @@ let rec start interface = (fun () -> setWarnPrinter(); if Prefs.read silent then Prefs.set Trace.terse true; if not (Prefs.read silent) - then Util.msg "%s\n" (Uicommon.contactingServerMsg())) + then Util.msg "%s\n" (Uicommon.contactingServerMsg())) (fun () -> Some "default") (fun () -> Util.msg "%s" Uicommon.shortUsageMsg; exit 1) (fun () -> Util.msg "%s" Uicommon.shortUsageMsg; exit 1) @@ -878,7 +878,7 @@ let rec start interface = (* If we've been killed, then die *) handleException Sys.Break; exit Uicommon.fatalExit - end + end | e -> begin (* If any other bad thing happened and the -repeat preference is set, then restart *) @@ -889,11 +889,11 @@ let rec start interface = handleException e; if false (*Prefs.read Uicommon.repeat <> ""*) then begin Util.msg "Restarting in 10 seconds...\n"; - Unix.sleep 10; + Unix.sleep 10; start interface end else exit Uicommon.fatalExit - end + end end let defaultUi = Uicommon.Text diff --git a/src/unicode.ml b/src/unicode.ml index bcac995..c0ef8fe 100644 --- a/src/unicode.ml +++ b/src/unicode.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/unicode.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -1076,266 +1076,266 @@ let case_sensitive_compare s s' = (****) let uniCharPrecompSourceTable = [| - 0x00000300; 0x00540000; 0x00000301; 0x00750054; - 0x00000302; 0x002000C9; 0x00000303; 0x001C00E9; - 0x00000304; 0x002C0105; 0x00000306; 0x00200131; - 0x00000307; 0x002E0151; 0x00000308; 0x0036017F; - 0x00000309; 0x001801B5; 0x0000030A; 0x000601CD; - 0x0000030B; 0x000601D3; 0x0000030C; 0x002501D9; - 0x0000030F; 0x000E01FE; 0x00000311; 0x000C020C; - 0x00000313; 0x000E0218; 0x00000314; 0x00100226; - 0x0000031B; 0x00040236; 0x00000323; 0x002A023A; - 0x00000324; 0x00020264; 0x00000325; 0x00020266; - 0x00000326; 0x00040268; 0x00000327; 0x0016026C; - 0x00000328; 0x000A0282; 0x0000032D; 0x000C028C; - 0x0000032E; 0x00020298; 0x00000330; 0x0006029A; - 0x00000331; 0x001102A0; 0x00000338; 0x002C02B1; - 0x00000342; 0x001D02DD; 0x00000345; 0x003F02FA; - 0x00000653; 0x00010339; 0x00000654; 0x0006033A; - 0x00000655; 0x00010340; 0x0000093C; 0x00030341; - 0x000009BE; 0x00010344; 0x000009D7; 0x00010345; - 0x00000B3E; 0x00010346; 0x00000B56; 0x00010347; - 0x00000B57; 0x00010348; 0x00000BBE; 0x00020349; - 0x00000BD7; 0x0002034B; 0x00000C56; 0x0001034D; - 0x00000CC2; 0x0001034E; 0x00000CD5; 0x0003034F; - 0x00000CD6; 0x00010352; 0x00000D3E; 0x00020353; - 0x00000D57; 0x00010355; 0x00000DCA; 0x00020356; - 0x00000DCF; 0x00010358; 0x00000DDF; 0x00010359; - 0x0000102E; 0x0001035A; 0x00003099; 0x0030035B; - 0x0000309A; 0x000A038B + 0x00000300; 0x00540000; 0x00000301; 0x00750054; + 0x00000302; 0x002000C9; 0x00000303; 0x001C00E9; + 0x00000304; 0x002C0105; 0x00000306; 0x00200131; + 0x00000307; 0x002E0151; 0x00000308; 0x0036017F; + 0x00000309; 0x001801B5; 0x0000030A; 0x000601CD; + 0x0000030B; 0x000601D3; 0x0000030C; 0x002501D9; + 0x0000030F; 0x000E01FE; 0x00000311; 0x000C020C; + 0x00000313; 0x000E0218; 0x00000314; 0x00100226; + 0x0000031B; 0x00040236; 0x00000323; 0x002A023A; + 0x00000324; 0x00020264; 0x00000325; 0x00020266; + 0x00000326; 0x00040268; 0x00000327; 0x0016026C; + 0x00000328; 0x000A0282; 0x0000032D; 0x000C028C; + 0x0000032E; 0x00020298; 0x00000330; 0x0006029A; + 0x00000331; 0x001102A0; 0x00000338; 0x002C02B1; + 0x00000342; 0x001D02DD; 0x00000345; 0x003F02FA; + 0x00000653; 0x00010339; 0x00000654; 0x0006033A; + 0x00000655; 0x00010340; 0x0000093C; 0x00030341; + 0x000009BE; 0x00010344; 0x000009D7; 0x00010345; + 0x00000B3E; 0x00010346; 0x00000B56; 0x00010347; + 0x00000B57; 0x00010348; 0x00000BBE; 0x00020349; + 0x00000BD7; 0x0002034B; 0x00000C56; 0x0001034D; + 0x00000CC2; 0x0001034E; 0x00000CD5; 0x0003034F; + 0x00000CD6; 0x00010352; 0x00000D3E; 0x00020353; + 0x00000D57; 0x00010355; 0x00000DCA; 0x00020356; + 0x00000DCF; 0x00010358; 0x00000DDF; 0x00010359; + 0x0000102E; 0x0001035A; 0x00003099; 0x0030035B; + 0x0000309A; 0x000A038B |] let uniCharBMPPrecompDestinationTable = [| - 0x0041; 0x00C0; 0x0045; 0x00C8; 0x0049; 0x00CC; 0x004E; 0x01F8; - 0x004F; 0x00D2; 0x0055; 0x00D9; 0x0057; 0x1E80; 0x0059; 0x1EF2; - 0x0061; 0x00E0; 0x0065; 0x00E8; 0x0069; 0x00EC; 0x006E; 0x01F9; - 0x006F; 0x00F2; 0x0075; 0x00F9; 0x0077; 0x1E81; 0x0079; 0x1EF3; - 0x00A8; 0x1FED; 0x00C2; 0x1EA6; 0x00CA; 0x1EC0; 0x00D4; 0x1ED2; - 0x00DC; 0x01DB; 0x00E2; 0x1EA7; 0x00EA; 0x1EC1; 0x00F4; 0x1ED3; - 0x00FC; 0x01DC; 0x0102; 0x1EB0; 0x0103; 0x1EB1; 0x0112; 0x1E14; - 0x0113; 0x1E15; 0x014C; 0x1E50; 0x014D; 0x1E51; 0x01A0; 0x1EDC; - 0x01A1; 0x1EDD; 0x01AF; 0x1EEA; 0x01B0; 0x1EEB; 0x0391; 0x1FBA; - 0x0395; 0x1FC8; 0x0397; 0x1FCA; 0x0399; 0x1FDA; 0x039F; 0x1FF8; - 0x03A5; 0x1FEA; 0x03A9; 0x1FFA; 0x03B1; 0x1F70; 0x03B5; 0x1F72; - 0x03B7; 0x1F74; 0x03B9; 0x1F76; 0x03BF; 0x1F78; 0x03C5; 0x1F7A; - 0x03C9; 0x1F7C; 0x03CA; 0x1FD2; 0x03CB; 0x1FE2; 0x0415; 0x0400; - 0x0418; 0x040D; 0x0435; 0x0450; 0x0438; 0x045D; 0x1F00; 0x1F02; - 0x1F01; 0x1F03; 0x1F08; 0x1F0A; 0x1F09; 0x1F0B; 0x1F10; 0x1F12; - 0x1F11; 0x1F13; 0x1F18; 0x1F1A; 0x1F19; 0x1F1B; 0x1F20; 0x1F22; - 0x1F21; 0x1F23; 0x1F28; 0x1F2A; 0x1F29; 0x1F2B; 0x1F30; 0x1F32; - 0x1F31; 0x1F33; 0x1F38; 0x1F3A; 0x1F39; 0x1F3B; 0x1F40; 0x1F42; - 0x1F41; 0x1F43; 0x1F48; 0x1F4A; 0x1F49; 0x1F4B; 0x1F50; 0x1F52; - 0x1F51; 0x1F53; 0x1F59; 0x1F5B; 0x1F60; 0x1F62; 0x1F61; 0x1F63; - 0x1F68; 0x1F6A; 0x1F69; 0x1F6B; 0x1FBF; 0x1FCD; 0x1FFE; 0x1FDD; - 0x0041; 0x00C1; 0x0043; 0x0106; 0x0045; 0x00C9; 0x0047; 0x01F4; - 0x0049; 0x00CD; 0x004B; 0x1E30; 0x004C; 0x0139; 0x004D; 0x1E3E; - 0x004E; 0x0143; 0x004F; 0x00D3; 0x0050; 0x1E54; 0x0052; 0x0154; - 0x0053; 0x015A; 0x0055; 0x00DA; 0x0057; 0x1E82; 0x0059; 0x00DD; - 0x005A; 0x0179; 0x0061; 0x00E1; 0x0063; 0x0107; 0x0065; 0x00E9; - 0x0067; 0x01F5; 0x0069; 0x00ED; 0x006B; 0x1E31; 0x006C; 0x013A; - 0x006D; 0x1E3F; 0x006E; 0x0144; 0x006F; 0x00F3; 0x0070; 0x1E55; - 0x0072; 0x0155; 0x0073; 0x015B; 0x0075; 0x00FA; 0x0077; 0x1E83; - 0x0079; 0x00FD; 0x007A; 0x017A; 0x00A8; 0x0385; 0x00C2; 0x1EA4; - 0x00C5; 0x01FA; 0x00C6; 0x01FC; 0x00C7; 0x1E08; 0x00CA; 0x1EBE; - 0x00CF; 0x1E2E; 0x00D4; 0x1ED0; 0x00D5; 0x1E4C; 0x00D8; 0x01FE; - 0x00DC; 0x01D7; 0x00E2; 0x1EA5; 0x00E5; 0x01FB; 0x00E6; 0x01FD; - 0x00E7; 0x1E09; 0x00EA; 0x1EBF; 0x00EF; 0x1E2F; 0x00F4; 0x1ED1; - 0x00F5; 0x1E4D; 0x00F8; 0x01FF; 0x00FC; 0x01D8; 0x0102; 0x1EAE; - 0x0103; 0x1EAF; 0x0112; 0x1E16; 0x0113; 0x1E17; 0x014C; 0x1E52; - 0x014D; 0x1E53; 0x0168; 0x1E78; 0x0169; 0x1E79; 0x01A0; 0x1EDA; - 0x01A1; 0x1EDB; 0x01AF; 0x1EE8; 0x01B0; 0x1EE9; 0x0391; 0x0386; - 0x0395; 0x0388; 0x0397; 0x0389; 0x0399; 0x038A; 0x039F; 0x038C; - 0x03A5; 0x038E; 0x03A9; 0x038F; 0x03B1; 0x03AC; 0x03B5; 0x03AD; - 0x03B7; 0x03AE; 0x03B9; 0x03AF; 0x03BF; 0x03CC; 0x03C5; 0x03CD; - 0x03C9; 0x03CE; 0x03CA; 0x0390; 0x03CB; 0x03B0; 0x03D2; 0x03D3; - 0x0413; 0x0403; 0x041A; 0x040C; 0x0433; 0x0453; 0x043A; 0x045C; - 0x1F00; 0x1F04; 0x1F01; 0x1F05; 0x1F08; 0x1F0C; 0x1F09; 0x1F0D; - 0x1F10; 0x1F14; 0x1F11; 0x1F15; 0x1F18; 0x1F1C; 0x1F19; 0x1F1D; - 0x1F20; 0x1F24; 0x1F21; 0x1F25; 0x1F28; 0x1F2C; 0x1F29; 0x1F2D; - 0x1F30; 0x1F34; 0x1F31; 0x1F35; 0x1F38; 0x1F3C; 0x1F39; 0x1F3D; - 0x1F40; 0x1F44; 0x1F41; 0x1F45; 0x1F48; 0x1F4C; 0x1F49; 0x1F4D; - 0x1F50; 0x1F54; 0x1F51; 0x1F55; 0x1F59; 0x1F5D; 0x1F60; 0x1F64; - 0x1F61; 0x1F65; 0x1F68; 0x1F6C; 0x1F69; 0x1F6D; 0x1FBF; 0x1FCE; - 0x1FFE; 0x1FDE; 0x0041; 0x00C2; 0x0043; 0x0108; 0x0045; 0x00CA; - 0x0047; 0x011C; 0x0048; 0x0124; 0x0049; 0x00CE; 0x004A; 0x0134; - 0x004F; 0x00D4; 0x0053; 0x015C; 0x0055; 0x00DB; 0x0057; 0x0174; - 0x0059; 0x0176; 0x005A; 0x1E90; 0x0061; 0x00E2; 0x0063; 0x0109; - 0x0065; 0x00EA; 0x0067; 0x011D; 0x0068; 0x0125; 0x0069; 0x00EE; - 0x006A; 0x0135; 0x006F; 0x00F4; 0x0073; 0x015D; 0x0075; 0x00FB; - 0x0077; 0x0175; 0x0079; 0x0177; 0x007A; 0x1E91; 0x1EA0; 0x1EAC; - 0x1EA1; 0x1EAD; 0x1EB8; 0x1EC6; 0x1EB9; 0x1EC7; 0x1ECC; 0x1ED8; - 0x1ECD; 0x1ED9; 0x0041; 0x00C3; 0x0045; 0x1EBC; 0x0049; 0x0128; - 0x004E; 0x00D1; 0x004F; 0x00D5; 0x0055; 0x0168; 0x0056; 0x1E7C; - 0x0059; 0x1EF8; 0x0061; 0x00E3; 0x0065; 0x1EBD; 0x0069; 0x0129; - 0x006E; 0x00F1; 0x006F; 0x00F5; 0x0075; 0x0169; 0x0076; 0x1E7D; - 0x0079; 0x1EF9; 0x00C2; 0x1EAA; 0x00CA; 0x1EC4; 0x00D4; 0x1ED6; - 0x00E2; 0x1EAB; 0x00EA; 0x1EC5; 0x00F4; 0x1ED7; 0x0102; 0x1EB4; - 0x0103; 0x1EB5; 0x01A0; 0x1EE0; 0x01A1; 0x1EE1; 0x01AF; 0x1EEE; - 0x01B0; 0x1EEF; 0x0041; 0x0100; 0x0045; 0x0112; 0x0047; 0x1E20; - 0x0049; 0x012A; 0x004F; 0x014C; 0x0055; 0x016A; 0x0059; 0x0232; - 0x0061; 0x0101; 0x0065; 0x0113; 0x0067; 0x1E21; 0x0069; 0x012B; - 0x006F; 0x014D; 0x0075; 0x016B; 0x0079; 0x0233; 0x00C4; 0x01DE; - 0x00C6; 0x01E2; 0x00D5; 0x022C; 0x00D6; 0x022A; 0x00DC; 0x01D5; - 0x00E4; 0x01DF; 0x00E6; 0x01E3; 0x00F5; 0x022D; 0x00F6; 0x022B; - 0x00FC; 0x01D6; 0x01EA; 0x01EC; 0x01EB; 0x01ED; 0x0226; 0x01E0; - 0x0227; 0x01E1; 0x022E; 0x0230; 0x022F; 0x0231; 0x0391; 0x1FB9; - 0x0399; 0x1FD9; 0x03A5; 0x1FE9; 0x03B1; 0x1FB1; 0x03B9; 0x1FD1; - 0x03C5; 0x1FE1; 0x0418; 0x04E2; 0x0423; 0x04EE; 0x0438; 0x04E3; - 0x0443; 0x04EF; 0x1E36; 0x1E38; 0x1E37; 0x1E39; 0x1E5A; 0x1E5C; - 0x1E5B; 0x1E5D; 0x0041; 0x0102; 0x0045; 0x0114; 0x0047; 0x011E; - 0x0049; 0x012C; 0x004F; 0x014E; 0x0055; 0x016C; 0x0061; 0x0103; - 0x0065; 0x0115; 0x0067; 0x011F; 0x0069; 0x012D; 0x006F; 0x014F; - 0x0075; 0x016D; 0x0228; 0x1E1C; 0x0229; 0x1E1D; 0x0391; 0x1FB8; - 0x0399; 0x1FD8; 0x03A5; 0x1FE8; 0x03B1; 0x1FB0; 0x03B9; 0x1FD0; - 0x03C5; 0x1FE0; 0x0410; 0x04D0; 0x0415; 0x04D6; 0x0416; 0x04C1; - 0x0418; 0x0419; 0x0423; 0x040E; 0x0430; 0x04D1; 0x0435; 0x04D7; - 0x0436; 0x04C2; 0x0438; 0x0439; 0x0443; 0x045E; 0x1EA0; 0x1EB6; - 0x1EA1; 0x1EB7; 0x0041; 0x0226; 0x0042; 0x1E02; 0x0043; 0x010A; - 0x0044; 0x1E0A; 0x0045; 0x0116; 0x0046; 0x1E1E; 0x0047; 0x0120; - 0x0048; 0x1E22; 0x0049; 0x0130; 0x004D; 0x1E40; 0x004E; 0x1E44; - 0x004F; 0x022E; 0x0050; 0x1E56; 0x0052; 0x1E58; 0x0053; 0x1E60; - 0x0054; 0x1E6A; 0x0057; 0x1E86; 0x0058; 0x1E8A; 0x0059; 0x1E8E; - 0x005A; 0x017B; 0x0061; 0x0227; 0x0062; 0x1E03; 0x0063; 0x010B; - 0x0064; 0x1E0B; 0x0065; 0x0117; 0x0066; 0x1E1F; 0x0067; 0x0121; - 0x0068; 0x1E23; 0x006D; 0x1E41; 0x006E; 0x1E45; 0x006F; 0x022F; - 0x0070; 0x1E57; 0x0072; 0x1E59; 0x0073; 0x1E61; 0x0074; 0x1E6B; - 0x0077; 0x1E87; 0x0078; 0x1E8B; 0x0079; 0x1E8F; 0x007A; 0x017C; - 0x015A; 0x1E64; 0x015B; 0x1E65; 0x0160; 0x1E66; 0x0161; 0x1E67; - 0x017F; 0x1E9B; 0x1E62; 0x1E68; 0x1E63; 0x1E69; 0x0041; 0x00C4; - 0x0045; 0x00CB; 0x0048; 0x1E26; 0x0049; 0x00CF; 0x004F; 0x00D6; - 0x0055; 0x00DC; 0x0057; 0x1E84; 0x0058; 0x1E8C; 0x0059; 0x0178; - 0x0061; 0x00E4; 0x0065; 0x00EB; 0x0068; 0x1E27; 0x0069; 0x00EF; - 0x006F; 0x00F6; 0x0074; 0x1E97; 0x0075; 0x00FC; 0x0077; 0x1E85; - 0x0078; 0x1E8D; 0x0079; 0x00FF; 0x00D5; 0x1E4E; 0x00F5; 0x1E4F; - 0x016A; 0x1E7A; 0x016B; 0x1E7B; 0x0399; 0x03AA; 0x03A5; 0x03AB; - 0x03B9; 0x03CA; 0x03C5; 0x03CB; 0x03D2; 0x03D4; 0x0406; 0x0407; - 0x0410; 0x04D2; 0x0415; 0x0401; 0x0416; 0x04DC; 0x0417; 0x04DE; - 0x0418; 0x04E4; 0x041E; 0x04E6; 0x0423; 0x04F0; 0x0427; 0x04F4; - 0x042B; 0x04F8; 0x042D; 0x04EC; 0x0430; 0x04D3; 0x0435; 0x0451; - 0x0436; 0x04DD; 0x0437; 0x04DF; 0x0438; 0x04E5; 0x043E; 0x04E7; - 0x0443; 0x04F1; 0x0447; 0x04F5; 0x044B; 0x04F9; 0x044D; 0x04ED; - 0x0456; 0x0457; 0x04D8; 0x04DA; 0x04D9; 0x04DB; 0x04E8; 0x04EA; - 0x04E9; 0x04EB; 0x0041; 0x1EA2; 0x0045; 0x1EBA; 0x0049; 0x1EC8; - 0x004F; 0x1ECE; 0x0055; 0x1EE6; 0x0059; 0x1EF6; 0x0061; 0x1EA3; - 0x0065; 0x1EBB; 0x0069; 0x1EC9; 0x006F; 0x1ECF; 0x0075; 0x1EE7; - 0x0079; 0x1EF7; 0x00C2; 0x1EA8; 0x00CA; 0x1EC2; 0x00D4; 0x1ED4; - 0x00E2; 0x1EA9; 0x00EA; 0x1EC3; 0x00F4; 0x1ED5; 0x0102; 0x1EB2; - 0x0103; 0x1EB3; 0x01A0; 0x1EDE; 0x01A1; 0x1EDF; 0x01AF; 0x1EEC; - 0x01B0; 0x1EED; 0x0041; 0x00C5; 0x0055; 0x016E; 0x0061; 0x00E5; - 0x0075; 0x016F; 0x0077; 0x1E98; 0x0079; 0x1E99; 0x004F; 0x0150; - 0x0055; 0x0170; 0x006F; 0x0151; 0x0075; 0x0171; 0x0423; 0x04F2; - 0x0443; 0x04F3; 0x0041; 0x01CD; 0x0043; 0x010C; 0x0044; 0x010E; - 0x0045; 0x011A; 0x0047; 0x01E6; 0x0048; 0x021E; 0x0049; 0x01CF; - 0x004B; 0x01E8; 0x004C; 0x013D; 0x004E; 0x0147; 0x004F; 0x01D1; - 0x0052; 0x0158; 0x0053; 0x0160; 0x0054; 0x0164; 0x0055; 0x01D3; - 0x005A; 0x017D; 0x0061; 0x01CE; 0x0063; 0x010D; 0x0064; 0x010F; - 0x0065; 0x011B; 0x0067; 0x01E7; 0x0068; 0x021F; 0x0069; 0x01D0; - 0x006A; 0x01F0; 0x006B; 0x01E9; 0x006C; 0x013E; 0x006E; 0x0148; - 0x006F; 0x01D2; 0x0072; 0x0159; 0x0073; 0x0161; 0x0074; 0x0165; - 0x0075; 0x01D4; 0x007A; 0x017E; 0x00DC; 0x01D9; 0x00FC; 0x01DA; - 0x01B7; 0x01EE; 0x0292; 0x01EF; 0x0041; 0x0200; 0x0045; 0x0204; - 0x0049; 0x0208; 0x004F; 0x020C; 0x0052; 0x0210; 0x0055; 0x0214; - 0x0061; 0x0201; 0x0065; 0x0205; 0x0069; 0x0209; 0x006F; 0x020D; - 0x0072; 0x0211; 0x0075; 0x0215; 0x0474; 0x0476; 0x0475; 0x0477; - 0x0041; 0x0202; 0x0045; 0x0206; 0x0049; 0x020A; 0x004F; 0x020E; - 0x0052; 0x0212; 0x0055; 0x0216; 0x0061; 0x0203; 0x0065; 0x0207; - 0x0069; 0x020B; 0x006F; 0x020F; 0x0072; 0x0213; 0x0075; 0x0217; - 0x0391; 0x1F08; 0x0395; 0x1F18; 0x0397; 0x1F28; 0x0399; 0x1F38; - 0x039F; 0x1F48; 0x03A9; 0x1F68; 0x03B1; 0x1F00; 0x03B5; 0x1F10; - 0x03B7; 0x1F20; 0x03B9; 0x1F30; 0x03BF; 0x1F40; 0x03C1; 0x1FE4; - 0x03C5; 0x1F50; 0x03C9; 0x1F60; 0x0391; 0x1F09; 0x0395; 0x1F19; - 0x0397; 0x1F29; 0x0399; 0x1F39; 0x039F; 0x1F49; 0x03A1; 0x1FEC; - 0x03A5; 0x1F59; 0x03A9; 0x1F69; 0x03B1; 0x1F01; 0x03B5; 0x1F11; - 0x03B7; 0x1F21; 0x03B9; 0x1F31; 0x03BF; 0x1F41; 0x03C1; 0x1FE5; - 0x03C5; 0x1F51; 0x03C9; 0x1F61; 0x004F; 0x01A0; 0x0055; 0x01AF; - 0x006F; 0x01A1; 0x0075; 0x01B0; 0x0041; 0x1EA0; 0x0042; 0x1E04; - 0x0044; 0x1E0C; 0x0045; 0x1EB8; 0x0048; 0x1E24; 0x0049; 0x1ECA; - 0x004B; 0x1E32; 0x004C; 0x1E36; 0x004D; 0x1E42; 0x004E; 0x1E46; - 0x004F; 0x1ECC; 0x0052; 0x1E5A; 0x0053; 0x1E62; 0x0054; 0x1E6C; - 0x0055; 0x1EE4; 0x0056; 0x1E7E; 0x0057; 0x1E88; 0x0059; 0x1EF4; - 0x005A; 0x1E92; 0x0061; 0x1EA1; 0x0062; 0x1E05; 0x0064; 0x1E0D; - 0x0065; 0x1EB9; 0x0068; 0x1E25; 0x0069; 0x1ECB; 0x006B; 0x1E33; - 0x006C; 0x1E37; 0x006D; 0x1E43; 0x006E; 0x1E47; 0x006F; 0x1ECD; - 0x0072; 0x1E5B; 0x0073; 0x1E63; 0x0074; 0x1E6D; 0x0075; 0x1EE5; - 0x0076; 0x1E7F; 0x0077; 0x1E89; 0x0079; 0x1EF5; 0x007A; 0x1E93; - 0x01A0; 0x1EE2; 0x01A1; 0x1EE3; 0x01AF; 0x1EF0; 0x01B0; 0x1EF1; - 0x0055; 0x1E72; 0x0075; 0x1E73; 0x0041; 0x1E00; 0x0061; 0x1E01; - 0x0053; 0x0218; 0x0054; 0x021A; 0x0073; 0x0219; 0x0074; 0x021B; - 0x0043; 0x00C7; 0x0044; 0x1E10; 0x0045; 0x0228; 0x0047; 0x0122; - 0x0048; 0x1E28; 0x004B; 0x0136; 0x004C; 0x013B; 0x004E; 0x0145; - 0x0052; 0x0156; 0x0053; 0x015E; 0x0054; 0x0162; 0x0063; 0x00E7; - 0x0064; 0x1E11; 0x0065; 0x0229; 0x0067; 0x0123; 0x0068; 0x1E29; - 0x006B; 0x0137; 0x006C; 0x013C; 0x006E; 0x0146; 0x0072; 0x0157; - 0x0073; 0x015F; 0x0074; 0x0163; 0x0041; 0x0104; 0x0045; 0x0118; - 0x0049; 0x012E; 0x004F; 0x01EA; 0x0055; 0x0172; 0x0061; 0x0105; - 0x0065; 0x0119; 0x0069; 0x012F; 0x006F; 0x01EB; 0x0075; 0x0173; - 0x0044; 0x1E12; 0x0045; 0x1E18; 0x004C; 0x1E3C; 0x004E; 0x1E4A; - 0x0054; 0x1E70; 0x0055; 0x1E76; 0x0064; 0x1E13; 0x0065; 0x1E19; - 0x006C; 0x1E3D; 0x006E; 0x1E4B; 0x0074; 0x1E71; 0x0075; 0x1E77; - 0x0048; 0x1E2A; 0x0068; 0x1E2B; 0x0045; 0x1E1A; 0x0049; 0x1E2C; - 0x0055; 0x1E74; 0x0065; 0x1E1B; 0x0069; 0x1E2D; 0x0075; 0x1E75; - 0x0042; 0x1E06; 0x0044; 0x1E0E; 0x004B; 0x1E34; 0x004C; 0x1E3A; - 0x004E; 0x1E48; 0x0052; 0x1E5E; 0x0054; 0x1E6E; 0x005A; 0x1E94; - 0x0062; 0x1E07; 0x0064; 0x1E0F; 0x0068; 0x1E96; 0x006B; 0x1E35; - 0x006C; 0x1E3B; 0x006E; 0x1E49; 0x0072; 0x1E5F; 0x0074; 0x1E6F; - 0x007A; 0x1E95; 0x003C; 0x226E; 0x003D; 0x2260; 0x003E; 0x226F; - 0x2190; 0x219A; 0x2192; 0x219B; 0x2194; 0x21AE; 0x21D0; 0x21CD; - 0x21D2; 0x21CF; 0x21D4; 0x21CE; 0x2203; 0x2204; 0x2208; 0x2209; - 0x220B; 0x220C; 0x2223; 0x2224; 0x2225; 0x2226; 0x223C; 0x2241; - 0x2243; 0x2244; 0x2245; 0x2247; 0x2248; 0x2249; 0x224D; 0x226D; - 0x2261; 0x2262; 0x2264; 0x2270; 0x2265; 0x2271; 0x2272; 0x2274; - 0x2273; 0x2275; 0x2276; 0x2278; 0x2277; 0x2279; 0x227A; 0x2280; - 0x227B; 0x2281; 0x227C; 0x22E0; 0x227D; 0x22E1; 0x2282; 0x2284; - 0x2283; 0x2285; 0x2286; 0x2288; 0x2287; 0x2289; 0x2291; 0x22E2; - 0x2292; 0x22E3; 0x22A2; 0x22AC; 0x22A8; 0x22AD; 0x22A9; 0x22AE; - 0x22AB; 0x22AF; 0x22B2; 0x22EA; 0x22B3; 0x22EB; 0x22B4; 0x22EC; - 0x22B5; 0x22ED; 0x00A8; 0x1FC1; 0x03B1; 0x1FB6; 0x03B7; 0x1FC6; - 0x03B9; 0x1FD6; 0x03C5; 0x1FE6; 0x03C9; 0x1FF6; 0x03CA; 0x1FD7; - 0x03CB; 0x1FE7; 0x1F00; 0x1F06; 0x1F01; 0x1F07; 0x1F08; 0x1F0E; - 0x1F09; 0x1F0F; 0x1F20; 0x1F26; 0x1F21; 0x1F27; 0x1F28; 0x1F2E; - 0x1F29; 0x1F2F; 0x1F30; 0x1F36; 0x1F31; 0x1F37; 0x1F38; 0x1F3E; - 0x1F39; 0x1F3F; 0x1F50; 0x1F56; 0x1F51; 0x1F57; 0x1F59; 0x1F5F; - 0x1F60; 0x1F66; 0x1F61; 0x1F67; 0x1F68; 0x1F6E; 0x1F69; 0x1F6F; - 0x1FBF; 0x1FCF; 0x1FFE; 0x1FDF; 0x0391; 0x1FBC; 0x0397; 0x1FCC; - 0x03A9; 0x1FFC; 0x03AC; 0x1FB4; 0x03AE; 0x1FC4; 0x03B1; 0x1FB3; - 0x03B7; 0x1FC3; 0x03C9; 0x1FF3; 0x03CE; 0x1FF4; 0x1F00; 0x1F80; - 0x1F01; 0x1F81; 0x1F02; 0x1F82; 0x1F03; 0x1F83; 0x1F04; 0x1F84; - 0x1F05; 0x1F85; 0x1F06; 0x1F86; 0x1F07; 0x1F87; 0x1F08; 0x1F88; - 0x1F09; 0x1F89; 0x1F0A; 0x1F8A; 0x1F0B; 0x1F8B; 0x1F0C; 0x1F8C; - 0x1F0D; 0x1F8D; 0x1F0E; 0x1F8E; 0x1F0F; 0x1F8F; 0x1F20; 0x1F90; - 0x1F21; 0x1F91; 0x1F22; 0x1F92; 0x1F23; 0x1F93; 0x1F24; 0x1F94; - 0x1F25; 0x1F95; 0x1F26; 0x1F96; 0x1F27; 0x1F97; 0x1F28; 0x1F98; - 0x1F29; 0x1F99; 0x1F2A; 0x1F9A; 0x1F2B; 0x1F9B; 0x1F2C; 0x1F9C; - 0x1F2D; 0x1F9D; 0x1F2E; 0x1F9E; 0x1F2F; 0x1F9F; 0x1F60; 0x1FA0; - 0x1F61; 0x1FA1; 0x1F62; 0x1FA2; 0x1F63; 0x1FA3; 0x1F64; 0x1FA4; - 0x1F65; 0x1FA5; 0x1F66; 0x1FA6; 0x1F67; 0x1FA7; 0x1F68; 0x1FA8; - 0x1F69; 0x1FA9; 0x1F6A; 0x1FAA; 0x1F6B; 0x1FAB; 0x1F6C; 0x1FAC; - 0x1F6D; 0x1FAD; 0x1F6E; 0x1FAE; 0x1F6F; 0x1FAF; 0x1F70; 0x1FB2; - 0x1F74; 0x1FC2; 0x1F7C; 0x1FF2; 0x1FB6; 0x1FB7; 0x1FC6; 0x1FC7; - 0x1FF6; 0x1FF7; 0x0627; 0x0622; 0x0627; 0x0623; 0x0648; 0x0624; - 0x064A; 0x0626; 0x06C1; 0x06C2; 0x06D2; 0x06D3; 0x06D5; 0x06C0; - 0x0627; 0x0625; 0x0928; 0x0929; 0x0930; 0x0931; 0x0933; 0x0934; - 0x09C7; 0x09CB; 0x09C7; 0x09CC; 0x0B47; 0x0B4B; 0x0B47; 0x0B48; - 0x0B47; 0x0B4C; 0x0BC6; 0x0BCA; 0x0BC7; 0x0BCB; 0x0B92; 0x0B94; - 0x0BC6; 0x0BCC; 0x0C46; 0x0C48; 0x0CC6; 0x0CCA; 0x0CBF; 0x0CC0; - 0x0CC6; 0x0CC7; 0x0CCA; 0x0CCB; 0x0CC6; 0x0CC8; 0x0D46; 0x0D4A; - 0x0D47; 0x0D4B; 0x0D46; 0x0D4C; 0x0DD9; 0x0DDA; 0x0DDC; 0x0DDD; - 0x0DD9; 0x0DDC; 0x0DD9; 0x0DDE; 0x1025; 0x1026; 0x3046; 0x3094; - 0x304B; 0x304C; 0x304D; 0x304E; 0x304F; 0x3050; 0x3051; 0x3052; - 0x3053; 0x3054; 0x3055; 0x3056; 0x3057; 0x3058; 0x3059; 0x305A; - 0x305B; 0x305C; 0x305D; 0x305E; 0x305F; 0x3060; 0x3061; 0x3062; - 0x3064; 0x3065; 0x3066; 0x3067; 0x3068; 0x3069; 0x306F; 0x3070; - 0x3072; 0x3073; 0x3075; 0x3076; 0x3078; 0x3079; 0x307B; 0x307C; - 0x309D; 0x309E; 0x30A6; 0x30F4; 0x30AB; 0x30AC; 0x30AD; 0x30AE; - 0x30AF; 0x30B0; 0x30B1; 0x30B2; 0x30B3; 0x30B4; 0x30B5; 0x30B6; - 0x30B7; 0x30B8; 0x30B9; 0x30BA; 0x30BB; 0x30BC; 0x30BD; 0x30BE; - 0x30BF; 0x30C0; 0x30C1; 0x30C2; 0x30C4; 0x30C5; 0x30C6; 0x30C7; - 0x30C8; 0x30C9; 0x30CF; 0x30D0; 0x30D2; 0x30D3; 0x30D5; 0x30D6; - 0x30D8; 0x30D9; 0x30DB; 0x30DC; 0x30EF; 0x30F7; 0x30F0; 0x30F8; - 0x30F1; 0x30F9; 0x30F2; 0x30FA; 0x30FD; 0x30FE; 0x306F; 0x3071; - 0x3072; 0x3074; 0x3075; 0x3077; 0x3078; 0x307A; 0x307B; 0x307D; - 0x30CF; 0x30D1; 0x30D2; 0x30D4; 0x30D5; 0x30D7; 0x30D8; 0x30DA; - 0x30DB; 0x30DD + 0x0041; 0x00C0; 0x0045; 0x00C8; 0x0049; 0x00CC; 0x004E; 0x01F8; + 0x004F; 0x00D2; 0x0055; 0x00D9; 0x0057; 0x1E80; 0x0059; 0x1EF2; + 0x0061; 0x00E0; 0x0065; 0x00E8; 0x0069; 0x00EC; 0x006E; 0x01F9; + 0x006F; 0x00F2; 0x0075; 0x00F9; 0x0077; 0x1E81; 0x0079; 0x1EF3; + 0x00A8; 0x1FED; 0x00C2; 0x1EA6; 0x00CA; 0x1EC0; 0x00D4; 0x1ED2; + 0x00DC; 0x01DB; 0x00E2; 0x1EA7; 0x00EA; 0x1EC1; 0x00F4; 0x1ED3; + 0x00FC; 0x01DC; 0x0102; 0x1EB0; 0x0103; 0x1EB1; 0x0112; 0x1E14; + 0x0113; 0x1E15; 0x014C; 0x1E50; 0x014D; 0x1E51; 0x01A0; 0x1EDC; + 0x01A1; 0x1EDD; 0x01AF; 0x1EEA; 0x01B0; 0x1EEB; 0x0391; 0x1FBA; + 0x0395; 0x1FC8; 0x0397; 0x1FCA; 0x0399; 0x1FDA; 0x039F; 0x1FF8; + 0x03A5; 0x1FEA; 0x03A9; 0x1FFA; 0x03B1; 0x1F70; 0x03B5; 0x1F72; + 0x03B7; 0x1F74; 0x03B9; 0x1F76; 0x03BF; 0x1F78; 0x03C5; 0x1F7A; + 0x03C9; 0x1F7C; 0x03CA; 0x1FD2; 0x03CB; 0x1FE2; 0x0415; 0x0400; + 0x0418; 0x040D; 0x0435; 0x0450; 0x0438; 0x045D; 0x1F00; 0x1F02; + 0x1F01; 0x1F03; 0x1F08; 0x1F0A; 0x1F09; 0x1F0B; 0x1F10; 0x1F12; + 0x1F11; 0x1F13; 0x1F18; 0x1F1A; 0x1F19; 0x1F1B; 0x1F20; 0x1F22; + 0x1F21; 0x1F23; 0x1F28; 0x1F2A; 0x1F29; 0x1F2B; 0x1F30; 0x1F32; + 0x1F31; 0x1F33; 0x1F38; 0x1F3A; 0x1F39; 0x1F3B; 0x1F40; 0x1F42; + 0x1F41; 0x1F43; 0x1F48; 0x1F4A; 0x1F49; 0x1F4B; 0x1F50; 0x1F52; + 0x1F51; 0x1F53; 0x1F59; 0x1F5B; 0x1F60; 0x1F62; 0x1F61; 0x1F63; + 0x1F68; 0x1F6A; 0x1F69; 0x1F6B; 0x1FBF; 0x1FCD; 0x1FFE; 0x1FDD; + 0x0041; 0x00C1; 0x0043; 0x0106; 0x0045; 0x00C9; 0x0047; 0x01F4; + 0x0049; 0x00CD; 0x004B; 0x1E30; 0x004C; 0x0139; 0x004D; 0x1E3E; + 0x004E; 0x0143; 0x004F; 0x00D3; 0x0050; 0x1E54; 0x0052; 0x0154; + 0x0053; 0x015A; 0x0055; 0x00DA; 0x0057; 0x1E82; 0x0059; 0x00DD; + 0x005A; 0x0179; 0x0061; 0x00E1; 0x0063; 0x0107; 0x0065; 0x00E9; + 0x0067; 0x01F5; 0x0069; 0x00ED; 0x006B; 0x1E31; 0x006C; 0x013A; + 0x006D; 0x1E3F; 0x006E; 0x0144; 0x006F; 0x00F3; 0x0070; 0x1E55; + 0x0072; 0x0155; 0x0073; 0x015B; 0x0075; 0x00FA; 0x0077; 0x1E83; + 0x0079; 0x00FD; 0x007A; 0x017A; 0x00A8; 0x0385; 0x00C2; 0x1EA4; + 0x00C5; 0x01FA; 0x00C6; 0x01FC; 0x00C7; 0x1E08; 0x00CA; 0x1EBE; + 0x00CF; 0x1E2E; 0x00D4; 0x1ED0; 0x00D5; 0x1E4C; 0x00D8; 0x01FE; + 0x00DC; 0x01D7; 0x00E2; 0x1EA5; 0x00E5; 0x01FB; 0x00E6; 0x01FD; + 0x00E7; 0x1E09; 0x00EA; 0x1EBF; 0x00EF; 0x1E2F; 0x00F4; 0x1ED1; + 0x00F5; 0x1E4D; 0x00F8; 0x01FF; 0x00FC; 0x01D8; 0x0102; 0x1EAE; + 0x0103; 0x1EAF; 0x0112; 0x1E16; 0x0113; 0x1E17; 0x014C; 0x1E52; + 0x014D; 0x1E53; 0x0168; 0x1E78; 0x0169; 0x1E79; 0x01A0; 0x1EDA; + 0x01A1; 0x1EDB; 0x01AF; 0x1EE8; 0x01B0; 0x1EE9; 0x0391; 0x0386; + 0x0395; 0x0388; 0x0397; 0x0389; 0x0399; 0x038A; 0x039F; 0x038C; + 0x03A5; 0x038E; 0x03A9; 0x038F; 0x03B1; 0x03AC; 0x03B5; 0x03AD; + 0x03B7; 0x03AE; 0x03B9; 0x03AF; 0x03BF; 0x03CC; 0x03C5; 0x03CD; + 0x03C9; 0x03CE; 0x03CA; 0x0390; 0x03CB; 0x03B0; 0x03D2; 0x03D3; + 0x0413; 0x0403; 0x041A; 0x040C; 0x0433; 0x0453; 0x043A; 0x045C; + 0x1F00; 0x1F04; 0x1F01; 0x1F05; 0x1F08; 0x1F0C; 0x1F09; 0x1F0D; + 0x1F10; 0x1F14; 0x1F11; 0x1F15; 0x1F18; 0x1F1C; 0x1F19; 0x1F1D; + 0x1F20; 0x1F24; 0x1F21; 0x1F25; 0x1F28; 0x1F2C; 0x1F29; 0x1F2D; + 0x1F30; 0x1F34; 0x1F31; 0x1F35; 0x1F38; 0x1F3C; 0x1F39; 0x1F3D; + 0x1F40; 0x1F44; 0x1F41; 0x1F45; 0x1F48; 0x1F4C; 0x1F49; 0x1F4D; + 0x1F50; 0x1F54; 0x1F51; 0x1F55; 0x1F59; 0x1F5D; 0x1F60; 0x1F64; + 0x1F61; 0x1F65; 0x1F68; 0x1F6C; 0x1F69; 0x1F6D; 0x1FBF; 0x1FCE; + 0x1FFE; 0x1FDE; 0x0041; 0x00C2; 0x0043; 0x0108; 0x0045; 0x00CA; + 0x0047; 0x011C; 0x0048; 0x0124; 0x0049; 0x00CE; 0x004A; 0x0134; + 0x004F; 0x00D4; 0x0053; 0x015C; 0x0055; 0x00DB; 0x0057; 0x0174; + 0x0059; 0x0176; 0x005A; 0x1E90; 0x0061; 0x00E2; 0x0063; 0x0109; + 0x0065; 0x00EA; 0x0067; 0x011D; 0x0068; 0x0125; 0x0069; 0x00EE; + 0x006A; 0x0135; 0x006F; 0x00F4; 0x0073; 0x015D; 0x0075; 0x00FB; + 0x0077; 0x0175; 0x0079; 0x0177; 0x007A; 0x1E91; 0x1EA0; 0x1EAC; + 0x1EA1; 0x1EAD; 0x1EB8; 0x1EC6; 0x1EB9; 0x1EC7; 0x1ECC; 0x1ED8; + 0x1ECD; 0x1ED9; 0x0041; 0x00C3; 0x0045; 0x1EBC; 0x0049; 0x0128; + 0x004E; 0x00D1; 0x004F; 0x00D5; 0x0055; 0x0168; 0x0056; 0x1E7C; + 0x0059; 0x1EF8; 0x0061; 0x00E3; 0x0065; 0x1EBD; 0x0069; 0x0129; + 0x006E; 0x00F1; 0x006F; 0x00F5; 0x0075; 0x0169; 0x0076; 0x1E7D; + 0x0079; 0x1EF9; 0x00C2; 0x1EAA; 0x00CA; 0x1EC4; 0x00D4; 0x1ED6; + 0x00E2; 0x1EAB; 0x00EA; 0x1EC5; 0x00F4; 0x1ED7; 0x0102; 0x1EB4; + 0x0103; 0x1EB5; 0x01A0; 0x1EE0; 0x01A1; 0x1EE1; 0x01AF; 0x1EEE; + 0x01B0; 0x1EEF; 0x0041; 0x0100; 0x0045; 0x0112; 0x0047; 0x1E20; + 0x0049; 0x012A; 0x004F; 0x014C; 0x0055; 0x016A; 0x0059; 0x0232; + 0x0061; 0x0101; 0x0065; 0x0113; 0x0067; 0x1E21; 0x0069; 0x012B; + 0x006F; 0x014D; 0x0075; 0x016B; 0x0079; 0x0233; 0x00C4; 0x01DE; + 0x00C6; 0x01E2; 0x00D5; 0x022C; 0x00D6; 0x022A; 0x00DC; 0x01D5; + 0x00E4; 0x01DF; 0x00E6; 0x01E3; 0x00F5; 0x022D; 0x00F6; 0x022B; + 0x00FC; 0x01D6; 0x01EA; 0x01EC; 0x01EB; 0x01ED; 0x0226; 0x01E0; + 0x0227; 0x01E1; 0x022E; 0x0230; 0x022F; 0x0231; 0x0391; 0x1FB9; + 0x0399; 0x1FD9; 0x03A5; 0x1FE9; 0x03B1; 0x1FB1; 0x03B9; 0x1FD1; + 0x03C5; 0x1FE1; 0x0418; 0x04E2; 0x0423; 0x04EE; 0x0438; 0x04E3; + 0x0443; 0x04EF; 0x1E36; 0x1E38; 0x1E37; 0x1E39; 0x1E5A; 0x1E5C; + 0x1E5B; 0x1E5D; 0x0041; 0x0102; 0x0045; 0x0114; 0x0047; 0x011E; + 0x0049; 0x012C; 0x004F; 0x014E; 0x0055; 0x016C; 0x0061; 0x0103; + 0x0065; 0x0115; 0x0067; 0x011F; 0x0069; 0x012D; 0x006F; 0x014F; + 0x0075; 0x016D; 0x0228; 0x1E1C; 0x0229; 0x1E1D; 0x0391; 0x1FB8; + 0x0399; 0x1FD8; 0x03A5; 0x1FE8; 0x03B1; 0x1FB0; 0x03B9; 0x1FD0; + 0x03C5; 0x1FE0; 0x0410; 0x04D0; 0x0415; 0x04D6; 0x0416; 0x04C1; + 0x0418; 0x0419; 0x0423; 0x040E; 0x0430; 0x04D1; 0x0435; 0x04D7; + 0x0436; 0x04C2; 0x0438; 0x0439; 0x0443; 0x045E; 0x1EA0; 0x1EB6; + 0x1EA1; 0x1EB7; 0x0041; 0x0226; 0x0042; 0x1E02; 0x0043; 0x010A; + 0x0044; 0x1E0A; 0x0045; 0x0116; 0x0046; 0x1E1E; 0x0047; 0x0120; + 0x0048; 0x1E22; 0x0049; 0x0130; 0x004D; 0x1E40; 0x004E; 0x1E44; + 0x004F; 0x022E; 0x0050; 0x1E56; 0x0052; 0x1E58; 0x0053; 0x1E60; + 0x0054; 0x1E6A; 0x0057; 0x1E86; 0x0058; 0x1E8A; 0x0059; 0x1E8E; + 0x005A; 0x017B; 0x0061; 0x0227; 0x0062; 0x1E03; 0x0063; 0x010B; + 0x0064; 0x1E0B; 0x0065; 0x0117; 0x0066; 0x1E1F; 0x0067; 0x0121; + 0x0068; 0x1E23; 0x006D; 0x1E41; 0x006E; 0x1E45; 0x006F; 0x022F; + 0x0070; 0x1E57; 0x0072; 0x1E59; 0x0073; 0x1E61; 0x0074; 0x1E6B; + 0x0077; 0x1E87; 0x0078; 0x1E8B; 0x0079; 0x1E8F; 0x007A; 0x017C; + 0x015A; 0x1E64; 0x015B; 0x1E65; 0x0160; 0x1E66; 0x0161; 0x1E67; + 0x017F; 0x1E9B; 0x1E62; 0x1E68; 0x1E63; 0x1E69; 0x0041; 0x00C4; + 0x0045; 0x00CB; 0x0048; 0x1E26; 0x0049; 0x00CF; 0x004F; 0x00D6; + 0x0055; 0x00DC; 0x0057; 0x1E84; 0x0058; 0x1E8C; 0x0059; 0x0178; + 0x0061; 0x00E4; 0x0065; 0x00EB; 0x0068; 0x1E27; 0x0069; 0x00EF; + 0x006F; 0x00F6; 0x0074; 0x1E97; 0x0075; 0x00FC; 0x0077; 0x1E85; + 0x0078; 0x1E8D; 0x0079; 0x00FF; 0x00D5; 0x1E4E; 0x00F5; 0x1E4F; + 0x016A; 0x1E7A; 0x016B; 0x1E7B; 0x0399; 0x03AA; 0x03A5; 0x03AB; + 0x03B9; 0x03CA; 0x03C5; 0x03CB; 0x03D2; 0x03D4; 0x0406; 0x0407; + 0x0410; 0x04D2; 0x0415; 0x0401; 0x0416; 0x04DC; 0x0417; 0x04DE; + 0x0418; 0x04E4; 0x041E; 0x04E6; 0x0423; 0x04F0; 0x0427; 0x04F4; + 0x042B; 0x04F8; 0x042D; 0x04EC; 0x0430; 0x04D3; 0x0435; 0x0451; + 0x0436; 0x04DD; 0x0437; 0x04DF; 0x0438; 0x04E5; 0x043E; 0x04E7; + 0x0443; 0x04F1; 0x0447; 0x04F5; 0x044B; 0x04F9; 0x044D; 0x04ED; + 0x0456; 0x0457; 0x04D8; 0x04DA; 0x04D9; 0x04DB; 0x04E8; 0x04EA; + 0x04E9; 0x04EB; 0x0041; 0x1EA2; 0x0045; 0x1EBA; 0x0049; 0x1EC8; + 0x004F; 0x1ECE; 0x0055; 0x1EE6; 0x0059; 0x1EF6; 0x0061; 0x1EA3; + 0x0065; 0x1EBB; 0x0069; 0x1EC9; 0x006F; 0x1ECF; 0x0075; 0x1EE7; + 0x0079; 0x1EF7; 0x00C2; 0x1EA8; 0x00CA; 0x1EC2; 0x00D4; 0x1ED4; + 0x00E2; 0x1EA9; 0x00EA; 0x1EC3; 0x00F4; 0x1ED5; 0x0102; 0x1EB2; + 0x0103; 0x1EB3; 0x01A0; 0x1EDE; 0x01A1; 0x1EDF; 0x01AF; 0x1EEC; + 0x01B0; 0x1EED; 0x0041; 0x00C5; 0x0055; 0x016E; 0x0061; 0x00E5; + 0x0075; 0x016F; 0x0077; 0x1E98; 0x0079; 0x1E99; 0x004F; 0x0150; + 0x0055; 0x0170; 0x006F; 0x0151; 0x0075; 0x0171; 0x0423; 0x04F2; + 0x0443; 0x04F3; 0x0041; 0x01CD; 0x0043; 0x010C; 0x0044; 0x010E; + 0x0045; 0x011A; 0x0047; 0x01E6; 0x0048; 0x021E; 0x0049; 0x01CF; + 0x004B; 0x01E8; 0x004C; 0x013D; 0x004E; 0x0147; 0x004F; 0x01D1; + 0x0052; 0x0158; 0x0053; 0x0160; 0x0054; 0x0164; 0x0055; 0x01D3; + 0x005A; 0x017D; 0x0061; 0x01CE; 0x0063; 0x010D; 0x0064; 0x010F; + 0x0065; 0x011B; 0x0067; 0x01E7; 0x0068; 0x021F; 0x0069; 0x01D0; + 0x006A; 0x01F0; 0x006B; 0x01E9; 0x006C; 0x013E; 0x006E; 0x0148; + 0x006F; 0x01D2; 0x0072; 0x0159; 0x0073; 0x0161; 0x0074; 0x0165; + 0x0075; 0x01D4; 0x007A; 0x017E; 0x00DC; 0x01D9; 0x00FC; 0x01DA; + 0x01B7; 0x01EE; 0x0292; 0x01EF; 0x0041; 0x0200; 0x0045; 0x0204; + 0x0049; 0x0208; 0x004F; 0x020C; 0x0052; 0x0210; 0x0055; 0x0214; + 0x0061; 0x0201; 0x0065; 0x0205; 0x0069; 0x0209; 0x006F; 0x020D; + 0x0072; 0x0211; 0x0075; 0x0215; 0x0474; 0x0476; 0x0475; 0x0477; + 0x0041; 0x0202; 0x0045; 0x0206; 0x0049; 0x020A; 0x004F; 0x020E; + 0x0052; 0x0212; 0x0055; 0x0216; 0x0061; 0x0203; 0x0065; 0x0207; + 0x0069; 0x020B; 0x006F; 0x020F; 0x0072; 0x0213; 0x0075; 0x0217; + 0x0391; 0x1F08; 0x0395; 0x1F18; 0x0397; 0x1F28; 0x0399; 0x1F38; + 0x039F; 0x1F48; 0x03A9; 0x1F68; 0x03B1; 0x1F00; 0x03B5; 0x1F10; + 0x03B7; 0x1F20; 0x03B9; 0x1F30; 0x03BF; 0x1F40; 0x03C1; 0x1FE4; + 0x03C5; 0x1F50; 0x03C9; 0x1F60; 0x0391; 0x1F09; 0x0395; 0x1F19; + 0x0397; 0x1F29; 0x0399; 0x1F39; 0x039F; 0x1F49; 0x03A1; 0x1FEC; + 0x03A5; 0x1F59; 0x03A9; 0x1F69; 0x03B1; 0x1F01; 0x03B5; 0x1F11; + 0x03B7; 0x1F21; 0x03B9; 0x1F31; 0x03BF; 0x1F41; 0x03C1; 0x1FE5; + 0x03C5; 0x1F51; 0x03C9; 0x1F61; 0x004F; 0x01A0; 0x0055; 0x01AF; + 0x006F; 0x01A1; 0x0075; 0x01B0; 0x0041; 0x1EA0; 0x0042; 0x1E04; + 0x0044; 0x1E0C; 0x0045; 0x1EB8; 0x0048; 0x1E24; 0x0049; 0x1ECA; + 0x004B; 0x1E32; 0x004C; 0x1E36; 0x004D; 0x1E42; 0x004E; 0x1E46; + 0x004F; 0x1ECC; 0x0052; 0x1E5A; 0x0053; 0x1E62; 0x0054; 0x1E6C; + 0x0055; 0x1EE4; 0x0056; 0x1E7E; 0x0057; 0x1E88; 0x0059; 0x1EF4; + 0x005A; 0x1E92; 0x0061; 0x1EA1; 0x0062; 0x1E05; 0x0064; 0x1E0D; + 0x0065; 0x1EB9; 0x0068; 0x1E25; 0x0069; 0x1ECB; 0x006B; 0x1E33; + 0x006C; 0x1E37; 0x006D; 0x1E43; 0x006E; 0x1E47; 0x006F; 0x1ECD; + 0x0072; 0x1E5B; 0x0073; 0x1E63; 0x0074; 0x1E6D; 0x0075; 0x1EE5; + 0x0076; 0x1E7F; 0x0077; 0x1E89; 0x0079; 0x1EF5; 0x007A; 0x1E93; + 0x01A0; 0x1EE2; 0x01A1; 0x1EE3; 0x01AF; 0x1EF0; 0x01B0; 0x1EF1; + 0x0055; 0x1E72; 0x0075; 0x1E73; 0x0041; 0x1E00; 0x0061; 0x1E01; + 0x0053; 0x0218; 0x0054; 0x021A; 0x0073; 0x0219; 0x0074; 0x021B; + 0x0043; 0x00C7; 0x0044; 0x1E10; 0x0045; 0x0228; 0x0047; 0x0122; + 0x0048; 0x1E28; 0x004B; 0x0136; 0x004C; 0x013B; 0x004E; 0x0145; + 0x0052; 0x0156; 0x0053; 0x015E; 0x0054; 0x0162; 0x0063; 0x00E7; + 0x0064; 0x1E11; 0x0065; 0x0229; 0x0067; 0x0123; 0x0068; 0x1E29; + 0x006B; 0x0137; 0x006C; 0x013C; 0x006E; 0x0146; 0x0072; 0x0157; + 0x0073; 0x015F; 0x0074; 0x0163; 0x0041; 0x0104; 0x0045; 0x0118; + 0x0049; 0x012E; 0x004F; 0x01EA; 0x0055; 0x0172; 0x0061; 0x0105; + 0x0065; 0x0119; 0x0069; 0x012F; 0x006F; 0x01EB; 0x0075; 0x0173; + 0x0044; 0x1E12; 0x0045; 0x1E18; 0x004C; 0x1E3C; 0x004E; 0x1E4A; + 0x0054; 0x1E70; 0x0055; 0x1E76; 0x0064; 0x1E13; 0x0065; 0x1E19; + 0x006C; 0x1E3D; 0x006E; 0x1E4B; 0x0074; 0x1E71; 0x0075; 0x1E77; + 0x0048; 0x1E2A; 0x0068; 0x1E2B; 0x0045; 0x1E1A; 0x0049; 0x1E2C; + 0x0055; 0x1E74; 0x0065; 0x1E1B; 0x0069; 0x1E2D; 0x0075; 0x1E75; + 0x0042; 0x1E06; 0x0044; 0x1E0E; 0x004B; 0x1E34; 0x004C; 0x1E3A; + 0x004E; 0x1E48; 0x0052; 0x1E5E; 0x0054; 0x1E6E; 0x005A; 0x1E94; + 0x0062; 0x1E07; 0x0064; 0x1E0F; 0x0068; 0x1E96; 0x006B; 0x1E35; + 0x006C; 0x1E3B; 0x006E; 0x1E49; 0x0072; 0x1E5F; 0x0074; 0x1E6F; + 0x007A; 0x1E95; 0x003C; 0x226E; 0x003D; 0x2260; 0x003E; 0x226F; + 0x2190; 0x219A; 0x2192; 0x219B; 0x2194; 0x21AE; 0x21D0; 0x21CD; + 0x21D2; 0x21CF; 0x21D4; 0x21CE; 0x2203; 0x2204; 0x2208; 0x2209; + 0x220B; 0x220C; 0x2223; 0x2224; 0x2225; 0x2226; 0x223C; 0x2241; + 0x2243; 0x2244; 0x2245; 0x2247; 0x2248; 0x2249; 0x224D; 0x226D; + 0x2261; 0x2262; 0x2264; 0x2270; 0x2265; 0x2271; 0x2272; 0x2274; + 0x2273; 0x2275; 0x2276; 0x2278; 0x2277; 0x2279; 0x227A; 0x2280; + 0x227B; 0x2281; 0x227C; 0x22E0; 0x227D; 0x22E1; 0x2282; 0x2284; + 0x2283; 0x2285; 0x2286; 0x2288; 0x2287; 0x2289; 0x2291; 0x22E2; + 0x2292; 0x22E3; 0x22A2; 0x22AC; 0x22A8; 0x22AD; 0x22A9; 0x22AE; + 0x22AB; 0x22AF; 0x22B2; 0x22EA; 0x22B3; 0x22EB; 0x22B4; 0x22EC; + 0x22B5; 0x22ED; 0x00A8; 0x1FC1; 0x03B1; 0x1FB6; 0x03B7; 0x1FC6; + 0x03B9; 0x1FD6; 0x03C5; 0x1FE6; 0x03C9; 0x1FF6; 0x03CA; 0x1FD7; + 0x03CB; 0x1FE7; 0x1F00; 0x1F06; 0x1F01; 0x1F07; 0x1F08; 0x1F0E; + 0x1F09; 0x1F0F; 0x1F20; 0x1F26; 0x1F21; 0x1F27; 0x1F28; 0x1F2E; + 0x1F29; 0x1F2F; 0x1F30; 0x1F36; 0x1F31; 0x1F37; 0x1F38; 0x1F3E; + 0x1F39; 0x1F3F; 0x1F50; 0x1F56; 0x1F51; 0x1F57; 0x1F59; 0x1F5F; + 0x1F60; 0x1F66; 0x1F61; 0x1F67; 0x1F68; 0x1F6E; 0x1F69; 0x1F6F; + 0x1FBF; 0x1FCF; 0x1FFE; 0x1FDF; 0x0391; 0x1FBC; 0x0397; 0x1FCC; + 0x03A9; 0x1FFC; 0x03AC; 0x1FB4; 0x03AE; 0x1FC4; 0x03B1; 0x1FB3; + 0x03B7; 0x1FC3; 0x03C9; 0x1FF3; 0x03CE; 0x1FF4; 0x1F00; 0x1F80; + 0x1F01; 0x1F81; 0x1F02; 0x1F82; 0x1F03; 0x1F83; 0x1F04; 0x1F84; + 0x1F05; 0x1F85; 0x1F06; 0x1F86; 0x1F07; 0x1F87; 0x1F08; 0x1F88; + 0x1F09; 0x1F89; 0x1F0A; 0x1F8A; 0x1F0B; 0x1F8B; 0x1F0C; 0x1F8C; + 0x1F0D; 0x1F8D; 0x1F0E; 0x1F8E; 0x1F0F; 0x1F8F; 0x1F20; 0x1F90; + 0x1F21; 0x1F91; 0x1F22; 0x1F92; 0x1F23; 0x1F93; 0x1F24; 0x1F94; + 0x1F25; 0x1F95; 0x1F26; 0x1F96; 0x1F27; 0x1F97; 0x1F28; 0x1F98; + 0x1F29; 0x1F99; 0x1F2A; 0x1F9A; 0x1F2B; 0x1F9B; 0x1F2C; 0x1F9C; + 0x1F2D; 0x1F9D; 0x1F2E; 0x1F9E; 0x1F2F; 0x1F9F; 0x1F60; 0x1FA0; + 0x1F61; 0x1FA1; 0x1F62; 0x1FA2; 0x1F63; 0x1FA3; 0x1F64; 0x1FA4; + 0x1F65; 0x1FA5; 0x1F66; 0x1FA6; 0x1F67; 0x1FA7; 0x1F68; 0x1FA8; + 0x1F69; 0x1FA9; 0x1F6A; 0x1FAA; 0x1F6B; 0x1FAB; 0x1F6C; 0x1FAC; + 0x1F6D; 0x1FAD; 0x1F6E; 0x1FAE; 0x1F6F; 0x1FAF; 0x1F70; 0x1FB2; + 0x1F74; 0x1FC2; 0x1F7C; 0x1FF2; 0x1FB6; 0x1FB7; 0x1FC6; 0x1FC7; + 0x1FF6; 0x1FF7; 0x0627; 0x0622; 0x0627; 0x0623; 0x0648; 0x0624; + 0x064A; 0x0626; 0x06C1; 0x06C2; 0x06D2; 0x06D3; 0x06D5; 0x06C0; + 0x0627; 0x0625; 0x0928; 0x0929; 0x0930; 0x0931; 0x0933; 0x0934; + 0x09C7; 0x09CB; 0x09C7; 0x09CC; 0x0B47; 0x0B4B; 0x0B47; 0x0B48; + 0x0B47; 0x0B4C; 0x0BC6; 0x0BCA; 0x0BC7; 0x0BCB; 0x0B92; 0x0B94; + 0x0BC6; 0x0BCC; 0x0C46; 0x0C48; 0x0CC6; 0x0CCA; 0x0CBF; 0x0CC0; + 0x0CC6; 0x0CC7; 0x0CCA; 0x0CCB; 0x0CC6; 0x0CC8; 0x0D46; 0x0D4A; + 0x0D47; 0x0D4B; 0x0D46; 0x0D4C; 0x0DD9; 0x0DDA; 0x0DDC; 0x0DDD; + 0x0DD9; 0x0DDC; 0x0DD9; 0x0DDE; 0x1025; 0x1026; 0x3046; 0x3094; + 0x304B; 0x304C; 0x304D; 0x304E; 0x304F; 0x3050; 0x3051; 0x3052; + 0x3053; 0x3054; 0x3055; 0x3056; 0x3057; 0x3058; 0x3059; 0x305A; + 0x305B; 0x305C; 0x305D; 0x305E; 0x305F; 0x3060; 0x3061; 0x3062; + 0x3064; 0x3065; 0x3066; 0x3067; 0x3068; 0x3069; 0x306F; 0x3070; + 0x3072; 0x3073; 0x3075; 0x3076; 0x3078; 0x3079; 0x307B; 0x307C; + 0x309D; 0x309E; 0x30A6; 0x30F4; 0x30AB; 0x30AC; 0x30AD; 0x30AE; + 0x30AF; 0x30B0; 0x30B1; 0x30B2; 0x30B3; 0x30B4; 0x30B5; 0x30B6; + 0x30B7; 0x30B8; 0x30B9; 0x30BA; 0x30BB; 0x30BC; 0x30BD; 0x30BE; + 0x30BF; 0x30C0; 0x30C1; 0x30C2; 0x30C4; 0x30C5; 0x30C6; 0x30C7; + 0x30C8; 0x30C9; 0x30CF; 0x30D0; 0x30D2; 0x30D3; 0x30D5; 0x30D6; + 0x30D8; 0x30D9; 0x30DB; 0x30DC; 0x30EF; 0x30F7; 0x30F0; 0x30F8; + 0x30F1; 0x30F9; 0x30F2; 0x30FA; 0x30FD; 0x30FE; 0x306F; 0x3071; + 0x3072; 0x3074; 0x3075; 0x3077; 0x3078; 0x307A; 0x307B; 0x307D; + 0x30CF; 0x30D1; 0x30D2; 0x30D4; 0x30D5; 0x30D7; 0x30D8; 0x30DA; + 0x30DB; 0x30DD |] let uniCharCombiningBitmap = "\ diff --git a/src/update.ml b/src/update.ml index 5c8ab60..c8f90e1 100644 --- a/src/update.ml +++ b/src/update.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/update.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 @@ -1056,7 +1056,7 @@ let translatePath = MOUNT POINTS ************************************************************************) -let mountpoints = +let mountpoints = Prefs.createStringList "mountpoint" "!abort if this path does not exist" ("Including the preference \\texttt{-mountpoint PATH} causes Unison to " @@ -1073,7 +1073,7 @@ let abortIfAnyMountpointsAreMissing fspath = raise (Util.Fatal (Printf.sprintf "Path %s / %s is designated as a mountpoint, but points to nothing on host %s\n" (Fspath.toPrintString fspath) (Path.toString path) - (Os.myCanonicalHostName ())))) + (Os.myCanonicalHostName ())))) (Prefs.read mountpoints) (*********************************************************************** @@ -1111,7 +1111,7 @@ let rec removePathFromTree path tree = Some (PathTreeNode (NameMap.add nm t children)) with Not_found -> Some tree - + let pathTreeOfList l = Safelist.fold_left (fun t p -> Some (addPathToTree p t)) None l @@ -1201,7 +1201,7 @@ let t0 = ref 0. (* Note that we do *not* want to do any status displays from the server side, since this will cause the server to block until the client has finished its own update detection and can receive and acknowledge - the status display message -- thus effectively serializing the client + the status display message -- thus effectively serializing the client and server! *) let showStatusAddLength scanInfo info = let len1 = Props.length info.Fileinfo.desc in @@ -1940,9 +1940,9 @@ let findLocal wantWatcher fspath pathList subpaths : "findLocal %s (%s)\n" (Fspath.toDebugString fspath) (String.concat " " (Safelist.map Path.toString pathList))); addHashToTempNames fspath; - (* Maybe we should remember the device number where the root lives at - the beginning of update detection, so that we can check, below, that - the device has not changed. This check would allow us to abort in case + (* Maybe we should remember the device number where the root lives at + the beginning of update detection, so that we can check, below, that + the device has not changed. This check would allow us to abort in case the root is on a removable device and this device gets removed during update detection, causing all the files to appear to have been deleted. --BCP 2006 *) diff --git a/src/update.mli b/src/update.mli index c08d3c7..80f1e2e 100644 --- a/src/update.mli +++ b/src/update.mli @@ -16,7 +16,7 @@ type archive = val storeRootsName : unit -> unit (* Retrieve the actual names of the roots *) -val getRootsName : unit -> string +val getRootsName : unit -> string (* Perform update detection. Optionally, takes as input the list of paths known not to be synchronized and a list of paths not to diff --git a/src/uutil.ml b/src/uutil.ml index 4ced119..09d1fdc 100644 --- a/src/uutil.ml +++ b/src/uutil.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/uutil.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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/src/win32rc/unison.rc b/src/win32rc/unison.rc index cdc6296..1b5aa36 100644 --- a/src/win32rc/unison.rc +++ b/src/win32rc/unison.rc @@ -1,3 +1,3 @@ -#include <winver.h>
-
-UNISON_ICON ICON "U.ico"
+#include <winver.h> + +UNISON_ICON ICON "U.ico" diff --git a/src/winmain.c b/src/winmain.c index 72719a8..d1cc1e1 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -3,7 +3,7 @@ extern char **__argv; -int WINAPI WinMain(HINSTANCE h, HINSTANCE hPrevInstance, +int WINAPI WinMain(HINSTANCE h, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { caml_main(__argv); return 0; diff --git a/src/xferhint.ml b/src/xferhint.ml index 51daa05..613b22a 100644 --- a/src/xferhint.ml +++ b/src/xferhint.ml @@ -1,5 +1,5 @@ (* Unison file synchronizer: src/xferhint.ml *) -(* Copyright 1999-2016, Benjamin C. Pierce +(* Copyright 1999-2016, Benjamin C. Pierce 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 |