remove trailing whitespace at end of lines
authorSteven Edwards <winehacker@gmail.com>
Sat, 7 May 2005 21:24:31 +0000 (21:24 +0000)
committerSteven Edwards <winehacker@gmail.com>
Sat, 7 May 2005 21:24:31 +0000 (21:24 +0000)
svn path=/trunk/; revision=15091

385 files changed:
rosapps/cmdutils/mode/mode.c
rosapps/cmdutils/more.c
rosapps/cmdutils/tee.c
rosapps/cmdutils/touch/touch.c
rosapps/cmdutils/y.c
rosapps/demos/maze/maze.c
rosapps/demos/maze/resource.h
rosapps/devutils/zoomin/framewnd.c
rosapps/devutils/zoomin/main.c
rosapps/dflat32/applicat.c
rosapps/dflat32/classes.h
rosapps/dflat32/config.c
rosapps/dflat32/dialbox.c
rosapps/dflat32/fileopen.c
rosapps/dflat32/listbox.c
rosapps/dflat32/memopad.c
rosapps/dflat32/menu.h
rosapps/dflat32/menubar.c
rosapps/dflat32/message.c
rosapps/dflat32/msgbox.c
rosapps/dflat32/pictbox.c
rosapps/dflat32/popdown.c
rosapps/dflat32/statbar.c
rosapps/dflat32/sysmenu.c
rosapps/dflat32/textbox.c
rosapps/games/solitaire/resource.h
rosapps/lib/dflat32/applicat.c
rosapps/lib/dflat32/config.c
rosapps/lib/dflat32/dialbox.c
rosapps/lib/dflat32/dllmain.c
rosapps/lib/dflat32/listbox.c
rosapps/lib/dflat32/menubar.c
rosapps/lib/dflat32/message.c
rosapps/lib/dflat32/msgbox.c
rosapps/lib/dflat32/pictbox.c
rosapps/lib/dflat32/popdown.c
rosapps/lib/dflat32/statbar.c
rosapps/lib/dflat32/stubs.c
rosapps/lib/dflat32/sysmenu.c
rosapps/mc/acconfig.h
rosapps/mc/config.h
rosapps/mc/edit/edit.c
rosapps/mc/edit/edit.h
rosapps/mc/edit/edit_key_translator.c
rosapps/mc/edit/editcmd.c
rosapps/mc/edit/editdraw.c
rosapps/mc/edit/editmenu.c
rosapps/mc/edit/editwidget.c
rosapps/mc/edit/syntax.c
rosapps/mc/edit/wordproc.c
rosapps/mc/pc/chmod.c
rosapps/mc/pc/config.h
rosapps/mc/pc/cons_nt.c
rosapps/mc/pc/cons_os2.c
rosapps/mc/pc/dirent_nt.c
rosapps/mc/pc/dirent_os2.c
rosapps/mc/pc/drive.c
rosapps/mc/pc/key_nt.c
rosapps/mc/pc/key_os2.c
rosapps/mc/pc/slint_pc.c
rosapps/mc/pc/trace_nt.c
rosapps/mc/pc/trace_nt.h
rosapps/mc/pc/util_nt.c
rosapps/mc/pc/util_os2.c
rosapps/mc/pc/util_win32.c
rosapps/mc/pc/util_win32.h
rosapps/mc/pc/util_winnt.c
rosapps/mc/slang/_slang.h
rosapps/mc/slang/jdmacros.h
rosapps/mc/slang/slang.h
rosapps/mc/slang/sldisply.c
rosapps/mc/slang/slerr.c
rosapps/mc/slang/slgetkey.c
rosapps/mc/slang/slmemcpy.c
rosapps/mc/slang/slmemset.c
rosapps/mc/slang/slos2tty.c
rosapps/mc/slang/slsignal.c
rosapps/mc/slang/slsmg.c
rosapps/mc/slang/sltermin.c
rosapps/mc/slang/sltoken.c
rosapps/mc/slang/slutty.c
rosapps/mc/slang/slvideo.c
rosapps/mc/slang/slw32tty.c
rosapps/mc/src/achown.c
rosapps/mc/src/background.c
rosapps/mc/src/boxes.c
rosapps/mc/src/chmod.c
rosapps/mc/src/chown.c
rosapps/mc/src/cmd.c
rosapps/mc/src/cmd.h
rosapps/mc/src/color.c
rosapps/mc/src/color.h
rosapps/mc/src/command.c
rosapps/mc/src/complete.c
rosapps/mc/src/cons.handler.c
rosapps/mc/src/cons.saver.c
rosapps/mc/src/dialog.c
rosapps/mc/src/dir.c
rosapps/mc/src/dir.h
rosapps/mc/src/dlg.c
rosapps/mc/src/dlg.h
rosapps/mc/src/ext.c
rosapps/mc/src/ext.h
rosapps/mc/src/file.c
rosapps/mc/src/find.c
rosapps/mc/src/find.h
rosapps/mc/src/fixhlp.c
rosapps/mc/src/help.c
rosapps/mc/src/hotlist.c
rosapps/mc/src/info.c
rosapps/mc/src/key.c
rosapps/mc/src/keyxdef.c
rosapps/mc/src/layout.c
rosapps/mc/src/learn.c
rosapps/mc/src/listmode.c
rosapps/mc/src/mad.c
rosapps/mc/src/mad.h
rosapps/mc/src/main.c
rosapps/mc/src/man2hlp.c
rosapps/mc/src/mem.h
rosapps/mc/src/menu.c
rosapps/mc/src/menu.h
rosapps/mc/src/mfmt.c
rosapps/mc/src/mouse.c
rosapps/mc/src/mouse.h
rosapps/mc/src/myslang.h
rosapps/mc/src/option.c
rosapps/mc/src/option.h
rosapps/mc/src/panel.h
rosapps/mc/src/panelize.c
rosapps/mc/src/popt.c
rosapps/mc/src/popt.h
rosapps/mc/src/profile.c
rosapps/mc/src/profile.h
rosapps/mc/src/regex.c
rosapps/mc/src/regex.h
rosapps/mc/src/rxvt.c
rosapps/mc/src/screen.c
rosapps/mc/src/setup.c
rosapps/mc/src/slint.c
rosapps/mc/src/subshell.c
rosapps/mc/src/terms.c
rosapps/mc/src/text.c
rosapps/mc/src/tree.c
rosapps/mc/src/tty.h
rosapps/mc/src/user.c
rosapps/mc/src/util.c
rosapps/mc/src/utilunix.c
rosapps/mc/src/view.c
rosapps/mc/src/view.h
rosapps/mc/src/widget.c
rosapps/mc/src/widget.h
rosapps/mc/src/win.c
rosapps/mc/src/wtools.c
rosapps/mc/src/wtools.h
rosapps/mc/src/xcurses.c
rosapps/mc/src/xslint.c
rosapps/mc/vfs/extfs.h
rosapps/mc/vfs/vfs.h
rosapps/net/ncftp/Strn/Strntok.c
rosapps/net/ncftp/autoconf/acconfig.h
rosapps/net/ncftp/libncftp/cmds.c
rosapps/net/ncftp/libncftp/errno.c
rosapps/net/ncftp/libncftp/ftp.c
rosapps/net/ncftp/libncftp/glob.c
rosapps/net/ncftp/libncftp/io.c
rosapps/net/ncftp/libncftp/linelist.c
rosapps/net/ncftp/libncftp/ncftp.h
rosapps/net/ncftp/libncftp/open.c
rosapps/net/ncftp/libncftp/rcmd.c
rosapps/net/ncftp/libncftp/util.c
rosapps/net/ncftp/ncftp/bookmark.c
rosapps/net/ncftp/ncftp/bookmark.h
rosapps/net/ncftp/ncftp/cmdlist.c
rosapps/net/ncftp/ncftp/cmds.c
rosapps/net/ncftp/ncftp/cmds.h
rosapps/net/ncftp/ncftp/getline.c
rosapps/net/ncftp/ncftp/getline.h
rosapps/net/ncftp/ncftp/getopt.c
rosapps/net/ncftp/ncftp/getopt.h
rosapps/net/ncftp/ncftp/log.c
rosapps/net/ncftp/ncftp/log.h
rosapps/net/ncftp/ncftp/ls.c
rosapps/net/ncftp/ncftp/ls.h
rosapps/net/ncftp/ncftp/main.c
rosapps/net/ncftp/ncftp/main.h
rosapps/net/ncftp/ncftp/pref.c
rosapps/net/ncftp/ncftp/pref.h
rosapps/net/ncftp/ncftp/preffw.c
rosapps/net/ncftp/ncftp/progress.c
rosapps/net/ncftp/ncftp/progress.h
rosapps/net/ncftp/ncftp/readln.c
rosapps/net/ncftp/ncftp/readln.h
rosapps/net/ncftp/ncftp/resource.h
rosapps/net/ncftp/ncftp/shell.c
rosapps/net/ncftp/ncftp/shell.h
rosapps/net/ncftp/ncftp/spool.c
rosapps/net/ncftp/ncftp/spool.h
rosapps/net/ncftp/ncftp/syshdrs.h
rosapps/net/ncftp/ncftp/trace.c
rosapps/net/ncftp/ncftp/trace.h
rosapps/net/ncftp/ncftp/util.c
rosapps/net/ncftp/ncftp/util.h
rosapps/net/ncftp/sio/SClose.c
rosapps/net/ncftp/sio/SConnect.c
rosapps/net/ncftp/sio/SRead.c
rosapps/net/ncftp/sio/SReadline.c
rosapps/net/ncftp/sio/SRecv.c
rosapps/net/ncftp/sio/SRecvfrom.c
rosapps/net/ncftp/sio/SRecvmsg.c
rosapps/net/ncftp/sio/SSend.c
rosapps/net/ncftp/sio/SSendto.c
rosapps/net/ncftp/sio/SSendtoByName.c
rosapps/net/ncftp/sio/SWait.c
rosapps/net/ncftp/sio/SWrite.c
rosapps/net/ncftp/sio/SocketUtil.c
rosapps/net/ncftp/sio/wincfg.h
rosapps/net/niclist/niclist.c
rosapps/notevil/notevil.c
rosapps/sysutils/chkdsk.c
rosapps/sysutils/chklib.c
rosapps/sysutils/config.h
rosapps/sysutils/ctm/ctm.c
rosapps/sysutils/ctm/ctm.h
rosapps/sysutils/fmifs.h
rosapps/sysutils/format.c
rosapps/sysutils/ldd.c
rosapps/sysutils/man/man.c
rosapps/sysutils/pedump.c
rosapps/sysutils/qsi.c
rosapps/sysutils/regexpl/ArgumentParser.h
rosapps/sysutils/regexpl/Completion.h
rosapps/sysutils/regexpl/Console.h
rosapps/sysutils/regexpl/CrtSupplement.c
rosapps/sysutils/regexpl/Pattern.h
rosapps/sysutils/regexpl/RegistryKey.h
rosapps/sysutils/regexpl/RegistryTree.h
rosapps/sysutils/regexpl/SecurityDescriptor.h
rosapps/sysutils/regexpl/Settings.h
rosapps/sysutils/regexpl/ShellCommand.h
rosapps/sysutils/regexpl/ShellCommandChangeKey.h
rosapps/sysutils/regexpl/ShellCommandConnect.h
rosapps/sysutils/regexpl/ShellCommandDACL.h
rosapps/sysutils/regexpl/ShellCommandDOKA.h
rosapps/sysutils/regexpl/ShellCommandDeleteKey.h
rosapps/sysutils/regexpl/ShellCommandDeleteValue.h
rosapps/sysutils/regexpl/ShellCommandDir.h
rosapps/sysutils/regexpl/ShellCommandExit.h
rosapps/sysutils/regexpl/ShellCommandHelp.h
rosapps/sysutils/regexpl/ShellCommandNewKey.h
rosapps/sysutils/regexpl/ShellCommandOwner.h
rosapps/sysutils/regexpl/ShellCommandSACL.h
rosapps/sysutils/regexpl/ShellCommandSetValue.h
rosapps/sysutils/regexpl/ShellCommandValue.h
rosapps/sysutils/regexpl/ShellCommandVersion.h
rosapps/sysutils/regexpl/ShellCommandsLinkedList.h
rosapps/sysutils/regexpl/TextHistory.h
rosapps/sysutils/shutdown.c
rosapps/sysutils/tcat/cat.c
rosapps/sysutils/tlist/tlist.c
rosapps/sysutils/win32err.c
rosapps/sysutils/wmain.c
rosapps/templates/dialog/dialog.c
rosapps/templates/dialog/memdlg.c
rosapps/templates/dialog/page1.c
rosapps/templates/dialog/trace.c
rosapps/templates/mdi/about.c
rosapps/templates/mdi/about.h
rosapps/templates/mdi/childwnd.c
rosapps/templates/mdi/childwnd.h
rosapps/templates/mdi/framewnd.c
rosapps/templates/mdi/framewnd.h
rosapps/templates/mdi/main.c
rosapps/templates/mdi/panelwnd.c
rosapps/templates/mdi/panelwnd.h
rosapps/templates/mdi/resource.h
rosapps/templates/mdi/ros2win.c
rosapps/templates/mdi/ros2win.h
rosapps/tests/accelerator/accelerator.c
rosapps/tests/alive/alive.c
rosapps/tests/alphablend/alphablend.c
rosapps/tests/apc/apc.c
rosapps/tests/apc2/apc2.c
rosapps/tests/bench/bench-syscall.c
rosapps/tests/bench/bench-thread.c
rosapps/tests/bitblt/bitblt.c
rosapps/tests/button2/buttontst2.c
rosapps/tests/capclock/capclock.c
rosapps/tests/carets/carets.c
rosapps/tests/combo/combotst.c
rosapps/tests/combo/utils.c
rosapps/tests/consume/consume.c
rosapps/tests/copymove/copymove.c
rosapps/tests/count/count.c
rosapps/tests/dibtest/dibtest.c
rosapps/tests/dirdlg/dirdlg.c
rosapps/tests/diskspeed/diskspeed.c
rosapps/tests/dnsapi/dnsapi.c
rosapps/tests/dnsquery/dnsquery.c
rosapps/tests/dump_shared_data/dump_shared_data.c
rosapps/tests/edit/edittest.c
rosapps/tests/edit/utils.c
rosapps/tests/enhmetafile/enhmetafile.c
rosapps/tests/enumwnd/enumwnd.c
rosapps/tests/fiber/fiber.c
rosapps/tests/gethostbyname/gethostbyname.c
rosapps/tests/global_mem/global_mem.c
rosapps/tests/gradient/gradient.c
rosapps/tests/guithreadinfo/guithreadinfo.c
rosapps/tests/hello/hello.c
rosapps/tests/hivetest/hivetest.c
rosapps/tests/icontest/icontest.c
rosapps/tests/lineclip/lineclip.c
rosapps/tests/linetest/linetest.c
rosapps/tests/lpc/conport.c
rosapps/tests/lpc/creport.c
rosapps/tests/lpc/dumpinfo.c
rosapps/tests/lpc/lpcclt.c
rosapps/tests/lpc/lpcsrv.c
rosapps/tests/map_dup_inherit/map_dup_inherit.c
rosapps/tests/mdi/mdi.c
rosapps/tests/mdi/resource.h
rosapps/tests/moztest/moztest.c
rosapps/tests/mstest/msclient.c
rosapps/tests/multithrdwin/multithrdwin.c
rosapps/tests/multiwin/multiwin.c
rosapps/tests/nameserverlist/nameserverlist.c
rosapps/tests/noexecute/noexecute.c
rosapps/tests/nptest/npserver.c
rosapps/tests/palbitblt/pal.c
rosapps/tests/popupmenu/popupmenu.c
rosapps/tests/primitives/mk_font.h
rosapps/tests/pteb/pteb.c
rosapps/tests/regdump/regcmds.c
rosapps/tests/regdump/regdump.c
rosapps/tests/regdump/regproc.c
rosapps/tests/regqueryvalue/regqueryvalue.c
rosapps/tests/regtest/regtest.c
rosapps/tests/sectest/sectest.c
rosapps/tests/shaptest/shaptest.c
rosapps/tests/shm/shmclt.c
rosapps/tests/shm/shmsrv.c
rosapps/tests/subclass/subclass.c
rosapps/tests/tcpsvr/tcpsvr.c
rosapps/tests/terminate/terminate.c
rosapps/tests/thread/thread.c
rosapps/tests/thread_msg/thread_msg.c
rosapps/tests/tmrqueue/tmrqueue.c
rosapps/tests/tokentest/tokentest.c
rosapps/tests/txtscale/mk_font.h
rosapps/tests/vmtest/vmtest.c
rosapps/tests/winhello/winhello.c
rosapps/tests/wm_paint/wm_paint.c
rosapps/tests/zwcontinue/zwcontinue.c
rosapps/welcome/welcome.c
rosapps/winfile/about.c
rosapps/winfile/about.h
rosapps/winfile/childwnd.c
rosapps/winfile/debug.c
rosapps/winfile/debug.h
rosapps/winfile/dialogs.c
rosapps/winfile/draw.c
rosapps/winfile/draw.h
rosapps/winfile/drivebar.c
rosapps/winfile/drivebar.h
rosapps/winfile/entries.c
rosapps/winfile/format.h
rosapps/winfile/framewnd.c
rosapps/winfile/listview.c
rosapps/winfile/main.c
rosapps/winfile/network.c
rosapps/winfile/network.h
rosapps/winfile/resource.h
rosapps/winfile/run.c
rosapps/winfile/run.h
rosapps/winfile/settings.c
rosapps/winfile/shell.c
rosapps/winfile/shell.h
rosapps/winfile/sort.c
rosapps/winfile/splitpath.c
rosapps/winfile/trace.c
rosapps/winfile/treeview.c
rosapps/winfile/utils.c
rosapps/winfile/worker.c
rosapps/winfile/worker.h

index 369a1fa..f2db406 100644 (file)
@@ -32,7 +32,7 @@
 #define NUM_ELEMENTS(a) (sizeof(a)/sizeof(a[0]))
 #define ASSERT(a)
 
 #define NUM_ELEMENTS(a) (sizeof(a)/sizeof(a[0]))
 #define ASSERT(a)
 
-const TCHAR* const usage_strings[] = { 
+const TCHAR* const usage_strings[] = {
     _T("Device Status:     MODE [device] [/STATUS]"),
     _T("Select code page:  MODE CON[:] CP SELECT=yyy"),
     _T("Code page status:  MODE CON[:] CP [/STATUS]"),
     _T("Device Status:     MODE [device] [/STATUS]"),
     _T("Select code page:  MODE CON[:] CP SELECT=yyy"),
     _T("Code page status:  MODE CON[:] CP [/STATUS]"),
@@ -45,7 +45,7 @@ const TCHAR* const usage_strings[] = {
     _T("                            [rts=on|off|hs|tg] [idsr=on|off]"),
 };
 
     _T("                            [rts=on|off|hs|tg] [idsr=on|off]"),
 };
 
-const TCHAR* const parity_strings[] = { 
+const TCHAR* const parity_strings[] = {
     _T("None"),   // default
     _T("Odd"),    // only symbol in this set to have a 'd' in it
     _T("Even"),   // ... 'v' in it
     _T("None"),   // default
     _T("Odd"),    // only symbol in this set to have a 'd' in it
     _T("Even"),   // ... 'v' in it
@@ -75,7 +75,7 @@ int QueryDevices()
     TCHAR buffer[10240];
     int len;
     TCHAR* ptr = buffer;
     TCHAR buffer[10240];
     int len;
     TCHAR* ptr = buffer;
-    
+
     *ptr = '\0';
     if (QueryDosDevice(NULL, buffer, NUM_ELEMENTS(buffer))) {
         while (*ptr != '\0') {
     *ptr = '\0';
     if (QueryDosDevice(NULL, buffer, NUM_ELEMENTS(buffer))) {
         while (*ptr != '\0') {
@@ -146,7 +146,7 @@ int ShowConsoleStatus()
     return 0;
 }
 
     return 0;
 }
 
-static 
+static
 BOOL SerialPortQuery(int nPortNum, LPDCB pDCB, LPCOMMTIMEOUTS pCommTimeouts, BOOL bWrite)
 {
     BOOL result;
 BOOL SerialPortQuery(int nPortNum, LPDCB pDCB, LPCOMMTIMEOUTS pCommTimeouts, BOOL bWrite)
 {
     BOOL result;
@@ -270,7 +270,7 @@ int SetConsoleState()
        return 0;
 }
 
        return 0;
 }
 
-static 
+static
 int ExtractModeSerialParams(const TCHAR* param)
 {
     if (       _tcsstr(param, _T("OFF"))) {
 int ExtractModeSerialParams(const TCHAR* param)
 {
     if (       _tcsstr(param, _T("OFF"))) {
@@ -428,7 +428,7 @@ int main(int argc, TCHAR *argv[])
             goto show_status;
         } else if (_tcsstr(param1, _T("lpt"))) {
             nPortNum = find_portnum(param1);
             goto show_status;
         } else if (_tcsstr(param1, _T("lpt"))) {
             nPortNum = find_portnum(param1);
-            if (nPortNum != -1) 
+            if (nPortNum != -1)
                 return ShowParallelStatus(nPortNum);
         } else if (_tcsstr(param1, _T("con"))) {
             return ShowConsoleStatus();
                 return ShowParallelStatus(nPortNum);
         } else if (_tcsstr(param1, _T("con"))) {
             return ShowConsoleStatus();
index d1bd8c5..a416716 100644 (file)
@@ -1,10 +1,10 @@
-/* 
+/*
  * MORE.C - external command.
  *
  * clone from 4nt more command
  *
  * 26 Sep 1999 - Paolo Pantaleo <paolopan@freemail.it>
  * MORE.C - external command.
  *
  * clone from 4nt more command
  *
  * 26 Sep 1999 - Paolo Pantaleo <paolopan@freemail.it>
- *     started 
+ *     started
  * Oct 2003 - Timothy Schepens <tischepe at fastmail dot fm>
  *     use window size instead of buffer size.
  */
  * Oct 2003 - Timothy Schepens <tischepe at fastmail dot fm>
  *     use window size instead of buffer size.
  */
index 0de7d78..0d244fa 100644 (file)
@@ -1,10 +1,10 @@
-/* 
+/*
  * TEE.C - external command.
  *
  * clone from 4nt tee command
  *
  * 01 Sep 1999 - Paolo Pantaleo <paolopan@freemail.it>
  * TEE.C - external command.
  *
  * clone from 4nt tee command
  *
  * 01 Sep 1999 - Paolo Pantaleo <paolopan@freemail.it>
- *     started 
+ *     started
  *
  *
  */
  *
  *
  */
@@ -69,7 +69,7 @@ INT main (int argc,char **p)
 
        /*handle for file and console*/
        HANDLE hConsoleIn,hConsoleOut;
 
        /*handle for file and console*/
        HANDLE hConsoleIn,hConsoleOut;
-       
+
        /*bytes written by WriteFile and ReadFile*/
        DWORD dwRead,dwWritten;
 
        /*bytes written by WriteFile and ReadFile*/
        DWORD dwRead,dwWritten;
 
@@ -82,7 +82,7 @@ INT main (int argc,char **p)
        INT i;
        BOOL bQuote;
 
        INT i;
        BOOL bQuote;
 
-       /*file list implementation*/    
+       /*file list implementation*/
        LPTSTR *files;
        INT iFileCounter=0;
        HANDLE *hFile;
        LPTSTR *files;
        INT iFileCounter=0;
        HANDLE *hFile;
@@ -140,7 +140,7 @@ INT main (int argc,char **p)
 /*
                if(  iFileCounter >= sizeof(files) / sizeof(*files)  )
                {
 /*
                if(  iFileCounter >= sizeof(files) / sizeof(*files)  )
                {
-                       ConErrPrintf("too many files, maximum is %d\n",sizeof(files) / sizeof(*files));                 
+                       ConErrPrintf("too many files, maximum is %d\n",sizeof(files) / sizeof(*files));
                        return 1;
                }
                */
                        return 1;
                }
                */
@@ -150,7 +150,7 @@ INT main (int argc,char **p)
 
        /*open file(s)*/
        for(i=0;i<iFileCounter;i++)
 
        /*open file(s)*/
        for(i=0;i<iFileCounter;i++)
-       {       
+       {
                //l=0;
                hFile[i] = CreateFile(files[i],GENERIC_WRITE,
                        0,NULL,
                //l=0;
                hFile[i] = CreateFile(files[i],GENERIC_WRITE,
                        0,NULL,
index 43f9f3e..2ce087c 100644 (file)
@@ -204,10 +204,10 @@ stime_arg1(char *arg, time_t *tvp)
 {
        struct tm *t;
        int yearset;
 {
        struct tm *t;
        int yearset;
-       char *p; 
+       char *p;
                                        /* Start with the current time. */
        if ((t = localtime(&tvp[0])) == NULL)
                                        /* Start with the current time. */
        if ((t = localtime(&tvp[0])) == NULL)
-               err(1, "localtime"); DbgPrint("[%s]", "[23]"); 
+               err(1, "localtime"); DbgPrint("[%s]", "[23]");
                                        /* [[CC]YY]MMDDhhmm[.SS] */
        if ((p = strchr(arg, '.')) == NULL)
                t->tm_sec = 0;          /* Seconds defaults to 0. */
                                        /* [[CC]YY]MMDDhhmm[.SS] */
        if ((p = strchr(arg, '.')) == NULL)
                t->tm_sec = 0;          /* Seconds defaults to 0. */
@@ -217,7 +217,7 @@ stime_arg1(char *arg, time_t *tvp)
                *p++ = '\0';
                t->tm_sec = ATOI2(p);
        }
                *p++ = '\0';
                t->tm_sec = ATOI2(p);
        }
-               
+
        yearset = 0;
        switch(strlen(arg)) {
        case 12:                        /* CCYYMMDDhhmm */
        yearset = 0;
        switch(strlen(arg)) {
        case 12:                        /* CCYYMMDDhhmm */
index 82f6c17..c048d85 100644 (file)
@@ -80,7 +80,7 @@ int main (int argc, char **argv)
        for (i = 1; i < argc; i++)
        {
                hFind=FindFirstFile(argv[i],&FindData);
        for (i = 1; i < argc; i++)
        {
                hFind=FindFirstFile(argv[i],&FindData);
-               
+
                if (hFind==INVALID_HANDLE_VALUE)
                {
                        ConErrPrintf("File not found - %s\n",argv[i]);
                if (hFind==INVALID_HANDLE_VALUE)
                {
                        ConErrPrintf("File not found - %s\n",argv[i]);
@@ -107,7 +107,7 @@ int main (int argc, char **argv)
 
                                if (dwRead>0 && bRet)
                                        WriteFile(hConsoleOut,buff,dwRead,&dwWritten,NULL);
 
                                if (dwRead>0 && bRet)
                                        WriteFile(hConsoleOut,buff,dwRead,&dwWritten,NULL);
-                       
+
                        } while(dwRead>0 && bRet);
 
                        CloseHandle(hFile);
                        } while(dwRead>0 && bRet);
 
                        CloseHandle(hFile);
index 31e561a..f5089f7 100644 (file)
  *             screenhack stuff.  There's still some work that could
  *             be done on this, particularly allowing a resource to
  *             specify how big the squares are.
  *             screenhack stuff.  There's still some work that could
  *             be done on this, particularly allowing a resource to
  *             specify how big the squares are.
- * modified:  [ 10-4-88 ]  Richard Hess    ...!uunet!cimshop!rhess  
+ * modified:  [ 10-4-88 ]  Richard Hess    ...!uunet!cimshop!rhess
  *              [ Revised primary execution loop within main()...
  *              [ Extended X event handler, check_events()...
  *              [ Revised primary execution loop within main()...
  *              [ Extended X event handler, check_events()...
- * modified:  [ 1-29-88 ]  Dave Lemke      lemke@sun.com  
+ * modified:  [ 1-29-88 ]  Dave Lemke      lemke@sun.com
  *              [ Hacked for X11...
  *              [ Hacked for X11...
- *              [  Note the word "hacked" -- this is extremely ugly, but at 
- *              [   least it does the job.  NOT a good programming example 
+ *              [  Note the word "hacked" -- this is extremely ugly, but at
+ *              [   least it does the job.  NOT a good programming example
  *              [   for X.
  * original:  [ 6/21/85 ]  Martin Weiss    Sun Microsystems  [ SunView ]
  *
  ******************************************************************************
  Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
  *              [   for X.
  * original:  [ 6/21/85 ]  Martin Weiss    Sun Microsystems  [ SunView ]
  *
  ******************************************************************************
  Copyright 1988 by Sun Microsystems, Inc. Mountain View, CA.
-  
+
  All Rights Reserved
  All Rights Reserved
-  
+
  Permission to use, copy, modify, and distribute this software and its
  Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted, 
+ documentation for any purpose and without fee is hereby granted,
  provided that the above copyright notice appear in all copies and that
  provided that the above copyright notice appear in all copies and that
- both that copyright notice and this permission notice appear in 
+ both that copyright notice and this permission notice appear in
  supporting documentation, and that the names of Sun or MIT not be
  used in advertising or publicity pertaining to distribution of the
  supporting documentation, and that the names of Sun or MIT not be
  used in advertising or publicity pertaining to distribution of the
- software without specific prior written permission. Sun and M.I.T. 
- make no representations about the suitability of this software for 
+ software without specific prior written permission. Sun and M.I.T.
+ make no representations about the suitability of this software for
  any purpose. It is provided "as is" without any express or implied warranty.
  any purpose. It is provided "as is" without any express or implied warranty.
+
  SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE. IN NO EVENT SHALL SUN BE LIABLE FOR ANY SPECIAL, INDIRECT
  OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
  SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE. IN NO EVENT SHALL SUN BE LIABLE FOR ANY SPECIAL, INDIRECT
  OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
- OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 
+ OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  OR PERFORMANCE OF THIS SOFTWARE.
  *****************************************************************************/
  OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  OR PERFORMANCE OF THIS SOFTWARE.
  *****************************************************************************/
@@ -115,7 +115,7 @@ static struct {
   unsigned char x;
   unsigned char y;
   unsigned char dir;
   unsigned char x;
   unsigned char y;
   unsigned char dir;
-  unsigned char dummy;  
+  unsigned char dummy;
 } move_list[MOVE_LIST_SIZE], save_path[MOVE_LIST_SIZE], path[MOVE_LIST_SIZE];
 
 static int maze_size_x, maze_size_y;
 } move_list[MOVE_LIST_SIZE], save_path[MOVE_LIST_SIZE], path[MOVE_LIST_SIZE];
 
 static int maze_size_x, maze_size_y;
@@ -139,50 +139,50 @@ static void
 initialize_maze()         /* draw the surrounding wall and start/end squares */
 {
   register int i, j, wall;
 initialize_maze()         /* draw the surrounding wall and start/end squares */
 {
   register int i, j, wall;
-  
+
   /* initialize all squares */
   for ( i=0; i<maze_size_x; i++) {
     for ( j=0; j<maze_size_y; j++) {
       maze[i][j] = 0;
     }
   }
   /* initialize all squares */
   for ( i=0; i<maze_size_x; i++) {
     for ( j=0; j<maze_size_y; j++) {
       maze[i][j] = 0;
     }
   }
-  
+
   /* top wall */
   for ( i=0; i<maze_size_x; i++ ) {
     maze[i][0] |= WALL_TOP;
   }
   /* top wall */
   for ( i=0; i<maze_size_x; i++ ) {
     maze[i][0] |= WALL_TOP;
   }
-  
+
   /* right wall */
   for ( j=0; j<maze_size_y; j++ ) {
     maze[maze_size_x-1][j] |= WALL_RIGHT;
   }
   /* right wall */
   for ( j=0; j<maze_size_y; j++ ) {
     maze[maze_size_x-1][j] |= WALL_RIGHT;
   }
-  
+
   /* bottom wall */
   for ( i=0; i<maze_size_x; i++ ) {
     maze[i][maze_size_y-1] |= WALL_BOTTOM;
   }
   /* bottom wall */
   for ( i=0; i<maze_size_x; i++ ) {
     maze[i][maze_size_y-1] |= WALL_BOTTOM;
   }
-  
+
   /* left wall */
   for ( j=0; j<maze_size_y; j++ ) {
     maze[0][j] |= WALL_LEFT;
   }
   /* left wall */
   for ( j=0; j<maze_size_y; j++ ) {
     maze[0][j] |= WALL_LEFT;
   }
-  
+
   /* set start square */
   wall = get_random(4);
   switch (wall) {
   /* set start square */
   wall = get_random(4);
   switch (wall) {
-  case 0:      
+  case 0:
     i = get_random(maze_size_x);
     j = 0;
     break;
     i = get_random(maze_size_x);
     j = 0;
     break;
-  case 1:      
+  case 1:
     i = maze_size_x - 1;
     j = get_random(maze_size_y);
     break;
     i = maze_size_x - 1;
     j = get_random(maze_size_y);
     break;
-  case 2:      
+  case 2:
     i = get_random(maze_size_x);
     j = maze_size_y - 1;
     break;
     i = get_random(maze_size_x);
     j = maze_size_y - 1;
     break;
-  case 3:      
+  case 3:
     i = 0;
     j = get_random(maze_size_y);
     break;
     i = 0;
     j = get_random(maze_size_y);
     break;
@@ -196,7 +196,7 @@ initialize_maze()         /* draw the surrounding wall and start/end squares */
   start_y = j;
   start_dir = wall;
   sqnum = 0;
   start_y = j;
   start_dir = wall;
   sqnum = 0;
-  
+
   /* set end square */
   wall = (wall + 2)%4;
   switch (wall) {
   /* set end square */
   wall = (wall + 2)%4;
   switch (wall) {
@@ -236,7 +236,7 @@ create_maze()             /* create a maze layout given the intiialized maze */
 {
   register int i, newdoor = 0;
   HDC hDC;
 {
   register int i, newdoor = 0;
   HDC hDC;
-  
+
   hDC = GetDC(hWnd);
   do {
     move_list[sqnum].x = cur_sq_x;
   hDC = GetDC(hWnd);
   do {
     move_list[sqnum].x = cur_sq_x;
@@ -248,10 +248,10 @@ create_maze()             /* create a maze layout given the intiialized maze */
                return; /* done ... return */
       }
     }
                return; /* done ... return */
       }
     }
-    
+
     /* mark the out door */
     maze[cur_sq_x][cur_sq_y] |= ( DOOR_OUT_TOP >> newdoor );
     /* mark the out door */
     maze[cur_sq_x][cur_sq_y] |= ( DOOR_OUT_TOP >> newdoor );
-    
+
     switch (newdoor) {
     case 0: cur_sq_y--;
       break;
     switch (newdoor) {
     case 0: cur_sq_y--;
       break;
@@ -263,10 +263,10 @@ create_maze()             /* create a maze layout given the intiialized maze */
       break;
     }
     sqnum++;
       break;
     }
     sqnum++;
-    
+
     /* mark the in door */
     maze[cur_sq_x][cur_sq_y] |= ( DOOR_IN_TOP >> ((newdoor+2)%4) );
     /* mark the in door */
     maze[cur_sq_x][cur_sq_y] |= ( DOOR_IN_TOP >> ((newdoor+2)%4) );
-    
+
     /* if end square set path length and save path */
     if ( maze[cur_sq_x][cur_sq_y] & END_SQUARE ) {
       path_length = sqnum;
     /* if end square set path length and save path */
     if ( maze[cur_sq_x][cur_sq_y] & END_SQUARE ) {
       path_length = sqnum;
@@ -276,9 +276,9 @@ create_maze()             /* create a maze layout given the intiialized maze */
        save_path[i].dir = move_list[i].dir;
       }
     }
        save_path[i].dir = move_list[i].dir;
       }
     }
-    
+
   } while (1);
   } while (1);
-  
+
 }
 
 
 }
 
 
@@ -287,9 +287,9 @@ choose_door(HDC hDC)                                    /* pick a new path */
 {
   int candidates[3];
   register int num_candidates;
 {
   int candidates[3];
   register int num_candidates;
-  
+
   num_candidates = 0;
   num_candidates = 0;
-  
+
   /* top wall */
   if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_TOP )
     goto rightwall;
   /* top wall */
   if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_TOP )
     goto rightwall;
@@ -304,7 +304,7 @@ choose_door(HDC hDC)                                    /* pick a new path */
     goto rightwall;
   }
   candidates[num_candidates++] = 0;
     goto rightwall;
   }
   candidates[num_candidates++] = 0;
-  
+
  rightwall:
   /* right wall */
   if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_RIGHT )
  rightwall:
   /* right wall */
   if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_RIGHT )
@@ -320,7 +320,7 @@ choose_door(HDC hDC)                                    /* pick a new path */
     goto bottomwall;
   }
   candidates[num_candidates++] = 1;
     goto bottomwall;
   }
   candidates[num_candidates++] = 1;
-  
+
  bottomwall:
   /* bottom wall */
   if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_BOTTOM )
  bottomwall:
   /* bottom wall */
   if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_BOTTOM )
@@ -336,7 +336,7 @@ choose_door(HDC hDC)                                    /* pick a new path */
     goto leftwall;
   }
   candidates[num_candidates++] = 2;
     goto leftwall;
   }
   candidates[num_candidates++] = 2;
-  
+
  leftwall:
   /* left wall */
   if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_LEFT )
  leftwall:
   /* left wall */
   if ( maze[cur_sq_x][cur_sq_y] & DOOR_IN_LEFT )
@@ -352,14 +352,14 @@ choose_door(HDC hDC)                                    /* pick a new path */
     goto donewall;
   }
   candidates[num_candidates++] = 3;
     goto donewall;
   }
   candidates[num_candidates++] = 3;
-  
+
  donewall:
   if (num_candidates == 0)
     return ( -1 );
   if (num_candidates == 1)
     return ( candidates[0] );
   return ( candidates[ get_random(num_candidates) ] );
  donewall:
   if (num_candidates == 0)
     return ( -1 );
   if (num_candidates == 1)
     return ( candidates[0] );
   return ( candidates[ get_random(num_candidates) ] );
-  
+
 }
 
 
 }
 
 
@@ -385,19 +385,19 @@ draw_solid_square(i, j, dir, hDC, hBrush)          /* draw a solid square in a s
   RECT rc;
 
   switch (dir) {
   RECT rc;
 
   switch (dir) {
-  case 0: 
+  case 0:
     rc.left = border_x + bw + grid_width * i;
        rc.right = rc.left + grid_width - (bw + bw);
        rc.top = border_y - bw + grid_height * j;
        rc.bottom = rc.top + grid_height;
     break;
     rc.left = border_x + bw + grid_width * i;
        rc.right = rc.left + grid_width - (bw + bw);
        rc.top = border_y - bw + grid_height * j;
        rc.bottom = rc.top + grid_height;
     break;
-  case 1: 
+  case 1:
        rc.left = border_x + bw + grid_width * i;
        rc.right = rc.left + grid_width;
        rc.top = border_y + bw + grid_height * j;
        rc.bottom = rc.top + grid_height - (bw + bw);
     break;
        rc.left = border_x + bw + grid_width * i;
        rc.right = rc.left + grid_width;
        rc.top = border_y + bw + grid_height * j;
        rc.bottom = rc.top + grid_height - (bw + bw);
     break;
-  case 2: 
+  case 2:
     rc.left = border_x + bw + grid_width * i;
        rc.right = rc.left + grid_width - (bw + bw);
        rc.top = border_y + bw + grid_height * j;
     rc.left = border_x + bw + grid_width * i;
        rc.right = rc.left + grid_width - (bw + bw);
        rc.top = border_y + bw + grid_height * j;
@@ -418,8 +418,8 @@ draw_maze_border(HWND hWnd, HDC hDC)        /* draw the maze outline */
 {
   register int i, j;
   HBRUSH hBrush;
 {
   register int i, j;
   HBRUSH hBrush;
-  
-  
+
+
   for ( i=0; i<maze_size_x; i++) {
     if ( maze[i][0] & WALL_TOP ) {
          MoveToEx(hDC, border_x + grid_width * i, border_y, NULL);
   for ( i=0; i<maze_size_x; i++) {
     if ( maze[i][0] & WALL_TOP ) {
          MoveToEx(hDC, border_x + grid_width * i, border_y, NULL);
@@ -459,7 +459,7 @@ draw_wall(i, j, dir, hDC)                                   /* draw a single wal
   switch (dir) {
   case 0:
        MoveToEx(hDC, border_x + grid_width * i, border_y + grid_height * j, NULL);
   switch (dir) {
   case 0:
        MoveToEx(hDC, border_x + grid_width * i, border_y + grid_height * j, NULL);
-       (void) LineTo(hDC, border_x + grid_width * (i+1), 
+       (void) LineTo(hDC, border_x + grid_width * (i+1),
                      border_y + grid_height * j);
     break;
   case 1:
                      border_y + grid_height * j);
     break;
   case 1:
@@ -471,13 +471,13 @@ draw_wall(i, j, dir, hDC)                                   /* draw a single wal
   case 2:
        MoveToEx(hDC, border_x + grid_width * i, border_y + grid_height * (j+1),
                 NULL);
   case 2:
        MoveToEx(hDC, border_x + grid_width * i, border_y + grid_height * (j+1),
                 NULL);
-       (void) LineTo(hDC, border_x + grid_width * (i+1), 
+       (void) LineTo(hDC, border_x + grid_width * (i+1),
                      border_y + grid_height * (j+1));
     break;
   case 3:
        MoveToEx(hDC, border_x + grid_width * i, border_y + grid_height * j,
                 NULL);
                      border_y + grid_height * (j+1));
     break;
   case 3:
        MoveToEx(hDC, border_x + grid_width * i, border_y + grid_height * j,
                 NULL);
-       (void) LineTo(hDC, border_x + grid_width * i, 
+       (void) LineTo(hDC, border_x + grid_width * i,
                      border_y + grid_height * (j+1));
     break;
   }
                      border_y + grid_height * (j+1));
     break;
   }
@@ -497,11 +497,11 @@ begin_solve_maze()                             /* solve it with graphical feedba
        0xaaaaaaaa
   };
   static RGBQUAD argbq[] = {
        0xaaaaaaaa
   };
   static RGBQUAD argbq[] = {
-       { 0, 0, 255, 0 },         
+       { 0, 0, 255, 0 },
        { 255, 255, 255, 0 }
   };
   BITMAPINFO *pbmi;
        { 255, 255, 255, 0 }
   };
   BITMAPINFO *pbmi;
-  
+
   hDC = GetDC(hWnd);
   pbmi = malloc(sizeof(BITMAPINFOHEADER) + sizeof(argbq) + sizeof(grayPattern));
   pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
   hDC = GetDC(hWnd);
   pbmi = malloc(sizeof(BITMAPINFOHEADER) + sizeof(argbq) + sizeof(grayPattern));
   pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -525,31 +525,31 @@ begin_solve_maze()                             /* solve it with graphical feedba
   /* plug up the surrounding wall */
   maze[start_x][start_y] |= (WALL_TOP >> start_dir);
   maze[end_x][end_y] |= (WALL_TOP >> end_dir);
   /* plug up the surrounding wall */
   maze[start_x][start_y] |= (WALL_TOP >> start_dir);
   maze[end_x][end_y] |= (WALL_TOP >> end_dir);
-  
+
   /* initialize search path */
   pathi = 0;
   path[pathi].x = end_x;
   path[pathi].y = end_y;
   path[pathi].dir = -1;
 }
   /* initialize search path */
   pathi = 0;
   path[pathi].x = end_x;
   path[pathi].y = end_y;
   path[pathi].dir = -1;
 }
-  
+
 static int
 solve_maze()                             /* solve it with graphical feedback */
 {
   int ret;
   int action_done;
 static int
 solve_maze()                             /* solve it with graphical feedback */
 {
   int ret;
   int action_done;
-                  
+
   do {
     action_done = 1;
     if ( ++path[pathi].dir >= 4 ) {
       pathi--;
   do {
     action_done = 1;
     if ( ++path[pathi].dir >= 4 ) {
       pathi--;
-      draw_solid_square( (int)(path[pathi].x), (int)(path[pathi].y), 
+      draw_solid_square( (int)(path[pathi].x), (int)(path[pathi].y),
                       (int)(path[pathi].dir), hDC, hBrushDead);
       ret = 0;
     }
                       (int)(path[pathi].dir), hDC, hBrushDead);
       ret = 0;
     }
-    else if ( ! (maze[path[pathi].x][path[pathi].y] & 
-               (WALL_TOP >> path[pathi].dir))  && 
-            ( (pathi == 0) || ( (path[pathi].dir != 
+    else if ( ! (maze[path[pathi].x][path[pathi].y] &
+               (WALL_TOP >> path[pathi].dir))  &&
+            ( (pathi == 0) || ( (path[pathi].dir !=
                            (int)(path[pathi-1].dir+2)%4) ) ) ) {
       enter_square(pathi, hDC, hBrushLiving);
       pathi++;
                            (int)(path[pathi-1].dir+2)%4) ) ) ) {
       enter_square(pathi, hDC, hBrushLiving);
       pathi++;
@@ -567,15 +567,15 @@ solve_maze()                             /* solve it with graphical feedback */
   } while (! action_done);
 
   return ret;
   } while (! action_done);
 
   return ret;
-} 
+}
 
 
 static void
 enter_square(int n, HDC hDC, HBRUSH hBrush)  /* move into a neighboring square */
 {
 
 
 static void
 enter_square(int n, HDC hDC, HBRUSH hBrush)  /* move into a neighboring square */
 {
-  draw_solid_square( (int)path[n].x, (int)path[n].y, 
+  draw_solid_square( (int)path[n].x, (int)path[n].y,
                    (int)path[n].dir, hDC, hBrush);
                    (int)path[n].dir, hDC, hBrush);
-  
+
   path[n+1].dir = -1;
   switch (path[n].dir) {
   case 0: path[n+1].x = path[n].x;
   path[n+1].dir = -1;
   switch (path[n].dir) {
   case 0: path[n+1].x = path[n].x;
index 1efacbb..517bc93 100644 (file)
@@ -4,7 +4,7 @@
 //
 
 // Next default values for new objects
 //
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 
index 257ba58..d1571ce 100644 (file)
@@ -23,7 +23,7 @@
 #define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <tchar.h>
 #define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <tchar.h>
-    
+
 #include "main.h"
 #include "framewnd.h"
 
 #include "main.h"
 #include "framewnd.h"
 
index fb795a0..29019ae 100644 (file)
@@ -25,7 +25,7 @@
 #include <tchar.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <stdlib.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 #include "framewnd.h"
 
 #include "main.h"
 #include "framewnd.h"
 
@@ -109,7 +109,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
     // Initialize global strings
     LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
     LoadString(hInstance, IDC_ZOOMIN, szFrameClass, MAX_LOADSTRING);
     // Initialize global strings
     LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
     LoadString(hInstance, IDC_ZOOMIN, szFrameClass, MAX_LOADSTRING);
-    
+
     // Store instance handle in our global variable
     hInst = hInstance;
 
     // Store instance handle in our global variable
     hInst = hInstance;
 
index 8111fa2..89cdc47 100644 (file)
@@ -81,7 +81,7 @@ static void AddStatusMsg(DFWINDOW wnd, DF_PARAM p1)
     if (wnd->StatusBar != NULL)    {
         if (p1 && *(char *)p1)
             DfSendMessage(wnd->StatusBar, DFM_SETTEXT, p1, 0);
     if (wnd->StatusBar != NULL)    {
         if (p1 && *(char *)p1)
             DfSendMessage(wnd->StatusBar, DFM_SETTEXT, p1, 0);
-        else 
+        else
             DfSendMessage(wnd->StatusBar, DFM_CLEARTEXT, 0, 0);
         DfSendMessage(wnd->StatusBar, DFM_PAINT, 0, 0);
     }
             DfSendMessage(wnd->StatusBar, DFM_CLEARTEXT, 0, 0);
         DfSendMessage(wnd->StatusBar, DFM_PAINT, 0, 0);
     }
@@ -95,7 +95,7 @@ static void SetFocusMsg(DFWINDOW wnd, BOOL p1)
     DfInFocus = p1 ? wnd : NULL;
        if (DfIsVisible(wnd))
            DfSendMessage(wnd, DFM_BORDER, 0, 0);
     DfInFocus = p1 ? wnd : NULL;
        if (DfIsVisible(wnd))
            DfSendMessage(wnd, DFM_BORDER, 0, 0);
-       else 
+       else
            DfSendMessage(wnd, DFM_SHOW_WINDOW, 0, 0);
 }
 
            DfSendMessage(wnd, DFM_SHOW_WINDOW, 0, 0);
 }
 
@@ -195,7 +195,7 @@ static void CommandMsg(DFWINDOW wnd, DF_PARAM p1, DF_PARAM p2)
             if (DfDialogBox(wnd, &Display, TRUE, NULL))    {
                                if (DfInFocus == wnd->MenuBarWnd || DfInFocus == wnd->StatusBar)
                                        oldFocus = DfApplicationWindow;
             if (DfDialogBox(wnd, &Display, TRUE, NULL))    {
                                if (DfInFocus == wnd->MenuBarWnd || DfInFocus == wnd->StatusBar)
                                        oldFocus = DfApplicationWindow;
-                               else 
+                               else
                                        oldFocus = DfInFocus;
                 DfSendMessage(wnd, DFM_HIDE_WINDOW, 0, 0);
                 SelectColors(wnd);
                                        oldFocus = DfInFocus;
                 DfSendMessage(wnd, DFM_HIDE_WINDOW, 0, 0);
                 SelectColors(wnd);
@@ -389,7 +389,7 @@ static char *WindowName(DFWINDOW wnd)
     {
         if (DfGetClass(wnd) == DF_DIALOG)
             return ((DF_DBOX *)(wnd->extension))->HelpName;
     {
         if (DfGetClass(wnd) == DF_DIALOG)
             return ((DF_DBOX *)(wnd->extension))->HelpName;
-        else 
+        else
             return "Untitled";
     }
     else
             return "Untitled";
     }
     else
index d0f3a15..1a8db71 100644 (file)
@@ -7,7 +7,7 @@
  *         You must add entries to the DfColor tables in
  *         DFCONFIG.C for new classes.
  *
  *         You must add entries to the DfColor tables in
  *         DFCONFIG.C for new classes.
  *
- *        Class Name  Base Class   Processor       Attribute    
+ *        Class Name  Base Class   Processor       Attribute
  *       ------------  --------- ---------------  -----------
  */
 DfClassDef(  DF_NORMAL,      -1,      DfNormalProc,      0 )
  *       ------------  --------- ---------------  -----------
  */
 DfClassDef(  DF_NORMAL,      -1,      DfNormalProc,      0 )
index a80a0a5..0a92a16 100644 (file)
@@ -449,7 +449,7 @@ void DfBuildFileName(char *path, char *ext)
        cp = strrchr(path, '\\');
        if (cp == NULL)
                cp = path;
        cp = strrchr(path, '\\');
        if (cp == NULL)
                cp = path;
-       else 
+       else
                cp++;
        strcpy(cp, DFlatApplication);
        strcat(cp, ext);
                cp++;
        strcpy(cp, DFlatApplication);
        strcat(cp, ext);
index 122b00a..018c13f 100644 (file)
@@ -529,11 +529,11 @@ void DfSetScrollBars(DFWINDOW wnd)
     int oldattr = DfGetAttribute(wnd);
     if (wnd->wlines > DfClientHeight(wnd))
         DfAddAttribute(wnd, DF_VSCROLLBAR);
     int oldattr = DfGetAttribute(wnd);
     if (wnd->wlines > DfClientHeight(wnd))
         DfAddAttribute(wnd, DF_VSCROLLBAR);
-    else 
+    else
         DfClearAttribute(wnd, DF_VSCROLLBAR);
     if (wnd->textwidth > DfClientWidth(wnd))
         DfAddAttribute(wnd, DF_HSCROLLBAR);
         DfClearAttribute(wnd, DF_VSCROLLBAR);
     if (wnd->textwidth > DfClientWidth(wnd))
         DfAddAttribute(wnd, DF_HSCROLLBAR);
-    else 
+    else
         DfClearAttribute(wnd, DF_HSCROLLBAR);
     if (DfGetAttribute(wnd) != oldattr)
         DfSendMessage(wnd, DFM_BORDER, 0, 0);
         DfClearAttribute(wnd, DF_HSCROLLBAR);
     if (DfGetAttribute(wnd) != oldattr)
         DfSendMessage(wnd, DFM_BORDER, 0, 0);
@@ -643,15 +643,15 @@ static void FixColors(DFWINDOW wnd)
        {
                if (ct->class != DF_SPINBUTTON && ct->class != DF_COMBOBOX)
                {
        {
                if (ct->class != DF_SPINBUTTON && ct->class != DF_COMBOBOX)
                {
-                       wnd->WindowColors[DF_FRAME_COLOR][DF_FG] = 
+                       wnd->WindowColors[DF_FRAME_COLOR][DF_FG] =
                                DfGetParent(wnd)->WindowColors[DF_FRAME_COLOR][DF_FG];
                                DfGetParent(wnd)->WindowColors[DF_FRAME_COLOR][DF_FG];
-                       wnd->WindowColors[DF_FRAME_COLOR][DF_BG] = 
+                       wnd->WindowColors[DF_FRAME_COLOR][DF_BG] =
                                DfGetParent(wnd)->WindowColors[DF_FRAME_COLOR][DF_BG];
                        if (ct->class != DF_EDITBOX && ct->class != DF_LISTBOX)
                        {
                                DfGetParent(wnd)->WindowColors[DF_FRAME_COLOR][DF_BG];
                        if (ct->class != DF_EDITBOX && ct->class != DF_LISTBOX)
                        {
-                               wnd->WindowColors[DF_STD_COLOR][DF_FG] = 
+                               wnd->WindowColors[DF_STD_COLOR][DF_FG] =
                                        DfGetParent(wnd)->WindowColors[DF_STD_COLOR][DF_FG];
                                        DfGetParent(wnd)->WindowColors[DF_STD_COLOR][DF_FG];
-                               wnd->WindowColors[DF_STD_COLOR][DF_BG] = 
+                               wnd->WindowColors[DF_STD_COLOR][DF_BG] =
                                        DfGetParent(wnd)->WindowColors[DF_STD_COLOR][DF_BG];
                        }
                }
                                        DfGetParent(wnd)->WindowColors[DF_STD_COLOR][DF_BG];
                        }
                }
index ee3cc1d..c813bf7 100644 (file)
@@ -183,7 +183,7 @@ static int DlgFnOpen(DFWINDOW wnd,DFMESSAGE msg,DF_PARAM p1,DF_PARAM p2)
                                                                        DfGetItemText(wnd, DF_ID_PATH, FileSpec, 65);
                                                                        strcat(FileSpec, FileName);
                                                                }
                                                                        DfGetItemText(wnd, DF_ID_PATH, FileSpec, 65);
                                                                        strcat(FileSpec, FileName);
                                                                }
-                                                               else 
+                                                               else
                                                                        strcpy(FileSpec, FileName);
                                                        }
                                                        break;
                                                                        strcpy(FileSpec, FileName);
                                                        }
                                                        break;
index d585f8f..302abd5 100644 (file)
@@ -398,7 +398,7 @@ static void FlipSelection(DFWINDOW wnd, int sel)
 }
 
 static int ExtendSelections(DFWINDOW wnd, int sel, int shift)
 }
 
 static int ExtendSelections(DFWINDOW wnd, int sel, int shift)
-{    
+{
     if (shift & (DF_LEFTSHIFT | DF_RIGHTSHIFT) &&
                         wnd->AnchorPoint != -1)    {
         int i = sel;
     if (shift & (DF_LEFTSHIFT | DF_RIGHTSHIFT) &&
                         wnd->AnchorPoint != -1)    {
         int i = sel;
index 8e3236e..b2b06f7 100644 (file)
@@ -125,7 +125,7 @@ static int MemoPadProc(DFWINDOW wnd,DFMESSAGE msg,DF_PARAM p1,DF_PARAM p2)
                 case DF_ID_PRINT:
                     PrintPad(DfInFocus);
                     return TRUE;
                 case DF_ID_PRINT:
                     PrintPad(DfInFocus);
                     return TRUE;
-                               case DF_ID_EXIT:        
+                               case DF_ID_EXIT:
                                        if (!DfYesNoBox("Exit Memopad?"))
                                                return FALSE;
                                        break;
                                        if (!DfYesNoBox("Exit Memopad?"))
                                                return FALSE;
                                        break;
@@ -144,7 +144,7 @@ static int MemoPadProc(DFWINDOW wnd,DFMESSAGE msg,DF_PARAM p1,DF_PARAM p2)
                                        FixTabMenu();
                     return TRUE;
                                case DF_ID_TAB6:
                                        FixTabMenu();
                     return TRUE;
                                case DF_ID_TAB6:
-                                       DfCfg.Tabs = 6;                                 
+                                       DfCfg.Tabs = 6;
                                        FixTabMenu();
                     return TRUE;
                                case DF_ID_TAB8:
                                        FixTabMenu();
                     return TRUE;
                                case DF_ID_TAB8:
@@ -254,7 +254,7 @@ static void OpenPadWindow(DFWINDOW wnd, char *FileName)
     }
        DfSendMessage(wwnd, DFM_CLOSE_WINDOW, 0, 0);
     DfSendMessage(wnd1, DFM_SETFOCUS, TRUE, 0);
     }
        DfSendMessage(wwnd, DFM_CLOSE_WINDOW, 0, 0);
     DfSendMessage(wnd1, DFM_SETFOCUS, TRUE, 0);
-    DfSendMessage(wnd1, DFM_MAXIMIZE, 0, 0);    
+    DfSendMessage(wnd1, DFM_MAXIMIZE, 0, 0);
 }
 
 /* --- Load the notepad file into the editor text buffer --- */
 }
 
 /* --- Load the notepad file into the editor text buffer --- */
@@ -414,7 +414,7 @@ static int EditorProc(DFWINDOW wnd,DFMESSAGE msg,DF_PARAM p1,DF_PARAM p2)
             rtn = DfDefaultWndProc(wnd, msg, p1, p2);
             if ((int)p1 == FALSE)
                 DfSendMessage(DfGetParent(wnd), DFM_ADDSTATUS, 0, 0);
             rtn = DfDefaultWndProc(wnd, msg, p1, p2);
             if ((int)p1 == FALSE)
                 DfSendMessage(DfGetParent(wnd), DFM_ADDSTATUS, 0, 0);
-            else 
+            else
                 ShowPosition(wnd);
             return rtn;
         case DFM_KEYBOARD_CURSOR:
                 ShowPosition(wnd);
             return rtn;
         case DFM_KEYBOARD_CURSOR:
index d19f1f4..a1b485a 100644 (file)
@@ -49,7 +49,7 @@ typedef struct DfMenuBar {
 #define DF_INACTIVE    1
 #define DF_CHECKED     2
 #define DF_TOGGLE      4
 #define DF_INACTIVE    1
 #define DF_CHECKED     2
 #define DF_TOGGLE      4
-#define DF_CASCADED    8    
+#define DF_CASCADED    8
 
 /* --------- the standard menus ---------- */
 extern DF_MBAR DfMainMenu;
 
 /* --------- the standard menus ---------- */
 extern DF_MBAR DfMainMenu;
index 841b541..a9e917f 100644 (file)
@@ -196,7 +196,7 @@ static void KeyboardMsg(DFWINDOW wnd, DF_PARAM p1)
             if (mwnd != NULL)
                 DfSendMessage(wnd, DFM_MB_SELECTION,
                     DfActiveMenuBar->ActiveSelection, 0);
             if (mwnd != NULL)
                 DfSendMessage(wnd, DFM_MB_SELECTION,
                     DfActiveMenuBar->ActiveSelection, 0);
-            else 
+            else
                 DfSendMessage(wnd, DFM_PAINT, 0, 0);
             break;
         case DF_BS:
                 DfSendMessage(wnd, DFM_PAINT, 0, 0);
             break;
         case DF_BS:
@@ -207,7 +207,7 @@ static void KeyboardMsg(DFWINDOW wnd, DF_PARAM p1)
             if (mwnd != NULL)
                 DfSendMessage(wnd, DFM_MB_SELECTION,
                     DfActiveMenuBar->ActiveSelection, 0);
             if (mwnd != NULL)
                 DfSendMessage(wnd, DFM_MB_SELECTION,
                     DfActiveMenuBar->ActiveSelection, 0);
-            else 
+            else
                 DfSendMessage(wnd, DFM_PAINT, 0, 0);
             break;
         default:
                 DfSendMessage(wnd, DFM_PAINT, 0, 0);
             break;
         default:
index 69713cf..5116dfd 100644 (file)
@@ -593,7 +593,7 @@ BOOL DfDispatchMessage (void)
        while (EventQueueCtr > 0)
        {
                struct events ev;
        while (EventQueueCtr > 0)
        {
                struct events ev;
-                       
+
                ev = EventQueue[EventQueueOffCtr];
                if (++EventQueueOffCtr == DF_MAXMESSAGES)
                        EventQueueOffCtr = 0;
                ev = EventQueue[EventQueueOffCtr];
                if (++EventQueueOffCtr == DF_MAXMESSAGES)
                        EventQueueOffCtr = 0;
index 6de724c..48c79eb 100644 (file)
@@ -123,7 +123,7 @@ BOOL DfInputBox(DFWINDOW wnd,char *ttl,char *msg,char *text,int len)
     InputText = text;
     TextLength = len;
     InputBoxDB.dwnd.title = ttl;
     InputText = text;
     TextLength = len;
     InputBoxDB.dwnd.title = ttl;
-    InputBoxDB.dwnd.w = 4 + 
+    InputBoxDB.dwnd.w = 4 +
         max(20, max(len, max((int)strlen(ttl), (int)strlen(msg))));
     InputBoxDB.ctl[1].dwnd.x = (InputBoxDB.dwnd.w-2-len)/2;
     InputBoxDB.ctl[0].dwnd.w = strlen(msg);
         max(20, max(len, max((int)strlen(ttl), (int)strlen(msg))));
     InputBoxDB.ctl[1].dwnd.x = (InputBoxDB.dwnd.w-2-len)/2;
     InputBoxDB.ctl[0].dwnd.w = strlen(msg);
index f791b15..8c382d8 100644 (file)
@@ -74,7 +74,7 @@ static int FindVector(DFWINDOW wnd, DFRECT rc, int x, int y)
                         coll = 0;
                     else if (rc.lf+x == rcc.rt)
                         coll = 2;
                         coll = 0;
                     else if (rc.lf+x == rcc.rt)
                         coll = 2;
-                    else 
+                    else
                         coll = 1;
                 }
             }
                         coll = 1;
                 }
             }
@@ -88,7 +88,7 @@ static int FindVector(DFWINDOW wnd, DFRECT rc, int x, int y)
                         coll = 0;
                     else if (rc.tp+y == rcc.bt)
                         coll = 2;
                         coll = 0;
                     else if (rc.tp+y == rcc.bt)
                         coll = 2;
-                    else 
+                    else
                         coll = 1;
                 }
             }
                         coll = 1;
                 }
             }
index 8467401..2fe650c 100644 (file)
@@ -228,7 +228,7 @@ static BOOL KeyboardMsg(DFWINDOW wnd, DF_PARAM p1, DF_PARAM p2)
         case DF_F1:
             if (ActivePopDown == NULL)
                 DfSendMessage(DfGetParent(wnd), DFM_KEYBOARD, p1, p2);
         case DF_F1:
             if (ActivePopDown == NULL)
                 DfSendMessage(DfGetParent(wnd), DFM_KEYBOARD, p1, p2);
-            else 
+            else
                 DfDisplayHelp(wnd,
                     (ActivePopDown+wnd->selection)->help);
             return TRUE;
                 DfDisplayHelp(wnd,
                     (ActivePopDown+wnd->selection)->help);
             return TRUE;
index 3a81cdd..5bee101 100644 (file)
@@ -14,7 +14,7 @@ int DfStatusBarProc(DFWINDOW wnd, DFMESSAGE msg, DF_PARAM p1, DF_PARAM p2)
                        if ((int)p1 == DF_CTRL_F4)
                                return TRUE;
                        break;
                        if ((int)p1 == DF_CTRL_F4)
                                return TRUE;
                        break;
-               case DFM_PAINT: 
+               case DFM_PAINT:
                        if (!DfIsVisible(wnd))
                                break;
                        statusbar = DfCalloc(1, DfWindowWidth(wnd)+1);
                        if (!DfIsVisible(wnd))
                                break;
                        statusbar = DfCalloc(1, DfWindowWidth(wnd)+1);
index 44edf3d..aeded49 100644 (file)
@@ -45,7 +45,7 @@ void DfBuildSystemMenu(DFWINDOW wnd)
        int lf, tp, ht, wd;
     DFWINDOW SystemMenuWnd;
 
        int lf, tp, ht, wd;
     DFWINDOW SystemMenuWnd;
 
-    DfSystemMenu.PullDown[0].Selections[6].Accelerator = 
+    DfSystemMenu.PullDown[0].Selections[6].Accelerator =
         (DfGetClass(wnd) == DF_APPLICATION) ? DF_ALT_F4 : DF_CTRL_F4;
 
     lf = DfGetLeft(wnd)+1;
         (DfGetClass(wnd) == DF_APPLICATION) ? DF_ALT_F4 : DF_CTRL_F4;
 
     lf = DfGetLeft(wnd)+1;
index 8dbc3af..1c3497d 100644 (file)
@@ -713,7 +713,7 @@ void DfWriteTextLine(DFWINDOW wnd, DFRECT *rcc, int y, BOOL reverse)
     if (*(lp+i) && i < wnd->wleft+3)    {
         if (wnd->wleft+4 > lnlen)
             trunc = TRUE;
     if (*(lp+i) && i < wnd->wleft+3)    {
         if (wnd->wleft+4 > lnlen)
             trunc = TRUE;
-        else 
+        else
             lp += 4;
     }
     else     {
             lp += 4;
     }
     else     {
index 25abe7e..601151b 100644 (file)
@@ -14,7 +14,7 @@
 #define IDM_HELP_ABOUT                  40006
 
 // Next default values for new objects
 #define IDM_HELP_ABOUT                  40006
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        105
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        105
index fc1d886..5c694d4 100644 (file)
@@ -81,7 +81,7 @@ static void AddStatusMsg(DFWINDOW wnd, PARAM p1)
     if (wnd->StatusBar != NULL)    {
         if (p1 && *(char *)p1)
             DfSendMessage(wnd->StatusBar, SETTEXT, p1, 0);
     if (wnd->StatusBar != NULL)    {
         if (p1 && *(char *)p1)
             DfSendMessage(wnd->StatusBar, SETTEXT, p1, 0);
-        else 
+        else
             DfSendMessage(wnd->StatusBar, CLEARTEXT, 0, 0);
         DfSendMessage(wnd->StatusBar, PAINT, 0, 0);
     }
             DfSendMessage(wnd->StatusBar, CLEARTEXT, 0, 0);
         DfSendMessage(wnd->StatusBar, PAINT, 0, 0);
     }
@@ -95,7 +95,7 @@ static void SetFocusMsg(DFWINDOW wnd, BOOL p1)
     inFocus = p1 ? wnd : NULL;
        if (isVisible(wnd))
            DfSendMessage(wnd, BORDER, 0, 0);
     inFocus = p1 ? wnd : NULL;
        if (isVisible(wnd))
            DfSendMessage(wnd, BORDER, 0, 0);
-       else 
+       else
            DfSendMessage(wnd, SHOW_WINDOW, 0, 0);
 }
 
            DfSendMessage(wnd, SHOW_WINDOW, 0, 0);
 }
 
@@ -195,7 +195,7 @@ static void CommandMsg(DFWINDOW wnd, PARAM p1, PARAM p2)
             if (DfDialogBox(wnd, &Display, TRUE, NULL))    {
                                if (inFocus == wnd->MenuBarWnd || inFocus == wnd->StatusBar)
                                        oldFocus = ApplicationWindow;
             if (DfDialogBox(wnd, &Display, TRUE, NULL))    {
                                if (inFocus == wnd->MenuBarWnd || inFocus == wnd->StatusBar)
                                        oldFocus = ApplicationWindow;
-                               else 
+                               else
                                        oldFocus = inFocus;
                 DfSendMessage(wnd, DFM_HIDE_WINDOW, 0, 0);
                 SelectColors(wnd);
                                        oldFocus = inFocus;
                 DfSendMessage(wnd, DFM_HIDE_WINDOW, 0, 0);
                 SelectColors(wnd);
@@ -389,7 +389,7 @@ static char *WindowName(DFWINDOW wnd)
     {
         if (GetClass(wnd) == DIALOG)
             return ((DBOX *)(wnd->extension))->HelpName;
     {
         if (GetClass(wnd) == DIALOG)
             return ((DBOX *)(wnd->extension))->HelpName;
-        else 
+        else
             return "Untitled";
     }
     else
             return "Untitled";
     }
     else
index 2d2b1e6..e59bb1c 100644 (file)
@@ -449,7 +449,7 @@ void BuildFileName(char *path, char *ext)
        cp = strrchr(path, '\\');
        if (cp == NULL)
                cp = path;
        cp = strrchr(path, '\\');
        if (cp == NULL)
                cp = path;
-       else 
+       else
                cp++;
        strcpy(cp, DFlatApplication);
        strcat(cp, ext);
                cp++;
        strcpy(cp, DFlatApplication);
        strcat(cp, ext);
index 8cec719..afd44b5 100644 (file)
@@ -529,11 +529,11 @@ void SetScrollBars(DFWINDOW wnd)
     int oldattr = GetAttribute(wnd);
     if (wnd->wlines > ClientHeight(wnd))
         AddAttribute(wnd, VSCROLLBAR);
     int oldattr = GetAttribute(wnd);
     if (wnd->wlines > ClientHeight(wnd))
         AddAttribute(wnd, VSCROLLBAR);
-    else 
+    else
         ClearAttribute(wnd, VSCROLLBAR);
     if (wnd->textwidth > ClientWidth(wnd))
         AddAttribute(wnd, HSCROLLBAR);
         ClearAttribute(wnd, VSCROLLBAR);
     if (wnd->textwidth > ClientWidth(wnd))
         AddAttribute(wnd, HSCROLLBAR);
-    else 
+    else
         ClearAttribute(wnd, HSCROLLBAR);
     if (GetAttribute(wnd) != oldattr)
         DfSendMessage(wnd, BORDER, 0, 0);
         ClearAttribute(wnd, HSCROLLBAR);
     if (GetAttribute(wnd) != oldattr)
         DfSendMessage(wnd, BORDER, 0, 0);
@@ -643,15 +643,15 @@ static void FixColors(DFWINDOW wnd)
        {
                if (ct->class != SPINBUTTON && ct->class != COMBOBOX)
                {
        {
                if (ct->class != SPINBUTTON && ct->class != COMBOBOX)
                {
-                       wnd->WindowColors[FRAME_COLOR][FG] = 
+                       wnd->WindowColors[FRAME_COLOR][FG] =
                                GetParent(wnd)->WindowColors[FRAME_COLOR][FG];
                                GetParent(wnd)->WindowColors[FRAME_COLOR][FG];
-                       wnd->WindowColors[FRAME_COLOR][BG] = 
+                       wnd->WindowColors[FRAME_COLOR][BG] =
                                GetParent(wnd)->WindowColors[FRAME_COLOR][BG];
                        if (ct->class != EDITBOX && ct->class != LISTBOX)
                        {
                                GetParent(wnd)->WindowColors[FRAME_COLOR][BG];
                        if (ct->class != EDITBOX && ct->class != LISTBOX)
                        {
-                               wnd->WindowColors[STD_COLOR][FG] = 
+                               wnd->WindowColors[STD_COLOR][FG] =
                                        GetParent(wnd)->WindowColors[STD_COLOR][FG];
                                        GetParent(wnd)->WindowColors[STD_COLOR][FG];
-                               wnd->WindowColors[STD_COLOR][BG] = 
+                               wnd->WindowColors[STD_COLOR][BG] =
                                        GetParent(wnd)->WindowColors[STD_COLOR][BG];
                        }
                }
                                        GetParent(wnd)->WindowColors[STD_COLOR][BG];
                        }
                }
index 9036d9b..0f4ee17 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * ReactOS DFLAT32.DLL
  */
 
  * ReactOS DFLAT32.DLL
  */
 
index e815bfe..965848c 100644 (file)
@@ -398,7 +398,7 @@ static void FlipSelection(DFWINDOW wnd, int sel)
 }
 
 static int ExtendSelections(DFWINDOW wnd, int sel, int shift)
 }
 
 static int ExtendSelections(DFWINDOW wnd, int sel, int shift)
-{    
+{
     if (shift & (LEFTSHIFT | RIGHTSHIFT) &&
                         wnd->AnchorPoint != -1)    {
         int i = sel;
     if (shift & (LEFTSHIFT | RIGHTSHIFT) &&
                         wnd->AnchorPoint != -1)    {
         int i = sel;
index 900272b..a5692db 100644 (file)
@@ -196,7 +196,7 @@ static void KeyboardMsg(DFWINDOW wnd, PARAM p1)
             if (mwnd != NULL)
                 DfSendMessage(wnd, MB_SELECTION,
                     ActiveMenuBar->ActiveSelection, 0);
             if (mwnd != NULL)
                 DfSendMessage(wnd, MB_SELECTION,
                     ActiveMenuBar->ActiveSelection, 0);
-            else 
+            else
                 DfSendMessage(wnd, PAINT, 0, 0);
             break;
         case BS:
                 DfSendMessage(wnd, PAINT, 0, 0);
             break;
         case BS:
@@ -207,7 +207,7 @@ static void KeyboardMsg(DFWINDOW wnd, PARAM p1)
             if (mwnd != NULL)
                 DfSendMessage(wnd, MB_SELECTION,
                     ActiveMenuBar->ActiveSelection, 0);
             if (mwnd != NULL)
                 DfSendMessage(wnd, MB_SELECTION,
                     ActiveMenuBar->ActiveSelection, 0);
-            else 
+            else
                 DfSendMessage(wnd, PAINT, 0, 0);
             break;
         default:
                 DfSendMessage(wnd, PAINT, 0, 0);
             break;
         default:
index b7700b0..711c04e 100644 (file)
@@ -593,7 +593,7 @@ BOOL DfDispatchMessage (void)
        while (EventQueueCtr > 0)
        {
                struct events ev;
        while (EventQueueCtr > 0)
        {
                struct events ev;
-                       
+
                ev = EventQueue[EventQueueOffCtr];
                if (++EventQueueOffCtr == MAXMESSAGES)
                        EventQueueOffCtr = 0;
                ev = EventQueue[EventQueueOffCtr];
                if (++EventQueueOffCtr == MAXMESSAGES)
                        EventQueueOffCtr = 0;
index 643c290..a5a5e52 100644 (file)
@@ -123,7 +123,7 @@ BOOL InputBox(DFWINDOW wnd,char *ttl,char *msg,char *text,int len)
     InputText = text;
     TextLength = len;
     InputBoxDB.dwnd.title = ttl;
     InputText = text;
     TextLength = len;
     InputBoxDB.dwnd.title = ttl;
-    InputBoxDB.dwnd.w = 4 + 
+    InputBoxDB.dwnd.w = 4 +
         max(20, max(len, max((int)strlen(ttl), (int)strlen(msg))));
     InputBoxDB.ctl[1].dwnd.x = (InputBoxDB.dwnd.w-2-len)/2;
     InputBoxDB.ctl[0].dwnd.w = strlen(msg);
         max(20, max(len, max((int)strlen(ttl), (int)strlen(msg))));
     InputBoxDB.ctl[1].dwnd.x = (InputBoxDB.dwnd.w-2-len)/2;
     InputBoxDB.ctl[0].dwnd.w = strlen(msg);
index e22842d..7f6b1b6 100644 (file)
@@ -74,7 +74,7 @@ static int FindVector(DFWINDOW wnd, DFRECT rc, int x, int y)
                         coll = 0;
                     else if (rc.lf+x == rcc.rt)
                         coll = 2;
                         coll = 0;
                     else if (rc.lf+x == rcc.rt)
                         coll = 2;
-                    else 
+                    else
                         coll = 1;
                 }
             }
                         coll = 1;
                 }
             }
@@ -88,7 +88,7 @@ static int FindVector(DFWINDOW wnd, DFRECT rc, int x, int y)
                         coll = 0;
                     else if (rc.tp+y == rcc.bt)
                         coll = 2;
                         coll = 0;
                     else if (rc.tp+y == rcc.bt)
                         coll = 2;
-                    else 
+                    else
                         coll = 1;
                 }
             }
                         coll = 1;
                 }
             }
index 2ea8b22..d77e7b4 100644 (file)
@@ -228,7 +228,7 @@ static BOOL KeyboardMsg(DFWINDOW wnd, PARAM p1, PARAM p2)
         case F1:
             if (ActivePopDown == NULL)
                 DfSendMessage(GetParent(wnd), KEYBOARD, p1, p2);
         case F1:
             if (ActivePopDown == NULL)
                 DfSendMessage(GetParent(wnd), KEYBOARD, p1, p2);
-            else 
+            else
                 DisplayHelp(wnd,
                     (ActivePopDown+wnd->selection)->help);
             return TRUE;
                 DisplayHelp(wnd,
                     (ActivePopDown+wnd->selection)->help);
             return TRUE;
index 1616ca6..10ec4fd 100644 (file)
@@ -14,7 +14,7 @@ int StatusBarProc(DFWINDOW wnd, DFMESSAGE msg, PARAM p1, PARAM p2)
                        if ((int)p1 == CTRL_F4)
                                return TRUE;
                        break;
                        if ((int)p1 == CTRL_F4)
                                return TRUE;
                        break;
-               case PAINT:     
+               case PAINT:
                        if (!isVisible(wnd))
                                break;
                        statusbar = DFcalloc(1, WindowWidth(wnd)+1);
                        if (!isVisible(wnd))
                                break;
                        statusbar = DFcalloc(1, WindowWidth(wnd)+1);
index 5e5143d..08b56c3 100644 (file)
@@ -8,7 +8,7 @@ int TestCriticalError(void)
 /* These are functions that are supposed to be part of the application
  * not part of the dflat32.dll
  *
 /* These are functions that are supposed to be part of the application
  * not part of the dflat32.dll
  *
- * - Fixme 
+ * - Fixme
  */
 
 char DFlatApplication[] = "none";   //edit.c
  */
 
 char DFlatApplication[] = "none";   //edit.c
index d41aaee..fb97e41 100644 (file)
@@ -45,7 +45,7 @@ void BuildSystemMenu(DFWINDOW wnd)
        int lf, tp, ht, wd;
     DFWINDOW SystemMenuWnd;
 
        int lf, tp, ht, wd;
     DFWINDOW SystemMenuWnd;
 
-    SystemMenu.PullDown[0].Selections[6].Accelerator = 
+    SystemMenu.PullDown[0].Selections[6].Accelerator =
         (GetClass(wnd) == APPLICATION) ? ALT_F4 : CTRL_F4;
 
     lf = GetLeft(wnd)+1;
         (GetClass(wnd) == APPLICATION) ? ALT_F4 : CTRL_F4;
 
     lf = GetLeft(wnd)+1;
index 0019175..9a4a370 100644 (file)
@@ -1,16 +1,16 @@
 /* This is the configuration file for the Midnight Commander. It was generated
    by autoconf's configure.
 /* This is the configuration file for the Midnight Commander. It was generated
    by autoconf's configure.
-   
+
    Configure for Midnight Commander
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1994, 1995 Miguel de Icaza
    Copyright (C) 1995 Jakub Jelinek
    Configure for Midnight Commander
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1994, 1995 Miguel de Icaza
    Copyright (C) 1995 Jakub Jelinek
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -19,7 +19,7 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
-   
+
 #include <VERSION>
 
 
 #include <VERSION>
 
 
@@ -78,7 +78,7 @@
 #undef HAVE_SUBSHELL_SUPPORT
 
 /* If you don't have gcc, define this */
 #undef HAVE_SUBSHELL_SUPPORT
 
 /* If you don't have gcc, define this */
-#undef OLD_TOOLS 
+#undef OLD_TOOLS
 
 /* Are you using other type of curses? */
 #undef OTHER_CURSES
 
 /* Are you using other type of curses? */
 #undef OTHER_CURSES
 #undef USE_NETCODE
 
 /* If defined, use .netrc for FTP connections */
 #undef USE_NETCODE
 
 /* If defined, use .netrc for FTP connections */
-#undef USE_NETRC 
+#undef USE_NETRC
 
 /* If your operating system does not have enough space for a file name
  * in a struct dirent, then define this
 
 /* If your operating system does not have enough space for a file name
  * in a struct dirent, then define this
index d8cf12e..4cfd30f 100644 (file)
@@ -2,17 +2,17 @@
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
 /* This is the configuration file for the Midnight Commander. It was generated
    by autoconf's configure.
 /* config.h.in.  Generated automatically from configure.in by autoheader.  */
 /* This is the configuration file for the Midnight Commander. It was generated
    by autoconf's configure.
-   
+
    Configure for Midnight Commander
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1994, 1995 Miguel de Icaza
    Copyright (C) 1995 Jakub Jelinek
    Configure for Midnight Commander
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1994, 1995 Miguel de Icaza
    Copyright (C) 1995 Jakub Jelinek
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -21,7 +21,7 @@
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
-   
+
 #include <VERSION>
 
 
 #include <VERSION>
 
 
 #define HAVE_SUBSHELL_SUPPORT 1
 
 /* If you don't have gcc, define this */
 #define HAVE_SUBSHELL_SUPPORT 1
 
 /* If you don't have gcc, define this */
-/* #undef OLD_TOOLS */ 
+/* #undef OLD_TOOLS */
 
 /* Is the subshell the default or optional? */
 /* #undef SUBSHELL_OPTIONAL */
 
 /* Is the subshell the default or optional? */
 /* #undef SUBSHELL_OPTIONAL */
 #define USE_NETCODE 1
 
 /* If defined, use .netrc for FTP connections */
 #define USE_NETCODE 1
 
 /* If defined, use .netrc for FTP connections */
-/* #undef USE_NETRC */ 
+/* #undef USE_NETRC */
 
 /* If your operating system does not have enough space for a file name
  * in a struct dirent, then define this
 
 /* If your operating system does not have enough space for a file name
  * in a struct dirent, then define this
index f5dbb4e..4d65551 100644 (file)
@@ -1,14 +1,14 @@
 /* editor low level data handling and cursor fundamentals.
 
    Copyright (C) 1996, 1997 the Free Software Foundation
 /* editor low level data handling and cursor fundamentals.
 
    Copyright (C) 1996, 1997 the Free Software Foundation
-   
+
    Authors: 1996, 1997 Paul Sheer
 
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    Authors: 1996, 1997 Paul Sheer
 
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -36,9 +36,9 @@
 /*
  *
  * here's a quick sketch of the layout: (don't run this through indent.)
 /*
  *
  * here's a quick sketch of the layout: (don't run this through indent.)
- * 
+ *
  * (b1 is buffers1 and b2 is buffers2)
  * (b1 is buffers1 and b2 is buffers2)
- * 
+ *
  *                                       |
  * \0\0\0\0\0m e _ f i l e . \nf i n . \n|T h i s _ i s _ s o\0\0\0\0\0\0\0\0\0
  * ______________________________________|______________________________________
  *                                       |
  * \0\0\0\0\0m e _ f i l e . \nf i n . \n|T h i s _ i s _ s o\0\0\0\0\0\0\0\0\0
  * ______________________________________|______________________________________
@@ -55,7 +55,7 @@
  *                              file end|||file beginning
  *                                       |
  *                                       |
  *                              file end|||file beginning
  *                                       |
  *                                       |
- * 
+ *
  *           _
  * This_is_some_file
  * fin.
  *           _
  * This_is_some_file
  * fin.
@@ -100,14 +100,14 @@ char *edit_get_buffer_as_text (WEdit * e)
 /* cursor set to start of file */
 int init_dynamic_edit_buffers (WEdit * edit, const char *filename, const char *text)
 {
 /* cursor set to start of file */
 int init_dynamic_edit_buffers (WEdit * edit, const char *filename, const char *text)
 {
+
 #if defined CR_LF_TRANSLATION
     /* Variables needed for safe handling of Translation from Microsoft CR/LF EOL to
        Unix Style LF EOL - Franco */
     long bytes_wanted,bytes_read,bytes_missing;
     char *p;
 #endif
 #if defined CR_LF_TRANSLATION
     /* Variables needed for safe handling of Translation from Microsoft CR/LF EOL to
        Unix Style LF EOL - Franco */
     long bytes_wanted,bytes_read,bytes_missing;
     char *p;
 #endif
+
     long buf;
     int j, file = 0, buf2;
 
     long buf;
     int j, file = 0, buf2;
 
@@ -129,15 +129,15 @@ int init_dynamic_edit_buffers (WEdit * edit, const char *filename, const char *t
     edit->buffers2[buf2] = CMalloc (EDIT_BUF_SIZE);
 
 /*
     edit->buffers2[buf2] = CMalloc (EDIT_BUF_SIZE);
 
 /*
-_read returns the number of bytes read, 
-which may be less than count if there are fewer than count bytes left in the file 
-or if the file was opened in text mode, 
-in which case each carriage return\96linefeed (CR-LF) pair is replaced 
-with a single linefeed character. Only the single linefeed character is counted 
+_read returns the number of bytes read,
+which may be less than count if there are fewer than count bytes left in the file
+or if the file was opened in text mode,
+in which case each carriage return\96linefeed (CR-LF) pair is replaced
+with a single linefeed character. Only the single linefeed character is counted
 in the return value. The replacement does not affect the file pointer.
 
 in the return value. The replacement does not affect the file pointer.
 
-_eof returns 1 if the current position is end of file, or 0 if it is not. 
-A return value of -1 indicates an error; in this case, errno is set to EBADF, 
+_eof returns 1 if the current position is end of file, or 0 if it is not.
+A return value of -1 indicates an error; in this case, errno is set to EBADF,
 which indicates an invalid file handle.
 */
     if (filename){
 which indicates an invalid file handle.
 */
     if (filename){
@@ -381,7 +381,7 @@ int edit_renew (WEdit * edit)
        dir = strdup (edit->dir);
     else
        dir = 0;
        dir = strdup (edit->dir);
     else
        dir = 0;
-    
+
     edit_clean (edit);
     if (!edit_init (edit, lines, columns, 0, "", dir, 0))
        return 0;
     edit_clean (edit);
     if (!edit_init (edit, lines, columns, 0, "", dir, 0))
        return 0;
@@ -1163,7 +1163,7 @@ int line_is_blank (WEdit * edit, long line)
     return is_blank (edit, p);
 }
 
     return is_blank (edit, p);
 }
 
-/* moves up until a blank line is reached, or until just 
+/* moves up until a blank line is reached, or until just
    before a non-blank line is reached */
 static void edit_move_up_paragraph (WEdit * edit, int scroll)
 {
    before a non-blank line is reached */
 static void edit_move_up_paragraph (WEdit * edit, int scroll)
 {
@@ -1638,7 +1638,7 @@ static void edit_tab_cmd (WEdit * edit)
     if (option_fake_half_tabs) {
        if (is_in_indent (edit)) {
            /*insert a half tab (usually four spaces) unless there is a
     if (option_fake_half_tabs) {
        if (is_in_indent (edit)) {
            /*insert a half tab (usually four spaces) unless there is a
-              half tab already behind, then delete it and insert a 
+              half tab already behind, then delete it and insert a
               full tab. */
            if (right_of_four_spaces (edit)) {
                for (i = 1; i <= HALF_TAB_SIZE; i++)
               full tab. */
            if (right_of_four_spaces (edit)) {
                for (i = 1; i <= HALF_TAB_SIZE; i++)
@@ -1811,7 +1811,7 @@ void edit_set_user_command (void (*func) (WEdit *, int))
 
 void edit_mail_dialog (WEdit * edit);
 
 
 void edit_mail_dialog (WEdit * edit);
 
-/* 
+/*
    This executes a command at a lower level than macro recording.
    It also does not push a key_press onto the undo stack. This means
    that if it is called many times, a single undo command will undo
    This executes a command at a lower level than macro recording.
    It also does not push a key_press onto the undo stack. This means
    that if it is called many times, a single undo command will undo
index 5f965c5..0bdfc81 100644 (file)
 #    include "../src/tty.h"
 #    include <sys/stat.h>
 #    include <errno.h>
 #    include "../src/tty.h"
 #    include <sys/stat.h>
 #    include <errno.h>
-     
+
 #    ifdef HAVE_FCNTL_H
 #        include <fcntl.h>
 #    endif
 #    ifdef HAVE_FCNTL_H
 #        include <fcntl.h>
 #    endif
-     
+
 #    include <stdlib.h>
 #    include <malloc.h>
 
 #    include <stdlib.h>
 #    include <malloc.h>
 
 #    include <stdio.h>
 #    include <stdarg.h>
 #    include <sys/types.h>
 #    include <stdio.h>
 #    include <stdarg.h>
 #    include <sys/types.h>
-     
+
 #       ifdef HAVE_UNISTD_H
 #           include <unistd.h>
 #       endif
 #       ifdef HAVE_UNISTD_H
 #           include <unistd.h>
 #       endif
-     
+
 #    include <my_string.h>
 #    include <sys/stat.h>
 #    include <my_string.h>
 #    include <sys/stat.h>
-     
+
 #    ifdef HAVE_FCNTL_H
 #       include <fcntl.h>
 #    endif
 #    ifdef HAVE_FCNTL_H
 #       include <fcntl.h>
 #    endif
-     
+
 #    include <stdlib.h>
 #    include <stdarg.h>
 
 #    include <stdlib.h>
 #    include <stdarg.h>
 
@@ -56,7 +56,7 @@
 #           include <time.h>
 #       endif
 #    endif
 #           include <time.h>
 #       endif
 #    endif
+
 #    include "regex.h"
 
 #endif
 #    include "regex.h"
 
 #endif
@@ -91,7 +91,7 @@
 #    include "../src/menu.h"
 #    include "../src/regex.h"
 #    define WANT_WIDGETS
 #    include "../src/menu.h"
 #    include "../src/regex.h"
 #    define WANT_WIDGETS
-     
+
 #    define WIDGET_COMMAND (WIDGET_USER + 10)
 #    define N_menus 5
 
 #    define WIDGET_COMMAND (WIDGET_USER + 10)
 #    define N_menus 5
 
@@ -282,9 +282,9 @@ struct editor_widget {
                                   deleted at all since last load or save */
 #ifdef MIDNIGHT
     int delete_file;                   /* has the file been created in edit_load_file? Delete
                                   deleted at all since last load or save */
 #ifdef MIDNIGHT
     int delete_file;                   /* has the file been created in edit_load_file? Delete
-                                  it at end of editing when it hasn't been modified 
+                                  it at end of editing when it hasn't been modified
                                   or saved */
                                   or saved */
-#endif                            
+#endif
     unsigned char highlight;
     long prev_col;             /*recent column position of the curser - used when moving
                                   up or down past lines that are shorter than the current line */
     unsigned char highlight;
     long prev_col;             /*recent column position of the curser - used when moving
                                   up or down past lines that are shorter than the current line */
@@ -463,7 +463,7 @@ void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg);
 
 #    define FONT_PIX_PER_LINE 1
 #    define FONT_MEAN_WIDTH 1
 
 #    define FONT_PIX_PER_LINE 1
 #    define FONT_MEAN_WIDTH 1
-     
+
 #    define get_sys_error(s) (s)
 #    define open mc_open
 #    define close(f) mc_close(f)
 #    define get_sys_error(s) (s)
 #    define open mc_open
 #    define close(f) mc_close(f)
@@ -476,7 +476,7 @@ void edit_get_syntax_color (WEdit * edit, long byte_index, int *fg, int *bg);
 #    define edit_get_load_file(d,f,h) input_dialog (h, _(" Enter file name: "), f)
 #    define edit_get_save_file(d,f,h) input_dialog (h, _(" Enter file name: "), f)
 #    define CMalloc(x) malloc(x)
 #    define edit_get_load_file(d,f,h) input_dialog (h, _(" Enter file name: "), f)
 #    define edit_get_save_file(d,f,h) input_dialog (h, _(" Enter file name: "), f)
 #    define CMalloc(x) malloc(x)
-     
+
 #    define set_error_msg(s) edit_init_error_msg = strdup(s)
 
 #    ifdef _EDIT_C
 #    define set_error_msg(s) edit_init_error_msg = strdup(s)
 
 #    ifdef _EDIT_C
@@ -502,7 +502,7 @@ extern char *edit_init_error_msg;
 
 #    define MY_O_TEXT 0
 #    define WIN_MESSAGES edit->widget->mainid, 20, 20
 
 #    define MY_O_TEXT 0
 #    define WIN_MESSAGES edit->widget->mainid, 20, 20
-     
+
 #    define edit_get_load_file(d,f,h) CGetLoadFile(WIN_MESSAGES,d,f,h)
 #    define edit_get_save_file(d,f,h) CGetSaveFile(WIN_MESSAGES,d,f,h)
 #    define edit_error_dialog(h,t) CErrorDialog(WIN_MESSAGES,h,"%s",t)
 #    define edit_get_load_file(d,f,h) CGetLoadFile(WIN_MESSAGES,d,f,h)
 #    define edit_get_save_file(d,f,h) CGetSaveFile(WIN_MESSAGES,d,f,h)
 #    define edit_error_dialog(h,t) CErrorDialog(WIN_MESSAGES,h,"%s",t)
index 068a21a..4fffa30 100644 (file)
@@ -97,7 +97,7 @@
      KEY_F (17), CK_Find_Again,
      ALT ('<'), CK_Beginning_Of_Text,
      ALT ('>'), CK_End_Of_Text,
      KEY_F (17), CK_Find_Again,
      ALT ('<'), CK_Beginning_Of_Text,
      ALT ('>'), CK_End_Of_Text,
-     
+
      0, 0};
 
     static long key_pad_map[10] =
      0, 0};
 
     static long key_pad_map[10] =
        goto fin;
 
 /* Function still not found for this key, so try macro's */
        goto fin;
 
 /* Function still not found for this key, so try macro's */
-/* This allows the same macro to be 
+/* This allows the same macro to be
    enabled by either eg "ALT('f')" or "XCTRL('f')" or "XCTRL('a'), 'f'" */
 
 /* key.h: #define ALT(x) (0x200 | (x)) */
    enabled by either eg "ALT('f')" or "XCTRL('f')" or "XCTRL('a'), 'f'" */
 
 /* key.h: #define ALT(x) (0x200 | (x)) */
index 7e846ad..7e8c372 100644 (file)
@@ -410,8 +410,8 @@ int edit_save_as_cmd (WEdit * edit)
                different_filename = 1;
                if ((file = open ((char *) exp, O_RDONLY)) != -1) {     /* the file exists */
                    close (file);
                different_filename = 1;
                if ((file = open ((char *) exp, O_RDONLY)) != -1) {     /* the file exists */
                    close (file);
-                   if (edit_query_dialog2 (_(" Warning "), 
-                   _(" A file already exists with this name. "), 
+                   if (edit_query_dialog2 (_(" Warning "),
+                   _(" A file already exists with this name. "),
 /* Push buttons to over-write the current file, or cancel the operation */
                    _("Overwrite"), _("Cancel")))
                        return 0;
 /* Push buttons to over-write the current file, or cancel the operation */
                    _("Overwrite"), _("Cancel")))
                        return 0;
@@ -423,7 +423,7 @@ int edit_save_as_cmd (WEdit * edit)
                edit->modified = 0;
 #ifdef MIDNIGHT
                edit->delete_file = 0;
                edit->modified = 0;
 #ifdef MIDNIGHT
                edit->delete_file = 0;
-#endif         
+#endif
                if (different_filename && !edit->explicit_syntax)
                    edit_load_syntax (edit, 0, 0);
                return 1;
                if (different_filename && !edit->explicit_syntax)
                    edit_load_syntax (edit, 0, 0);
                return 1;
@@ -462,7 +462,7 @@ int raw_callback (struct Dlg_head *h, int key, int Msg)
 }
 
 /* gets a raw key from the keyboard. Passing cancel = 1 draws
 }
 
 /* gets a raw key from the keyboard. Passing cancel = 1 draws
-   a cancel button thus allowing c-c etc.. Alternatively, cancel = 0 
+   a cancel button thus allowing c-c etc.. Alternatively, cancel = 0
    will return the next key pressed */
 int edit_raw_key_query (char *heading, char *query, int cancel)
 {
    will return the next key pressed */
 int edit_raw_key_query (char *heading, char *query, int cancel)
 {
@@ -624,7 +624,7 @@ void edit_delete_macro_cmd (WEdit * edit)
     command = CK_Macro (edit_raw_key_query (_(" Delete Macro "), _(" Press macro hotkey: "), 1));
 #else
 /* This heads the 'Delete Macro' dialog box */
     command = CK_Macro (edit_raw_key_query (_(" Delete Macro "), _(" Press macro hotkey: "), 1));
 #else
 /* This heads the 'Delete Macro' dialog box */
-    command = CK_Macro (CKeySymMod (CRawkeyQuery (0, 0, 0, _(" Delete Macro "), 
+    command = CK_Macro (CKeySymMod (CRawkeyQuery (0, 0, 0, _(" Delete Macro "),
 /* Input line for a single key press follows the ':' */
     _(" Press macro hotkey: "))));
 #endif
 /* Input line for a single key press follows the ':' */
     _(" Press macro hotkey: "))));
 #endif
@@ -708,7 +708,7 @@ int edit_save_cmd (WEdit * edit)
     edit->modified = 0;
 #ifdef MIDNIGHT
     edit->delete_file = 0;
     edit->modified = 0;
 #ifdef MIDNIGHT
     edit->delete_file = 0;
-#endif         
+#endif
 
     return 1;
 }
 
     return 1;
 }
@@ -850,7 +850,7 @@ void edit_block_move_cmd (WEdit * edit)
     }
     edit_scroll_screen_over_cursor (edit);
 
     }
     edit_scroll_screen_over_cursor (edit);
 
-    edit_cursor_move (edit, current - edit->curs1 
+    edit_cursor_move (edit, current - edit->curs1
        - (((current - edit->curs1) > 0) ? end_mark - start_mark : 0));
     edit_scroll_screen_over_cursor (edit);
 
        - (((current - edit->curs1) > 0) ? end_mark - start_mark : 0));
     edit_scroll_screen_over_cursor (edit);
 
@@ -1011,7 +1011,7 @@ void edit_replace_dialog (WEdit * edit, char **search_text, char **replace_text,
         0, 0, XV_WLAY_DONTCARE, NULL},
        {quick_checkbox, 25, 50, 9, REPLACE_DLG_HEIGHT, "Pr&ompt on replace", 0, 0,
         0, 0, XV_WLAY_DONTCARE, NULL},
         0, 0, XV_WLAY_DONTCARE, NULL},
        {quick_checkbox, 25, 50, 9, REPLACE_DLG_HEIGHT, "Pr&ompt on replace", 0, 0,
         0, 0, XV_WLAY_DONTCARE, NULL},
-       {quick_checkbox, 4, 50, 11, REPLACE_DLG_HEIGHT, "&Backwards", 0, 0, 
+       {quick_checkbox, 4, 50, 11, REPLACE_DLG_HEIGHT, "&Backwards", 0, 0,
         0, 0, XV_WLAY_DONTCARE, NULL},
        {quick_checkbox, 4, 50, 10, REPLACE_DLG_HEIGHT, "&Regular exprssn", 0, 0,
         0, 0, XV_WLAY_DONTCARE, NULL},
         0, 0, XV_WLAY_DONTCARE, NULL},
        {quick_checkbox, 4, 50, 10, REPLACE_DLG_HEIGHT, "&Regular exprssn", 0, 0,
         0, 0, XV_WLAY_DONTCARE, NULL},
@@ -1314,9 +1314,9 @@ int edit_replace_prompt (WEdit * edit, char *replace_text, int xpos, int ypos)
            p++;
        }
        edit->force |= REDRAW_COMPLETELY;
            p++;
        }
        edit->force |= REDRAW_COMPLETELY;
-       q = edit_query_dialog4 (_(" Replace "), 
+       q = edit_query_dialog4 (_(" Replace "),
 /* This is for the confirm replace dialog box. The replaced string comes after the ':' */
 /* This is for the confirm replace dialog box. The replaced string comes after the ':' */
-       catstrs (_(" Replace with: "), r, 0), 
+       catstrs (_(" Replace with: "), r, 0),
 /* Buttons for the confirm replace dialog box. */
        _("Replace"), _("Skip"), _("Replace all"), _("Cancel"));
        if (r)
 /* Buttons for the confirm replace dialog box. */
        _("Replace"), _("Skip"), _("Replace all"), _("Cancel"));
        if (r)
@@ -1457,7 +1457,7 @@ long edit_find_string (long start, unsigned char *exp, int *len, long last_byte,
            }
        } else {        /* regexp matching */
            long offset = 0;
            }
        } else {        /* regexp matching */
            long offset = 0;
-           int found_start, match_bol, move_win = 0; 
+           int found_start, match_bol, move_win = 0;
 
            while (start + offset < last_byte) {
                match_bol = (offset == 0 || (*get_byte) (data, start + offset - 1) == '\n');
 
            while (start + offset < last_byte) {
                match_bol = (offset == 0 || (*get_byte) (data, start + offset - 1) == '\n');
@@ -1846,7 +1846,7 @@ void edit_replace_cmd (WEdit * edit, int again)
                        while (repl_str[++i])
                            edit_insert (edit, repl_str[i]);
                    } else {
                        while (repl_str[++i])
                            edit_insert (edit, repl_str[i]);
                    } else {
-                       edit_error_dialog (_(" Replace "), 
+                       edit_error_dialog (_(" Replace "),
 /* "Invalid regexp string or scanf string" */
                        _(" Error in replacement format string. "));
                        replace_continue = 0;
 /* "Invalid regexp string or scanf string" */
                        _(" Error in replacement format string. "));
                        replace_continue = 0;
@@ -1988,7 +1988,7 @@ void edit_quit_cmd (WEdit * edit)
        case -1:
            return;
        }
        case -1:
            return;
        }
-    } 
+    }
 #ifdef MIDNIGHT
     else if (edit->delete_file)
        unlink (catstrs (edit->dir, edit->filename, 0));
 #ifdef MIDNIGHT
     else if (edit->delete_file)
        unlink (catstrs (edit->dir, edit->filename, 0));
@@ -2340,7 +2340,7 @@ int edit_sort_cmd (WEdit * edit)
 
     exp = old ? old : "";
 
 
     exp = old ? old : "";
 
-    exp = input_dialog (_(" Run Sort "), 
+    exp = input_dialog (_(" Run Sort "),
 /* Not essential to translate */
     _(" Enter sort options (see manpage) separated by whitespace: "), "");
 
 /* Not essential to translate */
     _(" Enter sort options (see manpage) separated by whitespace: "), "");
 
@@ -2353,13 +2353,13 @@ int edit_sort_cmd (WEdit * edit)
     e = system (catstrs (" sort ", exp, " ", home_dir, BLOCK_FILE, " > ", home_dir, TEMP_FILE, 0));
     if (e) {
        if (e == -1 || e == 127) {
     e = system (catstrs (" sort ", exp, " ", home_dir, BLOCK_FILE, " > ", home_dir, TEMP_FILE, 0));
     if (e) {
        if (e == -1 || e == 127) {
-           edit_error_dialog (_(" Sort "), 
+           edit_error_dialog (_(" Sort "),
 /* Not essential to translate */
            get_sys_error (_(" Error trying to execute sort command ")));
        } else {
            char q[8];
            sprintf (q, "%d ", e);
 /* Not essential to translate */
            get_sys_error (_(" Error trying to execute sort command ")));
        } else {
            char q[8];
            sprintf (q, "%d ", e);
-           edit_error_dialog (_(" Sort "), 
+           edit_error_dialog (_(" Sort "),
 /* Not essential to translate */
            catstrs (_(" Sort returned non-zero: "), q, 0));
        }
 /* Not essential to translate */
            catstrs (_(" Sort returned non-zero: "), q, 0));
        }
@@ -2385,7 +2385,7 @@ void edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block)
 
     if (block) {
        if (eval_marks (edit, &start_mark, &end_mark)) {
 
     if (block) {
        if (eval_marks (edit, &start_mark, &end_mark)) {
-           edit_error_dialog (_(" Process block "), 
+           edit_error_dialog (_(" Process block "),
 /* Not essential to translate */
                _(" You must first highlight a block of text. "));
            return;
 /* Not essential to translate */
                _(" You must first highlight a block of text. "));
            return;
@@ -2415,7 +2415,7 @@ void edit_block_process_cmd (WEdit * edit, const char *shell_cmd, int block)
            }
        } else {
 /* Not essential to translate */
            }
        } else {
 /* Not essential to translate */
-           edit_error_dialog (_(" Process block "), 
+           edit_error_dialog (_(" Process block "),
 /* Not essential to translate */
            get_sys_error (_(" Error trying to stat file ")));
            return;
 /* Not essential to translate */
            get_sys_error (_(" Error trying to stat file ")));
            return;
index 4936b6b..c563912 100644 (file)
@@ -96,7 +96,7 @@ void edit_status (WEdit * edit)
 extern int fixed_font;
 
 void rerender_text (CWidget * wdt);
 extern int fixed_font;
 
 void rerender_text (CWidget * wdt);
-    
+
 void edit_status (WEdit * edit)
 {
     if ((edit->widget->options & EDITOR_NO_TEXT)) {
 void edit_status (WEdit * edit)
 {
     if ((edit->widget->options & EDITOR_NO_TEXT)) {
@@ -603,7 +603,7 @@ void edit_render (WEdit * edit, int page, int row_start, int col_start, int row_
 #endif
 
     render_edit_text (edit, row_start, col_start, row_end, col_end);
 #endif
 
     render_edit_text (edit, row_start, col_start, row_end, col_end);
-    if (edit->force)           /* edit->force != 0 means a key was pending and the redraw 
+    if (edit->force)           /* edit->force != 0 means a key was pending and the redraw
                                   was halted, so next time we must redraw everything in case stuff
                                   was left undrawn from a previous key press */
        edit->force |= REDRAW_PAGE;
                                   was halted, so next time we must redraw everything in case stuff
                                   was left undrawn from a previous key press */
        edit->force |= REDRAW_PAGE;
index ffaf156..9605507 100644 (file)
@@ -36,7 +36,7 @@ extern WMenu *edit_menubar;
 
 #undef edit_message_dialog
 #define edit_message_dialog(w,x,y,h,s) query_dialog (h, s, 0, 1, "&Ok")
 
 #undef edit_message_dialog
 #define edit_message_dialog(w,x,y,h,s) query_dialog (h, s, 0, 1, "&Ok")
-#define CFocus(x) 
+#define CFocus(x)
 
 static void menu_cmd (int i)
 {
 
 static void menu_cmd (int i)
 {
@@ -53,7 +53,7 @@ void edit_wrap_cmd ()
     char *f;
     char s[12];
     sprintf (s, "%d", option_word_wrap_line_length);
     char *f;
     char s[12];
     sprintf (s, "%d", option_word_wrap_line_length);
-    f = input_dialog (_(" Word wrap "), 
+    f = input_dialog (_(" Word wrap "),
 /* Not essential to translate */
     _(" Enter line length, 0 for off: "), s);
     if (f) {
 /* Not essential to translate */
     _(" Enter line length, 0 for off: "), s);
     if (f) {
index b5d2e90..f959796 100644 (file)
@@ -411,7 +411,7 @@ void link_hscrollbar_to_editor (CWidget * scrollbar, CWidget * editor, XEvent *
     }
 }
 
     }
 }
 
-/* 
+/*
    This section comes from rxvt-2.21b1/src/screen.c by
    Robert Nation <nation@rocket.sanders.lockheed.com> &
    mods by mj olesen <olesen@me.QueensU.CA>
    This section comes from rxvt-2.21b1/src/screen.c by
    Robert Nation <nation@rocket.sanders.lockheed.com> &
    mods by mj olesen <olesen@me.QueensU.CA>
index af958bb..3b0fda3 100644 (file)
@@ -1054,7 +1054,7 @@ void edit_free_syntax_rules (WEdit * edit)
 
 #define CURRENT_SYNTAX_RULES_VERSION "22"
 
 
 #define CURRENT_SYNTAX_RULES_VERSION "22"
 
-char *syntax_text = 
+char *syntax_text =
 "# syntax rules version " CURRENT_SYNTAX_RULES_VERSION "\n"
 "# Allowable colors for mc are\n"
 "# (after the slash is a Cooledit color, 0-26 or any of the X colors in rgb.txt)\n"
 "# syntax rules version " CURRENT_SYNTAX_RULES_VERSION "\n"
 "# Allowable colors for mc are\n"
 "# (after the slash is a Cooledit color, 0-26 or any of the X colors in rgb.txt)\n"
index 5b147d8..d3ce53f 100644 (file)
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -133,8 +133,8 @@ static void strip_newlines (char *t, int size)
 #ifndef MIDNIGHT
 int edit_width_of_long_printable (int c);
 #endif
 #ifndef MIDNIGHT
 int edit_width_of_long_printable (int c);
 #endif
-/* 
-   This is a copy of the function 
+/*
+   This is a copy of the function
    int calc_text_pos (WEdit * edit, long b, long *q, int l)
    in propfont.c  :(
    It calculates the number of chars in a line specified to length l in pixels
    int calc_text_pos (WEdit * edit, long b, long *q, int l)
    in propfont.c  :(
    It calculates the number of chars in a line specified to length l in pixels
@@ -228,8 +228,8 @@ static void format_this (char *t, int size, int indent)
            break;
        p = word_start (t, q, size);
        if (p == -1)
            break;
        p = word_start (t, q, size);
        if (p == -1)
-           q = next_word_start (t, q, size);   /* Return the end of the word if the beginning 
-                                                  of the word is at the beginning of a line 
+           q = next_word_start (t, q, size);   /* Return the end of the word if the beginning
+                                                  of the word is at the beginning of a line
                                                   (i.e. a very long word) */
        else
            q = p;
                                                   (i.e. a very long word) */
        else
            q = p;
index cfaa777..403b3b4 100644 (file)
@@ -103,7 +103,7 @@ struct {
     WCheck      *check;
 } check_perm[PERMISSIONS] = {
 
     WCheck      *check;
 } check_perm[PERMISSIONS] = {
 
-    {  
+    {
        FILE_ARCHIVED, N_("Archive"), 0, 0,
     },
     {
        FILE_ARCHIVED, N_("Archive"), 0, 0,
     },
     {
@@ -245,7 +245,7 @@ static void init_chmod (void)
 
     ch_dlg = create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
                         chmod_callback, _("[Chmod]"), _("chmod"), DLG_CENTER);
 
     ch_dlg = create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
                         chmod_callback, _("[Chmod]"), _("chmod"), DLG_CENTER);
-                       
+
     x_set_dialog_title (ch_dlg, _("Chmod command"));
 
 #define XTRACT(i) BY+chmod_but[i].y-single_set, BX+chmod_but[i].x, \
     x_set_dialog_title (ch_dlg, _("Chmod command"));
 
 #define XTRACT(i) BY+chmod_but[i].y-single_set, BX+chmod_but[i].x, \
@@ -430,9 +430,9 @@ void chmod_cmd (void)
        statl = label_new (FY+4, FX+2, buffer, NULL);
        add_widget (ch_dlg, statl);
        tk_end_frame ();
        statl = label_new (FY+4, FX+2, buffer, NULL);
        add_widget (ch_dlg, statl);
        tk_end_frame ();
-       
+
        run_dlg (ch_dlg);       /* retrieve an action */
        run_dlg (ch_dlg);       /* retrieve an action */
-       
+
        /* do action */
        switch (ch_dlg->ret_value){
        case B_ENTER:
        /* do action */
        switch (ch_dlg->ret_value){
        case B_ENTER:
@@ -440,11 +440,11 @@ void chmod_cmd (void)
                mk_chmod (fname, c_stat);  /*.ado */
            need_update = 1;
            break;
                mk_chmod (fname, c_stat);  /*.ado */
            need_update = 1;
            break;
-       
+
        case B_CANCEL:
            end_chmod = 1;
            break;
        case B_CANCEL:
            end_chmod = 1;
            break;
-       
+
        case B_ALL:
        case B_MARKED:
            and_mask = or_mask = 0;
        case B_ALL:
        case B_MARKED:
            and_mask = or_mask = 0;
@@ -460,7 +460,7 @@ void chmod_cmd (void)
 
            apply_mask (sf_stat);
            break;
 
            apply_mask (sf_stat);
            break;
-       
+
        case B_SETMRK:
            and_mask = or_mask = 0;
            and_mask = ~and_mask;
        case B_SETMRK:
            and_mask = or_mask = 0;
            and_mask = ~and_mask;
index 93276d1..d512943 100644 (file)
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
  ----------------------------------------------------------------------------
  Changes:
 
  ----------------------------------------------------------------------------
  Changes:
index 1d18d70..e23e564 100644 (file)
@@ -1,12 +1,12 @@
 /* Client interface for General purpose Win32 console save/restore server
    Having the same interface as its Linux counterpart:
 /* Client interface for General purpose Win32 console save/restore server
    Having the same interface as its Linux counterpart:
-       Copyright (C) 1994 Janne Kukonlehto <jtklehto@stekt.oulu.fi> 
-   
+       Copyright (C) 1994 Janne Kukonlehto <jtklehto@stekt.oulu.fi>
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -14,8 +14,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
-   
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
    Note:
        show_console_contents doesn't know how to write to its window
        the rest works fine.
    Note:
        show_console_contents doesn't know how to write to its window
        the rest works fine.
@@ -39,7 +39,7 @@ void show_console_contents (int starty, unsigned char begin_line,
        unsigned char end_line)
 {
     COORD c0 = { 0, 0 };
        unsigned char end_line)
 {
     COORD c0 = { 0, 0 };
-    COORD csize; 
+    COORD csize;
     SMALL_RECT rect;
     CHAR_INFO *pchar;
 
     SMALL_RECT rect;
     CHAR_INFO *pchar;
 
@@ -58,7 +58,7 @@ void show_console_contents (int starty, unsigned char begin_line,
     /* FIXME: this should've work,
        but refresh() is called after this write :-( */
     win32APICALL(WriteConsoleOutput (hNew, pchar, csize, c0, &rect));
     /* FIXME: this should've work,
        but refresh() is called after this write :-( */
     win32APICALL(WriteConsoleOutput (hNew, pchar, csize, c0, &rect));
-    
+
     free (pchar);
 }
 
     free (pchar);
 }
 
index 09cd121..4658743 100644 (file)
@@ -1,13 +1,13 @@
 /* Client interface for General purpose OS/2 console save/restore server.
         1997 Alexander Dong <ado@software-ag.de>
    Having the same interface as its Linux counterpart:
 /* Client interface for General purpose OS/2 console save/restore server.
         1997 Alexander Dong <ado@software-ag.de>
    Having the same interface as its Linux counterpart:
-       Copyright (C) 1994 Janne Kukonlehto <jtklehto@stekt.oulu.fi> 
-   
+       Copyright (C) 1994 Janne Kukonlehto <jtklehto@stekt.oulu.fi>
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -15,8 +15,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
-   
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
 */
 
 #include <config.h>
 */
 
 #include <config.h>
@@ -101,7 +101,7 @@ void handle_console (unsigned char action)
       n = col * row * 2;
       VioWrtCellStr ((PCH) scr_buffer, (USHORT) n, 0, 0, 0); /* Write it back */
       break;
       n = col * row * 2;
       VioWrtCellStr ((PCH) scr_buffer, (USHORT) n, 0, 0, 0); /* Write it back */
       break;
-   default: 
+   default:
       /* This is not possible, but if we are here, just save the screen */
       handle_console(CONSOLE_SAVE);
      break;
       /* This is not possible, but if we are here, just save the screen */
       handle_console(CONSOLE_SAVE);
      break;
index c0b7900..7cdd929 100644 (file)
@@ -15,7 +15,7 @@ DIR *opendir (const char * a_dir)
        char *c_dir = malloc (strlen(a_dir) + 4);
        strcpy (c_dir, a_dir);
        strcat (c_dir, "\\*");
        char *c_dir = malloc (strlen(a_dir) + 4);
        strcpy (c_dir, a_dir);
        strcat (c_dir, "\\*");
-                       
+
        dd_dir->d_handle = FindFirstFile (c_dir, &wfd);
        if (dd_dir->d_handle == INVALID_HANDLE_VALUE)   {
                err = GetLastError();
        dd_dir->d_handle = FindFirstFile (c_dir, &wfd);
        if (dd_dir->d_handle == INVALID_HANDLE_VALUE)   {
                err = GetLastError();
@@ -42,7 +42,7 @@ DIR *opendir (const char * a_dir)
        dd_dir->d_size = wfd.nFileSizeLow;
        strcpy (dd_dir->d_name, wfd.cFileName);
        dd_dir->d_first = 1;
        dd_dir->d_size = wfd.nFileSizeLow;
        strcpy (dd_dir->d_name, wfd.cFileName);
        dd_dir->d_first = 1;
-       
+
        free (c_dir);
        return dd_dir;
 }
        free (c_dir);
        return dd_dir;
 }
@@ -51,12 +51,12 @@ DIR *readdir( DIR * dd_dir)
 {
        int err;
        WIN32_FIND_DATA wfd;
 {
        int err;
        WIN32_FIND_DATA wfd;
-       
+
        if (dd_dir->d_first) {
                dd_dir->d_first = 0;
                return dd_dir;
        }
        if (dd_dir->d_first) {
                dd_dir->d_first = 0;
                return dd_dir;
        }
-                       
+
        if(!FindNextFile (dd_dir->d_handle, &wfd)) {
                err = GetLastError();
                switch (err) {
        if(!FindNextFile (dd_dir->d_handle, &wfd)) {
                err = GetLastError();
                switch (err) {
@@ -81,7 +81,7 @@ DIR *readdir( DIR * dd_dir)
        dd_dir->d_size         = wfd.nFileSizeLow;
        strcpy (dd_dir->d_name, wfd.cFileName);
        return dd_dir;
        dd_dir->d_size         = wfd.nFileSizeLow;
        strcpy (dd_dir->d_name, wfd.cFileName);
        return dd_dir;
-}                
+}
 
 int closedir (DIR *dd_dir)
 {
 
 int closedir (DIR *dd_dir)
 {
index 973ebac..1580274 100644 (file)
@@ -23,8 +23,8 @@ DIR *opendir (const char * a_dir)
        strcpy (c_dir, a_dir);
        strcat (c_dir, "\\*.*");
         dd_dir->d_handle = (unsigned long*) HDIR_CREATE;
        strcpy (c_dir, a_dir);
        strcat (c_dir, "\\*.*");
         dd_dir->d_handle = (unsigned long*) HDIR_CREATE;
-        
-        rc = DosFindFirst(c_dir, 
+
+        rc = DosFindFirst(c_dir,
             (PHDIR) &dd_dir->d_handle,
             FILE_SYSTEM | FILE_HIDDEN | FILE_DIRECTORY,
             (PVOID) &FindBuffer,
             (PHDIR) &dd_dir->d_handle,
             FILE_SYSTEM | FILE_HIDDEN | FILE_DIRECTORY,
             (PVOID) &FindBuffer,
@@ -42,7 +42,7 @@ DIR *opendir (const char * a_dir)
            case ERROR_BUFFER_OVERFLOW:
                errno = ENOMEM;
                break;
            case ERROR_BUFFER_OVERFLOW:
                errno = ENOMEM;
                break;
-           default: 
+           default:
                errno = EINVAL;
                break;
            }
                errno = EINVAL;
                break;
            }
@@ -50,11 +50,11 @@ DIR *opendir (const char * a_dir)
            return NULL;
         }
        dd_dir->d_attr = FindBuffer.attrFile;
            return NULL;
         }
        dd_dir->d_attr = FindBuffer.attrFile;
-       dd_dir->d_time = dd_dir->d_date = 10; 
+       dd_dir->d_time = dd_dir->d_date = 10;
        dd_dir->d_size = FindBuffer.cbFile;
        strcpy (dd_dir->d_name, FindBuffer.achName);
        dd_dir->d_first = 1;
        dd_dir->d_size = FindBuffer.cbFile;
        strcpy (dd_dir->d_name, FindBuffer.achName);
        dd_dir->d_first = 1;
-       
+
        free (c_dir);
        return dd_dir;
 }
        free (c_dir);
        return dd_dir;
 }
@@ -65,13 +65,13 @@ DIR *readdir( DIR * dd_dir)
         FILEFINDBUF3    FindBuffer = {0};
         ULONG           FileCount  = 1;
        DIR             *ret_dir = (DIR*) malloc (sizeof(DIR));
         FILEFINDBUF3    FindBuffer = {0};
         ULONG           FileCount  = 1;
        DIR             *ret_dir = (DIR*) malloc (sizeof(DIR));
-       
+
        if (dd_dir->d_first) {
                dd_dir->d_first = 0;
                return dd_dir;
        }
 
        if (dd_dir->d_first) {
                dd_dir->d_first = 0;
                return dd_dir;
        }
 
-        rc = DosFindNext((HDIR) dd_dir->d_handle,                      
+        rc = DosFindNext((HDIR) dd_dir->d_handle,
                         (PVOID) &FindBuffer,
                         sizeof(FILEFINDBUF3),
                         &FileCount);
                         (PVOID) &FindBuffer,
                         sizeof(FILEFINDBUF3),
                         &FileCount);
@@ -86,19 +86,19 @@ DIR *readdir( DIR * dd_dir)
            case ERROR_BUFFER_OVERFLOW:
                errno = ENOMEM;
                break;
            case ERROR_BUFFER_OVERFLOW:
                errno = ENOMEM;
                break;
-           default: 
+           default:
                errno = EINVAL;
                break;
            }
            return NULL;
         }
 
                errno = EINVAL;
                break;
            }
            return NULL;
         }
 
-       ret_dir->d_attr = FindBuffer.attrFile; 
+       ret_dir->d_attr = FindBuffer.attrFile;
        ret_dir->d_time = ret_dir->d_date = 10;
        ret_dir->d_size = FindBuffer.cbFile;
        strcpy (ret_dir->d_name, FindBuffer.achName);
        return ret_dir;
        ret_dir->d_time = ret_dir->d_date = 10;
        ret_dir->d_size = FindBuffer.cbFile;
        strcpy (ret_dir->d_name, FindBuffer.achName);
        return ret_dir;
-}                
+}
 
 int closedir (DIR *dd_dir)
 {
 
 int closedir (DIR *dd_dir)
 {
index 2059f94..eaf5f38 100644 (file)
@@ -1,10 +1,10 @@
 /* Ch-Drive command for Windows NT and OS/2
 /* Ch-Drive command for Windows NT and OS/2
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
-   
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
    Bug:
        the code will not work if you have more drives than those that
    Bug:
        the code will not work if you have more drives than those that
-       can fit in a panel.  
+       can fit in a panel.
    */
 
 #include <config.h>
    */
 
 #include <config.h>
@@ -51,7 +51,7 @@ static void drive_cmd(void);
 #define B_DRIVE_BASE 100
 #define MAX_LGH 13             /* Length for drives */
 
 #define B_DRIVE_BASE 100
 #define MAX_LGH 13             /* Length for drives */
 
-static void drive_cmd()                        
+static void drive_cmd()
 {
     int  i, nNewDrive, nDrivesAvail;
     char szTempBuf[7], szDrivesAvail[27*4], *p;
 {
     int  i, nNewDrive, nDrivesAvail;
     char szTempBuf[7], szDrivesAvail[27*4], *p;
@@ -86,7 +86,7 @@ static void drive_cmd()
 
     /* Create Dialog */
     do_refresh ();
 
     /* Create Dialog */
     do_refresh ();
-       
+
     m_drv = ((nDrivesAvail > MAX_LGH) ? MAX_LGH: nDrivesAvail);
     /* Center on x, relative to panel */
     x_pos = this_panel->widget.x + (this_panel->widget.cols - m_drv*3)/2 + 2;
     m_drv = ((nDrivesAvail > MAX_LGH) ? MAX_LGH: nDrivesAvail);
     /* Center on x, relative to panel */
     x_pos = this_panel->widget.x + (this_panel->widget.cols - m_drv*3)/2 + 2;
@@ -128,14 +128,14 @@ static void drive_cmd()
                XV_WLAY_RIGHTOF);
     }
 
                XV_WLAY_RIGHTOF);
     }
 
-    run_dlg(drive_dlg);   
+    run_dlg(drive_dlg);
 
     /* do action */
     if (drive_dlg->ret_value != B_CANCEL) {
        int  errocc = 0; /* no error */
        int  rtn;
        char drvLetter;
 
     /* do action */
     if (drive_dlg->ret_value != B_CANCEL) {
        int  errocc = 0; /* no error */
        int  rtn;
        char drvLetter;
-       
+
        /* Set the Panel to Directory listing mode first */
        int is_right=(this_panel==right_panel);
 
        /* Set the Panel to Directory listing mode first */
        int is_right=(this_panel==right_panel);
 
@@ -155,7 +155,7 @@ static void drive_cmd()
 #else
        rtn = DosSetDefaultDisk(nNewDrive + 1);
 #endif
 #else
        rtn = DosSetDefaultDisk(nNewDrive + 1);
 #endif
-       if (rtn == -1) 
+       if (rtn == -1)
                errocc = 1;
        else {
                getcwd (this_panel->cwd, sizeof (this_panel->cwd)-2);
                errocc = 1;
        else {
                getcwd (this_panel->cwd, sizeof (this_panel->cwd)-2);
@@ -191,7 +191,7 @@ void drive_cmd_a()
 }
 
 void drive_cmd_b()
 }
 
 void drive_cmd_b()
-{                                  
+{
     this_panel = right_panel;
     drive_cmd();
 }
     this_panel = right_panel;
     drive_cmd();
 }
index 00e9f3a..bd44d55 100644 (file)
@@ -5,7 +5,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
   Bugs:
     Have trouble with non-US keyboards, "Alt-gr"+keys (API tells CTRL-ALT is pressed)
 
   Bugs:
     Have trouble with non-US keyboards, "Alt-gr"+keys (API tells CTRL-ALT is pressed)
@@ -61,15 +61,15 @@ struct {
     { KEY_F(10), VK_F10 },
     { KEY_F(11), VK_F11 },
     { KEY_F(12), VK_F12 },
     { KEY_F(10), VK_F10 },
     { KEY_F(11), VK_F11 },
     { KEY_F(12), VK_F12 },
-    { KEY_F(13), VK_F13 }, 
+    { KEY_F(13), VK_F13 },
     { KEY_F(14), VK_F14 },
     { KEY_F(15), VK_F15 },
     { KEY_F(16), VK_F16 },
     { KEY_F(17), VK_F17 },
     { KEY_F(18), VK_F18 },
     { KEY_F(19), VK_F19 },
     { KEY_F(14), VK_F14 },
     { KEY_F(15), VK_F15 },
     { KEY_F(16), VK_F16 },
     { KEY_F(17), VK_F17 },
     { KEY_F(18), VK_F18 },
     { KEY_F(19), VK_F19 },
-    { KEY_F(20), VK_F20 },     
-    { KEY_IC,    VK_INSERT },          
+    { KEY_F(20), VK_F20 },
+    { KEY_IC,    VK_INSERT },
     { KEY_DC,    VK_DELETE },
     { KEY_BACKSPACE, VK_BACK },
 
     { KEY_DC,    VK_DELETE },
     { KEY_BACKSPACE, VK_BACK },
 
@@ -85,13 +85,13 @@ struct {
     { ALT('*'),  VK_MULTIPLY },
     { ALT('+'),  VK_ADD },
     { ALT('-'),  VK_SUBTRACT },
     { ALT('*'),  VK_MULTIPLY },
     { ALT('+'),  VK_ADD },
     { ALT('-'),  VK_SUBTRACT },
-    
+
     { ALT('\t'), VK_PAUSE }, /* Added to make Complete work press Pause */
 
     { ESC_CHAR, VK_ESCAPE },
 
     { 0, 0}
     { ALT('\t'), VK_PAUSE }, /* Added to make Complete work press Pause */
 
     { ESC_CHAR, VK_ESCAPE },
 
     { 0, 0}
-};             
+};
 
 /*  init_key  - Called in main.c to initialize ourselves
                Get handle to console input
 
 /*  init_key  - Called in main.c to initialize ourselves
                Get handle to console input
@@ -103,14 +103,14 @@ void init_key (void)
 
 int ctrl_pressed ()
 {
 
 int ctrl_pressed ()
 {
-    if(dwSaved_ControlState & RIGHT_ALT_PRESSED) return 0; 
+    if(dwSaved_ControlState & RIGHT_ALT_PRESSED) return 0;
     /* The line above fixes the BUG with the AltGr Keys*/
     return dwSaved_ControlState & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED);
 }
 
 int shift_pressed ()
 {
     /* The line above fixes the BUG with the AltGr Keys*/
     return dwSaved_ControlState & (RIGHT_CTRL_PRESSED | LEFT_CTRL_PRESSED);
 }
 
 int shift_pressed ()
 {
-    if(dwSaved_ControlState & RIGHT_ALT_PRESSED) return 0; 
+    if(dwSaved_ControlState & RIGHT_ALT_PRESSED) return 0;
     /* The line above fixes the BUG with the AltGr Keys*/
     return dwSaved_ControlState & SHIFT_PRESSED;
 }
     /* The line above fixes the BUG with the AltGr Keys*/
     return dwSaved_ControlState & SHIFT_PRESSED;
 }
@@ -124,7 +124,7 @@ static int VKtoCurses (int a_vkc)
 {
     int i;
 
 {
     int i;
 
-    for (i = 0; key_table[i].vkcode != 0; i++) 
+    for (i = 0; key_table[i].vkcode != 0; i++)
        if (a_vkc == key_table[i].vkcode) {
            return key_table[i].key_code;
        }
        if (a_vkc == key_table[i].vkcode) {
            return key_table[i].key_code;
        }
@@ -183,7 +183,7 @@ int get_key_code (int no_delay)
        if (!dw)
            return 0;
     }
        if (!dw)
            return 0;
     }
+
     do {
        win32APICALL(ReadConsoleInput(hConsoleInput, &ir, 1, &dw));
        switch (ir.EventType) {
     do {
        win32APICALL(ReadConsoleInput(hConsoleInput, &ir, 1, &dw));
        switch (ir.EventType) {
@@ -219,7 +219,7 @@ int get_key_code (int no_delay)
                        evSaved_Event.type = GPM_DOWN | GPM_DOUBLE;
                        break;
                };
                        evSaved_Event.type = GPM_DOWN | GPM_DOUBLE;
                        break;
                };
-               return 0;       
+               return 0;
        }
     } while (!no_delay);
     return 0;
        }
     } while (!no_delay);
     return 0;
@@ -254,7 +254,7 @@ int get_event (Gpm_Event *event, int redo_event, int block)
        dirty++;
 
     vfs_timeout_handler ();
        dirty++;
 
     vfs_timeout_handler ();
-    
+
     c = block ? getch_with_delay () : get_key_code (1);
 
     if (!c) {
     c = block ? getch_with_delay () : get_key_code (1);
 
     if (!c) {
@@ -270,16 +270,16 @@ int mi_getch ()
 {
     Gpm_Event ev;
     int       key;
 {
     Gpm_Event ev;
     int       key;
-    
+
     while ((key = get_event (&ev, 0, 1)) == 0)
        ;
     return key;
 }
 
     while ((key = get_event (&ev, 0, 1)) == 0)
        ;
     return key;
 }
 
-/* 
+/*
    is_idle -    A function to check if we're idle.
    is_idle -    A function to check if we're idle.
-               It checks for any waiting event  (that can be a Key, Mouse event, 
-               and other internal events like focus or menu) 
+               It checks for any waiting event  (that can be a Key, Mouse event,
+               and other internal events like focus or menu)
 */
 int is_idle (void)
 {
 */
 int is_idle (void)
 {
index c67c734..06fe1b7 100644 (file)
@@ -7,7 +7,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 */
 
 
 */
 
@@ -86,9 +86,9 @@ static int VKtoCurses (int vkcode);
                                                    ALT(F12): 8c00
 
            Mapping for ALT(key_code):
                                                    ALT(F12): 8c00
 
            Mapping for ALT(key_code):
-                For Mapping with normal keys, only the scan code can be 
+                For Mapping with normal keys, only the scan code can be
                 used. (see struct ALT_table)
                 used. (see struct ALT_table)
-        
+
    Special keys:
         ENTER (number block): 0xaaaaE00D
         + (number block):     0xaaaa4E2B        Normal: 1B2B
    Special keys:
         ENTER (number block): 0xaaaaE00D
         + (number block):     0xaaaa4E2B        Normal: 1B2B
@@ -133,7 +133,7 @@ struct {
     { KEY_F(11), 0x85 },
     { KEY_F(12), 0x86 },
     { 0, 0}
     { KEY_F(11), 0x85 },
     { KEY_F(12), 0x86 },
     { 0, 0}
-};             
+};
 
 
 struct {
 
 
 struct {
@@ -181,7 +181,7 @@ struct {
     { ALT(KEY_F(11)),  0x8B },
     { ALT(KEY_F(12)),  0x8C },
     { 0, 0}
     { ALT(KEY_F(11)),  0x8B },
     { ALT(KEY_F(12)),  0x8C },
     { 0, 0}
-};             
+};
 
 
 struct {
 
 
 struct {
@@ -199,7 +199,7 @@ struct {
     { KEY_HOME,  0x47 },
     { KEY_END,  0x4F },
     { 0, 0}
     { KEY_HOME,  0x47 },
     { KEY_END,  0x4F },
     { 0, 0}
-};             
+};
 
 
 /*  init_key -- to make linker happy */
 
 
 /*  init_key -- to make linker happy */
@@ -217,7 +217,7 @@ static int push_char (int c)
 {
     if (!seq_append)
        seq_append = seq_buffer;
 {
     if (!seq_append)
        seq_append = seq_buffer;
-    
+
     if (seq_append == &(seq_buffer [sizeof (seq_buffer)-2]))
        return 0;
     *(seq_append++) = c;
     if (seq_append == &(seq_buffer [sizeof (seq_buffer)-2]))
        return 0;
     *(seq_append++) = c;
@@ -236,7 +236,7 @@ int get_key_code (int no_delay)
         if (inp_ch == 0) {
            return 0;
         }
         if (inp_ch == 0) {
            return 0;
         }
-    } 
+    }
 
     if (no_delay) {
        return (VKtoCurses(inp_ch));
 
     if (no_delay) {
        return (VKtoCurses(inp_ch));
@@ -255,7 +255,7 @@ static int VKtoCurses (int a_vkc)
 {
    int ctrlState = 0;
    int altState  = 0;
 {
    int ctrlState = 0;
    int altState  = 0;
-   
+
    int  fsState;
    char scanCode;
    char asciiCode;
    int  fsState;
    char scanCode;
    char asciiCode;
@@ -267,7 +267,7 @@ static int VKtoCurses (int a_vkc)
 
    scanCode = (char) ((a_vkc & 0x0000FFFF) >> 8);
    asciiCode = (char) (a_vkc & 0x000000FF);
 
    scanCode = (char) ((a_vkc & 0x0000FFFF) >> 8);
    asciiCode = (char) (a_vkc & 0x000000FF);
-   
+
    ctrlState  = (fsState & CTRL_PRESSED);
    altState   = (fsState & ALT_PRESSED);
 
    ctrlState  = (fsState & CTRL_PRESSED);
    altState   = (fsState & ALT_PRESSED);
 
@@ -295,20 +295,20 @@ static int VKtoCurses (int a_vkc)
    /* Scan Movement codes */
    if (asciiCode == 0) {
       /* Replace key code with that in table */
    /* Scan Movement codes */
    if (asciiCode == 0) {
       /* Replace key code with that in table */
-      for (i=0;  movement[i].vkcode != 0 || movement[i].key_code != 0; i++) 
-       if (scanCode == movement[i].vkcode) 
+      for (i=0;  movement[i].vkcode != 0 || movement[i].key_code != 0; i++)
+       if (scanCode == movement[i].vkcode)
             return (movement[i].key_code);
    }
 
    if (asciiCode == 0) {
       /* Function-key detected */
             return (movement[i].key_code);
    }
 
    if (asciiCode == 0) {
       /* Function-key detected */
-      for (i=0;  fkt_table[i].vkcode != 0 || fkt_table[i].key_code != 0; i++) 
-       if (scanCode == fkt_table[i].vkcode) 
+      for (i=0;  fkt_table[i].vkcode != 0 || fkt_table[i].key_code != 0; i++)
+       if (scanCode == fkt_table[i].vkcode)
             return (fkt_table[i].key_code);
       /* ALT - KEY */
       /* if (altState) */ {
             return (fkt_table[i].key_code);
       /* ALT - KEY */
       /* if (altState) */ {
-         for (i=0;  ALT_table[i].vkcode != 0 || ALT_table[i].key_code != 0; i++) 
-                if (scanCode == ALT_table[i].vkcode) 
+         for (i=0;  ALT_table[i].vkcode != 0 || ALT_table[i].key_code != 0; i++)
+                if (scanCode == ALT_table[i].vkcode)
                             return (ALT_table[i].key_code);
       }
    }
                             return (ALT_table[i].key_code);
       }
    }
@@ -348,7 +348,7 @@ int get_event (Gpm_Event *event, int redo_event, int block)
        dirty++;
 
     vfs_timeout_handler ();
        dirty++;
 
     vfs_timeout_handler ();
-    
+
     c = block ? getch_with_delay () : get_key_code (1);
     if (!c) {
        /* Code is 0, so this is a Control key or mouse event */
     c = block ? getch_with_delay () : get_key_code (1);
     if (!c) {
        /* Code is 0, so this is a Control key or mouse event */
@@ -364,17 +364,17 @@ int mi_getch ()
 {
     Gpm_Event ev;
     int       key;
 {
     Gpm_Event ev;
     int       key;
-    
+
     while ((key = get_event (&ev, 0, 1)) == 0)
        ;
     return key;
 }
 
 
     while ((key = get_event (&ev, 0, 1)) == 0)
        ;
     return key;
 }
 
 
-/* 
+/*
    is_idle -    A function to check if we're idle.
    is_idle -    A function to check if we're idle.
-               It checks for any waiting event  (that can be a Key, Mouse event, 
-               and other internal events like focus or menu) 
+               It checks for any waiting event  (that can be a Key, Mouse event,
+               and other internal events like focus or menu)
 */
 int is_idle (void)
 {
 */
 int is_idle (void)
 {
index 291d832..44f6f62 100644 (file)
@@ -1,13 +1,13 @@
 /* Slang interface to the Midnight Commander for Windows NT and OS/2
    This emulates some features of ncurses on top of slang
    S-lang is not fully consistent between its Unix and non-Unix versions.
 /* Slang interface to the Midnight Commander for Windows NT and OS/2
    This emulates some features of ncurses on top of slang
    S-lang is not fully consistent between its Unix and non-Unix versions.
-   
-      
+
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -60,7 +60,7 @@ int got_interrupt ()
 void slang_init (void)
 {
     SLtt_get_terminfo ();
 void slang_init (void)
 {
     SLtt_get_terminfo ();
-    SLang_init_tty (XCTRL('c'), 1, 0); 
+    SLang_init_tty (XCTRL('c'), 1, 0);
     slang_prog_mode ();
     load_terminfo_keys ();
 }
     slang_prog_mode ();
     load_terminfo_keys ();
 }
@@ -109,7 +109,7 @@ void hline (int ch, int len)
 
     last_x = SLsmg_get_column ();
     last_y = SLsmg_get_row ();
 
     last_x = SLsmg_get_column ();
     last_y = SLsmg_get_row ();
-    
+
     if (ch == 0)
        ch = ACS_HLINE;
 
     if (ch == 0)
        ch = ACS_HLINE;
 
@@ -145,7 +145,7 @@ int has_colors ()
     /* No terminals on NT, make default color */
     if (!disable_colors)
        SLtt_Use_Ansi_Colors = 1;
     /* No terminals on NT, make default color */
     if (!disable_colors)
        SLtt_Use_Ansi_Colors = 1;
-    
+
     /* Setup emulated colors */
     if (SLtt_Use_Ansi_Colors){
         /* DO NOT TRANSLATE WITH gettext SYNTAX coloring will be broken */
     /* Setup emulated colors */
     if (SLtt_Use_Ansi_Colors){
         /* DO NOT TRANSLATE WITH gettext SYNTAX coloring will be broken */
@@ -164,7 +164,7 @@ void attrset (int color)
        SLsmg_set_color (color);
        return;
     }
        SLsmg_set_color (color);
        return;
     }
-    
+
     if (color & A_BOLD){
        if (color == A_BOLD)
            SLsmg_set_color (A_BOLD);
     if (color & A_BOLD){
        if (color == A_BOLD)
            SLsmg_set_color (A_BOLD);
@@ -178,7 +178,7 @@ void attrset (int color)
     else
        SLsmg_set_color (color);
 }
     else
        SLsmg_set_color (color);
 }
-       
+
 void load_terminfo_keys ()
 {
 }
 void load_terminfo_keys ()
 {
 }
index 61aea9f..d32c1e8 100644 (file)
@@ -1,13 +1,13 @@
 /* trace_nt.c - Debugging routines
                  for Midnight Commander, under Win32
 /* trace_nt.c - Debugging routines
                  for Midnight Commander, under Win32
-   
+
    Written 951215 by Juan Grigera <grigera@isis.unlp.edu.ar>
    Written 951215 by Juan Grigera <grigera@isis.unlp.edu.ar>
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 #include <config.h>
 #ifdef HAVE_TRACE
  */
 #include <config.h>
 #ifdef HAVE_TRACE
@@ -28,7 +28,7 @@
 #include "trace_nt.h"
 
 /* Global variables */
 #include "trace_nt.h"
 
 /* Global variables */
-int __win32_tracing_enabled = 1;  
+int __win32_tracing_enabled = 1;
 
 static int _win32_tracing_started = 0;
 static FILE *__win32_trace_f = NULL;
 
 static int _win32_tracing_started = 0;
 static FILE *__win32_trace_f = NULL;
@@ -45,7 +45,7 @@ static char *visbuf(const char *buf);
 
 /*
     void _win32InitTrace()
 
 /*
     void _win32InitTrace()
-       This func will open file TRACE_FILE for output and add _win32EndTrace to onexit 
+       This func will open file TRACE_FILE for output and add _win32EndTrace to onexit
        list of funcs.
  */
 static void _win32InitTrace()
        list of funcs.
  */
 static void _win32InitTrace()
@@ -71,7 +71,7 @@ static void _win32EndTrace()
                _win32_tracing_started = 0;
                if (__win32_trace_f)
                        fclose (__win32_trace_f);
                _win32_tracing_started = 0;
                if (__win32_trace_f)
                        fclose (__win32_trace_f);
-       }       
+       }
 
 }
 
 
 }
 
@@ -102,12 +102,12 @@ void _win32Trace (const char *fmt, ...)
        #endif
 #endif
 
        #endif
 #endif
 
-       if(__win32_trace_f) 
+       if(__win32_trace_f)
                fprintf (__win32_trace_f, "%s\n", vp);
 }
 
 /*
                fprintf (__win32_trace_f, "%s\n", vp);
 }
 
 /*
-       void SetTrace (int trace) 
+       void SetTrace (int trace)
        Control debug output. Turn it of or on.
                trace: 0 = off, 1 = on.
  */
        Control debug output. Turn it of or on.
                trace: 0 = off, 1 = on.
  */
index 1eda396..3a5ee05 100644 (file)
@@ -6,7 +6,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 /* ------------------------------------------------------------------------------------------ *
  */
 
 /* ------------------------------------------------------------------------------------------ *
 /************************/
 
 /* Macros
 /************************/
 
 /* Macros
-   ------ 
+   ------
        win32Trace(x)     - Trace macro. Use double in parenthesis for x. Same args as printf.
        win32Trace(x)     - Trace macro. Use double in parenthesis for x. Same args as printf.
-       win32ASSERT(x)    - assert macro, but will not abort program and output sent to trace routine.  
-       win32APICALL(x)  - Use to enclose a Win32 system call that should return TRUE. 
-       win32APICALL_HANDLE(h,api)  - Use to enclose a Win32 system call that should return a handle. 
+       win32ASSERT(x)    - assert macro, but will not abort program and output sent to trace routine.
+       win32APICALL(x)  - Use to enclose a Win32 system call that should return TRUE.
+       win32APICALL_HANDLE(h,api)  - Use to enclose a Win32 system call that should return a handle.
 */
 #define win32Trace(x)                          if (__win32_tracing_enabled)    _win32Trace x
 #define win32ASSERT(x)                         if (!(x))    _win32DebugAssertionFailed (#x, __LINE__, __FILE__)
 */
 #define win32Trace(x)                          if (__win32_tracing_enabled)    _win32Trace x
 #define win32ASSERT(x)                         if (!(x))    _win32DebugAssertionFailed (#x, __LINE__, __FILE__)
@@ -52,7 +52,7 @@ void _win32TraceOff (void);
 #define TraceOff       _win32TraceOff
 
 /* Global variables  */
 #define TraceOff       _win32TraceOff
 
 /* Global variables  */
-extern int __win32_tracing_enabled;  
+extern int __win32_tracing_enabled;
 
 #else
 /************************/
 
 #else
 /************************/
@@ -60,8 +60,8 @@ extern int __win32_tracing_enabled;
 /************************/
 
 /* Wipe-out these macros */
 /************************/
 
 /* Wipe-out these macros */
-#define win32Trace(x)          
-#define win32ASSERT(x)         
+#define win32Trace(x)
+#define win32ASSERT(x)
 #define win32APICALL(x)                        x
 #define win32APICALL_HANDLE(h,api)     h=api;
 
 #define win32APICALL(x)                        x
 #define win32APICALL_HANDLE(h,api)     h=api;
 
index cc97b44..a13f343 100644 (file)
@@ -9,7 +9,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -142,7 +142,7 @@ int my_system (int as_shell_command, const char *shell, const char *command)
 /* .ado: temp. turn out */
     if (as_shell_command) {
                /* It is only the shell, /c will not work */
 /* .ado: temp. turn out */
     if (as_shell_command) {
                /* It is only the shell, /c will not work */
-               if (command) 
+               if (command)
                        spawnlp (P_WAIT, shell, shell, "/c", command, (char *) 0);
                else
                        spawnlp (P_WAIT, shell, (char *) 0);
                        spawnlp (P_WAIT, shell, shell, "/c", command, (char *) 0);
                else
                        spawnlp (P_WAIT, shell, (char *) 0);
@@ -155,11 +155,11 @@ int my_system (int as_shell_command, const char *shell, const char *command)
 #endif
     if (as_shell_command) {
        if (!access(command, 0)) {
 #endif
     if (as_shell_command) {
        if (!access(command, 0)) {
-           switch(win32_GetEXEType (shell)) {  
+           switch(win32_GetEXEType (shell)) {
                case EXE_win16:                 /* Windows 3.x archive or OS/2 */
                case EXE_win32GUI:              /* NT or Chicago GUI API */
                    spawnlp (P_NOWAIT, shell, shell, "/c", command, (char *) 0);   /* don't wait for GUI programs to end */
                case EXE_win16:                 /* Windows 3.x archive or OS/2 */
                case EXE_win32GUI:              /* NT or Chicago GUI API */
                    spawnlp (P_NOWAIT, shell, shell, "/c", command, (char *) 0);   /* don't wait for GUI programs to end */
-                   break;                      
+                   break;
                case EXE_otherCUI:              /* DOS COM, MZ, ZM, Phar Lap */
                case EXE_win32CUI:              /* NT or Chicago Console API, also OS/2 */
                case EXE_Unknown:
                case EXE_otherCUI:              /* DOS COM, MZ, ZM, Phar Lap */
                case EXE_win32CUI:              /* NT or Chicago Console API, also OS/2 */
                case EXE_Unknown:
@@ -186,7 +186,7 @@ int my_system (int as_shell_command, const char *shell, const char *command)
 */
 char* get_default_shell()
 {
 */
 char* get_default_shell()
 {
-    if (win32_GetPlatform() == OS_WinNT) 
+    if (win32_GetPlatform() == OS_WinNT)
        return "cmd.exe";
     else
        return "command.com";
        return "cmd.exe";
     else
        return "command.com";
@@ -269,7 +269,7 @@ char *canonicalize_pathname (char *path)
                continue;
            }
 
                continue;
            }
 
-           /* Handle `../' or trailing `..' by itself. 
+           /* Handle `../' or trailing `..' by itself.
               Remove the previous ?/ part with the exception of
               ../, which we should leave intact. */
            if (path[i + 1] == '.' && (path[i + 2] == PATH_SEP || !path[i + 2])) {
               Remove the previous ?/ part with the exception of
               ../, which we should leave intact. */
            if (path[i + 1] == '.' && (path[i + 2] == PATH_SEP || !path[i + 2])) {
@@ -291,7 +291,7 @@ char *canonicalize_pathname (char *path)
 }
 
 #ifndef USE_VFS
 }
 
 #ifndef USE_VFS
-/* 
+/*
    int mc_rmdir (char *path);
    Fix for Win95 UGLY BUG in rmdir: it will return ENOACCESS instead
    of ENOTEMPTY.
    int mc_rmdir (char *path);
    Fix for Win95 UGLY BUG in rmdir: it will return ENOACCESS instead
    of ENOTEMPTY.
@@ -354,7 +354,7 @@ static int conv_nt_unx_rc(int rc)
    return errCode;
 }
 
    return errCode;
 }
 
-/* 
+/*
    int mc_unlink (char *pathName)
    For Windows 95 and NT, files should be able to be deleted even
    if they don't have write-protection. We should build a question box
    int mc_unlink (char *pathName)
    For Windows 95 and NT, files should be able to be deleted even
    if they don't have write-protection. We should build a question box
@@ -409,7 +409,7 @@ int mc_unlink (char *pathName)
                }
        }
        if (rc == TRUE) return 0;
                }
        }
        if (rc == TRUE) return 0;
-       else 
+       else
                return -1;
 }
 #endif /*USE_VFS*/
                return -1;
 }
 #endif /*USE_VFS*/
@@ -426,9 +426,9 @@ void my_statfs (struct my_statfs *myfs_stats, char *path)
 
        /* KBytes available */
        myfs_stats->avail = (unsigned int)( ((double)lpSectorsPerCluster * lpBytesPerSector * lpFreeClusters) / 1024 );
 
        /* KBytes available */
        myfs_stats->avail = (unsigned int)( ((double)lpSectorsPerCluster * lpBytesPerSector * lpFreeClusters) / 1024 );
-       
+
        /* KBytes total */
        /* KBytes total */
-       myfs_stats->total = (unsigned int)( ((double)lpSectorsPerCluster * lpBytesPerSector * lpClusters) / 1024 ); 
+       myfs_stats->total = (unsigned int)( ((double)lpSectorsPerCluster * lpBytesPerSector * lpClusters) / 1024 );
        myfs_stats->nfree = lpFreeClusters;
        myfs_stats->nodes = lpClusters;
 
        myfs_stats->nfree = lpFreeClusters;
        myfs_stats->nodes = lpClusters;
 
@@ -493,9 +493,9 @@ void my_statfs (struct my_statfs *myfs_stats, char *path)
 int gettimeofday (struct timeval* tvp, void *p)
 {
     if (p != NULL)
 int gettimeofday (struct timeval* tvp, void *p)
 {
     if (p != NULL)
-       return 0;       
-    
- /* Since MC only calls this func from get_random_hint we return 
+       return 0;
+
+ /* Since MC only calls this func from get_random_hint we return
     some value, not exactly the "correct" one */
     tvp->tv_sec = GetTickCount()/1000;         /* Number of milliseconds since Windows //started*/
     tvp->tv_usec = GetTickCount();
     some value, not exactly the "correct" one */
     tvp->tv_sec = GetTickCount()/1000;         /* Number of milliseconds since Windows //started*/
     tvp->tv_usec = GetTickCount();
@@ -503,7 +503,7 @@ int gettimeofday (struct timeval* tvp, void *p)
 
 /* FAKE functions */
 
 
 /* FAKE functions */
 
-int 
+int
 look_for_exe(const char* pathname)
 {
    int j;
 look_for_exe(const char* pathname)
 {
    int j;
@@ -517,9 +517,9 @@ look_for_exe(const char* pathname)
       for (j=0; j<lgh-4; j++) {
          p++;
       } /* endfor */
       for (j=0; j<lgh-4; j++) {
          p++;
       } /* endfor */
-      if (!stricmp(p, ".exe") || 
-          !stricmp(p, ".bat") || 
-          !stricmp(p, ".com") || 
+      if (!stricmp(p, ".exe") ||
+          !stricmp(p, ".bat") ||
+          !stricmp(p, ".com") ||
           !stricmp(p, ".cmd")) {
          return 1;
       }
           !stricmp(p, ".cmd")) {
          return 1;
       }
@@ -527,7 +527,7 @@ look_for_exe(const char* pathname)
    return 0;
 }
 
    return 0;
 }
 
-int 
+int
 lstat (const char* pathname, struct stat *buffer)
 {
    int rc = stat (pathname, buffer);
 lstat (const char* pathname, struct stat *buffer)
 {
    int rc = stat (pathname, buffer);
@@ -543,7 +543,7 @@ lstat (const char* pathname, struct stat *buffer)
    return rc;
 }
 
    return rc;
 }
 
-int getuid ()        
+int getuid ()
 {
 /*    SID sid;
     LookupAccountName (NULL, &sid...
 {
 /*    SID sid;
     LookupAccountName (NULL, &sid...
@@ -552,7 +552,7 @@ int getuid ()
     return 0;
 }
 
     return 0;
 }
 
-int getgid ()        
+int getgid ()
 {
     return 0;
 }
 {
     return 0;
 }
@@ -638,13 +638,13 @@ int mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
        // Duplicate copy of original stdout back into stdout
        if(_dup2(std_sav[1], _fileno(stdout)) != 0)
            exit (1);
        // Duplicate copy of original stdout back into stdout
        if(_dup2(std_sav[1], _fileno(stdout)) != 0)
            exit (1);
-       // Close duplicate copy of original stdout  and stdin    
+       // Close duplicate copy of original stdout  and stdin
        close(std_sav[0]);
        close(std_sav[1]);
 
 
        while ((i = _read (inhandle, buffer,
        close(std_sav[0]);
        close(std_sav[1]);
 
 
        while ((i = _read (inhandle, buffer,
-                                                        (inlen == -1 || inlen > 8192) 
+                                                        (inlen == -1 || inlen > 8192)
                                                         ? 8192 : inlen)) > 0) {
                write (pipe0 [1], buffer, i);
                if (inlen != -1) {
                                                         ? 8192 : inlen)) > 0) {
                write (pipe0 [1], buffer, i);
                if (inlen != -1) {
@@ -662,10 +662,10 @@ int mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
 int mc_doublepclose (int pipe, pid_t pid)
 {
     int status = 0;
 int mc_doublepclose (int pipe, pid_t pid)
 {
     int status = 0;
-    
+
     close (pipe);
     _cwait ( &status, pid, 0);
     close (pipe);
     _cwait ( &status, pid, 0);
-    return status;     
+    return status;
 }
 
 /*hacks to get it compile, remove these after vfs works */
 }
 
 /*hacks to get it compile, remove these after vfs works */
index 17b73a7..a4efcd0 100644 (file)
@@ -9,7 +9,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -75,19 +75,19 @@ static int old_error;               /* File descriptor of old standard error */
 /* Creates a pipe to hold standard error for a later analysis. */
 /* The pipe can hold 4096 bytes. Make sure no more is written */
 /* or a deadlock might occur. */
 /* Creates a pipe to hold standard error for a later analysis. */
 /* The pipe can hold 4096 bytes. Make sure no more is written */
 /* or a deadlock might occur. */
-void 
+void
 open_error_pipe (void)
 {
    return;
 }
 
 open_error_pipe (void)
 {
    return;
 }
 
-void 
+void
 close_error_pipe (int error, char *text)
 {
    return;
 }
 
 close_error_pipe (int error, char *text)
 {
    return;
 }
 
-void 
+void
 check_error_pipe (void)
 {
     char error[MAX_PIPE_SIZE];
 check_error_pipe (void)
 {
     char error[MAX_PIPE_SIZE];
@@ -110,7 +110,7 @@ check_error_pipe (void)
 }
 
 
 }
 
 
-static int 
+static int
 StartWindowsProg (char *name, SHORT type)
 {
 #if 0 /* FIXME: PM DDL's should be loaded (or not loaded) at run time */
 StartWindowsProg (char *name, SHORT type)
 {
 #if 0 /* FIXME: PM DDL's should be loaded (or not loaded) at run time */
@@ -141,25 +141,25 @@ StartWindowsProg (char *name, SHORT type)
       pDetails.progt.progc = PROG_31_ENHSEAMLESSCOMMON ;
      break;
    }
       pDetails.progt.progc = PROG_31_ENHSEAMLESSCOMMON ;
      break;
    }
-   WinStartApp(NULLHANDLE, 
-               &pDetails, 
-               NULL, 
-               NULL, 
+   WinStartApp(NULLHANDLE,
+               &pDetails,
+               NULL,
+               NULL,
                SAF_INSTALLEDCMDLINE|SAF_STARTCHILDAPP) ;
 #endif
    return 0;
 }
 
 
                SAF_INSTALLEDCMDLINE|SAF_STARTCHILDAPP) ;
 #endif
    return 0;
 }
 
 
-static int 
+static int
 os2_system (int as_shell_command, const char *shell, const char *command, char *parm);
 
 os2_system (int as_shell_command, const char *shell, const char *command, char *parm);
 
-/* 
+/*
   as_shell_command = 1: If a program is started during input line, CTRL-O
   as_shell_command = 1: If a program is started during input line, CTRL-O
-                        or RETURN 
+                        or RETURN
                    = 0: F3, F4
 */
                    = 0: F3, F4
 */
-int 
+int
 my_system (int as_shell_command, const char *shell, const char *command)
 {
    char *sh;            /* This is the shell -- always! */
 my_system (int as_shell_command, const char *shell, const char *command)
 {
    char *sh;            /* This is the shell -- always! */
@@ -170,9 +170,9 @@ my_system (int as_shell_command, const char *shell, const char *command)
 
    sh = get_default_shell();
    if (strcmp(sh, shell)) {
 
    sh = get_default_shell();
    if (strcmp(sh, shell)) {
-      /* 
+      /*
          Not equal  -- That means: shell is the program and command is the
          Not equal  -- That means: shell is the program and command is the
-         parameter 
+         parameter
       */
       cmd  = (char *) shell;
       parm = (char *) command;
       */
       cmd  = (char *) shell;
       parm = (char *) command;
@@ -185,7 +185,7 @@ my_system (int as_shell_command, const char *shell, const char *command)
             if (command[i] == ' ') {
                temp[i] = (char) 0;
                length--;
             if (command[i] == ' ') {
                temp[i] = (char) 0;
                length--;
-            } else 
+            } else
                 break;
          }
          if (i==-1) {
                 break;
          }
          if (i==-1) {
@@ -205,30 +205,30 @@ my_system (int as_shell_command, const char *shell, const char *command)
    return os2_system (as_shell_command, sh, cmd, parm);
 }
 
    return os2_system (as_shell_command, sh, cmd, parm);
 }
 
-static int 
-ux_startp (const char *shell, const char *command, const char *parm) 
+static int
+ux_startp (const char *shell, const char *command, const char *parm)
 {
     if (parm) {
 {
     if (parm) {
-         spawnlp (P_WAIT, 
-              (char *) shell, 
-              (char *) shell, 
-              "/c", 
-              (char *) command, 
+         spawnlp (P_WAIT,
+              (char *) shell,
+              (char *) shell,
+              "/c",
+              (char *) command,
               (char *) parm,
               (char *) 0);
     } else {
               (char *) parm,
               (char *) 0);
     } else {
-         spawnlp (P_WAIT, 
-              (char *) shell, 
-              (char *) shell, 
-              "/c", 
-              (char *) command, 
+         spawnlp (P_WAIT,
+              (char *) shell,
+              (char *) shell,
+              "/c",
+              (char *) command,
               (char *) 0);
     }
     return 0;
 }
 
 
               (char *) 0);
     }
     return 0;
 }
 
 
-static int 
+static int
 os2_system (int as_shell_command, const char *shell, const char *command, char *parm)
 {
    register int i, j;
 os2_system (int as_shell_command, const char *shell, const char *command, char *parm)
 {
    register int i, j;
@@ -236,7 +236,7 @@ os2_system (int as_shell_command, const char *shell, const char *command, char *
    APIRET       rc = NO_ERROR;                  /* Return Code */
    char         pathValue[5] = "PATH";          /* For DosSearchPath */
    UCHAR        searchResult[MC_MAXPATHLEN * 2 + 1];     /* For DosSearchPath */
    APIRET       rc = NO_ERROR;                  /* Return Code */
    char         pathValue[5] = "PATH";          /* For DosSearchPath */
    UCHAR        searchResult[MC_MAXPATHLEN * 2 + 1];     /* For DosSearchPath */
-   
+
    char         *cmdString;
    char         *postFix[3];
    char         *line;
    char         *cmdString;
    char         *postFix[3];
    char         *line;
@@ -248,26 +248,26 @@ os2_system (int as_shell_command, const char *shell, const char *command, char *
 
    if (command == NULL) {
       /* .ado: just start a shell, we don't need the parameter */
 
    if (command == NULL) {
       /* .ado: just start a shell, we don't need the parameter */
-      spawnl (P_WAIT, 
-              (char *) shell, 
-              (char *) shell, 
-              (char *) command, (char *) 0);  
+      spawnl (P_WAIT,
+              (char *) shell,
+              (char *) shell,
+              (char *) command, (char *) 0);
       return 0;
    }
 
    memset(&StartData, 0, sizeof(StartData)) ;
       return 0;
    }
 
    memset(&StartData, 0, sizeof(StartData)) ;
-   StartData.Length             = sizeof(StartData);    
+   StartData.Length             = sizeof(StartData);
    StartData.Related            = SSF_RELATED_CHILD;
    StartData.FgBg               = SSF_FGBG_BACK;
    StartData.Related            = SSF_RELATED_CHILD;
    StartData.FgBg               = SSF_FGBG_BACK;
-   StartData.TraceOpt           = SSF_TRACEOPT_NONE;   
-   StartData.PgmTitle           = NULL;                
-   StartData.TermQ              = NULL;                 
+   StartData.TraceOpt           = SSF_TRACEOPT_NONE;
+   StartData.PgmTitle           = NULL;
+   StartData.TermQ              = NULL;
    StartData.InheritOpt         = SSF_INHERTOPT_PARENT;
    StartData.InheritOpt         = SSF_INHERTOPT_PARENT;
-   StartData.IconFile           = 0;              
-   StartData.PgmHandle          = 0;             
-   StartData.PgmControl         = SSF_CONTROL_VISIBLE ; 
-   StartData.ObjectBuffer       = ObjBuf;          
-   StartData.ObjectBuffLen      = 100;            
+   StartData.IconFile           = 0;
+   StartData.PgmHandle          = 0;
+   StartData.PgmControl         = SSF_CONTROL_VISIBLE ;
+   StartData.ObjectBuffer       = ObjBuf;
+   StartData.ObjectBuffLen      = 100;
    StartData.PgmInputs          = parm;
 
    postFix[0] = ".exe";
    StartData.PgmInputs          = parm;
 
    postFix[0] = ".exe";
@@ -300,7 +300,7 @@ os2_system (int as_shell_command, const char *shell, const char *command, char *
                             sizeof(searchResult));
       }
       free (line);
                             sizeof(searchResult));
       }
       free (line);
-   } else {         
+   } else {
       /* Just search */
       rc = DosSearchPath((SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY),
                          (PSZ) pathValue,
       /* Just search */
       rc = DosSearchPath((SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY),
                          (PSZ) pathValue,
@@ -350,9 +350,9 @@ os2_system (int as_shell_command, const char *shell, const char *command, char *
    } else {
       /* It's not a known exe type or it's a CMD/BAT file */
       i = strlen(searchResult);
    } else {
       /* It's not a known exe type or it's a CMD/BAT file */
       i = strlen(searchResult);
-      if ((toupper(searchResult[--i]) == 'T') && 
-          (toupper(searchResult[--i]) == 'A') &&  
-          (toupper(searchResult[--i]) == 'B') &&  
+      if ((toupper(searchResult[--i]) == 'T') &&
+          (toupper(searchResult[--i]) == 'A') &&
+          (toupper(searchResult[--i]) == 'B') &&
           (searchResult[--i] == '.')   ) {
         StartData.SessionType = PROG_WINDOWEDVDM;
         rc = DosStartSession(&StartData, &SessionID, &pid) ;
           (searchResult[--i] == '.')   ) {
         StartData.SessionType = PROG_WINDOWEDVDM;
         rc = DosStartSession(&StartData, &SessionID, &pid) ;
@@ -432,7 +432,7 @@ canonicalize_pathname (char *path)
                continue;
            }
 
                continue;
            }
 
-           /* Handle `../' or trailing `..' by itself. 
+           /* Handle `../' or trailing `..' by itself.
               Remove the previous ?/ part with the exception of
               ../, which we should leave intact. */
            if (path[i + 1] == '.' && (path[i + 2] == PATH_SEP || !path[i + 2])) {
               Remove the previous ?/ part with the exception of
               ../, which we should leave intact. */
            if (path[i + 1] == '.' && (path[i + 2] == PATH_SEP || !path[i + 2])) {
@@ -454,7 +454,7 @@ canonicalize_pathname (char *path)
 }
 
 
 }
 
 
-void 
+void
 my_statfs (struct my_statfs *myfs_stats, char *path)
 {
     PFSALLOCATE pBuf;
 my_statfs (struct my_statfs *myfs_stats, char *path)
 {
     PFSALLOCATE pBuf;
@@ -483,15 +483,15 @@ my_statfs (struct my_statfs *myfs_stats, char *path)
     /* KBytes available */
     myfs_stats->avail = pBuf->cSectorUnit * pBuf->cUnitAvail * pBuf->cbSector / 1024;
     /* KBytes total */
     /* KBytes available */
     myfs_stats->avail = pBuf->cSectorUnit * pBuf->cUnitAvail * pBuf->cbSector / 1024;
     /* KBytes total */
-    myfs_stats->total = pBuf->cSectorUnit * pBuf->cUnit * pBuf->cbSector / 1024; 
+    myfs_stats->total = pBuf->cSectorUnit * pBuf->cUnit * pBuf->cbSector / 1024;
     myfs_stats->nfree = pBuf->cUnitAvail;
     myfs_stats->nodes = pBuf->cbSector;
 
     lghBuf  = sizeof(FSINFO);
     pFsInfo = (PFSINFO) malloc(lghBuf);
     myfs_stats->nfree = pBuf->cUnitAvail;
     myfs_stats->nodes = pBuf->cbSector;
 
     lghBuf  = sizeof(FSINFO);
     pFsInfo = (PFSINFO) malloc(lghBuf);
-    rc      = DosQueryFSInfo(0L, 
-                             FSIL_VOLSER, 
-                             (PVOID) pFsInfo, 
+    rc      = DosQueryFSInfo(0L,
+                             FSIL_VOLSER,
+                             (PVOID) pFsInfo,
                              lghBuf);
     /* Get name */
     myfs_stats->device = strdup(pFsInfo->vol.szVolLabel);    /* Label of the Disk */
                              lghBuf);
     /* Get name */
     myfs_stats->device = strdup(pFsInfo->vol.szVolLabel);    /* Label of the Disk */
@@ -501,10 +501,10 @@ my_statfs (struct my_statfs *myfs_stats, char *path)
 
     szDeviceName[0] = (UCHAR) (diskNum + (ULONG) 'A' - 1);
     /* Now get the type of the disk */
 
     szDeviceName[0] = (UCHAR) (diskNum + (ULONG) 'A' - 1);
     /* Now get the type of the disk */
-    rc = DosQueryFSAttach(szDeviceName, 
-                          0L, 
-                          FSAIL_QUERYNAME, 
-                          pfsqBuffer, 
+    rc = DosQueryFSAttach(szDeviceName,
+                          0L,
+                          FSAIL_QUERYNAME,
+                          pfsqBuffer,
                           &cbBuffer);
 
     pszFSDName = pfsqBuffer->szName + pfsqBuffer->cbName + 1;
                           &cbBuffer);
 
     pszFSDName = pfsqBuffer->szName + pfsqBuffer->cbName + 1;
@@ -524,14 +524,14 @@ my_statfs (struct my_statfs *myfs_stats, char *path)
     free(pFsInfo);
 }
 
     free(pFsInfo);
 }
 
-int 
+int
 gettimeofday (struct timeval* tvp, void *p)
 {
    DATETIME     pdt = {0};
    if (p != NULL)              /* what is "p"? */
 gettimeofday (struct timeval* tvp, void *p)
 {
    DATETIME     pdt = {0};
    if (p != NULL)              /* what is "p"? */
-       return 0;       
-       
-    /* Since MC only calls this func from get_random_hint we return 
+       return 0;
+
+    /* Since MC only calls this func from get_random_hint we return
      * some value, not exactly the "correct" one
      */
     DosGetDateTime(&pdt);
      * some value, not exactly the "correct" one
      */
     DosGetDateTime(&pdt);
@@ -543,7 +543,7 @@ gettimeofday (struct timeval* tvp, void *p)
 
 /* FAKE functions */
 
 
 /* FAKE functions */
 
-int 
+int
 look_for_exe(const char* pathname)
 {
    int j;
 look_for_exe(const char* pathname)
 {
    int j;
@@ -557,9 +557,9 @@ look_for_exe(const char* pathname)
       for (j=0; j<lgh-4; j++) {
          p++;
       }
       for (j=0; j<lgh-4; j++) {
          p++;
       }
-      if (!stricmp(p, ".exe") || 
-          !stricmp(p, ".bat") || 
-          !stricmp(p, ".com") || 
+      if (!stricmp(p, ".exe") ||
+          !stricmp(p, ".bat") ||
+          !stricmp(p, ".com") ||
           !stricmp(p, ".cmd")) {
          return 1;
       }
           !stricmp(p, ".cmd")) {
          return 1;
       }
@@ -567,7 +567,7 @@ look_for_exe(const char* pathname)
    return 0;
 }
 
    return 0;
 }
 
-int 
+int
 lstat (const char* pathname, struct stat *buffer)
 {
    int rc = stat (pathname, buffer);
 lstat (const char* pathname, struct stat *buffer)
 {
    int rc = stat (pathname, buffer);
@@ -583,61 +583,61 @@ lstat (const char* pathname, struct stat *buffer)
    return rc;
 }
 
    return rc;
 }
 
-int 
-getuid ()            
+int
+getuid ()
 {
     return 0;
 }
 
 {
     return 0;
 }
 
-int 
-getgid ()            
+int
+getgid ()
 {
     return 0;
 }
 
 {
     return 0;
 }
 
-int 
+int
 readlink (char* path, char* buf, int size)
 {
     return -1;
 }
 
 readlink (char* path, char* buf, int size)
 {
     return -1;
 }
 
-int 
+int
 symlink (char *n1, char *n2)
 {
     return -1;
 }
 
 symlink (char *n1, char *n2)
 {
     return -1;
 }
 
-int 
+int
 link (char *p1, char *p2)
 {
     return -1;
 }
 
 link (char *p1, char *p2)
 {
     return -1;
 }
 
-int 
+int
 chown (char *path, int owner, int group)
 {
     return -1;
 }
 
 chown (char *path, int owner, int group)
 {
     return -1;
 }
 
-int 
+int
 mknod (char *path, int mode, int dev)
 {
     return -1;
 }
 
 mknod (char *path, int mode, int dev)
 {
     return -1;
 }
 
-void 
+void
 init_uid_gid_cache (void)
 {
     return;
 }
 
 init_uid_gid_cache (void)
 {
     return;
 }
 
-int 
+int
 mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
 {
        return 0;
 }
 
 mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
 {
        return 0;
 }
 
-int 
+int
 mc_doublepclose (int pipe, pid_t pid)
 {
        return 0;
 mc_doublepclose (int pipe, pid_t pid)
 {
        return 0;
@@ -650,13 +650,13 @@ vfs_get_current_dir (void)
        return NULL;
 }
 
        return NULL;
 }
 
-int 
+int
 vfs_current_is_extfs (void)
 {
        return 0;
 }
 
 vfs_current_is_extfs (void)
 {
        return 0;
 }
 
-int 
+int
 vfs_file_is_ftp (char *filename)
 {
        return 0;
 vfs_file_is_ftp (char *filename)
 {
        return 0;
@@ -695,7 +695,7 @@ mc_chdir(char *pathname)
       /* First set the default drive */
       if (lgh > 1) {
          if (pathname[1] == ':') {
       /* First set the default drive */
       if (lgh > 1) {
          if (pathname[1] == ':') {
-             ret = DosSetDefaultDisk(toupper(pathname[0]) - 'A' + 1); 
+             ret = DosSetDefaultDisk(toupper(pathname[0]) - 'A' + 1);
          }
       }
       /* After that, set the current dir! */
          }
       }
       /* After that, set the current dir! */
@@ -703,7 +703,7 @@ mc_chdir(char *pathname)
    }
    return ret;
 }
    }
    return ret;
 }
+
 int
 mc_chmod(char *pathName, int unxmode)
 {
 int
 mc_chmod(char *pathName, int unxmode)
 {
@@ -731,7 +731,7 @@ conv_os2_unx_rc(int os2rc)
       case ERROR_INVALID_PARAMETER:
          errCode = EINVAL;
          break;
       case ERROR_INVALID_PARAMETER:
          errCode = EINVAL;
          break;
-      default: 
+      default:
          errCode = EINVAL;
         break;
    }
          errCode = EINVAL;
         break;
    }
@@ -747,7 +747,7 @@ mc_open (char *file, int flags, int pmode)
 int
 mc_unlink(char *pathName)
 {
 int
 mc_unlink(char *pathName)
 {
-   /* Use OS/2 API to delete a file, if the file is set as read-only, 
+   /* Use OS/2 API to delete a file, if the file is set as read-only,
       the file will be deleted without asking the user! */
    APIRET       rc;
    rc = DosDelete(pathName);
       the file will be deleted without asking the user! */
    APIRET       rc;
    rc = DosDelete(pathName);
@@ -776,7 +776,7 @@ get_default_editor (void)
        APIRET  rc;
        char    pathValue[5] = "PATH";
        UCHAR   searchResult[MC_MAXPATHLEN + 1];
        APIRET  rc;
        char    pathValue[5] = "PATH";
        UCHAR   searchResult[MC_MAXPATHLEN + 1];
-       
+
         /* EPM is not always be installed */
        rc = DosSearchPath((SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY),
                           (PSZ) pathValue,
         /* EPM is not always be installed */
        rc = DosSearchPath((SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | SEARCH_CUR_DIRECTORY),
                           (PSZ) pathValue,
index 6c092b0..7a7aa70 100644 (file)
@@ -7,7 +7,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
 #include <config.h>
 */
 
 #include <config.h>
@@ -39,8 +39,8 @@ int win32_GetPlatform ()
     return (platform ? platform : (platform = win32_GetVersionEx()) );
 }
 
     return (platform ? platform : (platform = win32_GetVersionEx()) );
 }
 
-/* int win32_GetVersionEx () 
-   intended for use by win32_GetPlatform only 
+/* int win32_GetVersionEx ()
+   intended for use by win32_GetPlatform only
 */
 int win32_GetVersionEx ()
 {
 */
 int win32_GetVersionEx ()
 {
@@ -177,7 +177,7 @@ int win32_GetEXEType (const char* a_szFileName)
            return EXE_Unknown;                 /* FIXME: what is "NATIVE??" */
        default:
             win32Trace(("Unknown type %u.\n", image_optional_header.Subsystem));
            return EXE_Unknown;                 /* FIXME: what is "NATIVE??" */
        default:
             win32Trace(("Unknown type %u.\n", image_optional_header.Subsystem));
-           return EXE_Unknown;                 
+           return EXE_Unknown;
     }
 #else
     return EXE_Unknown;
     }
 #else
     return EXE_Unknown;
index 2ed74c7..11f0c2a 100644 (file)
@@ -8,7 +8,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -16,7 +16,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
 /* Prototypes */
 */
 
 /* Prototypes */
index cddf6ef..4f656ea 100644 (file)
@@ -7,7 +7,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 #include <config.h>
 #include <windows.h>
 */
 #include <config.h>
 #include <windows.h>
@@ -29,7 +29,7 @@
           0 if not
 
    Note:  Code taken from MSKbase Number: Q118626.
           0 if not
 
    Note:  Code taken from MSKbase Number: Q118626.
-   
+
    To determine whether or not a user is an administrator, you need to examine
    the user's access token with GetTokenInformation(). The access token
    represents the user's privileges and the groups to which the user belongs.
    To determine whether or not a user is an administrator, you need to examine
    the user's access token with GetTokenInformation(). The access token
    represents the user's privileges and the groups to which the user belongs.
@@ -76,7 +76,7 @@ int winnt_IsAdministrator()
 }
 
 
 }
 
 
-int geteuid () 
+int geteuid ()
 {
     if (winnt_IsAdministrator())
        return 0;
 {
     if (winnt_IsAdministrator())
        return 0;
index c42f73d..8aab3fd 100644 (file)
@@ -2,7 +2,7 @@
    need.  Use slang.h for that purpose. */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
    need.  Use slang.h for that purpose. */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -34,7 +34,7 @@
 
 
 /* These quantities are main_types for byte-compiled code.  They are used
 
 
 /* These quantities are main_types for byte-compiled code.  They are used
- * by the inner_interp routine.  The ones commented out with a // are 
+ * by the inner_interp routine.  The ones commented out with a // are
  * actually defined in slang.h because they are also used as the main_type in
  * the name table.
  */
  * actually defined in slang.h because they are also used as the main_type in
  * the name table.
  */
@@ -156,7 +156,7 @@ typedef struct SLBlock_Type
   {
      unsigned char main_type;
      unsigned char sub_type;
   {
      unsigned char main_type;
      unsigned char sub_type;
-     union 
+     union
        {
          struct SLBlock_Type *blk;
          int i_blk;
        {
          struct SLBlock_Type *blk;
          int i_blk;
@@ -290,7 +290,7 @@ extern void SLang_push_float(float64);
 extern void SLadd_variable(char *);
 extern void SLang_clear_error(void);
 extern void SLarray_info (void);
 extern void SLadd_variable(char *);
 extern void SLang_clear_error(void);
 extern void SLarray_info (void);
-extern int SLPreprocess_Only;                  /* preprocess instead of 
+extern int SLPreprocess_Only;                  /* preprocess instead of
                                                 * bytecompiling
                                                 */
 
                                                 * bytecompiling
                                                 */
 
index e822b3b..b80a263 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _JD_MACROS_H_
 #define _JD_MACROS_H_
 
 #ifndef _JD_MACROS_H_
 #define _JD_MACROS_H_
 
-/* This file defines some macros that I use with programs that link to 
+/* This file defines some macros that I use with programs that link to
  * the slang library.
  */
 
  * the slang library.
  */
 
@@ -15,7 +15,7 @@
 
 #ifdef HAVE_MEMORY_H
 # include <memory.h>
 
 #ifdef HAVE_MEMORY_H
 # include <memory.h>
-#endif 
+#endif
 
 #ifndef SLMEMSET
 # ifdef HAVE_MEMSET
 
 #ifndef SLMEMSET
 # ifdef HAVE_MEMSET
index 8f28fb8..0c74c57 100644 (file)
@@ -3,7 +3,7 @@
 /* -*- mode: C; mode: fold; -*- */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* -*- mode: C; mode: fold; -*- */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -96,13 +96,13 @@ extern "C" {
 #  define VOID unsigned char
 # endif
 #endif
 #  define VOID unsigned char
 # endif
 #endif
-   
+
 #if 1
    typedef int (*FVOID_STAR)(void);
 #else
 # define FVOID_STAR VOID_STAR
 #endif
 #if 1
    typedef int (*FVOID_STAR)(void);
 #else
 # define FVOID_STAR VOID_STAR
 #endif
-   
+
 #if defined(msdos) && !defined(DOS386) && !defined(__GO32__) && !defined(__WIN32__)
 # define SLFREE(buf)  farfree((void far *)(buf))
 # define SLMALLOC(x) farmalloc((unsigned long) (x))
 #if defined(msdos) && !defined(DOS386) && !defined(__GO32__) && !defined(__WIN32__)
 # define SLFREE(buf)  farfree((void far *)(buf))
 # define SLMALLOC(x) farmalloc((unsigned long) (x))
@@ -136,7 +136,7 @@ extern "C" {
 # define SLCALLOC(n, m) SLdebug_calloc((unsigned long) (n), (unsigned long)(m))
 # define SLREALLOC(p, x) SLdebug_realloc((unsigned char *)(p), (unsigned long)(x))
 #endif /* SL_MALLOC_DEBUG */
 # define SLCALLOC(n, m) SLdebug_calloc((unsigned long) (n), (unsigned long)(m))
 # define SLREALLOC(p, x) SLdebug_realloc((unsigned char *)(p), (unsigned long)(x))
 #endif /* SL_MALLOC_DEBUG */
-   
+
    extern unsigned char *SLdebug_malloc (unsigned long);
    extern unsigned char *SLdebug_calloc (unsigned long, unsigned long);
    extern unsigned char *SLdebug_realloc (unsigned char *, unsigned long);
    extern unsigned char *SLdebug_malloc (unsigned long);
    extern unsigned char *SLdebug_calloc (unsigned long, unsigned long);
    extern unsigned char *SLdebug_realloc (unsigned char *, unsigned long);
@@ -145,7 +145,7 @@ extern "C" {
    extern char *SLstrcpy(register char *, register char *);
    extern int SLstrcmp(register char *, register char *);
    extern char *SLstrncpy(char *, register char *, register  int);
    extern char *SLstrcpy(register char *, register char *);
    extern int SLstrcmp(register char *, register char *);
    extern char *SLstrncpy(char *, register char *, register  int);
-   
+
    extern void SLmemset (char *, char, int);
    extern char *SLmemchr (register char *, register char, register int);
    extern char *SLmemcpy (char *, char *, int);
    extern void SLmemset (char *, char, int);
    extern char *SLmemchr (register char *, register char, register int);
    extern char *SLmemcpy (char *, char *, int);
@@ -154,7 +154,7 @@ extern "C" {
 #ifdef float64
 # undef float64
 #endif
 #ifdef float64
 # undef float64
 #endif
-   
+
 #ifndef FLOAT64_TYPEDEFED
 # define FLOAT64_TYPEDEFED
   typedef double float64;
 #ifndef FLOAT64_TYPEDEFED
 # define FLOAT64_TYPEDEFED
   typedef double float64;
@@ -182,7 +182,7 @@ typedef struct SLang_Name_Type
      char name[SLANG_MAX_NAME_LEN + 2]; /* [0] is hash */
 
      unsigned char sub_type;
      char name[SLANG_MAX_NAME_LEN + 2]; /* [0] is hash */
 
      unsigned char sub_type;
-     
+
 /* Values for main_type may be as follows.  The particlular values are
  * for compatability.
  */
 /* Values for main_type may be as follows.  The particlular values are
  * for compatability.
  */
@@ -204,9 +204,9 @@ typedef struct SLang_Load_Type
 {
    long name;                         /* file name, string address, ... */
    long handle;                               /* FILE *, string address, etc... */
 {
    long name;                         /* file name, string address, ... */
    long handle;                               /* FILE *, string address, etc... */
-   
+
    char *ptr;                         /* input pointer to next line in object
    char *ptr;                         /* input pointer to next line in object
-                                       * to be read. 
+                                       * to be read.
                                        */
    /* Things below here are used by S-Lang. */
    int type;                          /* 'F' = file, 'S' = String, etc.. */
                                        */
    /* Things below here are used by S-Lang. */
    int type;                          /* 'F' = file, 'S' = String, etc.. */
@@ -215,7 +215,7 @@ typedef struct SLang_Load_Type
    int n;                             /* line number, etc... */
    char token[256];                   /* token to be parsed */
    int ofs;                           /* offset from buf where last read
    int n;                             /* line number, etc... */
    char token[256];                   /* token to be parsed */
    int ofs;                           /* offset from buf where last read
-                                       * took place 
+                                       * took place
                                        */
    int top_level;                     /* 1 if at top level of parsing */
 } SLang_Load_Type;
                                        */
    int top_level;                     /* 1 if at top level of parsing */
 } SLang_Load_Type;
@@ -225,8 +225,8 @@ typedef struct SLang_Load_Type
 #  define NO_PROTOTYPES
 # endif
 #endif
 #  define NO_PROTOTYPES
 # endif
 #endif
-   
-#ifndef NO_PROTOTYPES 
+
+#ifndef NO_PROTOTYPES
 # define _PROTO(x) x
 #else
 # define _PROTO(x) ()
 # define _PROTO(x) x
 #else
 # define _PROTO(x) ()
@@ -235,14 +235,14 @@ typedef struct SLang_Load_Type
 typedef struct SL_OOBinary_Type
 {
    unsigned char sub_type;            /* partner type for binary op */
 typedef struct SL_OOBinary_Type
 {
    unsigned char sub_type;            /* partner type for binary op */
-   
+
    /* The function take the binary op as first argument, the operand types
    /* The function take the binary op as first argument, the operand types
-    * form the second and third parameters and the last two parameters are 
+    * form the second and third parameters and the last two parameters are
     * pointers to the objects themselves.  It is up to the function to push
     * pointers to the objects themselves.  It is up to the function to push
-    * the result on the stack.  It must return 1 if it handled the operation 
+    * the result on the stack.  It must return 1 if it handled the operation
     * return zero if the operation is not defined.
     */
     * return zero if the operation is not defined.
     */
-   int (*binary_function)_PROTO((int, unsigned char, unsigned char, 
+   int (*binary_function)_PROTO((int, unsigned char, unsigned char,
                                  VOID_STAR, VOID_STAR));
 
    struct SL_OOBinary_Type *next;
                                  VOID_STAR, VOID_STAR));
 
    struct SL_OOBinary_Type *next;
@@ -259,13 +259,13 @@ typedef struct
    int (*unary_function)_PROTO((int, unsigned char, VOID_STAR));
    /* unary operation function */
    SL_OOBinary_Type *binary_ops;
    int (*unary_function)_PROTO((int, unsigned char, VOID_STAR));
    /* unary operation function */
    SL_OOBinary_Type *binary_ops;
-   
+
    int (*copy_function)_PROTO((unsigned char, VOID_STAR));
    /* This function is called do make a copy of the object */
 } SLang_Class_Type;
 
 extern SLang_Class_Type *SLang_Registered_Types[256];
    int (*copy_function)_PROTO((unsigned char, VOID_STAR));
    /* This function is called do make a copy of the object */
 } SLang_Class_Type;
 
 extern SLang_Class_Type *SLang_Registered_Types[256];
-   
+
 typedef struct
 {
    unsigned char main_type;           /* SLANG_RVARIABLE, etc.. */
 typedef struct
 {
    unsigned char main_type;           /* SLANG_RVARIABLE, etc.. */
@@ -277,7 +277,7 @@ typedef struct
 }
 SLuser_Object_Type;
 
 }
 SLuser_Object_Type;
 
-   
+
 /*}}}*/
 /*{{{ Interpreter Function Prototypes */
 
 /*}}}*/
 /*{{{ Interpreter Function Prototypes */
 
@@ -285,7 +285,7 @@ SLuser_Object_Type;
   /* Non zero if error occurs.  Must be reset to zero to continue. */
 
   extern int SLang_Traceback;
   /* Non zero if error occurs.  Must be reset to zero to continue. */
 
   extern int SLang_Traceback;
-  /* If non-zero, dump an S-Lang traceback upon error.  Available as 
+  /* If non-zero, dump an S-Lang traceback upon error.  Available as
      _traceback in S-Lang. */
 
   extern char *SLang_User_Prompt;
      _traceback in S-Lang. */
 
   extern char *SLang_User_Prompt;
@@ -299,16 +299,16 @@ SLuser_Object_Type;
   extern void (*SLang_Exit_Error_Hook)(char *);
   extern void SLang_exit_error (char *);
   extern void (*SLang_Dump_Routine)(char *);
   extern void (*SLang_Exit_Error_Hook)(char *);
   extern void SLang_exit_error (char *);
   extern void (*SLang_Dump_Routine)(char *);
-  /* Called if S-Lang traceback is enabled as well as other debugging 
+  /* Called if S-Lang traceback is enabled as well as other debugging
      routines (e.g., trace).  By default, these messages go to stderr. */
      routines (e.g., trace).  By default, these messages go to stderr. */
-  
+
   extern void (*SLang_Interrupt)(void);
   extern void (*SLang_Interrupt)(void);
-  /* function to call whenever inner interpreter is entered.  This is 
+  /* function to call whenever inner interpreter is entered.  This is
      a good place to set SLang_Error to USER_BREAK. */
 
   extern void (*SLang_User_Clear_Error)(void);
   /* function that gets called when '_clear_error' is called. */
      a good place to set SLang_Error to USER_BREAK. */
 
   extern void (*SLang_User_Clear_Error)(void);
   /* function that gets called when '_clear_error' is called. */
-  extern int (*SLang_User_Open_Slang_Object)(SLang_Load_Type *); 
+  extern int (*SLang_User_Open_Slang_Object)(SLang_Load_Type *);
   extern int (*SLang_User_Close_Slang_Object)(SLang_Load_Type *);
   /* user defined loading routines. */
 
   extern int (*SLang_User_Close_Slang_Object)(SLang_Load_Type *);
   /* user defined loading routines. */
 
@@ -320,7 +320,7 @@ SLuser_Object_Type;
 
 /* Functions: */
 
 
 /* Functions: */
 
-   extern int init_SLang(void);   
+   extern int init_SLang(void);
    /* This function is mandatory and must be called by all applications */
    extern int init_SLfiles(void);
    /* called if fputs, fgets, etc are need in S-Lang */
    /* This function is mandatory and must be called by all applications */
    extern int init_SLfiles(void);
    /* called if fputs, fgets, etc are need in S-Lang */
@@ -331,10 +331,10 @@ SLuser_Object_Type;
    /* unix system functions chmod, stat, etc... */
 
    extern int init_SLmatrix(void);
    /* unix system functions chmod, stat, etc... */
 
    extern int init_SLmatrix(void);
-   
+
    extern int SLang_add_table(SLang_Name_Type *, char *);
    extern int SLang_add_table(SLang_Name_Type *, char *);
-   /* add application dependent function table p1 to S-Lang.  A name p2 less 
-    *  than 32 characters must also be supplied.      
+   /* add application dependent function table p1 to S-Lang.  A name p2 less
+    *  than 32 characters must also be supplied.
     * Returns 0 upon failure or 1 upon success. */
 
    extern int SLang_add_global_variable (char *);
     * Returns 0 upon failure or 1 upon success. */
 
    extern int SLang_add_global_variable (char *);
@@ -345,28 +345,28 @@ SLuser_Object_Type;
 
    extern void SLang_restart(int);
    /* should be called if an error occurs.  If the passed integer is
 
    extern void SLang_restart(int);
    /* should be called if an error occurs.  If the passed integer is
-    * non-zero, items are popped off the stack; otherwise, the stack is 
+    * non-zero, items are popped off the stack; otherwise, the stack is
     * left intact.  Any time the stack is believed to be trashed, this routine
     * should be called with a non-zero argument (e.g., if setjmp/longjmp is
     * left intact.  Any time the stack is believed to be trashed, this routine
     * should be called with a non-zero argument (e.g., if setjmp/longjmp is
-    * called). */ 
+    * called). */
 
    extern void SLang_byte_compile_file(char *, int *);
    /* takes a file of S-Lang code and ``byte-compiles'' it for faster
     * loading.  The new filename is equivalent to the old except that a `c' is
 
    extern void SLang_byte_compile_file(char *, int *);
    /* takes a file of S-Lang code and ``byte-compiles'' it for faster
     * loading.  The new filename is equivalent to the old except that a `c' is
-    * appended to the name.  (e.g., init.sl --> init.slc).  If the second 
+    * appended to the name.  (e.g., init.sl --> init.slc).  If the second
     * parameter is non-zero, preprocess the file only.
     */
 
    extern void SLang_autoload(char *, char *);
    /* Automatically load S-Lang function p1 from file p2.  This function
       is also available via S-Lang */
     * parameter is non-zero, preprocess the file only.
     */
 
    extern void SLang_autoload(char *, char *);
    /* Automatically load S-Lang function p1 from file p2.  This function
       is also available via S-Lang */
-   
+
    extern char *SLang_load_string(char *);
    /* Like SLang_load_file except input is from a null terminated string. */
    extern char *SLang_load_string(char *);
    /* Like SLang_load_file except input is from a null terminated string. */
-   
+
    extern void SLang_do_pop(void);
    /* pops item off stack and frees any memory associated with it */
    extern void SLang_do_pop(void);
    /* pops item off stack and frees any memory associated with it */
-   
+
    extern int SLang_pop_integer(int *);
    /* pops integer *p0 from the stack.  Returns 0 upon success and non-zero
     * if the stack is empty or a type mismatch occurs, setting SLang_Error.
    extern int SLang_pop_integer(int *);
    /* pops integer *p0 from the stack.  Returns 0 upon success and non-zero
     * if the stack is empty or a type mismatch occurs, setting SLang_Error.
@@ -377,11 +377,11 @@ SLuser_Object_Type;
    /* pops string *p0 from stack.  If *p1 is non-zero, the string must be
     * freed after its use.  DO NOT FREE p0 if *p1 IS ZERO! Returns 0 upon
     * success */
    /* pops string *p0 from stack.  If *p1 is non-zero, the string must be
     * freed after its use.  DO NOT FREE p0 if *p1 IS ZERO! Returns 0 upon
     * success */
-      
+
    extern int SLang_pop_float(float64 *, int *, int *);
    /* Pops float *p1 from stack.  If *p3 is non-zero, *p1 was derived
       from the integer *p2. Returns zero upon success. */
    extern int SLang_pop_float(float64 *, int *, int *);
    /* Pops float *p1 from stack.  If *p3 is non-zero, *p1 was derived
       from the integer *p2. Returns zero upon success. */
-      
+
    extern SLuser_Object_Type *SLang_pop_user_object (unsigned char);
    extern void SLang_free_user_object (SLuser_Object_Type *);
    extern void SLang_free_intrinsic_user_object (SLuser_Object_Type *);
    extern SLuser_Object_Type *SLang_pop_user_object (unsigned char);
    extern void SLang_free_user_object (SLuser_Object_Type *);
    extern void SLang_free_intrinsic_user_object (SLuser_Object_Type *);
@@ -392,14 +392,14 @@ SLuser_Object_Type;
 
    extern void SLang_push_user_object (SLuser_Object_Type *);
    extern SLuser_Object_Type *SLang_create_user_object (unsigned char);
 
    extern void SLang_push_user_object (SLuser_Object_Type *);
    extern SLuser_Object_Type *SLang_create_user_object (unsigned char);
-   
+
    extern int SLang_add_unary_op (unsigned char, FVOID_STAR);
    extern int SLang_add_binary_op (unsigned char, unsigned char, FVOID_STAR);
    extern int SLang_register_class (unsigned char, FVOID_STAR, FVOID_STAR);
    extern int SLang_add_copy_operation (unsigned char, FVOID_STAR);
 
    extern long *SLang_pop_pointer(unsigned char *, unsigned char *, int *);
    extern int SLang_add_unary_op (unsigned char, FVOID_STAR);
    extern int SLang_add_binary_op (unsigned char, unsigned char, FVOID_STAR);
    extern int SLang_register_class (unsigned char, FVOID_STAR, FVOID_STAR);
    extern int SLang_add_copy_operation (unsigned char, FVOID_STAR);
 
    extern long *SLang_pop_pointer(unsigned char *, unsigned char *, int *);
-   /* Returns a pointer to object of type *p1,*p2 on top of stack. 
+   /* Returns a pointer to object of type *p1,*p2 on top of stack.
       If *p3 is non-zero, the Object must be freed after use. */
 
 
       If *p3 is non-zero, the Object must be freed after use. */
 
 
@@ -408,7 +408,7 @@ SLuser_Object_Type;
 
    extern void SLang_push_string(char *);
    /* Push string p1 onto stack */
 
    extern void SLang_push_string(char *);
    /* Push string p1 onto stack */
-   
+
    extern void SLang_push_integer(int);
    /* push integer p1 on stack */
 
    extern void SLang_push_integer(int);
    /* push integer p1 on stack */
 
@@ -418,20 +418,20 @@ SLuser_Object_Type;
 
    extern int SLang_is_defined(char *);
    /* Return non-zero is p1 is defined otherwise returns 0. */
 
    extern int SLang_is_defined(char *);
    /* Return non-zero is p1 is defined otherwise returns 0. */
-   
+
    extern int SLang_run_hooks(char *, char *, char *);
    /* calls S-Lang function p1 pushing strings p2 and p3 onto the stack
     * first.  If either string is NULL, it is not pushed. If p1 is not
     * defined, 0 is returned. */
 
    extern int SLang_execute_function(char *);
    extern int SLang_run_hooks(char *, char *, char *);
    /* calls S-Lang function p1 pushing strings p2 and p3 onto the stack
     * first.  If either string is NULL, it is not pushed. If p1 is not
     * defined, 0 is returned. */
 
    extern int SLang_execute_function(char *);
-   /* Call S-Lang function p1.  Returns 0 if the function is not defined 
+   /* Call S-Lang function p1.  Returns 0 if the function is not defined
     * and 1 if it is.
     */
 
    extern char *SLang_find_name(char *);
    /* Return a pointer to p1 in table if it is defined.  Returns NULL
     * and 1 if it is.
     */
 
    extern char *SLang_find_name(char *);
    /* Return a pointer to p1 in table if it is defined.  Returns NULL
-    * otherwise.  This is useful when one wants to avoid redundant strings. 
+    * otherwise.  This is useful when one wants to avoid redundant strings.
     */
 
    extern char *SLang_rpn_interpret(char *);
     */
 
    extern char *SLang_rpn_interpret(char *);
@@ -439,14 +439,14 @@ SLuser_Object_Type;
 
    extern void SLang_doerror(char *);
    /* set SLang_Error and display p1 as error message */
 
    extern void SLang_doerror(char *);
    /* set SLang_Error and display p1 as error message */
-   
-   extern SLuser_Object_Type *SLang_add_array(char *, long *, 
-                                             int, int, int, int, 
+
+   extern SLuser_Object_Type *SLang_add_array(char *, long *,
+                                             int, int, int, int,
                                              unsigned char, unsigned char);
                                              unsigned char, unsigned char);
-   /* This function has not been tested thoroughly yet.  Its purpose is to 
-    * allow a S-Lang procedure to access a C array. For example, suppose that 
+   /* This function has not been tested thoroughly yet.  Its purpose is to
+    * allow a S-Lang procedure to access a C array. For example, suppose that
     * you have an array of 100 ints defined as:
     * you have an array of 100 ints defined as:
-    *  
+    *
     *  int c_array[100];
     *
     * By calling something like:
     *  int c_array[100];
     *
     * By calling something like:
@@ -454,39 +454,39 @@ SLuser_Object_Type;
     *   SLang_add_array ("array_name", (long *) c_array, 1, 100, 0, 0,
     *                   'i', SLANG_IVARIABLE);
     *
     *   SLang_add_array ("array_name", (long *) c_array, 1, 100, 0, 0,
     *                   'i', SLANG_IVARIABLE);
     *
-    * the array can be accessed by the name 'array_name'.  This function 
-    * returns -1 upon failure.  The 3rd argument specifies the dimension 
+    * the array can be accessed by the name 'array_name'.  This function
+    * returns -1 upon failure.  The 3rd argument specifies the dimension
     * of the array, the 4th, and 5th arguments specify how many elements
     * of the array, the 4th, and 5th arguments specify how many elements
-    * there are in the x,y, and z directions.  The last argument must 
-    * be one of: 
-    * 
+    * there are in the x,y, and z directions.  The last argument must
+    * be one of:
+    *
     *        SLANG_IVARIABLE:  indicates array is writable
     *        SLANG_RVARIABLE:  indicates array is read only
     *        SLANG_IVARIABLE:  indicates array is writable
     *        SLANG_RVARIABLE:  indicates array is read only
-    * 
+    *
     * Returns NULL upon failure.
     */
 
 
 extern int SLang_free_array_handle (int);
     * Returns NULL upon failure.
     */
 
 
 extern int SLang_free_array_handle (int);
-/* This routine may be called by application to free array handle created by 
+/* This routine may be called by application to free array handle created by
  * the application.  Returns 0 upon success, -1 if the handle is invalid and
  * -2 if the handle is not associated with a C array.
  */
 
    extern char *SLang_extract_list_element(char *, int *, int*);
  * the application.  Returns 0 upon success, -1 if the handle is invalid and
  * -2 if the handle is not associated with a C array.
  */
 
    extern char *SLang_extract_list_element(char *, int *, int*);
-   extern void SLexpand_escaped_string (register char *, register char *, 
+   extern void SLexpand_escaped_string (register char *, register char *,
                                        register char *);
 
 extern SLang_Name_Type *SLang_get_function (char *);
                                        register char *);
 
 extern SLang_Name_Type *SLang_get_function (char *);
-/* The parameter is the name of a user defined S-Lang function.  This 
+/* The parameter is the name of a user defined S-Lang function.  This
  * routine returns NULL if the function does not exist or it returns the
  * a pointer to it in an internal S-Lang table.  This pointer can be used
  * by 'SLexecute_function' to call the function directly from C.
  */
  * routine returns NULL if the function does not exist or it returns the
  * a pointer to it in an internal S-Lang table.  This pointer can be used
  * by 'SLexecute_function' to call the function directly from C.
  */
-  
+
 extern void SLexecute_function(SLang_Name_Type *);
 /* This function allows an application to call a S-Lang function from within
 extern void SLexecute_function(SLang_Name_Type *);
 /* This function allows an application to call a S-Lang function from within
- * the C program.  The parameter must be non-NULL and must have been 
+ * the C program.  The parameter must be non-NULL and must have been
  * previously obtained by a call to 'SLang_get_function'.
  */
 extern void SLroll_stack (int *);
  * previously obtained by a call to 'SLang_get_function'.
  */
 extern void SLroll_stack (int *);
@@ -514,9 +514,9 @@ extern char *SLcurrent_time_string (void);
 extern int SLatoi(unsigned char *);
 
 extern int SLang_extract_token(char **, char *, int);
 extern int SLatoi(unsigned char *);
 
 extern int SLang_extract_token(char **, char *, int);
-/* returns 0 upon failure and non-zero upon success.  The first parameter 
- * is a pointer to the input stream which this function will bump along.  
- * The second parameter is the buffer where the token is placed.  The third 
+/* returns 0 upon failure and non-zero upon success.  The first parameter
+ * is a pointer to the input stream which this function will bump along.
+ * The second parameter is the buffer where the token is placed.  The third
  * parameter is used internally by the S-Lang library and should be 0 for
  * user applications.
  */
  * parameter is used internally by the S-Lang library and should be 0 for
  * user applications.
  */
@@ -524,12 +524,12 @@ extern int SLang_extract_token(char **, char *, int);
 /*}}}*/
 
 /*{{{ SLang getkey interface Functions */
 /*}}}*/
 
 /*{{{ SLang getkey interface Functions */
-   
+
 #ifdef REAL_UNIX_SYSTEM
 extern int SLang_TT_Baud_Rate;
 extern int SLang_TT_Read_FD;
 #endif
 #ifdef REAL_UNIX_SYSTEM
 extern int SLang_TT_Baud_Rate;
 extern int SLang_TT_Read_FD;
 #endif
-   
+
 extern int SLang_init_tty (int, int, int);
 /* Initializes the tty for single character input.  If the first parameter *p1
  * is in the range 0-255, it will be used for the abort character;
 extern int SLang_init_tty (int, int, int);
 /* Initializes the tty for single character input.  If the first parameter *p1
  * is in the range 0-255, it will be used for the abort character;
@@ -571,7 +571,7 @@ extern int SLang_Ignore_User_Abort;
 
 extern void SLang_set_abort_signal (void (*)(int));
 /* If SIGINT is generated, the function p1 will be called.  If p1 is NULL
 
 extern void SLang_set_abort_signal (void (*)(int));
 /* If SIGINT is generated, the function p1 will be called.  If p1 is NULL
- * the SLang_default signal handler is called.  This sets SLang_Error to 
+ * the SLang_default signal handler is called.  This sets SLang_Error to
  * USER_BREAK.  I suspect most users will simply want to pass NULL.
  */
 
  * USER_BREAK.  I suspect most users will simply want to pass NULL.
  */
 
@@ -635,19 +635,19 @@ extern SLKeyMap_List_Type SLKeyMap_List[SLANG_MAX_KEYMAPS];   /* these better be
 
 extern char *SLang_process_keystring(char *);
 
 
 extern char *SLang_process_keystring(char *);
 
-#ifdef SLKEYMAP_OBSOLETE   
+#ifdef SLKEYMAP_OBSOLETE
 extern int SLang_define_key1(char *, VOID_STAR, unsigned int, SLKeyMap_List_Type *);
 /* define key p1 in keymap p4 to invoke function p2.  If type p3 is given by
  * SLKEY_F_INTRINSIC, p2 is an intrinsic function, else it is a string to be
  * passed to the interpreter for evaluation.  The return value is important.
 extern int SLang_define_key1(char *, VOID_STAR, unsigned int, SLKeyMap_List_Type *);
 /* define key p1 in keymap p4 to invoke function p2.  If type p3 is given by
  * SLKEY_F_INTRINSIC, p2 is an intrinsic function, else it is a string to be
  * passed to the interpreter for evaluation.  The return value is important.
- * It returns 0 upon success, -1 upon malloc error, and -2 if the key is 
+ * It returns 0 upon success, -1 upon malloc error, and -2 if the key is
  * inconsistent.  SLang_Error is set upon error. */
 #else
 extern int SLkm_define_key (char *, FVOID_STAR, SLKeyMap_List_Type *);
 #endif
  * inconsistent.  SLang_Error is set upon error. */
 #else
 extern int SLkm_define_key (char *, FVOID_STAR, SLKeyMap_List_Type *);
 #endif
-   
+
 extern int SLang_define_key(char *, char *, SLKeyMap_List_Type *);
 extern int SLang_define_key(char *, char *, SLKeyMap_List_Type *);
-/* Like define_key1 except that p2 is a string that is to be associated with 
+/* Like define_key1 except that p2 is a string that is to be associated with
  * a function in the functions field of p3.  This routine calls define_key1.
  */
 
  * a function in the functions field of p3.  This routine calls define_key1.
  */
 
@@ -696,7 +696,7 @@ typedef struct SLang_Read_Line_Type
 /* Maximum size of display */
 #define SLRL_DISPLAY_BUFFER_SIZE 256
 
 /* Maximum size of display */
 #define SLRL_DISPLAY_BUFFER_SIZE 256
 
-typedef struct 
+typedef struct
 {
    SLang_Read_Line_Type *root, *tail, *last;
    unsigned char *buf;                /* edit buffer */
 {
    SLang_Read_Line_Type *root, *tail, *last;
    unsigned char *buf;                /* edit buffer */
@@ -704,14 +704,14 @@ typedef struct
    int point;                         /* current editing point */
    int tab;                           /* tab width */
    int len;                           /* current line size */
    int point;                         /* current editing point */
    int tab;                           /* tab width */
    int len;                           /* current line size */
-   
+
    /* display variables */
    int edit_width;                    /* length of display field */
    int curs_pos;                              /* current column */
    int start_column;                  /* column offset of display */
    int dhscroll;                      /* amount to use for horiz scroll */
    char *prompt;
    /* display variables */
    int edit_width;                    /* length of display field */
    int curs_pos;                              /* current column */
    int start_column;                  /* column offset of display */
    int dhscroll;                      /* amount to use for horiz scroll */
    char *prompt;
-   
+
    FVOID_STAR last_fun;                       /* last function executed by rl */
 
    /* These two contain an image of what is on the display */
    FVOID_STAR last_fun;                       /* last function executed by rl */
 
    /* These two contain an image of what is on the display */
@@ -719,7 +719,7 @@ typedef struct
    unsigned char upd_buf2[SLRL_DISPLAY_BUFFER_SIZE];
    unsigned char *old_upd, *new_upd;   /* pointers to previous two buffers */
    int new_upd_len, old_upd_len;       /* length of output buffers */
    unsigned char upd_buf2[SLRL_DISPLAY_BUFFER_SIZE];
    unsigned char *old_upd, *new_upd;   /* pointers to previous two buffers */
    int new_upd_len, old_upd_len;       /* length of output buffers */
-   
+
    SLKeyMap_List_Type *keymap;
 
    /* tty variables */
    SLKeyMap_List_Type *keymap;
 
    /* tty variables */
@@ -731,7 +731,7 @@ typedef struct
    void (*tt_insert)(char);
    void (*update_hook)(unsigned char *, int, int);
    /* The update hook is called with a pointer to a buffer p1 that contains
    void (*tt_insert)(char);
    void (*update_hook)(unsigned char *, int, int);
    /* The update hook is called with a pointer to a buffer p1 that contains
-    * an image of what the update hook is suppoed to produce.  The length 
+    * an image of what the update hook is suppoed to produce.  The length
     * of the buffer is p2 and after the update, the cursor is to be placed
     * in column p3.
     */
     * of the buffer is p2 and after the update, the cursor is to be placed
     * in column p3.
     */
@@ -743,7 +743,7 @@ extern SLang_Read_Line_Type * SLang_rline_save_line (SLang_RLine_Info_Type *);
 extern int SLang_init_readline (SLang_RLine_Info_Type *);
 extern int SLang_read_line (SLang_RLine_Info_Type *);
 extern int SLang_rline_insert (char *);
 extern int SLang_init_readline (SLang_RLine_Info_Type *);
 extern int SLang_read_line (SLang_RLine_Info_Type *);
 extern int SLang_rline_insert (char *);
-extern void SLrline_redraw (SLang_RLine_Info_Type *);   
+extern void SLrline_redraw (SLang_RLine_Info_Type *);
 extern int SLang_Rline_Quit;
 
 /*}}}*/
 extern int SLang_Rline_Quit;
 
 /*}}}*/
@@ -770,7 +770,7 @@ extern int SLtt_Ignore_Beep;
 #if defined(REAL_UNIX_SYSTEM)
 extern int SLtt_Force_Keypad_Init;
 #endif
 #if defined(REAL_UNIX_SYSTEM)
 extern int SLtt_Force_Keypad_Init;
 #endif
-   
+
 #ifndef __GO32__
 #if defined(VMS) || defined(REAL_UNIX_SYSTEM)
 extern int SLtt_Blink_Mode;
 #ifndef __GO32__
 #if defined(VMS) || defined(REAL_UNIX_SYSTEM)
 extern int SLtt_Blink_Mode;
@@ -787,8 +787,8 @@ extern int SLtt_Try_Termcap;
 #ifdef msdos
 extern int SLtt_Msdos_Cheap_Video;
 #endif
 #ifdef msdos
 extern int SLtt_Msdos_Cheap_Video;
 #endif
-   
-   
+
+
 extern int SLtt_flush_output (void);
 extern void SLtt_set_scroll_region(int, int);
 extern void SLtt_reset_scroll_region(void);
 extern int SLtt_flush_output (void);
 extern void SLtt_set_scroll_region(int, int);
 extern void SLtt_reset_scroll_region(void);
@@ -813,7 +813,7 @@ extern void SLtt_reset_video (void);
 extern void SLtt_get_terminfo(void);
 extern void SLtt_get_screen_size (void);
 extern int SLtt_set_cursor_visibility (int);
 extern void SLtt_get_terminfo(void);
 extern void SLtt_get_screen_size (void);
 extern int SLtt_set_cursor_visibility (int);
-   
+
 #if defined(VMS) || defined(REAL_UNIX_SYSTEM)
 extern void SLtt_enable_cursor_keys(void);
 extern void SLtt_set_term_vtxxx(int *);
 #if defined(VMS) || defined(REAL_UNIX_SYSTEM)
 extern void SLtt_enable_cursor_keys(void);
 extern void SLtt_set_term_vtxxx(int *);
@@ -833,19 +833,19 @@ extern void SLtt_disable_status_line (void);
    extern int SLtt_tigetnum (char *, char **);
 # endif
 #endif
    extern int SLtt_tigetnum (char *, char **);
 # endif
 #endif
-   
+
 extern SLtt_Char_Type SLtt_get_color_object (int);
 extern void SLtt_set_color_object (int, SLtt_Char_Type);
 extern void SLtt_set_color (int, char *, char *, char *);
 extern void SLtt_set_mono (int, char *, SLtt_Char_Type);
 extern void SLtt_add_color_attribute (int, SLtt_Char_Type);
 extern void SLtt_set_color_fgbg (int, SLtt_Char_Type, SLtt_Char_Type);
 extern SLtt_Char_Type SLtt_get_color_object (int);
 extern void SLtt_set_color_object (int, SLtt_Char_Type);
 extern void SLtt_set_color (int, char *, char *, char *);
 extern void SLtt_set_mono (int, char *, SLtt_Char_Type);
 extern void SLtt_add_color_attribute (int, SLtt_Char_Type);
 extern void SLtt_set_color_fgbg (int, SLtt_Char_Type, SLtt_Char_Type);
-     
+
 /*}}}*/
 
 /*{{{ SLang Preprocessor Interface */
 
 /*}}}*/
 
 /*{{{ SLang Preprocessor Interface */
 
-typedef struct 
+typedef struct
 {
    int this_level;
    int exec_level;
 {
    int this_level;
    int exec_level;
@@ -865,8 +865,8 @@ extern int SLprep_line_ok (char *, SLPreprocess_Type *);
    /* Adds a string to the SLang #ifdef preparsing defines. SLang already
       defines MSDOS, UNIX, and VMS on the appropriate system. */
 extern int (*SLprep_exists_hook) (char *, char);
    /* Adds a string to the SLang #ifdef preparsing defines. SLang already
       defines MSDOS, UNIX, and VMS on the appropriate system. */
 extern int (*SLprep_exists_hook) (char *, char);
-      
-   
+
+
 /*}}}*/
 
 /*{{{ SLsmg Screen Management Functions */
 /*}}}*/
 
 /*{{{ SLsmg Screen Management Functions */
@@ -909,7 +909,7 @@ extern void SLsmg_forward (int);
 extern void SLsmg_write_color_chars (unsigned short *, unsigned int);
 extern unsigned int SLsmg_read_raw (unsigned short *, unsigned int);
 extern unsigned int SLsmg_write_raw (unsigned short *, unsigned int);
 extern void SLsmg_write_color_chars (unsigned short *, unsigned int);
 extern unsigned int SLsmg_read_raw (unsigned short *, unsigned int);
 extern unsigned int SLsmg_write_raw (unsigned short *, unsigned int);
-   
+
 extern int SLsmg_Display_Eight_Bit;
 extern int SLsmg_Tab_Width;
 extern int SLsmg_Newline_Moves;
 extern int SLsmg_Display_Eight_Bit;
 extern int SLsmg_Tab_Width;
 extern int SLsmg_Newline_Moves;
@@ -999,7 +999,7 @@ int SLkp_define_keysym (char *, unsigned int);
 /* This function must be called AFTER SLtt_get_terminfo and not before. */
 extern int SLkp_init (void);
 
 /* This function must be called AFTER SLtt_get_terminfo and not before. */
 extern int SLkp_init (void);
 
-/* This function uses SLang_getkey and assumes that what ever initialization 
+/* This function uses SLang_getkey and assumes that what ever initialization
  * is required for SLang_getkey has been performed.
  */
 extern int SLkp_getkey (void);
  * is required for SLang_getkey has been performed.
  */
 extern int SLkp_getkey (void);
@@ -1016,7 +1016,7 @@ typedef struct _SLscroll_Type
 }
 SLscroll_Type;
 
 }
 SLscroll_Type;
 
-typedef struct 
+typedef struct
 {
    unsigned int flags;
    SLscroll_Type *top_window_line;   /* list element at top of window */
 {
    unsigned int flags;
    SLscroll_Type *top_window_line;   /* list element at top of window */
@@ -1088,8 +1088,8 @@ extern int SLsig_unblock_signals (void);
 /* This is not ready yet.  */
 # define SLANG_NOOP    9
 #endif
 /* This is not ready yet.  */
 # define SLANG_NOOP    9
 #endif
-   
-/* Everything above string should correspond to a pointer in the object 
+
+/* Everything above string should correspond to a pointer in the object
  * structure.  See do_binary (slang.c) for exploitation of this fact.
  */
 #define STRING_TYPE    10
  * structure.  See do_binary (slang.c) for exploitation of this fact.
  */
 #define STRING_TYPE    10
@@ -1154,14 +1154,14 @@ extern void SLadd_at_handler (long *, char *);
 
 #define MAKE_INTRINSIC(n, f, out, in)        \
     {0, n, (out | (in << 4)), SLANG_INTRINSIC, (long) f}
 
 #define MAKE_INTRINSIC(n, f, out, in)        \
     {0, n, (out | (in << 4)), SLANG_INTRINSIC, (long) f}
-       
+
 #define MAKE_VARIABLE(n, v, t, r)     \
     {0, n, t, (SLANG_IVARIABLE + r), (long) v}
 
 #else
 #define MAKE_INTRINSIC(n, f, out, in)        \
     {n, (out | (in << 4)), SLANG_INTRINSIC, (long) f}
 #define MAKE_VARIABLE(n, v, t, r)     \
     {0, n, t, (SLANG_IVARIABLE + r), (long) v}
 
 #else
 #define MAKE_INTRINSIC(n, f, out, in)        \
     {n, (out | (in << 4)), SLANG_INTRINSIC, (long) f}
-       
+
 #define MAKE_VARIABLE(n, v, t, r)     \
     {n, t, (SLANG_IVARIABLE + r), (long) v}
 #endif
 #define MAKE_VARIABLE(n, v, t, r)     \
     {n, t, (SLANG_IVARIABLE + r), (long) v}
 #endif
@@ -1202,13 +1202,13 @@ typedef struct
    int beg_matches[10];                       /* offset of start of \( */
    unsigned int end_matches[10];       /* length of nth submatch
                                        * Note that the entire match corresponds
    int beg_matches[10];                       /* offset of start of \( */
    unsigned int end_matches[10];       /* length of nth submatch
                                        * Note that the entire match corresponds
-                                       * to \0 
+                                       * to \0
                                        */
    int offset;                        /* offset to be added to beg_matches */
 } SLRegexp_Type;
 
                                        */
    int offset;                        /* offset to be added to beg_matches */
 } SLRegexp_Type;
 
-extern unsigned char *SLang_regexp_match(unsigned char *, 
-                                        unsigned int, 
+extern unsigned char *SLang_regexp_match(unsigned char *,
+                                        unsigned int,
                                         SLRegexp_Type *);
 extern int SLang_regexp_compile (SLRegexp_Type *);
 extern char *SLregexp_quote_string (char *, char *, unsigned int);
                                         SLRegexp_Type *);
 extern int SLang_regexp_compile (SLRegexp_Type *);
 extern char *SLregexp_quote_string (char *, char *, unsigned int);
@@ -1254,21 +1254,21 @@ typedef struct
 } SLsearch_Type;
 
 extern int SLsearch_init (char *, int, int, SLsearch_Type *);
 } SLsearch_Type;
 
 extern int SLsearch_init (char *, int, int, SLsearch_Type *);
-/* This routine must first be called before any search can take place. 
- * The second parameter specifies the direction of the search: greater than 
- * zero for a forwrd search and less than zero for a backward search.  The 
+/* This routine must first be called before any search can take place.
+ * The second parameter specifies the direction of the search: greater than
+ * zero for a forwrd search and less than zero for a backward search.  The
  * third parameter specifies whether the search is case sensitive or not.
  * third parameter specifies whether the search is case sensitive or not.
- * The last parameter is a pointer to a structure that is filled by this 
+ * The last parameter is a pointer to a structure that is filled by this
  * function and it is this structure that must be passed to SLsearch.
  */
 
 unsigned char *SLsearch (unsigned char *, unsigned char *, SLsearch_Type *);
  * function and it is this structure that must be passed to SLsearch.
  */
 
 unsigned char *SLsearch (unsigned char *, unsigned char *, SLsearch_Type *);
-/* To use this routine, you must first call 'SLsearch_init'.  Then the first 
+/* To use this routine, you must first call 'SLsearch_init'.  Then the first
  * two parameters p1 and p2 serve to define the region over which the search
  * is to take place.  The third parameter is the structure that was previously
  * initialized by SLsearch_init.
  * two parameters p1 and p2 serve to define the region over which the search
  * is to take place.  The third parameter is the structure that was previously
  * initialized by SLsearch_init.
- * 
- * The routine returns a pointer to the match if found otherwise it returns 
+ *
+ * The routine returns a pointer to the match if found otherwise it returns
  * NULL.
  */
 
  * NULL.
  */
 
index 711af71..900f903 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  *  characters) can not be written directly to the terminal, when the
  *  alt-char-set is activated, because writing these characters doesn't cause
  *  an implicit/temporary switching-back to the standard char-set!
  *  characters) can not be written directly to the terminal, when the
  *  alt-char-set is activated, because writing these characters doesn't cause
  *  an implicit/temporary switching-back to the standard char-set!
- *  
+ *
  *  The original code in SLang assumes that space, NL, CR, etc. can be
  *  printed when alt-char-set is activated. If SLTT_TRANSP_ACS_PATCH is
  *  defined, the modified code will not use this assumption.
  *  The original code in SLang assumes that space, NL, CR, etc. can be
  *  printed when alt-char-set is activated. If SLTT_TRANSP_ACS_PATCH is
  *  defined, the modified code will not use this assumption.
- *  [Remark: the patch-code is not the most exact solution, but works...] 
+ *  [Remark: the patch-code is not the most exact solution, but works...]
  */
 /*#define SLTT_TRANSP_ACS_PATCH 1*/
 
  */
 /*#define SLTT_TRANSP_ACS_PATCH 1*/
 
 #include <signal.h>
 
 
 #include <signal.h>
 
 
-/* Colors:  These definitions are used for the display.  However, the 
+/* Colors:  These definitions are used for the display.  However, the
  * application only uses object handles which get mapped to this
  * internal representation.  The mapping is performed by the Color_Map
  * structure below. */
  * application only uses object handles which get mapped to this
  * internal representation.  The mapping is performed by the Color_Map
  * structure below. */
@@ -165,7 +165,7 @@ static int Automatic_Margins;
 static int Worthless_Highlight;
 #define HP_GLITCH_CODE
 #ifdef HP_GLITCH_CODE
 static int Worthless_Highlight;
 #define HP_GLITCH_CODE
 #ifdef HP_GLITCH_CODE
-/* This glitch is exclusive to HP term.  Basically it means that to clear 
+/* This glitch is exclusive to HP term.  Basically it means that to clear
  * attributes, one has to erase to the end of the line.
  */
 static int Has_HP_Glitch;
  * attributes, one has to erase to the end of the line.
  */
 static int Has_HP_Glitch;
@@ -177,14 +177,14 @@ static int Linux_Console;
 
 /* It is crucial that JMAX_COLORS must be less than 128 since the high bit
  * is used to indicate a character from the ACS (alt char set).  The exception
 
 /* It is crucial that JMAX_COLORS must be less than 128 since the high bit
  * is used to indicate a character from the ACS (alt char set).  The exception
- * to this rule is if SLtt_Use_Blink_For_ACS is true.  This means that of 
- * the highbit is set, we interpret that as a blink character.  This is 
+ * to this rule is if SLtt_Use_Blink_For_ACS is true.  This means that of
+ * the highbit is set, we interpret that as a blink character.  This is
  * exploited by DOSemu.
  */
 #define JMAX_COLORS 256
 #define JNORMAL_COLOR 0
 
  * exploited by DOSemu.
  */
 #define JMAX_COLORS 256
 #define JNORMAL_COLOR 0
 
-typedef struct 
+typedef struct
 {
    SLtt_Char_Type fgbg;
    SLtt_Char_Type mono;
 {
    SLtt_Char_Type fgbg;
    SLtt_Char_Type mono;
@@ -194,7 +194,7 @@ typedef struct
 #define RGB1(r, g, b)   ((r) | ((g) << 1) | ((b) << 2))
 #define RGB(r, g, b, br, bg, bb)  ((RGB1(r, g, b) << 8) | (RGB1(br, bg, bb) << 16))
 
 #define RGB1(r, g, b)   ((r) | ((g) << 1) | ((b) << 2))
 #define RGB(r, g, b, br, bg, bb)  ((RGB1(r, g, b) << 8) | (RGB1(br, bg, bb) << 16))
 
-static Ansi_Color_Type Ansi_Color_Map[JMAX_COLORS] = 
+static Ansi_Color_Type Ansi_Color_Map[JMAX_COLORS] =
 {
    {RGB(1, 1, 1, 0, 0, 0), 0x00000000, NULL},   /* white/black */
    {RGB(0, 1, 0, 0, 0, 0), SLTT_REV_MASK, NULL},   /* green/black */
 {
    {RGB(1, 1, 1, 0, 0, 0), 0x00000000, NULL},   /* white/black */
    {RGB(0, 1, 0, 0, 0, 0), SLTT_REV_MASK, NULL},   /* green/black */
@@ -224,7 +224,7 @@ static Ansi_Color_Type Ansi_Color_Map[JMAX_COLORS] =
   static char *Color_Escape_Sequence = "\033[3%dm\033[4%dm";
 #else
 /* Believe it or not, this is what is in the linux terminfo database.  It
   static char *Color_Escape_Sequence = "\033[3%dm\033[4%dm";
 #else
 /* Believe it or not, this is what is in the linux terminfo database.  It
- * produces the same escape sequence but it is much more CPU intensive.  
+ * produces the same escape sequence but it is much more CPU intensive.
  * Why not just encode it as "\033[3%p1%dm\033[4%p2%dm" ???
  */
  /* static char *Color_Escape_Sequence = "\033[%p1%{30}%+%dm\033[%p2%{40}%+%dm"; */
  * Why not just encode it as "\033[3%p1%dm\033[4%p2%dm" ???
  */
  /* static char *Color_Escape_Sequence = "\033[%p1%{30}%+%dm\033[%p2%{40}%+%dm"; */
@@ -233,7 +233,7 @@ static char *Color_Escape_Sequence = "\033[3%d;4%dm";
 
 char *SLtt_Graphics_Char_Pairs;               /* ac termcap string -- def is vt100 */
 
 
 char *SLtt_Graphics_Char_Pairs;               /* ac termcap string -- def is vt100 */
 
-   
+
 /* 1 if terminal lacks the ability to do into insert mode or into delete
    mode. Currently controlled by S-Lang but later perhaps termcap. */
 
 /* 1 if terminal lacks the ability to do into insert mode or into delete
    mode. Currently controlled by S-Lang but later perhaps termcap. */
 
@@ -319,9 +319,9 @@ int SLtt_flush_output (void)
    int nwrite = 0;
    unsigned int total;
    int n = (int) (Output_Bufferp - Output_Buffer);
    int nwrite = 0;
    unsigned int total;
    int n = (int) (Output_Bufferp - Output_Buffer);
-   
+
    SLtt_Num_Chars_Output += n;
    SLtt_Num_Chars_Output += n;
-   
+
    total = 0;
    while (n > 0)
      {
    total = 0;
    while (n > 0)
      {
@@ -330,7 +330,7 @@ int SLtt_flush_output (void)
          {
             nwrite = 0;
 #ifdef EAGAIN
          {
             nwrite = 0;
 #ifdef EAGAIN
-            if (errno == EAGAIN) 
+            if (errno == EAGAIN)
               {
                  sl_usleep (100000);   /* 1/10 sec */
                  continue;
               {
                  sl_usleep (100000);   /* 1/10 sec */
                  continue;
@@ -363,10 +363,10 @@ static void tt_write(char *str, unsigned int n)
    static int total;
    unsigned long now;
    unsigned int ndiff;
    static int total;
    unsigned long now;
    unsigned int ndiff;
-   
+
    if ((str == NULL) || (n == 0)) return;
    total += n;
    if ((str == NULL) || (n == 0)) return;
    total += n;
-   
+
    while (1)
      {
        ndiff = MAX_OUTPUT_BUFFER_SIZE - (int) (Output_Bufferp - Output_Buffer);
    while (1)
      {
        ndiff = MAX_OUTPUT_BUFFER_SIZE - (int) (Output_Bufferp - Output_Buffer);
@@ -378,14 +378,14 @@ static void tt_write(char *str, unsigned int n)
             n -= ndiff;
             str += ndiff;
          }
             n -= ndiff;
             str += ndiff;
          }
-       else 
+       else
          {
             SLMEMCPY ((char *) Output_Bufferp, str, n);
             Output_Bufferp += n;
             break;
          }
      }
          {
             SLMEMCPY ((char *) Output_Bufferp, str, n);
             Output_Bufferp += n;
             break;
          }
      }
-   
+
    if (((SLtt_Baud_Rate > 150) && (SLtt_Baud_Rate <= 9600))
        && (10 * total > SLtt_Baud_Rate))
      {
    if (((SLtt_Baud_Rate > 150) && (SLtt_Baud_Rate <= 9600))
        && (10 * total > SLtt_Baud_Rate))
      {
@@ -411,14 +411,14 @@ void SLtt_putchar (char ch)
 #ifdef SLTT_TRANSP_ACS_PATCH
    int restore_acs = 0;
 #endif
 #ifdef SLTT_TRANSP_ACS_PATCH
    int restore_acs = 0;
 #endif
-    
+
    SLtt_normal_video ();
    if (Cursor_Set == 1)
      {
        if (ch >= ' ') Cursor_c++;
 #ifndef SLTT_TRANSP_ACS_PATCH
        else if (ch == '\b') Cursor_c--;
    SLtt_normal_video ();
    if (Cursor_Set == 1)
      {
        if (ch >= ' ') Cursor_c++;
 #ifndef SLTT_TRANSP_ACS_PATCH
        else if (ch == '\b') Cursor_c--;
-#else 
+#else
        if (ch <= ' ' && SLtt_ACS_Active)
          {
             SLtt_set_alt_char_set (0);
        if (ch <= ' ' && SLtt_ACS_Active)
          {
             SLtt_set_alt_char_set (0);
@@ -428,17 +428,17 @@ void SLtt_putchar (char ch)
 #endif
        else if (ch == '\r') Cursor_c = 0;
        else Cursor_Set = 0;
 #endif
        else if (ch == '\r') Cursor_c = 0;
        else Cursor_Set = 0;
-       
-       if ((Cursor_c + 1 == SLtt_Screen_Cols) 
+
+       if ((Cursor_c + 1 == SLtt_Screen_Cols)
            && Automatic_Margins) Cursor_Set = 0;
      }
            && Automatic_Margins) Cursor_Set = 0;
      }
-   
+
    if (Output_Bufferp < Output_Buffer + MAX_OUTPUT_BUFFER_SIZE)
      {
        *Output_Bufferp++ = (unsigned char) ch;
      }
    else tt_write (&ch, 1);
    if (Output_Bufferp < Output_Buffer + MAX_OUTPUT_BUFFER_SIZE)
      {
        *Output_Bufferp++ = (unsigned char) ch;
      }
    else tt_write (&ch, 1);
-   
+
 #ifdef SLTT_TRANSP_ACS_PATCH
    if (restore_acs)
      {
 #ifdef SLTT_TRANSP_ACS_PATCH
    if (restore_acs)
      {
@@ -447,7 +447,7 @@ void SLtt_putchar (char ch)
 #endif
 }
 
 #endif
 }
 
-/* this is supposed to be fast--- also handles 
+/* this is supposed to be fast--- also handles
    termcap: %d, &i, %., %+, %r strings as well as terminfo stuff */
 static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
 {
    termcap: %d, &i, %., %+, %r strings as well as terminfo stuff */
 static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
 {
@@ -456,12 +456,12 @@ static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
    int stack[10];
    int i = 0, z;
    stack[0] = y; stack[1] = x; i = 2;
    int stack[10];
    int i = 0, z;
    stack[0] = y; stack[1] = x; i = 2;
-   
+
    b = (unsigned char *) buf;
    if (fmt != NULL) while ((ch = *f++) != 0)
      {
        if (ch != '%') *b++ = ch;
    b = (unsigned char *) buf;
    if (fmt != NULL) while ((ch = *f++) != 0)
      {
        if (ch != '%') *b++ = ch;
-       else 
+       else
          {
             ch = *f++;
             if (tinfo)
          {
             ch = *f++;
             if (tinfo)
@@ -471,14 +471,14 @@ static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
                       /* map it to termcap.  Since this is terminfo,
                        * it must be one of:
                        *   %2d, %3d, %02d, %03d
                       /* map it to termcap.  Since this is terminfo,
                        * it must be one of:
                        *   %2d, %3d, %02d, %03d
-                       * 
+                       *
                        * I am assuming that a terminal that understands
                        * %2d form will also understand the %02d form.  These
                        * only differ by a space padding the field.
                        */
                        * I am assuming that a terminal that understands
                        * %2d form will also understand the %02d form.  These
                        * only differ by a space padding the field.
                        */
-                      
+
                       /* skip the 'd'-- hope it is there */
                       /* skip the 'd'-- hope it is there */
-                      if (ch == '0') 
+                      if (ch == '0')
                         {
                            ch = *f;
                            f += 2;
                         {
                            ch = *f;
                            f += 2;
@@ -486,7 +486,7 @@ static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
                       else f++;
                    }
               }
                       else f++;
                    }
               }
-            
+
             switch (ch)
               {
                case 'p':
             switch (ch)
               {
                case 'p':
@@ -494,12 +494,12 @@ static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
                  ch = *f++;
                  if (ch == '1') stack[i++] = x; else stack[i++] = y;
                  break;
                  ch = *f++;
                  if (ch == '1') stack[i++] = x; else stack[i++] = y;
                  break;
-                 
+
                case '\'':   /* 'x' */
                  stack[i++] = *f++;
                  f++;
                  break;
                case '\'':   /* 'x' */
                  stack[i++] = *f++;
                  f++;
                  break;
-                 
+
                case '{':              /* literal constant, e.g. {30} */
                  z = 0;
                  while (((ch = *f) <= '9') && (ch >= '0'))
                case '{':              /* literal constant, e.g. {30} */
                  z = 0;
                  while (((ch = *f) <= '9') && (ch >= '0'))
@@ -510,7 +510,7 @@ static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
                  stack[i++] = z;
                  if (ch == '}') f++;
                  break;
                  stack[i++] = z;
                  if (ch == '}') f++;
                  break;
-                      
+
                case 'd':
                case '2':
                case '3':
                case 'd':
                case '2':
                case '3':
@@ -522,12 +522,12 @@ static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
                       z = z % 100;
                       goto ten;
                    }
                       z = z % 100;
                       goto ten;
                    }
-                 else if (ch == 3) 
+                 else if (ch == 3)
                    {
                       *b++ = '0';
                       ch = '2';
                    }
                    {
                       *b++ = '0';
                       ch = '2';
                    }
-                 
+
                  if (z >= 10)
                    {
                       ten:
                  if (z >= 10)
                    {
                       ten:
@@ -535,16 +535,16 @@ static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
                       z = z % 10;
                    }
                  else if (ch == 2) *b++ = '0';
                       z = z % 10;
                    }
                  else if (ch == 2) *b++ = '0';
-                 
+
                  *b++ = z + '0';
                  break;
                  *b++ = z + '0';
                  break;
-                 
+
                case 'i':
                  offset = 1;
                  break;
                case 'i':
                  offset = 1;
                  break;
-                 
+
                case '+':
                case '+':
-                 if (tinfo) 
+                 if (tinfo)
                    {
                       z = stack[--i];
                       stack[i-1] += z;
                    {
                       z = stack[--i];
                       stack[i-1] += z;
@@ -558,19 +558,19 @@ static unsigned int tt_sprintf(char *buf, char *fmt, int x, int y)
                       *b++ = ch;
                    }
                  break;
                       *b++ = ch;
                    }
                  break;
-                
+
                case 'r':
                  stack[0] = x;
                  stack[1] = y;
                  break;
                case 'r':
                  stack[0] = x;
                  stack[1] = y;
                  break;
-                 
+
                case '.':
                case 'c':
                  ch = (unsigned char) stack[--i];
                  if (ch == '\n') ch++;
                  *b++ = ch;
                  break;
                case '.':
                case 'c':
                  ch = (unsigned char) stack[--i];
                  if (ch == '\n') ch++;
                  *b++ = ch;
                  break;
-                 
+
                default:
                  *b++ = ch;
               }
                default:
                  *b++ = ch;
               }
@@ -607,12 +607,12 @@ int SLtt_set_cursor_visibility (int show)
 {
    if ((Cursor_Visible_Str == NULL) || (Cursor_Invisible_Str == NULL))
      return -1;
 {
    if ((Cursor_Visible_Str == NULL) || (Cursor_Invisible_Str == NULL))
      return -1;
-   
+
    SLtt_write_string (show ? Cursor_Visible_Str : Cursor_Invisible_Str);
    return 0;
 }
 
    SLtt_write_string (show ? Cursor_Visible_Str : Cursor_Invisible_Str);
    return 0;
 }
 
-   
+
 /* the goto_rc function moves to row relative to scrolling region */
 void SLtt_goto_rc(int r, int c)
 {
 /* the goto_rc function moves to row relative to scrolling region */
 void SLtt_goto_rc(int r, int c)
 {
@@ -622,31 +622,31 @@ void SLtt_goto_rc(int r, int c)
 #ifdef SLTT_TRANSP_ACS_PATCH
    int check_alt_acs = 0;
 #endif
 #ifdef SLTT_TRANSP_ACS_PATCH
    int check_alt_acs = 0;
 #endif
-   
+
    if (c < 0)
      {
        c = -c - 1;
        Cursor_Set = 0;
      }
    if (c < 0)
      {
        c = -c - 1;
        Cursor_Set = 0;
      }
-   
+
    /* if (No_Move_In_Standout && Current_Fgbg) SLtt_normal_video (); */
    r += Scroll_r1;
    /* if (No_Move_In_Standout && Current_Fgbg) SLtt_normal_video (); */
    r += Scroll_r1;
-   
+
    if ((Cursor_Set > 0) || ((Cursor_Set < 0) && !Automatic_Margins))
      {
        n = r - Cursor_r;
    if ((Cursor_Set > 0) || ((Cursor_Set < 0) && !Automatic_Margins))
      {
        n = r - Cursor_r;
-       if ((n == -1) && (Cursor_Set > 0) && (Cursor_c == c) 
+       if ((n == -1) && (Cursor_Set > 0) && (Cursor_c == c)
            && (Curs_Up_Str != NULL))
          {
             s = Curs_Up_Str;
          }
        else if ((n >= 0) && (n <= 4))
          {
            && (Curs_Up_Str != NULL))
          {
             s = Curs_Up_Str;
          }
        else if ((n >= 0) && (n <= 4))
          {
-            if ((n == 0) && (Cursor_Set == 1) 
+            if ((n == 0) && (Cursor_Set == 1)
                 && ((c > 1) || (c == Cursor_c)))
               {
                  if (Cursor_c == c) return;
                 && ((c > 1) || (c == Cursor_c)))
               {
                  if (Cursor_c == c) return;
-                 if (Cursor_c == c + 1) 
+                 if (Cursor_c == c + 1)
                    {
                       s = buf;
                       *s++ = '\b'; *s = 0;
                    {
                       s = buf;
                       *s++ = '\b'; *s = 0;
@@ -673,7 +673,7 @@ void SLtt_goto_rc(int r, int c)
               }
             /* Will fail on VMS */
 #ifndef VMS
               }
             /* Will fail on VMS */
 #ifndef VMS
-            else if (SLtt_Newline_Ok && (Cursor_Set == 1) && 
+            else if (SLtt_Newline_Ok && (Cursor_Set == 1) &&
                      (Cursor_c >= c) && (c + 3 > Cursor_c))
               {
                  s = buf;
                      (Cursor_c >= c) && (c + 3 > Cursor_c))
               {
                  s = buf;
@@ -738,7 +738,7 @@ void SLtt_delete_nlines (int n)
 #ifdef SLTT_TRANSP_ACS_PATCH
    int restore_acs = 0;
 #endif
 #ifdef SLTT_TRANSP_ACS_PATCH
    int restore_acs = 0;
 #endif
-   
+
    if (n <= 0) return;
    SLtt_normal_video ();
    if (Del_N_Lines_Str != NULL) tt_printf(Del_N_Lines_Str,n, 0);
    if (n <= 0) return;
    SLtt_normal_video ();
    if (Del_N_Lines_Str != NULL) tt_printf(Del_N_Lines_Str,n, 0);
@@ -777,7 +777,7 @@ void SLtt_cls (void)
 void SLtt_reverse_index (int n)
 {
    if (!n) return;
 void SLtt_reverse_index (int n)
 {
    if (!n) return;
-   
+
    SLtt_normal_video();
    if (Add_N_Lines_Str != NULL) tt_printf(Add_N_Lines_Str,n, 0);
    else
    SLtt_normal_video();
    if (Add_N_Lines_Str != NULL) tt_printf(Add_N_Lines_Str,n, 0);
    else
@@ -793,7 +793,7 @@ static char *Visible_Bell_Str;
 void SLtt_beep (void)
 {
    if (SLtt_Ignore_Beep & 0x1) SLtt_putchar('\007');
 void SLtt_beep (void)
 {
    if (SLtt_Ignore_Beep & 0x1) SLtt_putchar('\007');
-   
+
    if (SLtt_Ignore_Beep & 0x2)
      {
        if (Visible_Bell_Str != NULL) SLtt_write_string (Visible_Bell_Str);
    if (SLtt_Ignore_Beep & 0x2)
      {
        if (Visible_Bell_Str != NULL) SLtt_write_string (Visible_Bell_Str);
@@ -852,7 +852,7 @@ void SLtt_set_mono (int obj, char *what, SLtt_Char_Type mask)
    if ((obj < 0) || (obj >= JMAX_COLORS))
      {
        return;
    if ((obj < 0) || (obj >= JMAX_COLORS))
      {
        return;
-     }   
+     }
    Ansi_Color_Map[obj].mono = mask & ATTR_MASK;
 }
 
    Ansi_Color_Map[obj].mono = mask & ATTR_MASK;
 }
 
@@ -860,20 +860,20 @@ static char *check_color_for_digit_form (char *color)
 {
    unsigned int i, ich;
    char *s = color;
 {
    unsigned int i, ich;
    char *s = color;
-   
+
    i = 0;
    while ((ich = (int) *s) != 0)
      {
        if ((ich < '0') || (ich > '9'))
          return color;
    i = 0;
    while ((ich = (int) *s) != 0)
      {
        if ((ich < '0') || (ich > '9'))
          return color;
-       
+
        i = i * 10 + (ich - '0');
        s++;
      }
        i = i * 10 + (ich - '0');
        s++;
      }
-   
+
    if (i < MAX_COLOR_NAMES)
      color = Color_Defs[i].name;
    if (i < MAX_COLOR_NAMES)
      color = Color_Defs[i].name;
-   
+
    return color;
 }
 
    return color;
 }
 
@@ -882,7 +882,7 @@ static int get_default_colors (char **fgp, char **bgp)
    static char fg_buf[16], bg_buf[16], *bg, *fg;
    static int already_parsed;
    char *p, *pmax;
    static char fg_buf[16], bg_buf[16], *bg, *fg;
    static int already_parsed;
    char *p, *pmax;
-   
+
    if (already_parsed == -1)
      return -1;
 
    if (already_parsed == -1)
      return -1;
 
@@ -892,9 +892,9 @@ static int get_default_colors (char **fgp, char **bgp)
        *bgp = bg;
        return 0;
      }
        *bgp = bg;
        return 0;
      }
-   
+
    already_parsed = -1;
    already_parsed = -1;
-   
+
    bg = getenv ("COLORFGBG");
 
    if (bg == NULL)
    bg = getenv ("COLORFGBG");
 
    if (bg == NULL)
@@ -903,22 +903,22 @@ static int get_default_colors (char **fgp, char **bgp)
        if (bg == NULL)
          return -1;
      }
        if (bg == NULL)
          return -1;
      }
-   
+
    p = fg_buf;
    pmax = p + (sizeof (fg_buf) - 1);
    p = fg_buf;
    pmax = p + (sizeof (fg_buf) - 1);
-       
+
    while ((*bg != 0) && (*bg != ';'))
      {
        if (p < pmax) *p++ = *bg;
        bg++;
      }
    *p = 0;
    while ((*bg != 0) && (*bg != ';'))
      {
        if (p < pmax) *p++ = *bg;
        bg++;
      }
    *p = 0;
-       
+
    if (*bg) bg++;
    if (*bg) bg++;
-       
+
    p = bg_buf;
    pmax = p + (sizeof (bg_buf) - 1);
    p = bg_buf;
    pmax = p + (sizeof (bg_buf) - 1);
-   
+
    /* Mark suggested allowing for extra spplication specific stuff following
     * the background color.  That is what the check for the semi-colon is for.
     */
    /* Mark suggested allowing for extra spplication specific stuff following
     * the background color.  That is what the check for the semi-colon is for.
     */
@@ -950,17 +950,17 @@ static int Color_0_Modified = 0;
 void SLtt_set_color_object (int obj, SLtt_Char_Type attr)
 {
    char *cust_esc;
 void SLtt_set_color_object (int obj, SLtt_Char_Type attr)
 {
    char *cust_esc;
-   
+
    if ((obj < 0) || (obj >= JMAX_COLORS)) return;
    if ((obj < 0) || (obj >= JMAX_COLORS)) return;
-     
+
    cust_esc = Ansi_Color_Map[obj].custom_esc;
    cust_esc = Ansi_Color_Map[obj].custom_esc;
-   if (cust_esc != NULL) 
+   if (cust_esc != NULL)
      {
        SLFREE (cust_esc);
        FgBg_Stats[(Ansi_Color_Map[obj].fgbg >> 8) & 0x7F] -= 1;
        Ansi_Color_Map[obj].custom_esc = NULL;
      }
      {
        SLFREE (cust_esc);
        FgBg_Stats[(Ansi_Color_Map[obj].fgbg >> 8) & 0x7F] -= 1;
        Ansi_Color_Map[obj].custom_esc = NULL;
      }
-   
+
    Ansi_Color_Map[obj].fgbg = attr;
    if (obj == 0) Color_0_Modified = 1;
 }
    Ansi_Color_Map[obj].fgbg = attr;
    if (obj == 0) Color_0_Modified = 1;
 }
@@ -975,13 +975,13 @@ SLtt_Char_Type SLtt_get_color_object (int obj)
 void SLtt_add_color_attribute (int obj, SLtt_Char_Type attr)
 {
    if ((obj < 0) || (obj >= JMAX_COLORS)) return;
 void SLtt_add_color_attribute (int obj, SLtt_Char_Type attr)
 {
    if ((obj < 0) || (obj >= JMAX_COLORS)) return;
-     
+
    Ansi_Color_Map[obj].fgbg |= (attr & ATTR_MASK);
    if (obj == 0) Color_0_Modified = 1;
 }
 
 static SLtt_Char_Type fb_to_fgbg (SLtt_Char_Type f, SLtt_Char_Type b)
    Ansi_Color_Map[obj].fgbg |= (attr & ATTR_MASK);
    if (obj == 0) Color_0_Modified = 1;
 }
 
 static SLtt_Char_Type fb_to_fgbg (SLtt_Char_Type f, SLtt_Char_Type b)
-{   
+{
    SLtt_Char_Type attr = 0;
 
    if ((f & 0xF0) == 0)
    SLtt_Char_Type attr = 0;
 
    if ((f & 0xF0) == 0)
@@ -990,14 +990,14 @@ static SLtt_Char_Type fb_to_fgbg (SLtt_Char_Type f, SLtt_Char_Type b)
        f &= 0x7;
      }
    else f = 9;
        f &= 0x7;
      }
    else f = 9;
-   
+
    if ((b & 0xF0) == 0)
      {
        if (b & 0x8) attr |= SLTT_BLINK_MASK;
        b &= 0x7;
      }
    else b = 9;
    if ((b & 0xF0) == 0)
      {
        if (b & 0x8) attr |= SLTT_BLINK_MASK;
        b &= 0x7;
      }
    else b = 9;
-   
+
    return ((f << 8) | (b << 16) | attr);
 }
 
    return ((f << 8) | (b << 16) | attr);
 }
 
@@ -1006,19 +1006,19 @@ static int make_color_fgbg (char *fg, char *bg, SLtt_Char_Type *fgbg)
    SLtt_Char_Type f = 0xFFFFFFFFU, b = 0xFFFFFFFFU;
    char *dfg, *dbg;
    unsigned int i;
    SLtt_Char_Type f = 0xFFFFFFFFU, b = 0xFFFFFFFFU;
    char *dfg, *dbg;
    unsigned int i;
-   
+
    if ((fg != NULL) && (*fg == 0)) fg = NULL;
    if ((bg != NULL) && (*bg == 0)) bg = NULL;
    if ((fg != NULL) && (*fg == 0)) fg = NULL;
    if ((bg != NULL) && (*bg == 0)) bg = NULL;
-   
+
    if ((fg == NULL) || (bg == NULL))
      {
        if (-1 == get_default_colors (&dfg, &dbg))
          return -1;
    if ((fg == NULL) || (bg == NULL))
      {
        if (-1 == get_default_colors (&dfg, &dbg))
          return -1;
-       
+
        if (fg == NULL) fg = dfg;
        if (bg == NULL) bg = dbg;
      }
        if (fg == NULL) fg = dfg;
        if (bg == NULL) bg = dbg;
      }
-   
+
    for (i = 0; i < MAX_COLOR_NAMES; i++)
      {
        if (strcmp(fg, Color_Defs[i].name)) continue;
    for (i = 0; i < MAX_COLOR_NAMES; i++)
      {
        if (strcmp(fg, Color_Defs[i].name)) continue;
@@ -1032,10 +1032,10 @@ static int make_color_fgbg (char *fg, char *bg, SLtt_Char_Type *fgbg)
        b = Color_Defs[i].color;
        break;
      }
        b = Color_Defs[i].color;
        break;
      }
-   
+
    if ((f == 0xFFFFFFFFU) || (b == 0xFFFFFFFFU))
      return -1;
    if ((f == 0xFFFFFFFFU) || (b == 0xFFFFFFFFU))
      return -1;
-   
+
    *fgbg = fb_to_fgbg (f, b);
    return 0;
 }
    *fgbg = fb_to_fgbg (f, b);
    return 0;
 }
@@ -1062,22 +1062,22 @@ void SLtt_set_color_esc (int obj, char *esc)
    char *cust_esc;
    SLtt_Char_Type fgbg = 0;
    int i;
    char *cust_esc;
    SLtt_Char_Type fgbg = 0;
    int i;
-   
+
    if ((obj < 0) || (obj >= JMAX_COLORS))
      {
        return;
      }
    if ((obj < 0) || (obj >= JMAX_COLORS))
      {
        return;
      }
-   
+
    cust_esc = Ansi_Color_Map[obj].custom_esc;
    cust_esc = Ansi_Color_Map[obj].custom_esc;
-   if (cust_esc != NULL) 
+   if (cust_esc != NULL)
      {
        SLFREE (cust_esc);
        FgBg_Stats[(Ansi_Color_Map[obj].fgbg >> 8) & 0x7F] -= 1;
      }
      {
        SLFREE (cust_esc);
        FgBg_Stats[(Ansi_Color_Map[obj].fgbg >> 8) & 0x7F] -= 1;
      }
-   
+
    cust_esc = (char *) SLMALLOC (strlen(esc) + 1);
    if (cust_esc != NULL) strcpy (cust_esc, esc);
    cust_esc = (char *) SLMALLOC (strlen(esc) + 1);
    if (cust_esc != NULL) strcpy (cust_esc, esc);
-   
+
    Ansi_Color_Map[obj].custom_esc = cust_esc;
    if (cust_esc == NULL) fgbg = 0;
    else
    Ansi_Color_Map[obj].custom_esc = cust_esc;
    if (cust_esc == NULL) fgbg = 0;
    else
@@ -1086,7 +1086,7 @@ void SLtt_set_color_esc (int obj, char *esc)
        for (i = 0; i < JMAX_COLORS; i++)
          {
             if (FgBg_Stats[i] == 0) fgbg = i;
        for (i = 0; i < JMAX_COLORS; i++)
          {
             if (FgBg_Stats[i] == 0) fgbg = i;
-            
+
             if (obj == i) continue;
             if ((Ansi_Color_Map[i].custom_esc) == NULL) continue;
             if (!strcmp (Ansi_Color_Map[i].custom_esc, cust_esc))
             if (obj == i) continue;
             if ((Ansi_Color_Map[i].custom_esc) == NULL) continue;
             if (!strcmp (Ansi_Color_Map[i].custom_esc, cust_esc))
@@ -1097,7 +1097,7 @@ void SLtt_set_color_esc (int obj, char *esc)
          }
        FgBg_Stats[fgbg] += 1;
      }
          }
        FgBg_Stats[fgbg] += 1;
      }
-   
+
    fgbg |= 0x80;
    Ansi_Color_Map[obj].fgbg = (fgbg | (fgbg << 8)) << 8;
    if (obj == 0) Color_0_Modified = 1;
    fgbg |= 0x80;
    Ansi_Color_Map[obj].fgbg = (fgbg | (fgbg << 8)) << 8;
    if (obj == 0) Color_0_Modified = 1;
@@ -1113,7 +1113,7 @@ void SLtt_set_alt_char_set (int i)
    if (SLtt_Has_Alt_Charset == 0) return;
    if (i == last_i) return;
    SLtt_write_string (i ? Start_Alt_Chars_Str : End_Alt_Chars_Str );
    if (SLtt_Has_Alt_Charset == 0) return;
    if (i == last_i) return;
    SLtt_write_string (i ? Start_Alt_Chars_Str : End_Alt_Chars_Str );
-   /* if (i) Current_Fgbg |= SLTT_ALTC_MASK; 
+   /* if (i) Current_Fgbg |= SLTT_ALTC_MASK;
     else Current_Fgbg &= ~SLTT_ALTC_MASK; */
    last_i = i;
 #ifdef SLTT_TRANSP_ACS_PATCH
     else Current_Fgbg &= ~SLTT_ALTC_MASK; */
    last_i = i;
 #ifdef SLTT_TRANSP_ACS_PATCH
@@ -1127,7 +1127,7 @@ static void write_attributes (SLtt_Char_Type fgbg)
 
    if (Worthless_Highlight) return;
    if (fgbg == Current_Fgbg) return;
 
    if (Worthless_Highlight) return;
    if (fgbg == Current_Fgbg) return;
-   
+
    /* Before spitting out colors, fix attributes */
    if ((fgbg & ATTR_MASK) != (Current_Fgbg & ATTR_MASK))
      {
    /* Before spitting out colors, fix attributes */
    if ((fgbg & ATTR_MASK) != (Current_Fgbg & ATTR_MASK))
      {
@@ -1135,17 +1135,17 @@ static void write_attributes (SLtt_Char_Type fgbg)
          {
             SLtt_write_string(Norm_Vid_Str);
             /* In case normal video turns off ALL attributes: */
          {
             SLtt_write_string(Norm_Vid_Str);
             /* In case normal video turns off ALL attributes: */
-            if (fgbg & SLTT_ALTC_MASK) 
+            if (fgbg & SLTT_ALTC_MASK)
               Current_Fgbg &= ~SLTT_ALTC_MASK;
             SLtt_set_alt_char_set (0);
          }
               Current_Fgbg &= ~SLTT_ALTC_MASK;
             SLtt_set_alt_char_set (0);
          }
-       
-       if ((fgbg & SLTT_ALTC_MASK) 
+
+       if ((fgbg & SLTT_ALTC_MASK)
            != (Current_Fgbg & SLTT_ALTC_MASK))
          {
             SLtt_set_alt_char_set ((int) (fgbg & SLTT_ALTC_MASK));
          }
            != (Current_Fgbg & SLTT_ALTC_MASK))
          {
             SLtt_set_alt_char_set ((int) (fgbg & SLTT_ALTC_MASK));
          }
-       
+
        if (fgbg & SLTT_ULINE_MASK) SLtt_write_string (UnderLine_Vid_Str);
        if (fgbg & SLTT_BOLD_MASK) SLtt_bold_video ();
        if (fgbg & SLTT_REV_MASK) SLtt_write_string (Rev_Vid_Str);
        if (fgbg & SLTT_ULINE_MASK) SLtt_write_string (UnderLine_Vid_Str);
        if (fgbg & SLTT_BOLD_MASK) SLtt_bold_video ();
        if (fgbg & SLTT_REV_MASK) SLtt_write_string (Rev_Vid_Str);
@@ -1157,7 +1157,7 @@ static void write_attributes (SLtt_Char_Type fgbg)
             if (SLtt_Blink_Mode) SLtt_write_string (Blink_Vid_Str);
          }
      }
             if (SLtt_Blink_Mode) SLtt_write_string (Blink_Vid_Str);
          }
      }
-   
+
    if (SLtt_Use_Ansi_Colors)
      {
        fg0 = (int) GET_FG(fgbg);
    if (SLtt_Use_Ansi_Colors)
      {
        fg0 = (int) GET_FG(fgbg);
@@ -1173,10 +1173,10 @@ void SLtt_reverse_video (int color)
 {
    SLtt_Char_Type fgbg;
    char *esc;
 {
    SLtt_Char_Type fgbg;
    char *esc;
-   
+
    if (Worthless_Highlight) return;
    if ((color < 0) || (color >= JMAX_COLORS)) return;
    if (Worthless_Highlight) return;
    if ((color < 0) || (color >= JMAX_COLORS)) return;
-   
+
    if (Video_Initialized == 0)
      {
        if (color == JNORMAL_COLOR)
    if (Video_Initialized == 0)
      {
        if (color == JNORMAL_COLOR)
@@ -1187,8 +1187,8 @@ void SLtt_reverse_video (int color)
        Current_Fgbg = 0xFFFFFFFFU;
        return;
      }
        Current_Fgbg = 0xFFFFFFFFU;
        return;
      }
-   
-   if (SLtt_Use_Ansi_Colors) 
+
+   if (SLtt_Use_Ansi_Colors)
      {
        fgbg = Ansi_Color_Map[color].fgbg;
        if ((esc = Ansi_Color_Map[color].custom_esc) != NULL)
      {
        fgbg = Ansi_Color_Map[color].fgbg;
        if ((esc = Ansi_Color_Map[color].custom_esc) != NULL)
@@ -1251,9 +1251,9 @@ void SLtt_wide_width (void)
 static void write_string_with_care (char *str)
 {
    unsigned int len;
 static void write_string_with_care (char *str)
 {
    unsigned int len;
-   
+
    if (str == NULL) return;
    if (str == NULL) return;
-   
+
    len = strlen (str);
    if (Automatic_Margins && (Cursor_r + 1 == SLtt_Screen_Rows))
      {
    len = strlen (str);
    if (Automatic_Margins && (Cursor_r + 1 == SLtt_Screen_Rows))
      {
@@ -1276,7 +1276,7 @@ static void send_attr_str (unsigned short *s)
    register SLtt_Char_Type attr;
    register unsigned short sh;
    int color, last_color = -1;
    register SLtt_Char_Type attr;
    register unsigned short sh;
    int color, last_color = -1;
-   
+
    p = out;
    while (0 != (sh = *s++))
      {
    p = out;
    while (0 != (sh = *s++))
      {
@@ -1289,7 +1289,7 @@ static void send_attr_str (unsigned short *s)
          {
             if (SLtt_Use_Ansi_Colors) attr = Ansi_Color_Map[color & 0x7F].fgbg;
             else attr = Ansi_Color_Map[color & 0x7F].mono;
          {
             if (SLtt_Use_Ansi_Colors) attr = Ansi_Color_Map[color & 0x7F].fgbg;
             else attr = Ansi_Color_Map[color & 0x7F].mono;
-            
+
             /* sh => color */
             if (color & 0x80) /* alternate char set */
               {
             /* sh => color */
             if (color & 0x80) /* alternate char set */
               {
@@ -1297,10 +1297,10 @@ static void send_attr_str (unsigned short *s)
                    {
                       if (SLtt_Blink_Mode) attr |= SLTT_BLINK_MASK;
                    }
                    {
                       if (SLtt_Blink_Mode) attr |= SLTT_BLINK_MASK;
                    }
-                 else attr |= SLTT_ALTC_MASK;   
+                 else attr |= SLTT_ALTC_MASK;
               }
               }
-            
-            
+
+
             if (attr != Current_Fgbg)
               {
 #ifndef SLTT_TRANSP_ACS_PATCH
             if (attr != Current_Fgbg)
               {
 #ifndef SLTT_TRANSP_ACS_PATCH
@@ -1330,7 +1330,7 @@ static void send_attr_str (unsigned short *s)
                            Current_Fgbg = attr;
                         }
                       else write_attributes (attr);
                            Current_Fgbg = attr;
                         }
                       else write_attributes (attr);
-                      
+
                       last_color = color;
                    }
               }
                       last_color = color;
                    }
               }
@@ -1345,9 +1345,9 @@ static void send_attr_str (unsigned short *s)
 static void forward_cursor (unsigned int n, int row)
 {
    char buf[30];
 static void forward_cursor (unsigned int n, int row)
 {
    char buf[30];
-   
-   
-   if (n <= 4) 
+
+
+   if (n <= 4)
      {
        SLtt_normal_video ();
        SLMEMSET (buf, ' ', n);
      {
        SLtt_normal_video ();
        SLMEMSET (buf, ' ', n);
@@ -1365,7 +1365,7 @@ static void forward_cursor (unsigned int n, int row)
 }
 
 
 }
 
 
-#define SPACE_CHAR (0x20 | (JNORMAL_COLOR << 8))                        
+#define SPACE_CHAR (0x20 | (JNORMAL_COLOR << 8))
 
 void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int row)
 {
 
 void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int row)
 {
@@ -1376,25 +1376,25 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
 #ifdef HP_GLITCH_CODE
    int handle_hp_glitch = 0;
 #endif
 #ifdef HP_GLITCH_CODE
    int handle_hp_glitch = 0;
 #endif
-   
+
    q = oldd; p = neww;
    qmax = oldd + len;
    pmax = p + len;
    q = oldd; p = neww;
    qmax = oldd + len;
    pmax = p + len;
-   
+
    /* Find out where to begin --- while they match, we are ok */
    while (1)
      {
        if (q == qmax) return;
 #if SLANG_HAS_KANJI_SUPPORT
    /* Find out where to begin --- while they match, we are ok */
    while (1)
      {
        if (q == qmax) return;
 #if SLANG_HAS_KANJI_SUPPORT
-       if (*p & 0x80) 
+       if (*p & 0x80)
          { /* new is kanji */
             if ((*q & 0x80) && ((q + 1) < qmax))
               { /* old is also kanji */
                  if (((0xFF & *q) != (0xFF & *p))
                      || ((0xFF & q[1]) != (0xFF & p[1])))
                    break; /* both kanji, but not match */
          { /* new is kanji */
             if ((*q & 0x80) && ((q + 1) < qmax))
               { /* old is also kanji */
                  if (((0xFF & *q) != (0xFF & *p))
                      || ((0xFF & q[1]) != (0xFF & p[1])))
                    break; /* both kanji, but not match */
-                 
-                 else 
+
+                 else
                    { /* kanji match ! */
                       if (!COLOR_EQS(*q, *p)) break;
                       q++; p++;
                    { /* kanji match ! */
                       if (!COLOR_EQS(*q, *p)) break;
                       q++; p++;
@@ -1406,7 +1406,7 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
               }
             else break; /* old is not kanji */
          }
               }
             else break; /* old is not kanji */
          }
-       else 
+       else
          { /* new is not kanji */
             if (*q & 0x80) break; /* old is kanji */
          }
          { /* new is not kanji */
             if (*q & 0x80) break; /* old is kanji */
          }
@@ -1437,17 +1437,17 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
      }
 #endif
    /* Find where the last non-blank character on old/new screen is */
      }
 #endif
    /* Find where the last non-blank character on old/new screen is */
-   
+
    while (qmax > q)
      {
        qmax--;
    while (qmax > q)
      {
        qmax--;
-       if (!CHAR_EQS(*qmax, SPACE_CHAR)) 
+       if (!CHAR_EQS(*qmax, SPACE_CHAR))
          {
             qmax++;
             break;
          }
      }
          {
             qmax++;
             break;
          }
      }
-   
+
    while (pmax > p)
      {
        pmax--;
    while (pmax > p)
      {
        pmax--;
@@ -1457,7 +1457,7 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
             break;
          }
      }
             break;
          }
      }
-   
+
    last_buffered_match = buf = buffer;                /* buffer is empty */
 
 #ifdef HP_GLITCH_CODE
    last_buffered_match = buf = buffer;                /* buffer is empty */
 
 #ifdef HP_GLITCH_CODE
@@ -1479,14 +1479,14 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
          {
             if (CHAR_EQS(*q,SPACE_CHAR) && CHAR_EQS(*p, SPACE_CHAR))
               {
          {
             if (CHAR_EQS(*q,SPACE_CHAR) && CHAR_EQS(*p, SPACE_CHAR))
               {
-                 /* If *q is not a space, we would have to overwrite it.  
-                  * However, if *q is a space, then while *p is also one, 
+                 /* If *q is not a space, we would have to overwrite it.
+                  * However, if *q is a space, then while *p is also one,
                   * we only need to skip over the blank field.
                   */
                  space_match = p;
                  p++; q++;
                   * we only need to skip over the blank field.
                   */
                  space_match = p;
                  p++; q++;
-                 while ((p < pmax) 
-                        && CHAR_EQS(*q,SPACE_CHAR) 
+                 while ((p < pmax)
+                        && CHAR_EQS(*q,SPACE_CHAR)
                         && CHAR_EQS(*p, SPACE_CHAR))
                    {
                       p++;
                         && CHAR_EQS(*p, SPACE_CHAR))
                    {
                       p++;
@@ -1498,9 +1498,9 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
 #if SLANG_HAS_KANJI_SUPPORT
             if ((*p & 0x80) && ((p + 1) < pmax))
               { /* new is kanji */
 #if SLANG_HAS_KANJI_SUPPORT
             if ((*p & 0x80) && ((p + 1) < pmax))
               { /* new is kanji */
-                 if (*q & 0x80) 
+                 if (*q & 0x80)
                    { /* old is also kanji */
                    { /* old is also kanji */
-                         if (((0xFF & *q) != (0xFF & *p)) 
+                         if (((0xFF & *q) != (0xFF & *p))
                              || ((0xFF & q[1]) != (0xFF & p[1])))
                         {
                            /* both kanji, but not match */
                              || ((0xFF & q[1]) != (0xFF & p[1])))
                         {
                            /* both kanji, but not match */
@@ -1509,9 +1509,9 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
                            q += 2;
                            continue;
                         }
                            q += 2;
                            continue;
                         }
-                      else 
+                      else
                         { /* kanji match ? */
                         { /* kanji match ? */
-                           if (!COLOR_EQS(*q, *p) || !COLOR_EQS(*(q+1), *(p+1))) 
+                           if (!COLOR_EQS(*q, *p) || !COLOR_EQS(*(q+1), *(p+1)))
                              {
                                 /* code is match ,but color is diff */
                                 *buf++ = *p++;
                              {
                                 /* code is match ,but color is diff */
                                 *buf++ = *p++;
@@ -1522,7 +1522,7 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
                            break;
                         }
                    }
                            break;
                         }
                    }
-                 else 
+                 else
                    { /* old is not kanji */
                       *buf++ = *p++;
                       *buf++ = *p++;
                    { /* old is not kanji */
                       *buf++ = *p++;
                       *buf++ = *p++;
@@ -1530,9 +1530,9 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
                       continue;
                    }
               }
                       continue;
                    }
               }
-            else 
+            else
               { /* new is not kanji */
               { /* new is not kanji */
-                 if (*q & 0x80) 
+                 if (*q & 0x80)
                    { /* old is kanji */
                       *buf++ = *p++;
                       q++;
                    { /* old is kanji */
                       *buf++ = *p++;
                       q++;
@@ -1546,20 +1546,20 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
             q++;
          }
        *buf = 0;
             q++;
          }
        *buf = 0;
-       
+
        if (buf != buffer) send_attr_str (buffer);
        buf = buffer;
        if (buf != buffer) send_attr_str (buffer);
        buf = buffer;
-       
-       if (n_spaces && (p < pmax)) 
+
+       if (n_spaces && (p < pmax))
          {
             forward_cursor (n_spaces, row);
          }
          {
             forward_cursor (n_spaces, row);
          }
-       
-       /* Now we overwrote what we could and cursor is placed at position 
-        * of a possible match of new and old.  If this is the case, skip 
+
+       /* Now we overwrote what we could and cursor is placed at position
+        * of a possible match of new and old.  If this is the case, skip
         * some more.
         */
         * some more.
         */
-#if !SLANG_HAS_KANJI_SUPPORT   
+#if !SLANG_HAS_KANJI_SUPPORT
        while ((p < pmax) && CHAR_EQS(*p, *q))
          {
             *buf++ = *p++;
        while ((p < pmax) && CHAR_EQS(*p, *q))
          {
             *buf++ = *p++;
@@ -1567,29 +1567,29 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
          }
 #else
        /* Kanji */
          }
 #else
        /* Kanji */
-       while (p < pmax) 
+       while (p < pmax)
          {
             if ((*p & 0x80) && ((p + 1) < pmax))
               { /* new is kanji */
          {
             if ((*p & 0x80) && ((p + 1) < pmax))
               { /* new is kanji */
-                 if (*q & 0x80) 
+                 if (*q & 0x80)
                    { /* old is also kanji */
                    { /* old is also kanji */
-                      if (((0xFF & *q) == (0xFF & *p)) 
+                      if (((0xFF & *q) == (0xFF & *p))
                           && ((0xFF & q[1]) == (0xFF & p[1])))
                         {
                            /* kanji match ? */
                           && ((0xFF & q[1]) == (0xFF & p[1])))
                         {
                            /* kanji match ? */
-                           if (!COLOR_EQS(*q, *p) 
+                           if (!COLOR_EQS(*q, *p)
                                || !COLOR_EQS(q[1], p[1]))
                              break;
                                || !COLOR_EQS(q[1], p[1]))
                              break;
-                           
+
                            *buf++ = *p++;
                            q++;
                            *buf++ = *p++;
                            q++;
-                           if (p >= pmax) 
+                           if (p >= pmax)
                              {
                                 *buf++ = SPACE_CHAR;
                                 p++;
                                 break;
                              }
                              {
                                 *buf++ = SPACE_CHAR;
                                 p++;
                                 break;
                              }
-                           else 
+                           else
                              {
                                 *buf++ = *p++;
                                 q++;
                              {
                                 *buf++ = *p++;
                                 q++;
@@ -1600,7 +1600,7 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
                    }
                  else break; /* old is not kanji */
               }
                    }
                  else break; /* old is not kanji */
               }
-            else 
+            else
               {  /* new is not kanji */
                  if (*q & 0x80) break; /* old is kanji */
                  if (!CHAR_EQS(*q, *p)) break;
               {  /* new is not kanji */
                  if (*q & 0x80) break; /* old is kanji */
                  if (!CHAR_EQS(*q, *p)) break;
@@ -1611,11 +1611,11 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
 #endif
        last_buffered_match = buf;
        if (p >= pmax) break;
 #endif
        last_buffered_match = buf;
        if (p >= pmax) break;
-       
+
        /* jump to new position is it is greater than 5 otherwise
         * let it sit in the buffer and output it later.
         */
        /* jump to new position is it is greater than 5 otherwise
         * let it sit in the buffer and output it later.
         */
-       if ((int) (buf - buffer) >= 5) 
+       if ((int) (buf - buffer) >= 5)
          {
             forward_cursor ((unsigned int) (buf - buffer), row);
             last_buffered_match = buf = buffer;
          {
             forward_cursor ((unsigned int) (buf - buffer), row);
             last_buffered_match = buf = buffer;
@@ -1626,7 +1626,7 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
      {
        if (q < qmax)
          {
      {
        if (q < qmax)
          {
-            if ((buf == last_buffered_match) 
+            if ((buf == last_buffered_match)
                 && ((int) (buf - buffer) >= 5))
               {
                  forward_cursor ((unsigned int) (buf - buffer), row);
                 && ((int) (buf - buffer) >= 5))
               {
                  forward_cursor ((unsigned int) (buf - buffer), row);
@@ -1640,22 +1640,22 @@ void SLtt_smart_puts(unsigned short *neww, unsigned short *oldd, int len, int ro
      }
    if (q < qmax) SLtt_del_eol ();
    if (Automatic_Margins && (Cursor_c + 1 >= SLtt_Screen_Cols)) Cursor_Set = 0;
      }
    if (q < qmax) SLtt_del_eol ();
    if (Automatic_Margins && (Cursor_c + 1 >= SLtt_Screen_Cols)) Cursor_Set = 0;
-}  
+}
 
 
 static void get_color_info (void)
 {
    char *fg, *bg;
 
 
 static void get_color_info (void)
 {
    char *fg, *bg;
-   
+
    SLtt_Use_Ansi_Colors = (NULL != getenv ("COLORTERM"));
    SLtt_Use_Ansi_Colors = (NULL != getenv ("COLORTERM"));
-   
+
    if (-1 == get_default_colors (&fg, &bg))
      return;
    if (-1 == get_default_colors (&fg, &bg))
      return;
-     
+
    /* Check to see if application has already set them. */
    if (Color_0_Modified)
      return;
    /* Check to see if application has already set them. */
    if (Color_0_Modified)
      return;
-   
+
    SLtt_set_color (0, NULL, fg, bg);
    SLtt_set_color (1, NULL, bg, fg);
 }
    SLtt_set_color (0, NULL, fg, bg);
    SLtt_set_color (1, NULL, bg, fg);
 }
@@ -1695,13 +1695,13 @@ static char *my_tgetstr(char *what, char **p)
        /* Check for AIX brain-damage */
        if (*what == '@')
          return NULL;
        /* Check for AIX brain-damage */
        if (*what == '@')
          return NULL;
-       
+
        /* lose pad info --- with today's technology, term is a loser if
           it is really needed */
        /* lose pad info --- with today's technology, term is a loser if
           it is really needed */
-       while ((*what == '.') || 
+       while ((*what == '.') ||
               ((*what >= '0') && (*what <= '9'))) what++;
               ((*what >= '0') && (*what <= '9'))) what++;
-       if (*what == '*') what++;       
-       
+       if (*what == '*') what++;
+
        /* lose terminfo padding--- looks like $<...> */
         w = what;
        while (*w) if ((*w++ == '$') && (*w == '<'))
        /* lose terminfo padding--- looks like $<...> */
         w = what;
        while (*w) if ((*w++ == '$') && (*w == '<'))
@@ -1714,7 +1714,7 @@ static char *my_tgetstr(char *what, char **p)
             while ((*w1++ = *w++) != 0);
             w = wsave;
          }
             while ((*w1++ = *w++) != 0);
             w = wsave;
          }
-       if (*what == 0) what = NULL; 
+       if (*what == 0) what = NULL;
      }
    return(what);
 }
      }
    return(what);
 }
@@ -1745,33 +1745,33 @@ void SLtt_get_terminfo (void)
    char *term, *t, ch;
    int is_xterm;
    int almost_vtxxx;
    char *term, *t, ch;
    int is_xterm;
    int almost_vtxxx;
-   
+
    get_color_info ();
    get_color_info ();
-   
+
    if (NULL == (term = (char *) getenv("TERM")))
      {
        SLang_exit_error("TERM environment variable needs set.");
      }
    if (NULL == (term = (char *) getenv("TERM")))
      {
        SLang_exit_error("TERM environment variable needs set.");
      }
-   
+
    Linux_Console = (!strncmp (term, "linux", 5)
 #ifdef linux
                    || !strncmp(term, "con", 3)
 #endif
                    );
    Linux_Console = (!strncmp (term, "linux", 5)
 #ifdef linux
                    || !strncmp(term, "con", 3)
 #endif
                    );
-      
+
    t = term;
    t = term;
-   
+
    if (strcmp(t, "vt52") && (*t++ == 'v') && (*t++ == 't')
    if (strcmp(t, "vt52") && (*t++ == 'v') && (*t++ == 't')
-       && (ch = *t, (ch >= '1') && (ch <= '9'))) Vt100_Like = 1; 
+       && (ch = *t, (ch >= '1') && (ch <= '9'))) Vt100_Like = 1;
 
    is_xterm = !strncmp (term, "xterm", 5);
    almost_vtxxx = (Vt100_Like
                   || Linux_Console
                   || is_xterm
                   || !strcmp (term, "screen"));
 
    is_xterm = !strncmp (term, "xterm", 5);
    almost_vtxxx = (Vt100_Like
                   || Linux_Console
                   || is_xterm
                   || !strcmp (term, "screen"));
-     
+
 #ifndef USE_TERMCAP
 #ifndef USE_TERMCAP
-   if (NULL == (Tbuf = tgetent (term))) 
+   if (NULL == (Tbuf = tgetent (term)))
      {
        char err_buf[512];
        if (almost_vtxxx) /* Special cases. */
      {
        char err_buf[512];
        if (almost_vtxxx) /* Special cases. */
@@ -1792,31 +1792,31 @@ termcap entry.", term);
 #else                                 /* USE_TERMCAP */
    if (1 != tgetent(Tbuf, term)) SLang_exit_error("Unknown terminal.");
 #endif                                /* NOT USE_TERMCAP */
 #else                                 /* USE_TERMCAP */
    if (1 != tgetent(Tbuf, term)) SLang_exit_error("Unknown terminal.");
 #endif                                /* NOT USE_TERMCAP */
-   
-   if ((NULL == (Cls_Str = SLtt_tgetstr("cl"))) 
+
+   if ((NULL == (Cls_Str = SLtt_tgetstr("cl")))
        || (NULL == (Curs_Pos_Str = SLtt_tgetstr("cm"))))
      {
        SLang_exit_error("Terminal not powerful enough for SLang.");
      }
        || (NULL == (Curs_Pos_Str = SLtt_tgetstr("cm"))))
      {
        SLang_exit_error("Terminal not powerful enough for SLang.");
      }
-   
+
    if ((NULL == (Ins_Mode_Str = SLtt_tgetstr("im")))
        || ( NULL == (Eins_Mode_Str = SLtt_tgetstr("ei")))
        || ( NULL == (Del_Char_Str = SLtt_tgetstr("dc"))))
      SLtt_Term_Cannot_Insert = 1;
    if ((NULL == (Ins_Mode_Str = SLtt_tgetstr("im")))
        || ( NULL == (Eins_Mode_Str = SLtt_tgetstr("ei")))
        || ( NULL == (Del_Char_Str = SLtt_tgetstr("dc"))))
      SLtt_Term_Cannot_Insert = 1;
-   
+
    Visible_Bell_Str = SLtt_tgetstr ("vb");
    Curs_Up_Str = SLtt_tgetstr ("up");
    Rev_Scroll_Str = SLtt_tgetstr("sr");
    Del_N_Lines_Str = SLtt_tgetstr("DL");
    Add_N_Lines_Str = SLtt_tgetstr("AL");
    Visible_Bell_Str = SLtt_tgetstr ("vb");
    Curs_Up_Str = SLtt_tgetstr ("up");
    Rev_Scroll_Str = SLtt_tgetstr("sr");
    Del_N_Lines_Str = SLtt_tgetstr("DL");
    Add_N_Lines_Str = SLtt_tgetstr("AL");
-   
-   /* Actually these are used to initialize terminals that use cursor 
+
+   /* Actually these are used to initialize terminals that use cursor
     * addressing.  Hard to believe.
     */
    Term_Init_Str = SLtt_tgetstr ("ti");
    Term_Reset_Str = SLtt_tgetstr ("te");
 
     * addressing.  Hard to believe.
     */
    Term_Init_Str = SLtt_tgetstr ("ti");
    Term_Reset_Str = SLtt_tgetstr ("te");
 
-   /* If I do this for vtxxx terminals, arrow keys start sending ESC O A, 
+   /* If I do this for vtxxx terminals, arrow keys start sending ESC O A,
     * which I do not want.  This is mainly for HP terminals.
     */
    if ((almost_vtxxx == 0) || SLtt_Force_Keypad_Init)
     * which I do not want.  This is mainly for HP terminals.
     */
    if ((almost_vtxxx == 0) || SLtt_Force_Keypad_Init)
@@ -1834,12 +1834,12 @@ termcap entry.", term);
        if (Del_N_Lines_Str == NULL) Del_N_Lines_Str = "\033[%dM";
        if (Add_N_Lines_Str == NULL) Add_N_Lines_Str = "\033[%dL";
      }
        if (Del_N_Lines_Str == NULL) Del_N_Lines_Str = "\033[%dM";
        if (Add_N_Lines_Str == NULL) Add_N_Lines_Str = "\033[%dL";
      }
-   
+
    Scroll_R_Str = SLtt_tgetstr("cs");
    Scroll_R_Str = SLtt_tgetstr("cs");
-   
+
    SLtt_get_screen_size ();
 
    SLtt_get_screen_size ();
 
-   if ((Scroll_R_Str == NULL) 
+   if ((Scroll_R_Str == NULL)
        || (((NULL == Del_N_Lines_Str) || (NULL == Add_N_Lines_Str))
           && (NULL == Rev_Scroll_Str)))
      {
        || (((NULL == Del_N_Lines_Str) || (NULL == Add_N_Lines_Str))
           && (NULL == Rev_Scroll_Str)))
      {
@@ -1852,12 +1852,12 @@ termcap entry.", term);
          }
        else SLtt_Term_Cannot_Scroll = 1;
      }
          }
        else SLtt_Term_Cannot_Scroll = 1;
      }
-   
+
    Del_Eol_Str = SLtt_tgetstr("ce");
 
    Rev_Vid_Str = SLtt_tgetstr("mr");
    if (Rev_Vid_Str == NULL) Rev_Vid_Str = SLtt_tgetstr("so");
    Del_Eol_Str = SLtt_tgetstr("ce");
 
    Rev_Vid_Str = SLtt_tgetstr("mr");
    if (Rev_Vid_Str == NULL) Rev_Vid_Str = SLtt_tgetstr("so");
-   
+
    Bold_Vid_Str = SLtt_tgetstr("md");
 
    /* Although xterm cannot blink, it does display the blinking characters
    Bold_Vid_Str = SLtt_tgetstr("md");
 
    /* Although xterm cannot blink, it does display the blinking characters
@@ -1866,9 +1866,9 @@ termcap entry.", term);
    if ((NULL == (Blink_Vid_Str = SLtt_tgetstr("mb")))
        && is_xterm)
      Blink_Vid_Str = "\033[5m";
    if ((NULL == (Blink_Vid_Str = SLtt_tgetstr("mb")))
        && is_xterm)
      Blink_Vid_Str = "\033[5m";
-   
+
    UnderLine_Vid_Str = SLtt_tgetstr("us");
    UnderLine_Vid_Str = SLtt_tgetstr("us");
-   
+
    Start_Alt_Chars_Str = SLtt_tgetstr ("as");   /* smacs */
    End_Alt_Chars_Str = SLtt_tgetstr ("ae");   /* rmacs */
    Enable_Alt_Char_Set = SLtt_tgetstr ("eA");   /* enacs */
    Start_Alt_Chars_Str = SLtt_tgetstr ("as");   /* smacs */
    End_Alt_Chars_Str = SLtt_tgetstr ("ae");   /* rmacs */
    Enable_Alt_Char_Set = SLtt_tgetstr ("eA");   /* enacs */
@@ -1877,7 +1877,7 @@ termcap entry.", term);
 #ifndef NCURSES_BRAIN_DAMAGE_CONTROL
 # define NCURSES_BRAIN_DAMAGE_CONTROL 0
 #endif
 #ifndef NCURSES_BRAIN_DAMAGE_CONTROL
 # define NCURSES_BRAIN_DAMAGE_CONTROL 0
 #endif
-   
+
 #if NCURSES_BRAIN_DAMAGE_CONTROL
    if (Linux_Console)
      {
 #if NCURSES_BRAIN_DAMAGE_CONTROL
    if (Linux_Console)
      {
@@ -1890,7 +1890,7 @@ termcap entry.", term);
        Enable_Alt_Char_Set = NULL;
 # else
        char *lgcp = "`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o\302q\304r\362s_t\303u\264v\301w\302x\263y\371z\372{\373|\374}\375~";
        Enable_Alt_Char_Set = NULL;
 # else
        char *lgcp = "`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o\302q\304r\362s_t\303u\264v\301w\302x\263y\371z\372{\373|\374}\375~";
-       
+
        SLtt_Graphics_Char_Pairs = lgcp;
        Start_Alt_Chars_Str = "\033[11m";
        End_Alt_Chars_Str = "\033[10m";
        SLtt_Graphics_Char_Pairs = lgcp;
        Start_Alt_Chars_Str = "\033[11m";
        End_Alt_Chars_Str = "\033[10m";
@@ -1898,7 +1898,7 @@ termcap entry.", term);
 # endif
      }
 #endif
 # endif
      }
 #endif
-   
+
    if (NULL == SLtt_Graphics_Char_Pairs)
      {
        /* make up for defective termcap/terminfo */
    if (NULL == SLtt_Graphics_Char_Pairs)
      {
        /* make up for defective termcap/terminfo */
@@ -1909,7 +1909,7 @@ termcap entry.", term);
             Enable_Alt_Char_Set = "\033)0";
          }
      }
             Enable_Alt_Char_Set = "\033)0";
          }
      }
-   
+
     /* aixterm added by willi */
    if (is_xterm || !strncmp (term, "aixterm", 7))
      {
     /* aixterm added by willi */
    if (is_xterm || !strncmp (term, "aixterm", 7))
      {
@@ -1917,15 +1917,15 @@ termcap entry.", term);
        End_Alt_Chars_Str = "\017";
        Enable_Alt_Char_Set = "\033(B\033)0";
      }
        End_Alt_Chars_Str = "\017";
        Enable_Alt_Char_Set = "\033(B\033)0";
      }
-   
-   if ((SLtt_Graphics_Char_Pairs == NULL) && 
+
+   if ((SLtt_Graphics_Char_Pairs == NULL) &&
        ((Start_Alt_Chars_Str == NULL) || (End_Alt_Chars_Str == NULL)))
      {
        SLtt_Has_Alt_Charset = 0;
        Enable_Alt_Char_Set = NULL;
      }
    else SLtt_Has_Alt_Charset = 1;
        ((Start_Alt_Chars_Str == NULL) || (End_Alt_Chars_Str == NULL)))
      {
        SLtt_Has_Alt_Charset = 0;
        Enable_Alt_Char_Set = NULL;
      }
    else SLtt_Has_Alt_Charset = 1;
-   
+
 
    /* status line capabilities */
    if ((SLtt_Has_Status_Line == -1)
 
    /* status line capabilities */
    if ((SLtt_Has_Status_Line == -1)
@@ -1938,17 +1938,17 @@ termcap entry.", term);
        Num_Status_Line_Columns = TGETNUM("ws");
        if (Num_Status_Line_Columns < 0) Num_Status_Line_Columns = 0;
      }
        Num_Status_Line_Columns = TGETNUM("ws");
        if (Num_Status_Line_Columns < 0) Num_Status_Line_Columns = 0;
      }
-   
-   if (NULL == (Norm_Vid_Str = SLtt_tgetstr("me"))) 
+
+   if (NULL == (Norm_Vid_Str = SLtt_tgetstr("me")))
      {
        Norm_Vid_Str = SLtt_tgetstr("se");
      }
      {
        Norm_Vid_Str = SLtt_tgetstr("se");
      }
-   
+
    Cursor_Invisible_Str = SLtt_tgetstr("vi");
    Cursor_Visible_Str = SLtt_tgetstr("ve");
    Cursor_Invisible_Str = SLtt_tgetstr("vi");
    Cursor_Visible_Str = SLtt_tgetstr("ve");
-   
+
    Curs_F_Str = SLtt_tgetstr("RI");
    Curs_F_Str = SLtt_tgetstr("RI");
-   
+
 #if 0
    if (NULL != Curs_F_Str)
      {
 #if 0
    if (NULL != Curs_F_Str)
      {
@@ -1956,7 +1956,7 @@ termcap entry.", term);
      }
    else Len_Curs_F_Str = strlen(Curs_Pos_Str);
 #endif
      }
    else Len_Curs_F_Str = strlen(Curs_Pos_Str);
 #endif
-   
+
    Automatic_Margins = TGETFLAG ("am");
    /* No_Move_In_Standout = !TGETFLAG ("ms"); */
 #ifdef HP_GLITCH_CODE
    Automatic_Margins = TGETFLAG ("am");
    /* No_Move_In_Standout = !TGETFLAG ("ms"); */
 #ifdef HP_GLITCH_CODE
@@ -1972,14 +1972,14 @@ termcap entry.", term);
 
    if (Worthless_Highlight)
      SLtt_Has_Alt_Charset = 0;
 
    if (Worthless_Highlight)
      SLtt_Has_Alt_Charset = 0;
-   
+
    /* Check for color information in the termcap.  A program should not
     * rely on this information being accurate.
     */
    if (SLtt_Use_Ansi_Colors == 0)
      {
        Reset_Color_String = SLtt_tgetstr ("op");
    /* Check for color information in the termcap.  A program should not
     * rely on this information being accurate.
     */
    if (SLtt_Use_Ansi_Colors == 0)
      {
        Reset_Color_String = SLtt_tgetstr ("op");
-       
+
        SLtt_Use_Ansi_Colors = ((NULL != Reset_Color_String)
                                || (NULL != SLtt_tgetstr ("Sf"))
                                || (NULL != SLtt_tgetstr ("Sb"))
        SLtt_Use_Ansi_Colors = ((NULL != Reset_Color_String)
                                || (NULL != SLtt_tgetstr ("Sf"))
                                || (NULL != SLtt_tgetstr ("Sb"))
@@ -1987,9 +1987,9 @@ termcap entry.", term);
                                || (NULL != SLtt_tgetstr ("AB"))
                                || (-1 != SLtt_tgetnum ("Co"))
                                || (-1 != SLtt_tgetnum ("pa")));
                                || (NULL != SLtt_tgetstr ("AB"))
                                || (-1 != SLtt_tgetnum ("Co"))
                                || (-1 != SLtt_tgetnum ("pa")));
-       
+
      }
      }
-   
+
 #if defined(__QNX__) && defined(QNX_QANSI_SLANG_COMPAT_ACS)
    /*
     * Override the alt-char-set handling string in case of a
 #if defined(__QNX__) && defined(QNX_QANSI_SLANG_COMPAT_ACS)
    /*
     * Override the alt-char-set handling string in case of a
@@ -2005,8 +2005,8 @@ termcap entry.", term);
         End_Alt_Chars_Str = "\017";   /* rmacs/ae (^O) */
         SLtt_Graphics_Char_Pairs =    /* acsc/ac */
            "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~O\141";
         End_Alt_Chars_Str = "\017";   /* rmacs/ae (^O) */
         SLtt_Graphics_Char_Pairs =    /* acsc/ac */
            "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~O\141";
-       
-       /* 
+
+       /*
         * it would be required to modify the sgr/sa entry also, if it
         * would be used (->embedded as/ae sequences)...
         */
         * it would be required to modify the sgr/sa entry also, if it
         * would be used (->embedded as/ae sequences)...
         */
@@ -2031,7 +2031,7 @@ void SLtt_enable_cursor_keys (void)
 void SLtt_get_terminfo ()
 {
    int zero = 0;
 void SLtt_get_terminfo ()
 {
    int zero = 0;
-   
+
    get_color_info ();
 
    SLtt_set_term_vtxxx(&zero);
    get_color_info ();
 
    SLtt_set_term_vtxxx(&zero);
@@ -2039,20 +2039,20 @@ void SLtt_get_terminfo ()
    End_Alt_Chars_Str = "\017";
    SLtt_Has_Alt_Charset = 1;
    SLtt_Graphics_Char_Pairs = "aaffgghhjjkkllmmnnooqqssttuuvvwwxx";
    End_Alt_Chars_Str = "\017";
    SLtt_Has_Alt_Charset = 1;
    SLtt_Graphics_Char_Pairs = "aaffgghhjjkkllmmnnooqqssttuuvvwwxx";
-   Enable_Alt_Char_Set = "\033(B\033)0"; 
+   Enable_Alt_Char_Set = "\033(B\033)0";
    SLtt_get_screen_size ();
 }
 #endif
 
 /* This sets term for vt102 terminals it parameter vt100 is 0.  If vt100
    SLtt_get_screen_size ();
 }
 #endif
 
 /* This sets term for vt102 terminals it parameter vt100 is 0.  If vt100
- * is non-zero, set terminal appropriate for a only vt100  
+ * is non-zero, set terminal appropriate for a only vt100
  * (no add line capability). */
  * (no add line capability). */
-                                                          
+
 void SLtt_set_term_vtxxx(int *vt100)
 {
    Norm_Vid_Str = "\033[m";
 void SLtt_set_term_vtxxx(int *vt100)
 {
    Norm_Vid_Str = "\033[m";
-   
-   Scroll_R_Str = "\033[%i%d;%dr"; 
+
+   Scroll_R_Str = "\033[%i%d;%dr";
    Cls_Str = "\033[2J\033[H";
    Rev_Vid_Str = "\033[7m";
    Bold_Vid_Str = "\033[1m";
    Cls_Str = "\033[2J\033[H";
    Rev_Vid_Str = "\033[7m";
    Bold_Vid_Str = "\033[1m";
@@ -2104,7 +2104,7 @@ void SLtt_reset_video (void)
 
    Current_Fgbg = 0xFFFFFFFFU;
    SLtt_set_alt_char_set (0);
 
    Current_Fgbg = 0xFFFFFFFFU;
    SLtt_set_alt_char_set (0);
-   if (SLtt_Use_Ansi_Colors) 
+   if (SLtt_Use_Ansi_Colors)
      {
        if (Reset_Color_String == NULL)
          {
      {
        if (Reset_Color_String == NULL)
          {
@@ -2131,7 +2131,7 @@ void SLtt_bold_video (void)
 int SLtt_set_mouse_mode (int mode, int force)
 {
    char *term;
 int SLtt_set_mouse_mode (int mode, int force)
 {
    char *term;
-   
+
    if (force == 0)
      {
        if (NULL == (term = (char *) getenv("TERM"))) return -1;
    if (force == 0)
      {
        if (NULL == (term = (char *) getenv("TERM"))) return -1;
@@ -2143,7 +2143,7 @@ int SLtt_set_mouse_mode (int mode, int force)
      SLtt_write_string ("\033[?9h");
    else
      SLtt_write_string ("\033[?9l");
      SLtt_write_string ("\033[?9h");
    else
      SLtt_write_string ("\033[?9l");
-   
+
    return 0;
 }
 
    return 0;
 }
 
@@ -2160,16 +2160,16 @@ int SLtt_write_to_status_line (char *s, int col)
        || (Goto_Status_Line_Str == NULL)
        || (Return_From_Status_Line_Str == NULL))
      return -1;
        || (Goto_Status_Line_Str == NULL)
        || (Return_From_Status_Line_Str == NULL))
      return -1;
-   
+
    tt_printf (Goto_Status_Line_Str, col, 0);
    SLtt_write_string (s);
    SLtt_write_string (Return_From_Status_Line_Str);
    return 0;
 }
 
    tt_printf (Goto_Status_Line_Str, col, 0);
    SLtt_write_string (s);
    SLtt_write_string (Return_From_Status_Line_Str);
    return 0;
 }
 
-   
+
 void SLtt_get_screen_size (void)
 void SLtt_get_screen_size (void)
-{   
+{
 #ifdef VMS
    int status, code;
    unsigned short chan;
 #ifdef VMS
    int status, code;
    unsigned short chan;
@@ -2179,10 +2179,10 @@ void SLtt_get_screen_size (void)
    VIOMODEINFO vioModeInfo;
 #endif
    int r = 0, c = 0;
    VIOMODEINFO vioModeInfo;
 #endif
    int r = 0, c = 0;
-   
+
 #if defined(TIOCGWINSZ) && !defined(SCO_FLAVOR)
    struct winsize wind_struct;
 #if defined(TIOCGWINSZ) && !defined(SCO_FLAVOR)
    struct winsize wind_struct;
-   
+
    do
      {
        if ((ioctl(1,TIOCGWINSZ,&wind_struct) == 0)
    do
      {
        if ((ioctl(1,TIOCGWINSZ,&wind_struct) == 0)
@@ -2195,7 +2195,7 @@ void SLtt_get_screen_size (void)
          }
      }
    while (errno == EINTR);
          }
      }
    while (errno == EINTR);
-   
+
 #endif
 
 #ifdef VMS
 #endif
 
 #ifdef VMS
@@ -2218,21 +2218,21 @@ void SLtt_get_screen_size (void)
    vioModeInfo.cb = sizeof(vioModeInfo);
    VioGetMode (&vioModeInfo, 0);
    c = vioModeInfo.col;
    vioModeInfo.cb = sizeof(vioModeInfo);
    VioGetMode (&vioModeInfo, 0);
    c = vioModeInfo.col;
-   r = vioModeInfo.row;   
+   r = vioModeInfo.row;
 #endif
 #endif
-   
+
    if (r <= 0)
      {
        char *s = getenv ("LINES");
        if (s != NULL) r = atoi (s);
      }
    if (r <= 0)
      {
        char *s = getenv ("LINES");
        if (s != NULL) r = atoi (s);
      }
-   
+
    if (c <= 0)
      {
        char *s = getenv ("COLUMNS");
        if (s != NULL) c = atoi (s);
      }
    if (c <= 0)
      {
        char *s = getenv ("COLUMNS");
        if (s != NULL) c = atoi (s);
      }
-   
+
    if ((r <= 0) || (r > 200)) r = 24;
    if ((c <= 0) || (c > 250)) c = 80;
    SLtt_Screen_Rows = r;
    if ((r <= 0) || (r > 200)) r = 24;
    if ((c <= 0) || (c > 250)) c = 80;
    SLtt_Screen_Rows = r;
index 3a59829..fdbf601 100644 (file)
@@ -1,7 +1,7 @@
 /* error handling common to all routines. */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* error handling common to all routines. */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -32,11 +32,11 @@ void SLang_doerror (char *error)
    char *str = NULL;
 
    *err = 0;
    char *str = NULL;
 
    *err = 0;
-   
+
    str = "Slang/Midnight Commander unknown error";
 
    sprintf(err, "S-Lang Error: %s", str);
    str = "Slang/Midnight Commander unknown error";
 
    sprintf(err, "S-Lang Error: %s", str);
-   
+
    if (SLang_Error_Routine == NULL)
      {
        fputs (err, stderr);
    if (SLang_Error_Routine == NULL)
      {
        fputs (err, stderr);
index 5a43f85..9086e59 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -18,7 +18,7 @@ int SLang_Abort_Char = 7;
 int SLang_Ignore_User_Abort = 0;
 
 /* This has the effect of mapping all characters in the range 128-169 to
 int SLang_Ignore_User_Abort = 0;
 
 /* This has the effect of mapping all characters in the range 128-169 to
- * ESC [ something 
+ * ESC [ something
  */
 #ifndef __GO32__
 # if defined(__unix__) || defined(vms)
  */
 #ifndef __GO32__
 # if defined(__unix__) || defined(vms)
@@ -31,18 +31,18 @@ unsigned int SLang_getkey (void)
 {
    unsigned int imax;
    unsigned int ch;
 {
    unsigned int imax;
    unsigned int ch;
-   
+
    if (SLang_Input_Buffer_Len)
      {
        ch = (unsigned int) *SLang_Input_Buffer;
        SLang_Input_Buffer_Len--;
        imax = SLang_Input_Buffer_Len;
    if (SLang_Input_Buffer_Len)
      {
        ch = (unsigned int) *SLang_Input_Buffer;
        SLang_Input_Buffer_Len--;
        imax = SLang_Input_Buffer_Len;
-   
-       SLMEMCPY ((char *) SLang_Input_Buffer, 
+
+       SLMEMCPY ((char *) SLang_Input_Buffer,
                (char *) (SLang_Input_Buffer + 1), imax);
      }
    else if (0xFFFF == (ch = SLsys_getkey ())) return ch;
                (char *) (SLang_Input_Buffer + 1), imax);
      }
    else if (0xFFFF == (ch = SLsys_getkey ())) return ch;
-   
+
 #ifdef DEC_8BIT_HACK
    if (ch & 0x80)
      {
 #ifdef DEC_8BIT_HACK
    if (ch & 0x80)
      {
@@ -78,8 +78,8 @@ void SLang_buffer_keystring (unsigned char *s, unsigned int n)
 {
 
    if (n + SLang_Input_Buffer_Len + 3 > MAX_INPUT_BUFFER_LEN) return;
 {
 
    if (n + SLang_Input_Buffer_Len + 3 > MAX_INPUT_BUFFER_LEN) return;
-   
-   SLMEMCPY ((char *) SLang_Input_Buffer + SLang_Input_Buffer_Len, 
+
+   SLMEMCPY ((char *) SLang_Input_Buffer + SLang_Input_Buffer_Len,
           (char *) s, n);
    SLang_Input_Buffer_Len += n;
 }
           (char *) s, n);
    SLang_Input_Buffer_Len += n;
 }
@@ -95,14 +95,14 @@ int SLang_input_pending (int tsecs)
    int n;
    unsigned char c;
    if (SLang_Input_Buffer_Len) return (int) SLang_Input_Buffer_Len;
    int n;
    unsigned char c;
    if (SLang_Input_Buffer_Len) return (int) SLang_Input_Buffer_Len;
-   
+
    n = SLsys_input_pending (tsecs);
    n = SLsys_input_pending (tsecs);
-   
+
    if (n <= 0) return 0;
    if (n <= 0) return 0;
-   
+
    c = (unsigned char) SLang_getkey ();
    SLang_ungetkey_string (&c, 1);
    c = (unsigned char) SLang_getkey ();
    SLang_ungetkey_string (&c, 1);
-   
+
    return n;
 }
 #endif /* OS2_NT */
    return n;
 }
 #endif /* OS2_NT */
@@ -110,10 +110,10 @@ int SLang_input_pending (int tsecs)
 void SLang_flush_input (void)
 {
    int quit = SLKeyBoard_Quit;
 void SLang_flush_input (void)
 {
    int quit = SLKeyBoard_Quit;
-   
+
    SLang_Input_Buffer_Len = 0;
    SLang_Input_Buffer_Len = 0;
-   SLKeyBoard_Quit = 0;   
-   while (SLsys_input_pending (0) > 0) 
+   SLKeyBoard_Quit = 0;
+   while (SLsys_input_pending (0) > 0)
      {
        (void) SLsys_getkey ();
        /* Set this to 0 because SLsys_getkey may stuff keyboard buffer if
      {
        (void) SLsys_getkey ();
        /* Set this to 0 because SLsys_getkey may stuff keyboard buffer if
index 5edf25b..b47a07e 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -10,7 +10,7 @@
    use system rouines.  For msdos, I use inline assembly. */
 
 /* The current versions only work in the forward direction only!! */
    use system rouines.  For msdos, I use inline assembly. */
 
 /* The current versions only work in the forward direction only!! */
-      
+
 #include "config.h"
 
 #include <stdio.h>
 #include "config.h"
 
 #include <stdio.h>
@@ -32,20 +32,20 @@ char *SLmemcpy(char *s1, char *s2, int n)
    asm mov si, bx
    asm mov di, dx
    return(s1);
    asm mov si, bx
    asm mov di, dx
    return(s1);
-   
+
 #else
    register char *smax, *s = s1;
    int n2;
 #else
    register char *smax, *s = s1;
    int n2;
-   
+
    n2 = n % 4;
    smax = s + (n - 4);
    n2 = n % 4;
    smax = s + (n - 4);
-   while (s <= smax) 
+   while (s <= smax)
      {
        *s = *s2; *(s + 1) = *(s2 + 1); *(s + 2) = *(s2 + 2); *(s + 3) = *(s2 + 3);
        s += 4;
        s2 += 4;
      }
    while (n2--) *s++ = *s2++;
      {
        *s = *s2; *(s + 1) = *(s2 + 1); *(s + 2) = *(s2 + 2); *(s + 3) = *(s2 + 3);
        s += 4;
        s2 += 4;
      }
    while (n2--) *s++ = *s2++;
-   return(s1); 
+   return(s1);
 #endif
 }
 #endif
 }
index a83ae19..1081944 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -10,7 +10,7 @@
    use system rouines.  For msdos, I use inline assembly. */
 
 /* The current versions only work in the forward direction only!! */
    use system rouines.  For msdos, I use inline assembly. */
 
 /* The current versions only work in the forward direction only!! */
-      
+
 #include "config.h"
 
 #include <stdio.h>
 #include "config.h"
 
 #include <stdio.h>
@@ -34,10 +34,10 @@ void SLmemset(char *p, char space, int n)
 
    pmax = p + (n - 4);
    n = n % 4;
 
    pmax = p + (n - 4);
    n = n % 4;
-   while (p <= pmax) 
+   while (p <= pmax)
      {
        *p++ = space; *p++ = space; *p++ = space; *p++= space;
      }
      {
        *p++ = space; *p++ = space; *p++ = space; *p++= space;
      }
-   while (n--) *p++ = space;     
+   while (n--) *p++ = space;
 #endif
 }
 #endif
 }
index e056fff..4603e22 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -235,10 +235,10 @@ unsigned int SLsys_getkey ()
 {
    unsigned int c;
    unsigned char scan;
 {
    unsigned int c;
    unsigned char scan;
-   
+
    int tsecs = 300;
    int tsecs = 300;
-   
-   if (!keyWaiting()) 
+
+   if (!keyWaiting())
      while (!SLsys_input_pending(tsecs));
 
    /* read codes from buffer */
      while (!SLsys_input_pending(tsecs));
 
    /* read codes from buffer */
index 7d4c19d..4596da7 100644 (file)
@@ -21,7 +21,7 @@ SLSig_Fun_Type *SLsignal (int sig, SLSig_Fun_Type *f)
 {
 #ifdef SLANG_POSIX_SIGNALS
    struct sigaction old_sa, new_sa;
 {
 #ifdef SLANG_POSIX_SIGNALS
    struct sigaction old_sa, new_sa;
-   
+
 # ifdef SIGALRM
    /* We want system calls to be interrupted by SIGALRM. */
    if (sig == SIGALRM) return SLsignal_intr (sig, f);
 # ifdef SIGALRM
    /* We want system calls to be interrupted by SIGALRM. */
    if (sig == SIGALRM) return SLsignal_intr (sig, f);
@@ -29,15 +29,15 @@ SLSig_Fun_Type *SLsignal (int sig, SLSig_Fun_Type *f)
 
    sigemptyset (&new_sa.sa_mask);
    new_sa.sa_handler = f;
 
    sigemptyset (&new_sa.sa_mask);
    new_sa.sa_handler = f;
-   
+
    new_sa.sa_flags = 0;
 # ifdef SA_RESTART
    new_sa.sa_flags |= SA_RESTART;
 # endif
    new_sa.sa_flags = 0;
 # ifdef SA_RESTART
    new_sa.sa_flags |= SA_RESTART;
 # endif
-   
+
    if (-1 == sigaction (sig, &new_sa, &old_sa))
      return (SLSig_Fun_Type *) SIG_ERR;
    if (-1 == sigaction (sig, &new_sa, &old_sa))
      return (SLSig_Fun_Type *) SIG_ERR;
-   
+
    return old_sa.sa_handler;
 #else
    /* Not POSIX. */
    return old_sa.sa_handler;
 #else
    /* Not POSIX. */
@@ -45,25 +45,25 @@ SLSig_Fun_Type *SLsignal (int sig, SLSig_Fun_Type *f)
 #endif
 }
 
 #endif
 }
 
-/* This function will NOT cause system calls to be restarted after 
- * signal if possible 
+/* This function will NOT cause system calls to be restarted after
+ * signal if possible
  */
 SLSig_Fun_Type *SLsignal_intr (int sig, SLSig_Fun_Type *f)
 {
 #ifdef SLANG_POSIX_SIGNALS
    struct sigaction old_sa, new_sa;
  */
 SLSig_Fun_Type *SLsignal_intr (int sig, SLSig_Fun_Type *f)
 {
 #ifdef SLANG_POSIX_SIGNALS
    struct sigaction old_sa, new_sa;
-   
+
    sigemptyset (&new_sa.sa_mask);
    new_sa.sa_handler = f;
    sigemptyset (&new_sa.sa_mask);
    new_sa.sa_handler = f;
-   
+
    new_sa.sa_flags = 0;
 # ifdef SA_INTERRUPT
    new_sa.sa_flags |= SA_INTERRUPT;
 # endif
    new_sa.sa_flags = 0;
 # ifdef SA_INTERRUPT
    new_sa.sa_flags |= SA_INTERRUPT;
 # endif
-   
+
    if (-1 == sigaction (sig, &new_sa, &old_sa))
      return (SLSig_Fun_Type *) SIG_ERR;
    if (-1 == sigaction (sig, &new_sa, &old_sa))
      return (SLSig_Fun_Type *) SIG_ERR;
-   
+
    return old_sa.sa_handler;
 #else
    /* Not POSIX. */
    return old_sa.sa_handler;
 #else
    /* Not POSIX. */
@@ -72,7 +72,7 @@ SLSig_Fun_Type *SLsignal_intr (int sig, SLSig_Fun_Type *f)
 }
 
 
 }
 
 
-/* We are primarily interested in blocking signals that would cause the 
+/* We are primarily interested in blocking signals that would cause the
  * application to reset the tty.  These include suspend signals and
  * possibly interrupt signals.
  */
  * application to reset the tty.  These include suspend signals and
  * possibly interrupt signals.
  */
@@ -87,13 +87,13 @@ int SLsig_block_signals (void)
 #ifdef SLANG_POSIX_SIGNALS
    sigset_t new_mask;
 #endif
 #ifdef SLANG_POSIX_SIGNALS
    sigset_t new_mask;
 #endif
-   
+
    Blocked_Depth++;
    if (Blocked_Depth != 1)
      {
        return 0;
      }
    Blocked_Depth++;
    if (Blocked_Depth != 1)
      {
        return 0;
      }
-   
+
 #ifdef SLANG_POSIX_SIGNALS
    sigemptyset (&new_mask);
 # ifdef SIGQUIT
 #ifdef SLANG_POSIX_SIGNALS
    sigemptyset (&new_mask);
 # ifdef SIGQUIT
@@ -111,7 +111,7 @@ int SLsig_block_signals (void)
 # ifdef SIGTTOU
    sigaddset (&new_mask, SIGTTOU);
 # endif
 # ifdef SIGTTOU
    sigaddset (&new_mask, SIGTTOU);
 # endif
-   
+
    (void) sigprocmask (SIG_BLOCK, &new_mask, &Old_Signal_Mask);
    return 0;
 #else
    (void) sigprocmask (SIG_BLOCK, &new_mask, &Old_Signal_Mask);
    return 0;
 #else
@@ -124,12 +124,12 @@ int SLsig_unblock_signals (void)
 {
    if (Blocked_Depth == 0)
      return -1;
 {
    if (Blocked_Depth == 0)
      return -1;
-   
+
    Blocked_Depth--;
    Blocked_Depth--;
-   
+
    if (Blocked_Depth != 0)
      return 0;
    if (Blocked_Depth != 0)
      return 0;
-   
+
 #ifdef SLANG_POSIX_SIGNALS
    (void) sigprocmask (SIG_SETMASK, &Old_Signal_Mask, NULL);
    return 0;
 #ifdef SLANG_POSIX_SIGNALS
    (void) sigprocmask (SIG_SETMASK, &Old_Signal_Mask, NULL);
    return 0;
index ababdf3..94f0293 100644 (file)
@@ -1,7 +1,7 @@
 /* SLang Screen management routines */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* SLang Screen management routines */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -60,7 +60,7 @@ static void blank_line (unsigned short *p, int n, unsigned char ch)
    register unsigned short color_ch;
 
    color_ch = (This_Color << 8) | (unsigned short) ch;
    register unsigned short color_ch;
 
    color_ch = (This_Color << 8) | (unsigned short) ch;
-   
+
    while (p < pmax)
      {
        *p++ = color_ch;
    while (p < pmax)
      {
        *p++ = color_ch;
@@ -72,7 +72,7 @@ static void clear_region (int row, int n)
 {
    int i;
    int imax = row + n;
 {
    int i;
    int imax = row + n;
-   
+
    if (imax > Screen_Rows) imax = Screen_Rows;
    for (i = row; i < imax; i++)
      {
    if (imax > Screen_Rows) imax = Screen_Rows;
    for (i = row; i < imax; i++)
      {
@@ -87,10 +87,10 @@ static void clear_region (int row, int n)
 void SLsmg_erase_eol (void)
 {
    int r, c;
 void SLsmg_erase_eol (void)
 {
    int r, c;
-   
+
    c = This_Col - Start_Col;
    r = This_Row - Start_Row;
    c = This_Col - Start_Col;
    r = This_Row - Start_Row;
-   
+
    if ((r < 0) || (r >= Screen_Rows)) return;
    if (c < 0) c = 0; else if (c >= Screen_Cols) return;
    blank_line (SL_Screen[This_Row].neew + c , Screen_Cols - c, ' ');
    if ((r < 0) || (r >= Screen_Rows)) return;
    if (c < 0) c = 0; else if (c >= Screen_Cols) return;
    blank_line (SL_Screen[This_Row].neew + c , Screen_Cols - c, ' ');
@@ -115,7 +115,7 @@ static void scroll_up (void)
    This_Row--;
 }
 
    This_Row--;
 }
 
-   
+
 
 
 void SLsmg_gotorc (int r, int c)
 
 
 void SLsmg_gotorc (int r, int c)
@@ -150,7 +150,7 @@ void SLsmg_set_char_set (int i)
                                        */
    if (i) This_Alt_Char = ALT_CHAR_FLAG;
    else This_Alt_Char = 0;
                                        */
    if (i) This_Alt_Char = ALT_CHAR_FLAG;
    else This_Alt_Char = 0;
-   
+
    This_Color &= 0x7F;
    This_Color |= This_Alt_Char;
 }
    This_Color &= 0x7F;
    This_Color |= This_Alt_Char;
 }
@@ -179,10 +179,10 @@ static int point_visible (int col_too)
 {
    return ((This_Row >= Start_Row) && (This_Row < Start_Row + Screen_Rows)
           && ((col_too == 0)
 {
    return ((This_Row >= Start_Row) && (This_Row < Start_Row + Screen_Rows)
           && ((col_too == 0)
-              || ((This_Col >= Start_Col) 
+              || ((This_Col >= Start_Col)
                   && (This_Col < Start_Col + Screen_Cols))));
 }
                   && (This_Col < Start_Col + Screen_Cols))));
 }
-   
+
 void SLsmg_printf (char *fmt, ...)
 {
    char p[1000];
 void SLsmg_printf (char *fmt, ...)
 {
    char p[1000];
@@ -191,7 +191,7 @@ void SLsmg_printf (char *fmt, ...)
    va_start(ap, fmt);
    (void) vsprintf(p, fmt, ap);
    va_end(ap);
    va_start(ap, fmt);
    (void) vsprintf(p, fmt, ap);
    va_end(ap);
-   
+
    SLsmg_write_string (p);
 }
 
    SLsmg_write_string (p);
 }
 
@@ -205,7 +205,7 @@ void SLsmg_write_nstring (char *str, int n)
    int width;
    char blank = ' ';
    if (str == NULL) width = 0;
    int width;
    char blank = ' ';
    if (str == NULL) width = 0;
-   else 
+   else
      {
        width = strlen (str);
        if (width > n) width = n;
      {
        width = strlen (str);
        if (width > n) width = n;
@@ -218,7 +218,7 @@ void SLsmg_write_wrapped_string (char *s, int r, int c, int dr, int dc, int fill
 {
    register char ch, *p;
    int maxc = dc;
 {
    register char ch, *p;
    int maxc = dc;
-   
+
    if ((dr == 0) || (dc == 0)) return;
    p = s;
    dc = 0;
    if ((dr == 0) || (dc == 0)) return;
    p = s;
    dc = 0;
@@ -228,9 +228,9 @@ void SLsmg_write_wrapped_string (char *s, int r, int c, int dr, int dc, int fill
        if ((ch == 0) || (ch == '\n'))
          {
             int diff;
        if ((ch == 0) || (ch == '\n'))
          {
             int diff;
-            
+
             diff = maxc - dc;
             diff = maxc - dc;
-            
+
             SLsmg_gotorc (r, c);
             SLsmg_write_nchars (s, dc);
             if (fill && (diff > 0))
             SLsmg_gotorc (r, c);
             SLsmg_write_nchars (s, dc);
             if (fill && (diff > 0))
@@ -238,7 +238,7 @@ void SLsmg_write_wrapped_string (char *s, int r, int c, int dr, int dc, int fill
                  while (diff--) SLsmg_write_char (' ');
               }
             if ((ch == 0) || (dr == 1)) break;
                  while (diff--) SLsmg_write_char (' ');
               }
             if ((ch == 0) || (dr == 1)) break;
-            
+
             r++;
             dc = 0;
             dr--;
             r++;
             dc = 0;
             dr--;
@@ -259,7 +259,7 @@ void SLsmg_write_wrapped_string (char *s, int r, int c, int dr, int dc, int fill
      }
 }
 
      }
 }
 
-   
+
 
 int SLsmg_Tab_Width = 8;
 
 
 int SLsmg_Tab_Width = 8;
 
@@ -282,30 +282,30 @@ void SLsmg_write_nchars (char *str, int n)
    int newline_flag;
 #ifndef pc_system
    int alt_char_set_flag;
    int newline_flag;
 #ifndef pc_system
    int alt_char_set_flag;
-   
-   alt_char_set_flag = ((SLtt_Use_Blink_For_ACS == 0) 
+
+   alt_char_set_flag = ((SLtt_Use_Blink_For_ACS == 0)
                        && (This_Color & ALT_CHAR_FLAG));
 #endif
 
    str_max = str + n;
    color = This_Color << 8;
                        && (This_Color & ALT_CHAR_FLAG));
 #endif
 
    str_max = str + n;
    color = This_Color << 8;
-   
+
    top:                                       /* get here only on newline */
    top:                                       /* get here only on newline */
-   
+
    newline_flag = 0;
    start_len = Start_Col;
    newline_flag = 0;
    start_len = Start_Col;
-   
+
    if (point_visible (0) == 0) return;
    if (point_visible (0) == 0) return;
-   
+
    len = This_Col;
    max_len = start_len + Screen_Cols;
 
    p = SL_Screen[This_Row].neew;
    if (len > start_len) p += (len - start_len);
    len = This_Col;
    max_len = start_len + Screen_Cols;
 
    p = SL_Screen[This_Row].neew;
    if (len > start_len) p += (len - start_len);
-   
+
    flags = SL_Screen[This_Row].flags;
    while ((len < max_len) && (str < str_max))
    flags = SL_Screen[This_Row].flags;
    while ((len < max_len) && (str < str_max))
-     { 
+     {
        ch = (unsigned char) *str++;
 
 #ifndef pc_system
        ch = (unsigned char) *str++;
 
 #ifndef pc_system
@@ -332,7 +332,7 @@ void SLsmg_write_nchars (char *str, int n)
                  p++;
               }
          }
                  p++;
               }
          }
-       
+
        else if ((ch == '\t') && (SLsmg_Tab_Width > 0))
          {
             n = len;
        else if ((ch == '\t') && (SLsmg_Tab_Width > 0))
          {
             n = len;
@@ -345,7 +345,7 @@ void SLsmg_write_nchars (char *str, int n)
                  len += 1;
                  if (len > start_len)
                    {
                  len += 1;
                  if (len > start_len)
                    {
-                      if (*p != neew) 
+                      if (*p != neew)
                         {
                            flags |= TOUCHED;
                            *p = neew;
                         {
                            flags |= TOUCHED;
                            *p = neew;
@@ -381,7 +381,7 @@ void SLsmg_write_nchars (char *str, int n)
                       ch &= 0x7F;
                    }
               }
                       ch &= 0x7F;
                    }
               }
-            
+
             len += 1;
             if (len > start_len)
               {
             len += 1;
             if (len > start_len)
               {
@@ -394,7 +394,7 @@ void SLsmg_write_nchars (char *str, int n)
                  p++;
                  if (len == max_len) break;
               }
                  p++;
                  if (len == max_len) break;
               }
-            
+
             if (ch == 127) ch = '?'; else ch = ch + '@';
             len++;
             if (len > start_len)
             if (ch == 127) ch = '?'; else ch = ch + '@';
             len++;
             if (len > start_len)
@@ -409,13 +409,13 @@ void SLsmg_write_nchars (char *str, int n)
               }
          }
      }
               }
          }
      }
-   
+
    SL_Screen[This_Row].flags = flags;
    This_Col = len;
    SL_Screen[This_Row].flags = flags;
    This_Col = len;
-   
+
    if (SLsmg_Newline_Moves == 0)
      return;
    if (SLsmg_Newline_Moves == 0)
      return;
-   
+
    if (newline_flag == 0)
      {
        while (str < str_max)
    if (newline_flag == 0)
      {
        while (str < str_max)
@@ -426,7 +426,7 @@ void SLsmg_write_nchars (char *str, int n)
        if (str == str_max) return;
        str++;
      }
        if (str == str_max) return;
        str++;
      }
-   
+
    This_Row++;
    This_Col = 0;
    if (This_Row == Start_Row + Screen_Rows)
    This_Row++;
    This_Col = 0;
    if (This_Row == Start_Row + Screen_Rows)
@@ -456,7 +456,7 @@ void SLsmg_cls (void)
 static void do_copy (unsigned short *a, unsigned short *b)
 {
    unsigned short *amax = a + Screen_Cols;
 static void do_copy (unsigned short *a, unsigned short *b)
 {
    unsigned short *amax = a + Screen_Cols;
-   
+
    while (a < amax) *a++ = *b++;
 }
 #endif
    while (a < amax) *a++ = *b++;
 }
 #endif
@@ -469,16 +469,16 @@ static unsigned long compute_hash (unsigned short *s, int n)
    register unsigned long sum = 0;
    register unsigned short *smax, ch;
    int is_blank = 2;
    register unsigned long sum = 0;
    register unsigned short *smax, ch;
    int is_blank = 2;
-   
+
    s += SLsmg_Scroll_Hash_Border;
    smax = s + (n - SLsmg_Scroll_Hash_Border);
    s += SLsmg_Scroll_Hash_Border;
    smax = s + (n - SLsmg_Scroll_Hash_Border);
-   while (s < smax) 
+   while (s < smax)
      {
        ch = *s++;
        if (is_blank && ((ch & 0xFF) != 32)) is_blank--;
      {
        ch = *s++;
        if (is_blank && ((ch & 0xFF) != 32)) is_blank--;
-       
+
        sum += ch;
        sum += ch;
-       
+
        h = sum + (h << 3);
        if ((g = h & 0xE0000000UL) != 0)
          {
        h = sum + (h << 3);
        if ((g = h & 0xE0000000UL) != 0)
          {
@@ -499,9 +499,9 @@ static void try_scroll (void)
    int color, did_scroll = 0;
    unsigned short *tmp;
    int ignore;
    int color, did_scroll = 0;
    unsigned short *tmp;
    int ignore;
-   
+
    /* find region limits. */
    /* find region limits. */
-   
+
    for (rmax = Screen_Rows - 1; rmax > 0; rmax--)
      {
        if (SL_Screen[rmax].new_hash != SL_Screen[rmax].old_hash)
    for (rmax = Screen_Rows - 1; rmax > 0; rmax--)
      {
        if (SL_Screen[rmax].new_hash != SL_Screen[rmax].old_hash)
@@ -510,11 +510,11 @@ static void try_scroll (void)
             if ((r1 == 0)
                 || (SL_Screen[r1].new_hash != SL_Screen[r1].old_hash))
               break;
             if ((r1 == 0)
                 || (SL_Screen[r1].new_hash != SL_Screen[r1].old_hash))
               break;
-            
+
             rmax = r1;
          }
      }
             rmax = r1;
          }
      }
-   
+
    for (rmin = 0; rmin < rmax; rmin++)
      {
        if (SL_Screen[rmin].new_hash != SL_Screen[rmin].old_hash)
    for (rmin = 0; rmin < rmax; rmin++)
      {
        if (SL_Screen[rmin].new_hash != SL_Screen[rmin].old_hash)
@@ -523,30 +523,30 @@ static void try_scroll (void)
             if ((r1 == rmax)
                 || (SL_Screen[r1].new_hash != SL_Screen[r1].old_hash))
               break;
             if ((r1 == rmax)
                 || (SL_Screen[r1].new_hash != SL_Screen[r1].old_hash))
               break;
-            
+
             rmin = r1;
          }
      }
 
             rmin = r1;
          }
      }
 
-   
+
    for (i = rmax; i > rmin; i--)
      {
        hash = SL_Screen[i].new_hash;
        if (hash == Blank_Hash) continue;
    for (i = rmax; i > rmin; i--)
      {
        hash = SL_Screen[i].new_hash;
        if (hash == Blank_Hash) continue;
-       
-       if ((hash == SL_Screen[i].old_hash) 
+
+       if ((hash == SL_Screen[i].old_hash)
            || ((i + 1 < Screen_Rows) && (hash == SL_Screen[i + 1].old_hash))
            || ((i - 1 > rmin) && (SL_Screen[i].old_hash == SL_Screen[i - 1].new_hash)))
          continue;
            || ((i + 1 < Screen_Rows) && (hash == SL_Screen[i + 1].old_hash))
            || ((i - 1 > rmin) && (SL_Screen[i].old_hash == SL_Screen[i - 1].new_hash)))
          continue;
-       
+
        for (j = i - 1; j >= rmin; j--)
          {
             if (hash == SL_Screen[j].old_hash) break;
          }
        if (j < rmin) continue;
        for (j = i - 1; j >= rmin; j--)
          {
             if (hash == SL_Screen[j].old_hash) break;
          }
        if (j < rmin) continue;
-       
+
        r2 = i;                        /* end scroll region */
        r2 = i;                        /* end scroll region */
-       
+
        di = i - j;
        j--;
        ignore = 0;
        di = i - j;
        j--;
        ignore = 0;
@@ -556,12 +556,12 @@ static void try_scroll (void)
             j--;
          }
        r1 = j + 1;
             j--;
          }
        r1 = j + 1;
-       
+
        /* If this scroll only scrolls this line into place, don't do it.
         */
        if ((di > 1) && (r1 + di + ignore == r2)) continue;
        /* If this scroll only scrolls this line into place, don't do it.
         */
        if ((di > 1) && (r1 + di + ignore == r2)) continue;
-       
-       /* If there is anything in the scrolling region that is ok, abort the 
+
+       /* If there is anything in the scrolling region that is ok, abort the
         * scroll.
         */
 
         * scroll.
         */
 
@@ -576,7 +576,7 @@ static void try_scroll (void)
               }
          }
        if (j <= r2) continue;
               }
          }
        if (j <= r2) continue;
-       
+
        color = This_Color;  This_Color = 0;
        did_scroll = 1;
        SLtt_normal_video ();
        color = This_Color;  This_Color = 0;
        did_scroll = 1;
        SLtt_normal_video ();
@@ -584,11 +584,11 @@ static void try_scroll (void)
        SLtt_goto_rc (0, 0);
        SLtt_reverse_index (di);
        SLtt_reset_scroll_region ();
        SLtt_goto_rc (0, 0);
        SLtt_reverse_index (di);
        SLtt_reset_scroll_region ();
-       /* Now we have a hole in the screen.  Make the virtual screen look 
+       /* Now we have a hole in the screen.  Make the virtual screen look
         * like it.
         */
        for (j = r1; j <= r2; j++) SL_Screen[j].flags = TOUCHED;
         * like it.
         */
        for (j = r1; j <= r2; j++) SL_Screen[j].flags = TOUCHED;
-       
+
        while (di--)
          {
             tmp = SL_Screen[r2].old;
        while (di--)
          {
             tmp = SL_Screen[r2].old;
@@ -605,7 +605,7 @@ static void try_scroll (void)
        This_Color = color;
      }
    if (did_scroll) return;
        This_Color = color;
      }
    if (did_scroll) return;
-   
+
    /* Try other direction */
 
    for (i = rmin; i < rmax; i++)
    /* Try other direction */
 
    for (i = rmin; i < rmax; i++)
@@ -613,18 +613,18 @@ static void try_scroll (void)
        hash = SL_Screen[i].new_hash;
        if (hash == Blank_Hash) continue;
        if (hash == SL_Screen[i].old_hash) continue;
        hash = SL_Screen[i].new_hash;
        if (hash == Blank_Hash) continue;
        if (hash == SL_Screen[i].old_hash) continue;
-       
+
        /* find a match further down screen */
        for (j = i + 1; j <= rmax; j++)
          {
             if (hash == SL_Screen[j].old_hash) break;
          }
        if (j > rmax) continue;
        /* find a match further down screen */
        for (j = i + 1; j <= rmax; j++)
          {
             if (hash == SL_Screen[j].old_hash) break;
          }
        if (j > rmax) continue;
-       
+
        r1 = i;                        /* beg scroll region */
        di = j - i;                    /* number of lines to scroll */
        j++;                           /* since we know this is a match */
        r1 = i;                        /* beg scroll region */
        di = j - i;                    /* number of lines to scroll */
        j++;                           /* since we know this is a match */
-       
+
        /* find end of scroll region */
        ignore = 0;
        while ((j <= rmax) && (SL_Screen[j].old_hash == SL_Screen[j - di].new_hash))
        /* find end of scroll region */
        ignore = 0;
        while ((j <= rmax) && (SL_Screen[j].old_hash == SL_Screen[j - di].new_hash))
@@ -633,15 +633,15 @@ static void try_scroll (void)
             j++;
          }
        r2 = j - 1;                    /* end of scroll region */
             j++;
          }
        r2 = j - 1;                    /* end of scroll region */
-       
+
        /* If this scroll only scrolls this line into place, don't do it.
         */
        if ((di > 1) && (r1 + di + ignore == r2)) continue;
 
        /* If this scroll only scrolls this line into place, don't do it.
         */
        if ((di > 1) && (r1 + di + ignore == r2)) continue;
 
-       /* If there is anything in the scrolling region that is ok, abort the 
+       /* If there is anything in the scrolling region that is ok, abort the
         * scroll.
         */
         * scroll.
         */
-       
+
        for (j = r1; j <= r2; j++)
          {
             if ((SL_Screen[j].old_hash != Blank_Hash)
        for (j = r1; j <= r2; j++)
          {
             if ((SL_Screen[j].old_hash != Blank_Hash)
@@ -650,21 +650,21 @@ static void try_scroll (void)
                  if ((j - di < r1) || (SL_Screen[j].old_hash != SL_Screen[j - di].new_hash))
                    break;
               }
                  if ((j - di < r1) || (SL_Screen[j].old_hash != SL_Screen[j - di].new_hash))
                    break;
               }
-            
+
          }
        if (j <= r2) continue;
          }
        if (j <= r2) continue;
-       
+
        color = This_Color;  This_Color = 0;
        SLtt_normal_video ();
        SLtt_set_scroll_region (r1, r2);
        SLtt_goto_rc (0, 0);           /* relative to scroll region */
        SLtt_delete_nlines (di);
        SLtt_reset_scroll_region ();
        color = This_Color;  This_Color = 0;
        SLtt_normal_video ();
        SLtt_set_scroll_region (r1, r2);
        SLtt_goto_rc (0, 0);           /* relative to scroll region */
        SLtt_delete_nlines (di);
        SLtt_reset_scroll_region ();
-       /* Now we have a hole in the screen.  Make the virtual screen look 
+       /* Now we have a hole in the screen.  Make the virtual screen look
         * like it.
         */
        for (j = r1; j <= r2; j++) SL_Screen[j].flags = TOUCHED;
         * like it.
         */
        for (j = r1; j <= r2; j++) SL_Screen[j].flags = TOUCHED;
-       
+
        while (di--)
          {
             tmp = SL_Screen[r1].old;
        while (di--)
          {
             tmp = SL_Screen[r1].old;
@@ -683,15 +683,15 @@ static void try_scroll (void)
 }
 
 #endif   /* NOT pc_system */
 }
 
 #endif   /* NOT pc_system */
-        
-       
-       
+
+
+
 static int Smg_Inited;
 
 void SLsmg_refresh (void)
 {
    int i;
 static int Smg_Inited;
 
 void SLsmg_refresh (void)
 {
    int i;
-   
+
    if (Smg_Inited == 0) return;
 #ifndef pc_system
    for (i = 0; i < Screen_Rows; i++)
    if (Smg_Inited == 0) return;
 #ifndef pc_system
    for (i = 0; i < Screen_Rows; i++)
@@ -700,8 +700,8 @@ void SLsmg_refresh (void)
        SL_Screen[i].new_hash = compute_hash (SL_Screen[i].neew, Screen_Cols);
      }
 #endif
        SL_Screen[i].new_hash = compute_hash (SL_Screen[i].neew, Screen_Cols);
      }
 #endif
-   
-   if (Cls_Flag) 
+
+   if (Cls_Flag)
      {
        SLtt_normal_video ();  SLtt_cls ();
      }
      {
        SLtt_normal_video ();  SLtt_cls ();
      }
@@ -712,9 +712,9 @@ void SLsmg_refresh (void)
    for (i = 0; i < Screen_Rows; i++)
      {
        int trashed;
    for (i = 0; i < Screen_Rows; i++)
      {
        int trashed;
-       
+
        if (SL_Screen[i].flags == 0) continue;
        if (SL_Screen[i].flags == 0) continue;
-       
+
        if (SL_Screen[i].flags & TRASHED)
          {
             SLtt_goto_rc (i, -1); /* Force cursor to move */
        if (SL_Screen[i].flags & TRASHED)
          {
             SLtt_goto_rc (i, -1); /* Force cursor to move */
@@ -723,21 +723,21 @@ void SLsmg_refresh (void)
             trashed = 1;
          }
        else trashed = 0;
             trashed = 1;
          }
        else trashed = 0;
-       
-       if (Cls_Flag || trashed) 
+
+       if (Cls_Flag || trashed)
          {
             int color = This_Color;
             This_Color = 0;
             blank_line (SL_Screen[i].old, Screen_Cols, ' ');
             This_Color = color;
          }
          {
             int color = This_Color;
             This_Color = 0;
             blank_line (SL_Screen[i].old, Screen_Cols, ' ');
             This_Color = color;
          }
-       
+
        SL_Screen[i].old[Screen_Cols] = 0;
        SL_Screen[i].neew[Screen_Cols] = 0;
        SL_Screen[i].old[Screen_Cols] = 0;
        SL_Screen[i].neew[Screen_Cols] = 0;
-       
+
        SLtt_smart_puts (SL_Screen[i].neew, SL_Screen[i].old, Screen_Cols, i);
 
        SLtt_smart_puts (SL_Screen[i].neew, SL_Screen[i].old, Screen_Cols, i);
 
-       SLMEMCPY ((char *) SL_Screen[i].old, (char *) SL_Screen[i].neew, 
+       SLMEMCPY ((char *) SL_Screen[i].old, (char *) SL_Screen[i].neew,
                  Screen_Cols * sizeof (short));
 
        SL_Screen[i].flags = 0;
                  Screen_Cols * sizeof (short));
 
        SL_Screen[i].flags = 0;
@@ -745,7 +745,7 @@ void SLsmg_refresh (void)
        SL_Screen[i].old_hash = SL_Screen[i].new_hash;
 #endif
      }
        SL_Screen[i].old_hash = SL_Screen[i].new_hash;
 #endif
      }
-   
+
    if (point_visible (1)) SLtt_goto_rc (This_Row - Start_Row, This_Col - Start_Col);
    SLtt_flush_output ();
    Cls_Flag = 0;
    if (point_visible (1)) SLtt_goto_rc (This_Row - Start_Row, This_Col - Start_Col);
    SLtt_flush_output ();
    Cls_Flag = 0;
@@ -755,12 +755,12 @@ static int compute_clip (int row, int n, int box_start, int box_end,
                         int *rmin, int *rmax)
 {
    int row_max;
                         int *rmin, int *rmax)
 {
    int row_max;
-   
+
    if (n < 0) return 0;
    if (row >= box_end) return 0;
    row_max = row + n;
    if (row_max <= box_start) return 0;
    if (n < 0) return 0;
    if (row >= box_end) return 0;
    row_max = row + n;
    if (row_max <= box_start) return 0;
-   
+
    if (row < box_start) row = box_start;
    if (row_max >= box_end) row_max = box_end;
    *rmin = row;
    if (row < box_start) row = box_start;
    if (row_max >= box_end) row_max = box_end;
    *rmin = row;
@@ -772,10 +772,10 @@ void SLsmg_touch_lines (int row, int n)
 {
    int i;
    int r1, r2;
 {
    int i;
    int r1, r2;
-   
+
    if (0 == compute_clip (row, n, Start_Row, Start_Row + Screen_Rows, &r1, &r2))
      return;
    if (0 == compute_clip (row, n, Start_Row, Start_Row + Screen_Rows, &r1, &r2))
      return;
-   
+
    r1 -= Start_Row;
    r2 -= Start_Row;
    for (i = r1; i < r2; i++)
    r1 -= Start_Row;
    r2 -= Start_Row;
    for (i = r1; i < r2; i++)
@@ -791,17 +791,17 @@ static void init_alt_char_set (void)
 {
    int i;
    unsigned char *p, *pmax, ch;
 {
    int i;
    unsigned char *p, *pmax, ch;
-   
+
    if (Alt_Char_Set[128] == 128) return;
 
    i = 32;
    memset ((char *)Alt_Char_Set, ' ', i);
    if (Alt_Char_Set[128] == 128) return;
 
    i = 32;
    memset ((char *)Alt_Char_Set, ' ', i);
-   while (i <= 128) 
+   while (i <= 128)
      {
        Alt_Char_Set [i] = i;
        i++;
      }
      {
        Alt_Char_Set [i] = i;
        i++;
      }
-   
+
    /* Map to VT100 */
    if (SLtt_Has_Alt_Charset)
      {
    /* Map to VT100 */
    if (SLtt_Has_Alt_Charset)
      {
@@ -810,7 +810,7 @@ static void init_alt_char_set (void)
      }
    else        p = (unsigned char *) Fake_Alt_Char_Pairs;
    pmax = p + strlen ((char *) p);
      }
    else        p = (unsigned char *) Fake_Alt_Char_Pairs;
    pmax = p + strlen ((char *) p);
-   
+
    /* Some systems have messed up entries for this */
    while (p < pmax)
      {
    /* Some systems have messed up entries for this */
    while (p < pmax)
      {
@@ -840,7 +840,7 @@ void SLsmg_suspend_smg (void)
        SLtt_reset_video ();
        Smg_Suspended = 1;
      }
        SLtt_reset_video ();
        Smg_Suspended = 1;
      }
-   
+
    UNBLOCK_SIGNALS
 }
 
    UNBLOCK_SIGNALS
 }
 
@@ -849,19 +849,19 @@ void SLsmg_resume_smg (void)
    int i;
    BLOCK_SIGNALS
 
    int i;
    BLOCK_SIGNALS
 
-   if (Smg_Suspended == 0) 
+   if (Smg_Suspended == 0)
      {
        UNBLOCK_SIGNALS
        return;
      }
      {
        UNBLOCK_SIGNALS
        return;
      }
-   
+
    Smg_Suspended = 0;
    SLtt_init_video ();
    Cls_Flag = 1;
    for (i = 0; i < Screen_Rows; i++)
      SL_Screen[i].flags |= TRASHED;
    SLsmg_refresh ();
    Smg_Suspended = 0;
    SLtt_init_video ();
    Cls_Flag = 1;
    for (i = 0; i < Screen_Rows; i++)
      SL_Screen[i].flags |= TRASHED;
    SLsmg_refresh ();
-   
+
    UNBLOCK_SIGNALS
 }
 
    UNBLOCK_SIGNALS
 }
 
@@ -870,7 +870,7 @@ int SLsmg_init_smg (void)
    int i, len;
    unsigned short *old, *neew;
    BLOCK_SIGNALS
    int i, len;
    unsigned short *old, *neew;
    BLOCK_SIGNALS
-     
+
    if (Smg_Inited) SLsmg_reset_smg ();
    SLtt_init_video ();
    Screen_Cols = SLtt_Screen_Cols;
    if (Smg_Inited) SLsmg_reset_smg ();
    SLtt_init_video ();
    Screen_Cols = SLtt_Screen_Cols;
@@ -913,8 +913,8 @@ void SLsmg_reset_smg (void)
 {
    int i;
    BLOCK_SIGNALS
 {
    int i;
    BLOCK_SIGNALS
-     
-   if (Smg_Inited == 0) 
+
+   if (Smg_Inited == 0)
      {
        UNBLOCK_SIGNALS
        return;
      {
        UNBLOCK_SIGNALS
        return;
@@ -928,7 +928,7 @@ void SLsmg_reset_smg (void)
    SLtt_reset_video ();
    This_Alt_Char = This_Color = 0;
    Smg_Inited = 0;
    SLtt_reset_video ();
    This_Alt_Char = This_Color = 0;
    Smg_Inited = 0;
-   
+
    UNBLOCK_SIGNALS
 }
 
    UNBLOCK_SIGNALS
 }
 
@@ -946,16 +946,16 @@ unsigned short SLsmg_char_at (void)
 void SLsmg_vprintf (char *fmt, va_list ap)
 {
    char p[1000];
 void SLsmg_vprintf (char *fmt, va_list ap)
 {
    char p[1000];
-   
+
    (void) vsprintf(p, fmt, ap);
    (void) vsprintf(p, fmt, ap);
-   
+
    SLsmg_write_string (p);
 }
 
 void SLsmg_set_screen_start (int *r, int *c)
 {
    int or = Start_Row, oc = Start_Col;
    SLsmg_write_string (p);
 }
 
 void SLsmg_set_screen_start (int *r, int *c)
 {
    int or = Start_Row, oc = Start_Col;
-   
+
    if (c == NULL) Start_Col = 0;
    else
      {
    if (c == NULL) Start_Col = 0;
    else
      {
@@ -973,7 +973,7 @@ void SLsmg_set_screen_start (int *r, int *c)
 void SLsmg_draw_object (int r, int c, unsigned char object)
 {
    This_Row = r;  This_Col = c;
 void SLsmg_draw_object (int r, int c, unsigned char object)
 {
    This_Row = r;  This_Col = c;
-   
+
    if (point_visible (1))
      {
        int color = This_Color;
    if (point_visible (1))
      {
        int color = This_Color;
@@ -992,33 +992,33 @@ void SLsmg_draw_hline (int n)
    int cmin, cmax;
    int final_col = This_Col + n;
    int save_color;
    int cmin, cmax;
    int final_col = This_Col + n;
    int save_color;
-   
-   if ((This_Row < Start_Row) || (This_Row >= Start_Row + Screen_Rows) 
+
+   if ((This_Row < Start_Row) || (This_Row >= Start_Row + Screen_Rows)
        || (0 == compute_clip (This_Col, n, Start_Col, Start_Col + Screen_Cols,
                              &cmin, &cmax)))
      {
        This_Col = final_col;
        return;
      }
        || (0 == compute_clip (This_Col, n, Start_Col, Start_Col + Screen_Cols,
                              &cmin, &cmax)))
      {
        This_Col = final_col;
        return;
      }
-   
+
    if (hbuf[0] == 0)
      {
        SLMEMSET ((char *) hbuf, SLSMG_HLINE_CHAR, 16);
      }
    if (hbuf[0] == 0)
      {
        SLMEMSET ((char *) hbuf, SLSMG_HLINE_CHAR, 16);
      }
-   
+
    n = cmax - cmin;
    count = n / 16;
    n = cmax - cmin;
    count = n / 16;
-   
+
    save_color = This_Color;
    This_Color |= ALT_CHAR_FLAG;
    This_Col = cmin;
    save_color = This_Color;
    This_Color |= ALT_CHAR_FLAG;
    This_Col = cmin;
-   
+
    SLsmg_write_nchars ((char *) hbuf, n % 16);
    while (count-- > 0)
      {
        SLsmg_write_nchars ((char *) hbuf, 16);
      }
    SLsmg_write_nchars ((char *) hbuf, n % 16);
    while (count-- > 0)
      {
        SLsmg_write_nchars ((char *) hbuf, 16);
      }
-   
+
    This_Color = save_color;
    This_Col = final_col;
 }
    This_Color = save_color;
    This_Col = final_col;
 }
@@ -1029,7 +1029,7 @@ void SLsmg_draw_vline (int n)
    int c = This_Col, rmin, rmax;
    int final_row = This_Row + n;
    int save_color;
    int c = This_Col, rmin, rmax;
    int final_row = This_Row + n;
    int save_color;
-   
+
    if (((c < Start_Col) || (c >= Start_Col + Screen_Cols)) ||
        (0 == compute_clip (This_Row, n, Start_Row, Start_Row + Screen_Rows,
                          &rmin, &rmax)))
    if (((c < Start_Col) || (c >= Start_Col + Screen_Cols)) ||
        (0 == compute_clip (This_Row, n, Start_Row, Start_Row + Screen_Rows,
                          &rmin, &rmax)))
@@ -1037,52 +1037,52 @@ void SLsmg_draw_vline (int n)
        This_Row = final_row;
        return;
      }
        This_Row = final_row;
        return;
      }
-   
+
    save_color = This_Color;
    This_Color |= ALT_CHAR_FLAG;
    save_color = This_Color;
    This_Color |= ALT_CHAR_FLAG;
-    
+
    for (This_Row = rmin; This_Row < rmax; This_Row++)
      {
        This_Col = c;
        SLsmg_write_nchars ((char *) &ch, 1);
      }
    for (This_Row = rmin; This_Row < rmax; This_Row++)
      {
        This_Col = c;
        SLsmg_write_nchars ((char *) &ch, 1);
      }
-   
+
    This_Col = c;  This_Row = final_row;
    This_Color = save_color;
 }
 
 void SLsmg_draw_box (int r, int c, int dr, int dc)
 {
    This_Col = c;  This_Row = final_row;
    This_Color = save_color;
 }
 
 void SLsmg_draw_box (int r, int c, int dr, int dc)
 {
-   if (!dr || !dc) return; 
+   if (!dr || !dc) return;
    This_Row = r;  This_Col = c;
    dr--; dc--;
    This_Row = r;  This_Col = c;
    dr--; dc--;
-   SLsmg_draw_hline (dc);  
+   SLsmg_draw_hline (dc);
    SLsmg_draw_vline (dr);
    This_Row = r;  This_Col = c;
    SLsmg_draw_vline (dr);
    SLsmg_draw_vline (dr);
    This_Row = r;  This_Col = c;
    SLsmg_draw_vline (dr);
-   SLsmg_draw_hline (dc);   
+   SLsmg_draw_hline (dc);
    SLsmg_draw_object (r, c, SLSMG_ULCORN_CHAR);
    SLsmg_draw_object (r, c + dc, SLSMG_URCORN_CHAR);
    SLsmg_draw_object (r + dr, c, SLSMG_LLCORN_CHAR);
    SLsmg_draw_object (r + dr, c + dc, SLSMG_LRCORN_CHAR);
    This_Row = r; This_Col = c;
 }
    SLsmg_draw_object (r, c, SLSMG_ULCORN_CHAR);
    SLsmg_draw_object (r, c + dc, SLSMG_URCORN_CHAR);
    SLsmg_draw_object (r + dr, c, SLSMG_LLCORN_CHAR);
    SLsmg_draw_object (r + dr, c + dc, SLSMG_LRCORN_CHAR);
    This_Row = r; This_Col = c;
 }
-   
+
 void SLsmg_fill_region (int r, int c, int dr, int dc, unsigned char ch)
 {
    static unsigned char hbuf[16];
    int count;
    int dcmax, rmax;
 void SLsmg_fill_region (int r, int c, int dr, int dc, unsigned char ch)
 {
    static unsigned char hbuf[16];
    int count;
    int dcmax, rmax;
-   
-   
+
+
    if ((dc < 0) || (dr < 0)) return;
    if ((dc < 0) || (dr < 0)) return;
-   
+
    SLsmg_gotorc (r, c);
    r = This_Row; c = This_Col;
    SLsmg_gotorc (r, c);
    r = This_Row; c = This_Col;
-   
+
    dcmax = Screen_Cols - This_Col;
    if (dc > dcmax) dc = dcmax;
    dcmax = Screen_Cols - This_Col;
    if (dc > dcmax) dc = dcmax;
-   
+
    rmax = This_Row + dr;
    if (rmax > Screen_Rows) rmax = Screen_Rows;
 
    rmax = This_Row + dr;
    if (rmax > Screen_Rows) rmax = Screen_Rows;
 
@@ -1090,7 +1090,7 @@ void SLsmg_fill_region (int r, int c, int dr, int dc, unsigned char ch)
    ch = Alt_Char_Set[ch];
 #endif
    if (ch != hbuf[0]) SLMEMSET ((char *) hbuf, (char) ch, 16);
    ch = Alt_Char_Set[ch];
 #endif
    if (ch != hbuf[0]) SLMEMSET ((char *) hbuf, (char) ch, 16);
-   
+
    for (This_Row = r; This_Row < rmax; This_Row++)
      {
        This_Col = c;
    for (This_Row = r; This_Row < rmax; This_Row++)
      {
        This_Col = c;
@@ -1101,7 +1101,7 @@ void SLsmg_fill_region (int r, int c, int dr, int dc, unsigned char ch)
             SLsmg_write_nchars ((char *) hbuf, 16);
          }
      }
             SLsmg_write_nchars ((char *) hbuf, 16);
          }
      }
-   
+
    This_Row = r;
 }
 
    This_Row = r;
 }
 
@@ -1115,21 +1115,21 @@ void SLsmg_write_color_chars (unsigned short *s, unsigned int len)
    unsigned short *smax, sh;
    char buf[32], *b, *bmax;
    int color, save_color;
    unsigned short *smax, sh;
    char buf[32], *b, *bmax;
    int color, save_color;
-   
+
    smax = s + len;
    b = buf;
    bmax = b + sizeof (buf);
    smax = s + len;
    b = buf;
    bmax = b + sizeof (buf);
-   
+
    save_color = This_Color;
 
    while (s < smax)
      {
        sh = *s++;
    save_color = This_Color;
 
    while (s < smax)
      {
        sh = *s++;
-       
+
        color = sh >> 8;
        if ((color != This_Color) || (b == bmax))
          {
        color = sh >> 8;
        if ((color != This_Color) || (b == bmax))
          {
-            if (b != buf) 
+            if (b != buf)
               {
                  SLsmg_write_nchars (buf, (int) (b - buf));
                  b = buf;
               {
                  SLsmg_write_nchars (buf, (int) (b - buf));
                  b = buf;
@@ -1138,10 +1138,10 @@ void SLsmg_write_color_chars (unsigned short *s, unsigned int len)
          }
        *b++ = (char) (sh & 0xFF);
      }
          }
        *b++ = (char) (sh & 0xFF);
      }
-   
+
    if (b != buf)
      SLsmg_write_nchars (buf, (int) (b - buf));
    if (b != buf)
      SLsmg_write_nchars (buf, (int) (b - buf));
-       
+
    This_Color = save_color;
 }
 
    This_Color = save_color;
 }
 
@@ -1150,13 +1150,13 @@ unsigned int SLsmg_read_raw (unsigned short *buf, unsigned int len)
    unsigned int r, c;
 
    if (0 == point_visible (1)) return 0;
    unsigned int r, c;
 
    if (0 == point_visible (1)) return 0;
-   
+
    r = (unsigned int) (This_Row - Start_Row);
    c = (unsigned int) (This_Col - Start_Col);
    r = (unsigned int) (This_Row - Start_Row);
    c = (unsigned int) (This_Col - Start_Col);
-   
+
    if (c + len > (unsigned int) Screen_Cols)
      len = (unsigned int) Screen_Cols - c;
    if (c + len > (unsigned int) Screen_Cols)
      len = (unsigned int) Screen_Cols - c;
-   
+
    memcpy ((char *) buf, (char *) (SL_Screen[r].neew + c), len * sizeof (short));
    return len;
 }
    memcpy ((char *) buf, (char *) (SL_Screen[r].neew + c), len * sizeof (short));
    return len;
 }
@@ -1165,19 +1165,19 @@ unsigned int SLsmg_write_raw (unsigned short *buf, unsigned int len)
 {
    unsigned int r, c;
    unsigned short *dest;
 {
    unsigned int r, c;
    unsigned short *dest;
-   
+
    if (0 == point_visible (1)) return 0;
    if (0 == point_visible (1)) return 0;
-   
+
    r = (unsigned int) (This_Row - Start_Row);
    c = (unsigned int) (This_Col - Start_Col);
    r = (unsigned int) (This_Row - Start_Row);
    c = (unsigned int) (This_Col - Start_Col);
-   
+
    if (c + len > (unsigned int) Screen_Cols)
      len = (unsigned int) Screen_Cols - c;
    if (c + len > (unsigned int) Screen_Cols)
      len = (unsigned int) Screen_Cols - c;
-   
+
    dest = SL_Screen[r].neew + c;
    dest = SL_Screen[r].neew + c;
-   
+
    if (0 != memcmp ((char *) dest, (char *) buf, len * sizeof (short)))
    if (0 != memcmp ((char *) dest, (char *) buf, len * sizeof (short)))
-     { 
+     {
        memcpy ((char *) dest, (char *) buf, len * sizeof (short));
        SL_Screen[r].flags |= TOUCHED;
      }
        memcpy ((char *) dest, (char *) buf, len * sizeof (short));
        SL_Screen[r].flags |= TOUCHED;
      }
index 4f3d717..a3c76f3 100644 (file)
@@ -4,7 +4,7 @@
 
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -24,7 +24,7 @@
  * The majority of the comments found in the file were taken from the
  * term(4) man page on an SGI.
  */
  * The majority of the comments found in the file were taken from the
  * term(4) man page on an SGI.
  */
+
 /* Short integers are stored in two 8-bit bytes.  The first byte contains
  * the least significant 8 bits of the value, and the second byte contains
  * the most significant 8 bits.  (Thus, the value represented is
 /* Short integers are stored in two 8-bit bytes.  The first byte contains
  * the least significant 8 bits of the value, and the second byte contains
  * the most significant 8 bits.  (Thus, the value represented is
@@ -53,7 +53,7 @@ static int make_integer (unsigned char *buf)
  * tic, and read by the routine setupterm [see curses(3X).]  The file is
  * divided into six parts in the following order:  the header, terminal
  * names, boolean flags, numbers, strings, and string table.
  * tic, and read by the routine setupterm [see curses(3X).]  The file is
  * divided into six parts in the following order:  the header, terminal
  * names, boolean flags, numbers, strings, and string table.
- * 
+ *
  * The header section begins the file.  This section contains six short
  * integers in the format described below.  These integers are (1) the magic
  * number (octal 0432); (2) the size, in bytes, of the names section; (3)
  * The header section begins the file.  This section contains six short
  * integers in the format described below.  These integers are (1) the magic
  * number (octal 0432); (2) the size, in bytes, of the names section; (3)
@@ -65,7 +65,7 @@ static int make_integer (unsigned char *buf)
 
 #define MAGIC 0432
 
 
 #define MAGIC 0432
 
-/* In this structure, all char * fields are malloced EXCEPT if the 
+/* In this structure, all char * fields are malloced EXCEPT if the
  * structure is SLTERMCAP.  In that case, only terminal_names is malloced
  * and the other fields are pointers into it.
  */
  * structure is SLTERMCAP.  In that case, only terminal_names is malloced
  * and the other fields are pointers into it.
  */
@@ -77,19 +77,19 @@ typedef struct
 
    unsigned int name_section_size;
    char *terminal_names;
 
    unsigned int name_section_size;
    char *terminal_names;
-   
+
    unsigned int boolean_section_size;
    unsigned char *boolean_flags;
    unsigned int boolean_section_size;
    unsigned char *boolean_flags;
-   
+
    unsigned int num_numbers;
    unsigned char *numbers;
    unsigned int num_numbers;
    unsigned char *numbers;
-   
+
    unsigned int num_string_offsets;
    unsigned char *string_offsets;
    unsigned int num_string_offsets;
    unsigned char *string_offsets;
-   
+
    unsigned int string_table_size;
    char *string_table;
    unsigned int string_table_size;
    char *string_table;
-   
+
 } Terminfo_Type;
 
 static char *tcap_getstr (char *, Terminfo_Type *);
 } Terminfo_Type;
 
 static char *tcap_getstr (char *, Terminfo_Type *);
@@ -101,10 +101,10 @@ static FILE *open_terminfo (char *file, Terminfo_Type *h)
 {
    FILE *fp;
    unsigned char buf[12];
 {
    FILE *fp;
    unsigned char buf[12];
-   
+
    fp = fopen (file, "rb");
    if (fp == NULL) return NULL;
    fp = fopen (file, "rb");
    if (fp == NULL) return NULL;
-   
+
    if ((12 == fread ((char *) buf, 1, 12, fp) && (MAGIC == make_integer (buf))))
      {
        h->name_section_size = make_integer (buf + 2);
    if ((12 == fread ((char *) buf, 1, 12, fp) && (MAGIC == make_integer (buf))))
      {
        h->name_section_size = make_integer (buf + 2);
@@ -113,15 +113,15 @@ static FILE *open_terminfo (char *file, Terminfo_Type *h)
        h->num_string_offsets = make_integer (buf + 8);
        h->string_table_size = make_integer (buf + 10);
      }
        h->num_string_offsets = make_integer (buf + 8);
        h->string_table_size = make_integer (buf + 10);
      }
-   else 
+   else
      {
        fclose (fp);
        fp = NULL;
      }
    return fp;
 }
      {
        fclose (fp);
        fp = NULL;
      }
    return fp;
 }
-   
-/* 
+
+/*
  * The terminal names section comes next.  It contains the first line of the
  * terminfo description, listing the various names for the terminal,
  * separated by the bar ( | ) character (see term(5)).  The section is
  * The terminal names section comes next.  It contains the first line of the
  * terminfo description, listing the various names for the terminal,
  * separated by the bar ( | ) character (see term(5)).  The section is
@@ -132,7 +132,7 @@ static FILE *open_terminfo (char *file, Terminfo_Type *h)
 static unsigned char *read_terminfo_section (FILE *fp, unsigned int size)
 {
    char *s;
 static unsigned char *read_terminfo_section (FILE *fp, unsigned int size)
 {
    char *s;
-   
+
    if (NULL == (s = (char *) SLMALLOC (size))) return NULL;
    if (size != fread (s, 1, size, fp))
      {
    if (NULL == (s = (char *) SLMALLOC (size))) return NULL;
    if (size != fread (s, 1, size, fp))
      {
@@ -161,16 +161,16 @@ static unsigned char *read_boolean_flags (FILE *fp, Terminfo_Type *t)
     * even byte offset. All short integers are aligned on a short word
     * boundary.
     */
     * even byte offset. All short integers are aligned on a short word
     * boundary.
     */
-   
+
    unsigned int size = (t->name_section_size + t->boolean_section_size) % 2;
    size += t->boolean_section_size;
    unsigned int size = (t->name_section_size + t->boolean_section_size) % 2;
    size += t->boolean_section_size;
-   
+
    return t->boolean_flags = read_terminfo_section (fp, size);
 }
 
 
 
    return t->boolean_flags = read_terminfo_section (fp, size);
 }
 
 
 
-/* 
+/*
  * The numbers section is similar to the boolean flags section.  Each
  * capability takes up two bytes, and is stored as a short integer.  If the
  * value represented is -1 or -2, the capability is taken to be missing.
  * The numbers section is similar to the boolean flags section.  Each
  * capability takes up two bytes, and is stored as a short integer.  If the
  * value represented is -1 or -2, the capability is taken to be missing.
@@ -219,7 +219,7 @@ static char *read_string_table (FILE *fp, Terminfo_Type *t)
  */
 
 #define MAX_TI_DIRS 7
  */
 
 #define MAX_TI_DIRS 7
-static char *Terminfo_Dirs [MAX_TI_DIRS] = 
+static char *Terminfo_Dirs [MAX_TI_DIRS] =
 {
    NULL,
    "/usr/lib/terminfo",
 {
    NULL,
    "/usr/lib/terminfo",
@@ -232,25 +232,25 @@ static char *Terminfo_Dirs [MAX_TI_DIRS] =
 
 char *SLtt_tigetent (char *term)
 {
 
 char *SLtt_tigetent (char *term)
 {
-   char *tidir; 
+   char *tidir;
    int i;
    FILE *fp = NULL;
    char file[256];
    Terminfo_Type *ti;
 
    if (
    int i;
    FILE *fp = NULL;
    char file[256];
    Terminfo_Type *ti;
 
    if (
-       (term == NULL) 
+       (term == NULL)
 #ifdef SLANG_UNTIC
        && (SLang_Untic_Terminfo_File == NULL)
 #endif
        )
      return NULL;
 #ifdef SLANG_UNTIC
        && (SLang_Untic_Terminfo_File == NULL)
 #endif
        )
      return NULL;
-   
+
    if (NULL == (ti = (Terminfo_Type *) SLMALLOC (sizeof (Terminfo_Type))))
      {
        return NULL;
      }
    if (NULL == (ti = (Terminfo_Type *) SLMALLOC (sizeof (Terminfo_Type))))
      {
        return NULL;
      }
-   
+
 #ifdef SLANG_UNTIC
    if (SLang_Untic_Terminfo_File != NULL)
      {
 #ifdef SLANG_UNTIC
    if (SLang_Untic_Terminfo_File != NULL)
      {
@@ -261,7 +261,7 @@ char *SLtt_tigetent (char *term)
 #endif
    /* If we are on a termcap based system, use termcap */
    if (0 == tcap_getent (term, ti)) return (char *) ti;
 #endif
    /* If we are on a termcap based system, use termcap */
    if (0 == tcap_getent (term, ti)) return (char *) ti;
-       
+
    Terminfo_Dirs[0] = getenv ("TERMINFO");
    i = 0;
    while (i < MAX_TI_DIRS)
    Terminfo_Dirs[0] = getenv ("TERMINFO");
    i = 0;
    while (i < MAX_TI_DIRS)
@@ -277,8 +277,8 @@ char *SLtt_tigetent (char *term)
 #ifdef SLANG_UNTIC
    fp_open_label:
 #endif
 #ifdef SLANG_UNTIC
    fp_open_label:
 #endif
-   
-   if (fp != NULL) 
+
+   if (fp != NULL)
      {
        if (NULL != read_terminal_names (fp, ti))
          {
      {
        if (NULL != read_terminal_names (fp, ti))
          {
@@ -305,7 +305,7 @@ char *SLtt_tigetent (char *term)
          }
        fclose (fp);
      }
          }
        fclose (fp);
      }
-   
+
    SLFREE (ti);
    return NULL;
 }
    SLFREE (ti);
    return NULL;
 }
@@ -316,7 +316,7 @@ char *SLtt_tigetent (char *term)
 # define UNTIC_COMMENT(x)
 #endif
 
 # define UNTIC_COMMENT(x)
 #endif
 
-typedef struct 
+typedef struct
 {
    char name[3];
    int offset;
 {
    char name[3];
    int offset;
@@ -413,7 +413,7 @@ static int compute_cap_offset (char *cap, Terminfo_Type *t, Tgetstr_Map_Type *ma
 
    (void) t;
    cha = *cap++; chb = *cap;
 
    (void) t;
    cha = *cap++; chb = *cap;
-   
+
    while (*map->name != 0)
      {
        if ((cha == *map->name) && (chb == *(map->name + 1)))
    while (*map->name != 0)
      {
        if ((cha == *map->name) && (chb == *(map->name + 1)))
@@ -426,16 +426,16 @@ static int compute_cap_offset (char *cap, Terminfo_Type *t, Tgetstr_Map_Type *ma
    return -1;
 }
 
    return -1;
 }
 
-   
+
 char *SLtt_tigetstr (char *cap, char **pp)
 {
    int offset;
    Terminfo_Type *t;
 char *SLtt_tigetstr (char *cap, char **pp)
 {
    int offset;
    Terminfo_Type *t;
-   
+
    if ((pp == NULL) || (NULL == (t = (Terminfo_Type *) *pp))) return NULL;
    if ((pp == NULL) || (NULL == (t = (Terminfo_Type *) *pp))) return NULL;
-   
+
    if (t->flags == SLTERMCAP) return tcap_getstr (cap, t);
    if (t->flags == SLTERMCAP) return tcap_getstr (cap, t);
-   
+
    offset = compute_cap_offset (cap, t, Tgetstr_Map, t->num_string_offsets);
    if (offset < 0) return NULL;
    offset = make_integer (t->string_offsets + 2 * offset);
    offset = compute_cap_offset (cap, t, Tgetstr_Map, t->num_string_offsets);
    if (offset < 0) return NULL;
    offset = make_integer (t->string_offsets + 2 * offset);
@@ -458,7 +458,7 @@ int SLtt_tigetnum (char *cap, char **pp)
 {
    int offset;
    Terminfo_Type *t;
 {
    int offset;
    Terminfo_Type *t;
-   
+
    if ((pp == NULL) || (NULL == (t = (Terminfo_Type *) *pp))) return -1;
 
    if (t->flags == SLTERMCAP) return tcap_getnum (cap, t);
    if ((pp == NULL) || (NULL == (t = (Terminfo_Type *) *pp))) return -1;
 
    if (t->flags == SLTERMCAP) return tcap_getnum (cap, t);
@@ -483,13 +483,13 @@ int SLtt_tigetflag (char *cap, char **pp)
 {
    int offset;
    Terminfo_Type *t;
 {
    int offset;
    Terminfo_Type *t;
-   
+
    if ((pp == NULL) || (NULL == (t = (Terminfo_Type *) *pp))) return -1;
 
    if (t->flags == SLTERMCAP) return tcap_getflag (cap, t);
    if ((pp == NULL) || (NULL == (t = (Terminfo_Type *) *pp))) return -1;
 
    if (t->flags == SLTERMCAP) return tcap_getflag (cap, t);
-   
+
    offset = compute_cap_offset (cap, t, Tgetflag_Map, t->boolean_section_size);
    offset = compute_cap_offset (cap, t, Tgetflag_Map, t->boolean_section_size);
-   
+
    if (offset < 0) return -1;
    return (int) *(t->boolean_flags + offset);
 }
    if (offset < 0) return -1;
    return (int) *(t->boolean_flags + offset);
 }
@@ -505,7 +505,7 @@ static int tcap_getflag (char *cap, Terminfo_Type *t)
    char a, b;
    char *f = (char *) t->boolean_flags;
    char *fmax;
    char a, b;
    char *f = (char *) t->boolean_flags;
    char *fmax;
-   
+
    if (f == NULL) return 0;
    fmax = f + t->boolean_section_size;
 
    if (f == NULL) return 0;
    fmax = f + t->boolean_section_size;
 
@@ -524,10 +524,10 @@ static char *tcap_get_cap (unsigned char *cap, unsigned char *caps, unsigned int
 {
    unsigned char c0, c1;
    unsigned char *caps_max;
 {
    unsigned char c0, c1;
    unsigned char *caps_max;
-   
+
    c0 = cap[0];
    c1 = cap[1];
    c0 = cap[0];
    c1 = cap[1];
-   
+
    if (caps == NULL) return NULL;
    caps_max = caps + len;
    while (caps < caps_max)
    if (caps == NULL) return NULL;
    caps_max = caps + len;
    while (caps < caps_max)
@@ -541,7 +541,7 @@ static char *tcap_get_cap (unsigned char *cap, unsigned char *caps, unsigned int
    return NULL;
 }
 
    return NULL;
 }
 
-   
+
 static int tcap_getnum (char *cap, Terminfo_Type *t)
 {
    cap = tcap_get_cap ((unsigned char *) cap, t->numbers, t->num_numbers);
 static int tcap_getnum (char *cap, Terminfo_Type *t)
 {
    cap = tcap_get_cap ((unsigned char *) cap, t->numbers, t->num_numbers);
@@ -569,7 +569,7 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
    unsigned char *buf, *b;
    unsigned char *t;
    int len;
    unsigned char *buf, *b;
    unsigned char *t;
    int len;
-   
+
    if (SLtt_Try_Termcap == 0) return -1;
 #if 1
    /* XFREE86 xterm sets the TERMCAP environment variable to an invalid
    if (SLtt_Try_Termcap == 0) return -1;
 #if 1
    /* XFREE86 xterm sets the TERMCAP environment variable to an invalid
@@ -580,8 +580,8 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
 #endif
    termcap = (unsigned char *) getenv ("TERMCAP");
    if ((termcap == NULL) || (*termcap == '/')) return -1;
 #endif
    termcap = (unsigned char *) getenv ("TERMCAP");
    if ((termcap == NULL) || (*termcap == '/')) return -1;
-   
-   /* We have a termcap so lets use it provided it does not have a reference 
+
+   /* We have a termcap so lets use it provided it does not have a reference
     * to another terminal via tc=.  In that case, user terminfo.  The alternative
     * would be to parse the termcap file which I do not want to do right now.
     * Besides, this is a terminfo based system and if the termcap were parsed
     * to another terminal via tc=.  In that case, user terminfo.  The alternative
     * would be to parse the termcap file which I do not want to do right now.
     * Besides, this is a terminfo based system and if the termcap were parsed
@@ -595,17 +595,17 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
          return -1;
        t += (len + 1);
      }
          return -1;
        t += (len + 1);
      }
-   
+
    /* malloc some extra space just in case it is needed. */
    len = strlen ((char *) termcap) + 256;
    if (NULL == (buf = (unsigned char *) SLMALLOC ((unsigned int) len))) return -1;
 
    b = buf;
    /* malloc some extra space just in case it is needed. */
    len = strlen ((char *) termcap) + 256;
    if (NULL == (buf = (unsigned char *) SLMALLOC ((unsigned int) len))) return -1;
 
    b = buf;
-   
+
    /* The beginning of the termcap entry contains the names of the entry.
    /* The beginning of the termcap entry contains the names of the entry.
-    * It is terminated by a colon. 
+    * It is terminated by a colon.
     */
     */
-   
+
    ti->terminal_names = (char *) b;
    t = termcap;
    len = tcap_extract_field (t);
    ti->terminal_names = (char *) b;
    t = termcap;
    len = tcap_extract_field (t);
@@ -618,14 +618,14 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
    b[len] = 0;
    b += len + 1;
    ti->name_section_size = len;
    b[len] = 0;
    b += len + 1;
    ti->name_section_size = len;
-   
-   
-   /* Now, we are really at the start of the termcap entries.  Point the 
+
+
+   /* Now, we are really at the start of the termcap entries.  Point the
     * termcap variable here since we want to refer to this a number of times.
     */
    termcap = t + (len + 1);
     * termcap variable here since we want to refer to this a number of times.
     */
    termcap = t + (len + 1);
-   
-   
+
+
    /* Process strings first. */
    ti->string_table = (char *) b;
    t = termcap;
    /* Process strings first. */
    ti->string_table = (char *) b;
    t = termcap;
@@ -633,7 +633,7 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
      {
        unsigned char *b1;
        unsigned char *tmax;
      {
        unsigned char *b1;
        unsigned char *tmax;
-       
+
        /* We are looking for: XX=something */
        if ((len < 4) || (t[2] != '=') || (*t == '.'))
          {
        /* We are looking for: XX=something */
        if ((len < 4) || (t[2] != '=') || (*t == '.'))
          {
@@ -642,7 +642,7 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
          }
        tmax = t + len;
        b1 = b;
          }
        tmax = t + len;
        b1 = b;
-       
+
        while (t < tmax)
          {
             ch = *t++;
        while (t < tmax)
          {
             ch = *t++;
@@ -664,7 +664,7 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
        b1[2] = (unsigned char) len;    /* replace the = by the length */
        /* skip colon to next field. */
        t++;
        b1[2] = (unsigned char) len;    /* replace the = by the length */
        /* skip colon to next field. */
        t++;
-     }   
+     }
    ti->string_table_size = (int) (b - (unsigned char *) ti->string_table);
 
    /* Now process the numbers. */
    ti->string_table_size = (int) (b - (unsigned char *) ti->string_table);
 
    /* Now process the numbers. */
@@ -675,7 +675,7 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
      {
        unsigned char *b1;
        unsigned char *tmax;
      {
        unsigned char *b1;
        unsigned char *tmax;
-       
+
        /* We are looking for: XX#NUMBER */
        if ((len < 4) || (t[2] != '#') || (*t == '.'))
          {
        /* We are looking for: XX#NUMBER */
        if ((len < 4) || (t[2] != '#') || (*t == '.'))
          {
@@ -684,7 +684,7 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
          }
        tmax = t + len;
        b1 = b;
          }
        tmax = t + len;
        b1 = b;
-       
+
        while (t < tmax)
          {
             *b++ = *t++;
        while (t < tmax)
          {
             *b++ = *t++;
@@ -694,16 +694,16 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
        len = (int) (b - b1);
        b1[2] = (unsigned char) len;    /* replace the # by the length */
        t++;
        len = (int) (b - b1);
        b1[2] = (unsigned char) len;    /* replace the # by the length */
        t++;
-     }   
+     }
    ti->num_numbers = (int) (b - ti->numbers);
    ti->num_numbers = (int) (b - ti->numbers);
-   
+
    /* Now process the flags. */
    t = termcap;
    ti->boolean_flags = b;
    while (-1 != (len = tcap_extract_field (t)))
      {
        /* We are looking for: XX#NUMBER */
    /* Now process the flags. */
    t = termcap;
    ti->boolean_flags = b;
    while (-1 != (len = tcap_extract_field (t)))
      {
        /* We are looking for: XX#NUMBER */
-       if ((len != 2) || (*t == '.') || (*t <= ' ')) 
+       if ((len != 2) || (*t == '.') || (*t <= ' '))
          {
             t += len + 1;
             continue;
          {
             t += len + 1;
             continue;
@@ -712,7 +712,7 @@ static int tcap_getent (char *term, Terminfo_Type *ti)
        b[1] = t[1];
        t += 3;
        b += 2;
        b[1] = t[1];
        t += 3;
        b += 2;
-     }   
+     }
    ti->boolean_section_size = (int) (b - ti->boolean_flags);
    ti->flags = SLTERMCAP;
    return 0;
    ti->boolean_section_size = (int) (b - ti->boolean_flags);
    ti->flags = SLTERMCAP;
    return 0;
index 0f17186..64f7796 100644 (file)
@@ -62,9 +62,9 @@ char *SLexpand_escaped_char(char *p, char *ch)
    int i = 0;
    int max = 0, num, base = 0;
    char ch1;
    int i = 0;
    int max = 0, num, base = 0;
    char ch1;
-   
+
    ch1 = *p++;
    ch1 = *p++;
-   
+
    switch (ch1)
      {
       default: num = ch1; break;
    switch (ch1)
      {
       default: num = ch1; break;
@@ -75,23 +75,23 @@ char *SLexpand_escaped_char(char *p, char *ch)
       case 'r': num = '\r'; break;
       case 'f': num = '\f'; break;
       case 'E': case 'e': num = 27; break;
       case 'r': num = '\r'; break;
       case 'f': num = '\f'; break;
       case 'E': case 'e': num = 27; break;
-      case 'a': num = 7; 
+      case 'a': num = 7;
        break;
        break;
-       
+
        /* octal */
        /* octal */
-      case '0': case '1': case '2': case '3': 
-      case '4': case '5': case '6': case '7': 
-       max = '7'; 
+      case '0': case '1': case '2': case '3':
+      case '4': case '5': case '6': case '7':
+       max = '7';
        base = 8; i = 2; num = ch1 - '0';
        break;
        base = 8; i = 2; num = ch1 - '0';
        break;
-       
+
       case 'd':                               /* decimal -- S-Lang extension */
       case 'd':                               /* decimal -- S-Lang extension */
-       base = 10; 
+       base = 10;
        i = 3;
        max = '9';
        num = 0;
        break;
        i = 3;
        max = '9';
        num = 0;
        break;
-       
+
       case 'x':                               /* hex */
        base = 16;
        max = '9';
       case 'x':                               /* hex */
        base = 16;
        max = '9';
@@ -99,11 +99,11 @@ char *SLexpand_escaped_char(char *p, char *ch)
        num = 0;
        break;
      }
        num = 0;
        break;
      }
-   
+
    while (i--)
      {
        ch1 = *p;
    while (i--)
      {
        ch1 = *p;
-       
+
        if ((ch1 <= max) && (ch1 >= '0'))
          {
             num = base * num + (ch1 - '0');
        if ((ch1 <= max) && (ch1 >= '0'))
          {
             num = base * num + (ch1 - '0');
@@ -117,16 +117,16 @@ char *SLexpand_escaped_char(char *p, char *ch)
        else break;
        p++;
      }
        else break;
        p++;
      }
-   
+
    *ch = (char) num;
    return p;
 }
 
    *ch = (char) num;
    return p;
 }
 
-void SLexpand_escaped_string (register char *s, register char *t, 
+void SLexpand_escaped_string (register char *s, register char *t,
                              register char *tmax)
 {
    char ch;
                              register char *tmax)
 {
    char ch;
-   
+
    while (t < tmax)
      {
        ch = *t++;
    while (t < tmax)
      {
        ch = *t++;
@@ -146,13 +146,13 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
    int string;
    char ch1;
    char *word_max;
    int string;
    char ch1;
    char *word_max;
-   
+
    word_max = word + 250;
    word_max = word + 250;
-   
+
    line = *linep;
 
    /* skip white space */
    line = *linep;
 
    /* skip white space */
-   while (((ch = *line) == ' ') 
+   while (((ch = *line) == ' ')
          || (ch == '\t')) line++;
 
    if ((!ch) || (ch == '\n'))
          || (ch == '\t')) line++;
 
    if ((!ch) || (ch == '\n'))
@@ -160,26 +160,26 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
        *linep = line;
        return(0);
      }
        *linep = line;
        return(0);
      }
-   
+
    *word++ = ch;
    line++;
    *word++ = ch;
    line++;
-   
+
    /* Look for -something and rule out --something and -= something */
    /* Look for -something and rule out --something and -= something */
-   if ((ch == '-') && 
+   if ((ch == '-') &&
        (*line != '-') && (*line != '=') && ((*line > '9') || (*line < '0')))
      {
        *word = 0;
        *linep = line;
        return 1;
      }
        (*line != '-') && (*line != '=') && ((*line > '9') || (*line < '0')))
      {
        *word = 0;
        *linep = line;
        return 1;
      }
-   
-       
+
+
    if (ch == '"') string = 1; else string = 0;
    if (ch == '\'')
      {
        if ((ch = *line++) != 0)
          {
    if (ch == '"') string = 1; else string = 0;
    if (ch == '\'')
      {
        if ((ch = *line++) != 0)
          {
-            if (ch == '\\') 
+            if (ch == '\\')
               {
                  line = SLexpand_escaped_char(line, &ch1);
                  ch = ch1;
               {
                  line = SLexpand_escaped_char(line, &ch1);
                  ch = ch1;
@@ -196,8 +196,8 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
      }
    else  if (!special_chars[(unsigned char) ch])
      {
      }
    else  if (!special_chars[(unsigned char) ch])
      {
-       while (ch = *line++, 
-              (ch > '"') || 
+       while (ch = *line++,
+              (ch > '"') ||
               ((ch != '\n') && (ch != 0) && (ch != '"')))
          {
             if (string)
               ((ch != '\n') && (ch != 0) && (ch != '"')))
          {
             if (string)
@@ -207,7 +207,7 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
                       ch = *line++;
                       if ((ch == 0) || (ch == '\n')) break;
                       if (byte_comp) *word++ = '\\';
                       ch = *line++;
                       if ((ch == 0) || (ch == '\n')) break;
                       if (byte_comp) *word++ = '\\';
-                      else 
+                      else
                         {
                            line = SLexpand_escaped_char(line - 1, &ch1);
                            ch = ch1;
                         {
                            line = SLexpand_escaped_char(line - 1, &ch1);
                            ch = ch1;
@@ -219,7 +219,7 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
                  line--;
                  break;
               }
                  line--;
                  break;
               }
-            
+
             *word++ = ch;
             if (word > word_max)
               {
             *word++ = ch;
             if (word > word_max)
               {
@@ -228,7 +228,7 @@ int SLang_extract_token (char **linep, char *word_parm, int byte_comp)
               }
          }
      }
               }
          }
      }
-   
+
    if ((!ch) || (ch == '\n')) line--;
    if ((ch == '"') && string) *word++ = '"'; else if (string) SLang_Error = SYNTAX_ERROR;
    *word = 0;
    if ((!ch) || (ch == '\n')) line--;
    if ((ch == '"') && string) *word++ = '"'; else if (string) SLang_Error = SYNTAX_ERROR;
    *word = 0;
@@ -259,7 +259,7 @@ int SLang_guess_type (char *t)
    if (*t == '-') t++;
    p = t;
 #ifdef FLOAT_TYPE
    if (*t == '-') t++;
    p = t;
 #ifdef FLOAT_TYPE
-   if (*p != '.') 
+   if (*p != '.')
      {
 #endif
        while ((*p >= '0') && (*p <= '9')) p++;
      {
 #endif
        while ((*p >= '0') && (*p <= '9')) p++;
@@ -267,7 +267,7 @@ int SLang_guess_type (char *t)
        if ((*p == 'x') && (p == t + 1))   /* 0x?? */
          {
             p++;
        if ((*p == 'x') && (p == t + 1))   /* 0x?? */
          {
             p++;
-            while (ch = *p, 
+            while (ch = *p,
                    ((ch >= '0') && (ch <= '9'))
                    || (((ch | 0x20) >= 'a') && ((ch | 0x20) <= 'f'))) p++;
          }
                    ((ch >= '0') && (ch <= '9'))
                    || (((ch | 0x20) >= 'a') && ((ch | 0x20) <= 'f'))) p++;
          }
@@ -276,7 +276,7 @@ int SLang_guess_type (char *t)
        return(STRING_TYPE);
 #else
      }
        return(STRING_TYPE);
 #else
      }
-   
+
    /* now down to float case */
    if (*p == '.')
      {
    /* now down to float case */
    if (*p == '.')
      {
@@ -297,24 +297,24 @@ int SLatoi (unsigned char *s)
    register unsigned char ch;
    register unsigned int value;
    register int base;
    register unsigned char ch;
    register unsigned int value;
    register int base;
-   
+
    if (*s != '0') return atoi((char *) s);
 
    /* look for 'x' which indicates hex */
    s++;
    if (*s != '0') return atoi((char *) s);
 
    /* look for 'x' which indicates hex */
    s++;
-   if ((*s | 0x20) == 'x') 
+   if ((*s | 0x20) == 'x')
      {
        base = 16;
        s++;
      {
        base = 16;
        s++;
-       if (*s == 0) 
+       if (*s == 0)
          {
             SLang_Error = SYNTAX_ERROR;
             return -1;
          }
      }
    else base = 8;
          {
             SLang_Error = SYNTAX_ERROR;
             return -1;
          }
      }
    else base = 8;
-   
-   
+
+
    value = 0;
    while ((ch = *s++) != 0)
      {
    value = 0;
    while ((ch = *s++) != 0)
      {
@@ -338,7 +338,7 @@ int SLatoi (unsigned char *s)
           case '7':
             ch1 -= '0';
             break;
           case '7':
             ch1 -= '0';
             break;
-            
+
           case 'a':
           case 'b':
           case 'c':
           case 'a':
           case 'b':
           case 'c':
index ed2ee8c..b5a5818 100644 (file)
@@ -1,7 +1,7 @@
 /* slutty.c --- Unix Low level terminal (tty) functions for S-Lang */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* slutty.c --- Unix Low level terminal (tty) functions for S-Lang */
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -104,27 +104,27 @@ typedef struct termios TTY_Termio_Type;
 static TTY_Termio_Type Old_TTY;
 
 #ifdef HAVE_TERMIOS_H
 static TTY_Termio_Type Old_TTY;
 
 #ifdef HAVE_TERMIOS_H
-static struct 
+static struct
 {
     speed_t key;
     int value;
 {
     speed_t key;
     int value;
-} Baud_Rates[] = 
+} Baud_Rates[] =
 {
    {B0, 0},
 {
    {B0, 0},
-   {B50, 50}, 
-   {B75, 75}, 
-   {B110, 110}, 
-   {B134, 134}, 
-   {B150, 150}, 
-   {B200, 200}, 
-   {B300, 300}, 
-   {B600, 600}, 
-   {B1200, 1200}, 
-   {B1800, 1800}, 
-   {B2400, 2400}, 
-   {B4800, 4800}, 
-   {B9600, 9600}, 
-   {B19200, 19200}, 
+   {B50, 50},
+   {B75, 75},
+   {B110, 110},
+   {B134, 134},
+   {B150, 150},
+   {B200, 200},
+   {B300, 300},
+   {B600, 600},
+   {B1200, 1200},
+   {B1800, 1800},
+   {B2400, 2400},
+   {B4800, 4800},
+   {B9600, 9600},
+   {B19200, 19200},
    {B38400, 38400}
 #ifdef B57600
    , {B57600, 57600}
    {B38400, 38400}
 #ifdef B57600
    , {B57600, 57600}
@@ -175,7 +175,7 @@ static int
 speed_t2baud_rate (speed_t s)
 {
     int i;
 speed_t2baud_rate (speed_t s)
 {
     int i;
-    
+
     for (i = 0; i < sizeof (Baud_Rates)/sizeof (Baud_Rates[0]); i++)
        if (Baud_Rates[i].key == s)
            return (Baud_Rates[i].value);
     for (i = 0; i < sizeof (Baud_Rates)/sizeof (Baud_Rates[0]); i++)
        if (Baud_Rates[i].key == s)
            return (Baud_Rates[i].value);
@@ -185,17 +185,17 @@ speed_t2baud_rate (speed_t s)
 int SLang_init_tty (int abort_char, int no_flow_control, int opost)
 {
    TTY_Termio_Type newtty;
 int SLang_init_tty (int abort_char, int no_flow_control, int opost)
 {
    TTY_Termio_Type newtty;
-   
+
    SLsig_block_signals ();
    SLsig_block_signals ();
-   
-   if (TTY_Inited) 
+
+   if (TTY_Inited)
      {
        SLsig_unblock_signals ();
        return 0;
      }
      {
        SLsig_unblock_signals ();
        return 0;
      }
-   
+
    TTY_Open = 0;
    TTY_Open = 0;
-   
+
    if ((SLang_TT_Read_FD == -1)
        || (1 != isatty (SLang_TT_Read_FD)))
      {
    if ((SLang_TT_Read_FD == -1)
        || (1 != isatty (SLang_TT_Read_FD)))
      {
@@ -215,14 +215,14 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
 #if 0
 /* In the Midnight Commander we bind stderr sometimes to a pipe. If we
    use stderr for terminal input and call SLang_getkey while stderr is
 #if 0
 /* In the Midnight Commander we bind stderr sometimes to a pipe. If we
    use stderr for terminal input and call SLang_getkey while stderr is
-   bound to a pipe MC will hang completly in SLsys_input_pending. 
+   bound to a pipe MC will hang completly in SLsys_input_pending.
    NOTE: There's an independent fix for this problem in src/slint.c for
    NOTE: There's an independent fix for this problem in src/slint.c for
-   the case that the Midnight Commander is linked against a shared slang 
+   the case that the Midnight Commander is linked against a shared slang
    library compiled from different sources.
  */
             SLang_TT_Read_FD = fileno (stderr);
             if (1 != isatty (SLang_TT_Read_FD))
    library compiled from different sources.
  */
             SLang_TT_Read_FD = fileno (stderr);
             if (1 != isatty (SLang_TT_Read_FD))
-#endif      
+#endif
               {
                  SLang_TT_Read_FD = fileno (stdin);
                  if (1 != isatty (SLang_TT_Read_FD))
               {
                  SLang_TT_Read_FD = fileno (stdin);
                  if (1 != isatty (SLang_TT_Read_FD))
@@ -233,10 +233,10 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
               }
          }
      }
               }
          }
      }
-   
+
    SLang_Abort_Char = abort_char;
    SLang_Abort_Char = abort_char;
-   
-   /* Some systems may not permit signals to be blocked.  As a result, the 
+
+   /* Some systems may not permit signals to be blocked.  As a result, the
     * return code must be checked.
     */
    while (-1 == GET_TERMIOS(SLang_TT_Read_FD, &Old_TTY))
     * return code must be checked.
     */
    while (-1 == GET_TERMIOS(SLang_TT_Read_FD, &Old_TTY))
@@ -247,7 +247,7 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
             return -1;
          }
      }
             return -1;
          }
      }
-   
+
    while (-1 == GET_TERMIOS(SLang_TT_Read_FD, &newtty))
      {
        if (errno != EINTR)
    while (-1 == GET_TERMIOS(SLang_TT_Read_FD, &newtty))
      {
        if (errno != EINTR)
@@ -256,7 +256,7 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
             return -1;
          }
      }
             return -1;
          }
      }
-   
+
 #ifndef HAVE_TERMIOS_H
    newtty.s.sg_flags &= ~(ECHO);
    newtty.s.sg_flags &= ~(CRMOD);
 #ifndef HAVE_TERMIOS_H
    newtty.s.sg_flags &= ~(ECHO);
    newtty.s.sg_flags &= ~(CRMOD);
@@ -270,9 +270,9 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
    newtty.lt.t_lnextc = 255;
    newtty.s.sg_flags |= CBREAK;                /* do I want cbreak or raw????? */
 #else
    newtty.lt.t_lnextc = 255;
    newtty.s.sg_flags |= CBREAK;                /* do I want cbreak or raw????? */
 #else
-   
+
    /* get baud rate */
    /* get baud rate */
-   
+
    /* [not only QNX related !?!]
     * ECHO(0x08) is a c_lflag bit, it means here PARMRK(0x08) in c_iflag!!!
     */
    /* [not only QNX related !?!]
     * ECHO(0x08) is a c_lflag bit, it means here PARMRK(0x08) in c_iflag!!!
     */
@@ -285,11 +285,11 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
 
    if (SLang_TT_Baud_Rate == 0)
      {
 
    if (SLang_TT_Baud_Rate == 0)
      {
-/* Note:  if this generates an compiler error, simply remove 
+/* Note:  if this generates an compiler error, simply remove
    the statement */
 #ifdef HAVE_CFGETOSPEED
        SLang_TT_Baud_Rate = cfgetospeed (&newtty);
    the statement */
 #ifdef HAVE_CFGETOSPEED
        SLang_TT_Baud_Rate = cfgetospeed (&newtty);
-#endif 
+#endif
        SLang_TT_Baud_Rate = speed_t2baud_rate (SLang_TT_Baud_Rate);
      }
    if (no_flow_control) newtty.c_iflag &= ~IXON; else newtty.c_iflag |= IXON;
        SLang_TT_Baud_Rate = speed_t2baud_rate (SLang_TT_Baud_Rate);
      }
    if (no_flow_control) newtty.c_iflag &= ~IXON; else newtty.c_iflag |= IXON;
@@ -306,7 +306,7 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
    newtty.c_cc[VSWTCH] = NULL_VALUE;   /* to ignore who knows what */
 #endif
 #endif /* NOT HAVE_TERMIOS_H */
    newtty.c_cc[VSWTCH] = NULL_VALUE;   /* to ignore who knows what */
 #endif
 #endif /* NOT HAVE_TERMIOS_H */
-   
+
    while (-1 == SET_TERMIOS(SLang_TT_Read_FD, &newtty))
      {
        if (errno != EINTR)
    while (-1 == SET_TERMIOS(SLang_TT_Read_FD, &newtty))
      {
        if (errno != EINTR)
@@ -315,7 +315,7 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
             return -1;
          }
      }
             return -1;
          }
      }
-   
+
    TTY_Inited = 1;
    SLsig_unblock_signals ();
    return 0;
    TTY_Inited = 1;
    SLsig_unblock_signals ();
    return 0;
@@ -324,19 +324,19 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
 void SLtty_set_suspend_state (int mode)
 {
    TTY_Termio_Type newtty;
 void SLtty_set_suspend_state (int mode)
 {
    TTY_Termio_Type newtty;
-   
+
    SLsig_block_signals ();
    SLsig_block_signals ();
-   
+
    if (TTY_Inited == 0)
      {
        SLsig_unblock_signals ();
        return;
      }
    if (TTY_Inited == 0)
      {
        SLsig_unblock_signals ();
        return;
      }
-      
+
    while ((-1 == GET_TERMIOS (SLang_TT_Read_FD, &newtty))
          && (errno == EINTR))
      ;
    while ((-1 == GET_TERMIOS (SLang_TT_Read_FD, &newtty))
          && (errno == EINTR))
      ;
-   
+
 #ifndef HAVE_TERMIOS_H
    if (mode == 0) newtty.lt.t_suspc = 255;
    else newtty.lt.t_suspc = Old_TTY.lt.t_suspc;
 #ifndef HAVE_TERMIOS_H
    if (mode == 0) newtty.lt.t_suspc = 255;
    else newtty.lt.t_suspc = Old_TTY.lt.t_suspc;
@@ -344,7 +344,7 @@ void SLtty_set_suspend_state (int mode)
    if (mode == 0) newtty.c_cc[VSUSP] = NULL_VALUE;
    else newtty.c_cc[VSUSP] = Old_TTY.c_cc[VSUSP];
 #endif
    if (mode == 0) newtty.c_cc[VSUSP] = NULL_VALUE;
    else newtty.c_cc[VSUSP] = Old_TTY.c_cc[VSUSP];
 #endif
-   
+
    while ((-1 == SET_TERMIOS (SLang_TT_Read_FD, &newtty))
          && (errno == EINTR))
      ;
    while ((-1 == SET_TERMIOS (SLang_TT_Read_FD, &newtty))
          && (errno == EINTR))
      ;
@@ -355,27 +355,27 @@ void SLtty_set_suspend_state (int mode)
 void SLang_reset_tty (void)
 {
    SLsig_block_signals ();
 void SLang_reset_tty (void)
 {
    SLsig_block_signals ();
-   
+
    if (TTY_Inited == 0)
      {
        SLsig_unblock_signals ();
        return;
      }
    if (TTY_Inited == 0)
      {
        SLsig_unblock_signals ();
        return;
      }
-   
+
    while ((-1 == SET_TERMIOS(SLang_TT_Read_FD, &Old_TTY))
          && (errno == EINTR))
      ;
    while ((-1 == SET_TERMIOS(SLang_TT_Read_FD, &Old_TTY))
          && (errno == EINTR))
      ;
-   
+
    if (TTY_Open)
      {
        while ((-1 == close (SLang_TT_Read_FD))
               && (errno == EINTR))
          ;
    if (TTY_Open)
      {
        while ((-1 == close (SLang_TT_Read_FD))
               && (errno == EINTR))
          ;
-         
+
        TTY_Open = 0;
        SLang_TT_Read_FD = -1;
      }
        TTY_Open = 0;
        SLang_TT_Read_FD = -1;
      }
-   
+
    TTY_Inited = 0;
    SLsig_unblock_signals ();
 }
    TTY_Inited = 0;
    SLsig_unblock_signals ();
 }
@@ -383,7 +383,7 @@ void SLang_reset_tty (void)
 static void default_sigint (int sig)
 {
    sig = errno;                               /* use parameter */
 static void default_sigint (int sig)
 {
    sig = errno;                               /* use parameter */
-   
+
    SLKeyBoard_Quit = 1;
    if (SLang_Ignore_User_Abort == 0) SLang_Error = USER_BREAK;
    SLsignal_intr (SIGINT, default_sigint);
    SLKeyBoard_Quit = 1;
    if (SLang_Ignore_User_Abort == 0) SLang_Error = USER_BREAK;
    SLsignal_intr (SIGINT, default_sigint);
@@ -393,10 +393,10 @@ static void default_sigint (int sig)
 void SLang_set_abort_signal (void (*hand)(int))
 {
    int save_errno = errno;
 void SLang_set_abort_signal (void (*hand)(int))
 {
    int save_errno = errno;
-   
+
    if (hand == NULL) hand = default_sigint;
    SLsignal_intr (SIGINT, hand);
    if (hand == NULL) hand = default_sigint;
    SLsignal_intr (SIGINT, hand);
-   
+
    errno = save_errno;
 }
 
    errno = save_errno;
 }
 
@@ -418,7 +418,7 @@ int SLsys_input_pending(int tsecs)
    long usecs, secs;
 
    if (TTY_Inited == 0) return -1;
    long usecs, secs;
 
    if (TTY_Inited == 0) return -1;
-   
+
    if (tsecs >= 0)
      {
        secs = tsecs / 10;
    if (tsecs >= 0)
      {
        secs = tsecs / 10;
@@ -430,13 +430,13 @@ int SLsys_input_pending(int tsecs)
        secs = tsecs / 1000;
        usecs = (tsecs % 1000) * 1000;
      }
        secs = tsecs / 1000;
        usecs = (tsecs % 1000) * 1000;
      }
-   
+
    wait.tv_sec = secs;
    wait.tv_usec = usecs;
 
    FD_ZERO(&Read_FD_Set);
    FD_SET(SLang_TT_Read_FD, &Read_FD_Set);
    wait.tv_sec = secs;
    wait.tv_usec = usecs;
 
    FD_ZERO(&Read_FD_Set);
    FD_SET(SLang_TT_Read_FD, &Read_FD_Set);
-   
+
    return select(SLang_TT_Read_FD + 1, &Read_FD_Set, NULL, NULL, &wait);
 }
 
    return select(SLang_TT_Read_FD + 1, &Read_FD_Set, NULL, NULL, &wait);
 }
 
@@ -448,69 +448,69 @@ static int handle_interrupt (void)
    if (SLang_getkey_intr_hook != NULL)
      {
        int save_tty_fd = SLang_TT_Read_FD;
    if (SLang_getkey_intr_hook != NULL)
      {
        int save_tty_fd = SLang_TT_Read_FD;
-   
+
        if (-1 == (*SLang_getkey_intr_hook) ())
          return -1;
        if (-1 == (*SLang_getkey_intr_hook) ())
          return -1;
-       
+
        if (save_tty_fd != SLang_TT_Read_FD)
          return -1;
      }
        if (save_tty_fd != SLang_TT_Read_FD)
          return -1;
      }
-   
+
    return 0;
 }
 
 unsigned int SLsys_getkey (void)
 {
    unsigned char c;
    return 0;
 }
 
 unsigned int SLsys_getkey (void)
 {
    unsigned char c;
-   
+
    if (TTY_Inited == 0)
      {
        int ic = fgetc (stdin);
        if (ic == EOF) return SLANG_GETKEY_ERROR;
        return (unsigned int) ic;
      }
    if (TTY_Inited == 0)
      {
        int ic = fgetc (stdin);
        if (ic == EOF) return SLANG_GETKEY_ERROR;
        return (unsigned int) ic;
      }
-   
+
    while (1)
      {
        int ret;
    while (1)
      {
        int ret;
-       
-       if (SLKeyBoard_Quit) 
+
+       if (SLKeyBoard_Quit)
          return SLang_Abort_Char;
          return SLang_Abort_Char;
-       
+
        if (0 == (ret = SLsys_input_pending (100)))
          continue;
        if (0 == (ret = SLsys_input_pending (100)))
          continue;
-       
+
        if (ret != -1)
          break;
        if (ret != -1)
          break;
-       
-       if (SLKeyBoard_Quit) 
+
+       if (SLKeyBoard_Quit)
          return SLang_Abort_Char;
          return SLang_Abort_Char;
-       
+
        if (errno == EINTR)
          {
             if (-1 == handle_interrupt ())
               return SLANG_GETKEY_ERROR;
        if (errno == EINTR)
          {
             if (-1 == handle_interrupt ())
               return SLANG_GETKEY_ERROR;
-            
+
             continue;
          }
             continue;
          }
-       
+
        break;                         /* let read handle it */
      }
        break;                         /* let read handle it */
      }
-   
+
    while (-1 == read(SLang_TT_Read_FD, (char *) &c, 1))
      {
    while (-1 == read(SLang_TT_Read_FD, (char *) &c, 1))
      {
-       if (errno == EINTR) 
+       if (errno == EINTR)
          {
             if (-1 == handle_interrupt ())
               return SLANG_GETKEY_ERROR;
          {
             if (-1 == handle_interrupt ())
               return SLANG_GETKEY_ERROR;
-            
-            if (SLKeyBoard_Quit) 
+
+            if (SLKeyBoard_Quit)
               return SLang_Abort_Char;
               return SLang_Abort_Char;
-            
+
             continue;
          }
 #ifdef EAGAIN
             continue;
          }
 #ifdef EAGAIN
-       if (errno == EAGAIN) 
+       if (errno == EAGAIN)
          {
             sleep (1);
             continue;
          {
             sleep (1);
             continue;
index 911f39e..47cbf43 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -85,7 +85,7 @@ static int Blink_Killed;      /* high intensity background enabled */
 #define JNORMAL_COLOR  0
 #define JNO_COLOR      -1
 
 #define JNORMAL_COLOR  0
 #define JNO_COLOR      -1
 
-static unsigned char Color_Map [JMAX_COLORS] = 
+static unsigned char Color_Map [JMAX_COLORS] =
 {
    0x7, 0x70, 0x70, 0x70, 0x70, 0x7, 0x7, 0x7,
    0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7,
 {
    0x7, 0x70, 0x70, 0x70, 0x70, 0x7, 0x7, 0x7,
    0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7,
@@ -210,24 +210,24 @@ static int Saved_Cursor_Row;
 static void save_screen (void)
 {
    int row, col;
 static void save_screen (void)
 {
    int row, col;
-   
+
    if (Saved_Screen_Buffer != NULL)
      {
        SLFREE (Saved_Screen_Buffer);
        Saved_Screen_Buffer = NULL;
      }
    if (Saved_Screen_Buffer != NULL)
      {
        SLFREE (Saved_Screen_Buffer);
        Saved_Screen_Buffer = NULL;
      }
-#ifdef GO32_VIDEO   
-   Saved_Screen_Buffer = SLMALLOC (sizeof (short) * 
+#ifdef GO32_VIDEO
+   Saved_Screen_Buffer = SLMALLOC (sizeof (short) *
                                   ScreenCols () * ScreenRows ());
 
    if (Saved_Screen_Buffer == NULL)
      return;
                                   ScreenCols () * ScreenRows ());
 
    if (Saved_Screen_Buffer == NULL)
      return;
-   
+
    ScreenRetrieve (Saved_Screen_Buffer);
    ScreenGetCursor (&row, &col);
    Saved_Cursor_Row = row;
 #endif
    ScreenRetrieve (Saved_Screen_Buffer);
    ScreenGetCursor (&row, &col);
    Saved_Cursor_Row = row;
 #endif
-   
+
 }
 
 static void restore_screen (void)
 }
 
 static void restore_screen (void)
@@ -237,7 +237,7 @@ static void restore_screen (void)
    ScreenUpdate (Saved_Screen_Buffer);
    SLtt_goto_rc (Saved_Cursor_Row, 0);
 #endif
    ScreenUpdate (Saved_Screen_Buffer);
    SLtt_goto_rc (Saved_Cursor_Row, 0);
 #endif
-   
+
 }
 #endif                                /* HAS_SAVE_SCREEN */
 /*----------------------------------------------------------------------*\
 }
 #endif                                /* HAS_SAVE_SCREEN */
 /*----------------------------------------------------------------------*\
@@ -249,7 +249,7 @@ void SLtt_write_string (char *str)
 {
 #ifdef WIN32
    unsigned long bytes;
 {
 #ifdef WIN32
    unsigned long bytes;
-   
+
    (void) WriteConsole(hStdout, str, strlen(str), &bytes, NULL);
 #else
    fputs (str, stdout);
    (void) WriteConsole(hStdout, str, strlen(str), &bytes, NULL);
 #else
    fputs (str, stdout);
@@ -292,7 +292,7 @@ void SLtt_goto_rc (int row, int col)
    newPosition.X = col;
    newPosition.Y = row;
 #endif
    newPosition.X = col;
    newPosition.Y = row;
 #endif
-   
+
 #if !defined (USE_ASM)
    if (row > SLtt_Screen_Rows) row = SLtt_Screen_Rows;
    if (col > SLtt_Screen_Cols) col = SLtt_Screen_Cols;
 #if !defined (USE_ASM)
    if (row > SLtt_Screen_Rows) row = SLtt_Screen_Rows;
    if (col > SLtt_Screen_Cols) col = SLtt_Screen_Cols;
@@ -398,10 +398,10 @@ static void slvid_deleol (int x)
    unsigned char *p, *pmax;
    int w = mkSpaceChar ();
    int count = SLtt_Screen_Cols - x;
    unsigned char *p, *pmax;
    int w = mkSpaceChar ();
    int count = SLtt_Screen_Cols - x;
-   
+
    p = Line_Buffer;
    pmax = p + 2 * count;
    p = Line_Buffer;
    pmax = p + 2 * count;
-   
+
    while (p < pmax)
      {
        *p++ = (unsigned char) w;
    while (p < pmax)
      {
        *p++ = (unsigned char) w;
@@ -430,7 +430,7 @@ void SLtt_begin_insert (void)
    slvid_getxy ();
    n = SLtt_Screen_Cols - Cursor_Col;
    /* Msdos_Insert_Mode = 1; */
    slvid_getxy ();
    n = SLtt_Screen_Cols - Cursor_Col;
    /* Msdos_Insert_Mode = 1; */
-   
+
 # ifndef WIN32
 #  if defined (EMX_VIDEO)
    v_getline (Line_Buffer, Cursor_Col, Cursor_Row, n);
 # ifndef WIN32
 #  if defined (EMX_VIDEO)
    v_getline (Line_Buffer, Cursor_Col, Cursor_Row, n);
@@ -442,7 +442,7 @@ void SLtt_begin_insert (void)
    VioWrtCellStr ((PCH)Line_Buffer, n, Cursor_Row, Cursor_Col + 1, 0);
 #   else       /* __os2__ */
    p = mkScreenPointer (Cursor_Row, SLtt_Screen_Cols - 1);
    VioWrtCellStr ((PCH)Line_Buffer, n, Cursor_Row, Cursor_Col + 1, 0);
 #   else       /* __os2__ */
    p = mkScreenPointer (Cursor_Row, SLtt_Screen_Cols - 1);
-   
+
 #    if defined (HAS_LINEAR_SCREEN)
    /* pmin = p - (n-1); */
    pmin = mkScreenPointer (Cursor_Row, Cursor_Col);
 #    if defined (HAS_LINEAR_SCREEN)
    /* pmin = p - (n-1); */
    pmin = mkScreenPointer (Cursor_Row, Cursor_Col);
@@ -452,23 +452,23 @@ void SLtt_begin_insert (void)
    asm  mov ax, ds
      asm  mov bx, di
      asm  mov dx, si
    asm  mov ax, ds
      asm  mov bx, di
      asm  mov dx, si
-     
+
      asm  mov cx, n
      asm  les di, p
      asm  lds si, p
      asm  sub si, 2
      asm  std
      asm  rep movsw
      asm  mov cx, n
      asm  les di, p
      asm  lds si, p
      asm  sub si, 2
      asm  std
      asm  rep movsw
-     
+
      asm  mov ds, ax
      asm  mov di, bx
      asm  mov si, dx
 #    endif     /* HAS_LINEAR_SCREEN */
 #   endif  /* __os2__ */
 #  endif       /* EMX_VIDEO */
      asm  mov ds, ax
      asm  mov di, bx
      asm  mov si, dx
 #    endif     /* HAS_LINEAR_SCREEN */
 #   endif  /* __os2__ */
 #  endif       /* EMX_VIDEO */
-     
+
 # endif  /* WIN32 */
 # endif  /* WIN32 */
-     
+
 #endif /* not GO32_VIDEO */
 }
 
 #endif /* not GO32_VIDEO */
 }
 
@@ -497,12 +497,12 @@ void SLtt_delete_char (void)
 #  endif
 # endif
    int n;
 #  endif
 # endif
    int n;
-   
+
    slvid_getxy ();
    n = SLtt_Screen_Cols - Cursor_Col - 1;
    slvid_getxy ();
    n = SLtt_Screen_Cols - Cursor_Col - 1;
-   
+
 # ifndef WIN32
 # ifndef WIN32
-   
+
 #  if defined (EMX_VIDEO)
    v_getline (Line_Buffer, Cursor_Col+1, Cursor_Row, n);
    v_putline (Line_Buffer, Cursor_Col, Cursor_Row, n);
 #  if defined (EMX_VIDEO)
    v_getline (Line_Buffer, Cursor_Col+1, Cursor_Row, n);
    v_putline (Line_Buffer, Cursor_Col, Cursor_Row, n);
@@ -514,7 +514,7 @@ void SLtt_delete_char (void)
    return;
 #   else       /* __os2__ */
    p = mkScreenPointer (Cursor_Row, Cursor_Col);
    return;
 #   else       /* __os2__ */
    p = mkScreenPointer (Cursor_Row, Cursor_Col);
-   
+
 #    if defined (HAS_LINEAR_SCREEN)
    while (n--)
      {
 #    if defined (HAS_LINEAR_SCREEN)
    while (n--)
      {
@@ -527,23 +527,23 @@ void SLtt_delete_char (void)
    asm  mov ax, ds
      asm  mov bx, si
      asm  mov dx, di
    asm  mov ax, ds
      asm  mov bx, si
      asm  mov dx, di
-     
+
      asm  mov cx, n
      asm  les di, p
      asm  lds si, p
      asm  add si, 2
      asm  cld
      asm  rep movsw
      asm  mov cx, n
      asm  les di, p
      asm  lds si, p
      asm  add si, 2
      asm  cld
      asm  rep movsw
-     
+
      asm  mov ds, ax
      asm  mov si, bx
      asm  mov di, dx
 #    endif     /* HAS_LINEAR_SCREEN */
 #   endif /* __os2__ */
 #  endif /* EMX_VIDEO */
      asm  mov ds, ax
      asm  mov si, bx
      asm  mov di, dx
 #    endif     /* HAS_LINEAR_SCREEN */
 #   endif /* __os2__ */
 #  endif /* EMX_VIDEO */
-     
+
 # endif /* WIN32 */
 # endif /* WIN32 */
-     
+
 #endif /* not GO32_VIDEO */
 }
 
 #endif /* not GO32_VIDEO */
 }
 
@@ -555,9 +555,9 @@ void SLtt_delete_char (void)
 \*----------------------------------------------------------------------*/
 void SLtt_erase_line (void)
 {
 \*----------------------------------------------------------------------*/
 void SLtt_erase_line (void)
 {
-   
+
 #ifndef WIN32
 #ifndef WIN32
-   
+
 # if defined (GO32_VIDEO) || defined (EMX_VIDEO)
    Attribute_Byte = 0x07;
    slvid_deleol (0);
 # if defined (GO32_VIDEO) || defined (EMX_VIDEO)
    Attribute_Byte = 0x07;
    slvid_deleol (0);
@@ -572,7 +572,7 @@ void SLtt_erase_line (void)
    unsigned short *p = mkScreenPointer (Cursor_Row, 0);
 #   if defined (HAS_LINEAR_SCREEN)
    register unsigned short *pmax = p + SLtt_Screen_Cols;
    unsigned short *p = mkScreenPointer (Cursor_Row, 0);
 #   if defined (HAS_LINEAR_SCREEN)
    register unsigned short *pmax = p + SLtt_Screen_Cols;
-   
+
    Attribute_Byte = 0x07;
    w = mkSpaceChar ();
    while (p < pmax) *p++ = w;
    Attribute_Byte = 0x07;
    w = mkSpaceChar ();
    while (p < pmax) *p++ = w;
@@ -591,9 +591,9 @@ void SLtt_erase_line (void)
 #  endif  /* __os2__ */
 # endif  /* GO32_VIDEO or EMX_VIDEO */
      Current_Color = JNO_COLOR;                /* since we messed with attribute byte */
 #  endif  /* __os2__ */
 # endif  /* GO32_VIDEO or EMX_VIDEO */
      Current_Color = JNO_COLOR;                /* since we messed with attribute byte */
-   
+
 #endif  /* WIN32 */
 #endif  /* WIN32 */
-   
+
 }
 
 /*----------------------------------------------------------------------*\
 }
 
 /*----------------------------------------------------------------------*\
@@ -604,9 +604,9 @@ void SLtt_erase_line (void)
 void SLtt_delete_nlines (int nlines)
 {
    SLtt_normal_video ();
 void SLtt_delete_nlines (int nlines)
 {
    SLtt_normal_video ();
-   
+
 #ifndef WIN32
 #ifndef WIN32
-   
+
 # if defined (EMX_VIDEO)
    v_attrib (Attribute_Byte);
    v_scroll (0, Scroll_r1, SLtt_Screen_Cols-1, Scroll_r2, nlines, V_SCROLL_UP);
 # if defined (EMX_VIDEO)
    v_attrib (Attribute_Byte);
    v_scroll (0, Scroll_r1, SLtt_Screen_Cols-1, Scroll_r2, nlines, V_SCROLL_UP);
@@ -649,9 +649,9 @@ void SLtt_delete_nlines (int nlines)
 #   endif      /* USE_ASM */
 #  endif /* __os2__ */
 # endif        /* EMX_VIDEO */
 #   endif      /* USE_ASM */
 #  endif /* __os2__ */
 # endif        /* EMX_VIDEO */
-   
+
 #endif  /* WIN32 */
 #endif  /* WIN32 */
-   
+
 }
 
 /*----------------------------------------------------------------------*\
 }
 
 /*----------------------------------------------------------------------*\
@@ -662,9 +662,9 @@ void SLtt_delete_nlines (int nlines)
 void SLtt_reverse_index (int nlines)
 {
    SLtt_normal_video ();
 void SLtt_reverse_index (int nlines)
 {
    SLtt_normal_video ();
-   
+
 #ifndef WIN32
 #ifndef WIN32
-   
+
 # if defined (EMX_VIDEO)
    v_attrib (Attribute_Byte);
    v_scroll (0, Scroll_r1, SLtt_Screen_Cols-1, Scroll_r2, nlines,
 # if defined (EMX_VIDEO)
    v_attrib (Attribute_Byte);
    v_scroll (0, Scroll_r1, SLtt_Screen_Cols-1, Scroll_r2, nlines,
@@ -706,9 +706,9 @@ void SLtt_reverse_index (int nlines)
 #   endif      /* USE_ASM */
 #  endif       /* __os2__ */
 # endif  /* EMX_VIDEO */
 #   endif      /* USE_ASM */
 #  endif       /* __os2__ */
 # endif  /* EMX_VIDEO */
-   
+
 #endif  /* WIN32 */
 #endif  /* WIN32 */
-   
+
 }
 
 /*----------------------------------------------------------------------*\
 }
 
 /*----------------------------------------------------------------------*\
@@ -718,12 +718,12 @@ void SLtt_reverse_index (int nlines)
 \*----------------------------------------------------------------------*/
 static void slvid_invert_region (int top_row, int bot_row)
 {
 \*----------------------------------------------------------------------*/
 static void slvid_invert_region (int top_row, int bot_row)
 {
-   
+
 #ifndef WIN32
 #ifndef WIN32
-   
+
 # if defined (EMX_VIDEO)
    int row, col;
 # if defined (EMX_VIDEO)
    int row, col;
-   
+
    for (row = top_row; row < bot_row; row++)
      {
        v_getline (Line_Buffer, 0, row, SLtt_Screen_Cols);
    for (row = top_row; row < bot_row; row++)
      {
        v_getline (Line_Buffer, 0, row, SLtt_Screen_Cols);
@@ -735,7 +735,7 @@ static void slvid_invert_region (int top_row, int bot_row)
 #  ifdef __os2__
    int row, col;
    USHORT length = SLtt_Screen_Cols * 2;
 #  ifdef __os2__
    int row, col;
    USHORT length = SLtt_Screen_Cols * 2;
-   
+
    for (row = top_row; row < bot_row; row++)
      {
        VioReadCellStr ((PCH)Line_Buffer, &length, row, 0, 0);
    for (row = top_row; row < bot_row; row++)
      {
        VioReadCellStr ((PCH)Line_Buffer, &length, row, 0, 0);
@@ -747,7 +747,7 @@ static void slvid_invert_region (int top_row, int bot_row)
 #   if defined (__GO32__) || defined (__WATCOMC__)
    unsigned char buf [2 * 180 * 80];         /* 180 cols x 80 rows */
    unsigned char *b, *bmax;
 #   if defined (__GO32__) || defined (__WATCOMC__)
    unsigned char buf [2 * 180 * 80];         /* 180 cols x 80 rows */
    unsigned char *b, *bmax;
-   
+
    b    = buf + 1 + 2 * SLtt_Screen_Cols * top_row;
    bmax = buf + 1 + 2 * SLtt_Screen_Cols * bot_row;
    ScreenRetrieve (buf);
    b    = buf + 1 + 2 * SLtt_Screen_Cols * top_row;
    bmax = buf + 1 + 2 * SLtt_Screen_Cols * bot_row;
    ScreenRetrieve (buf);
@@ -761,7 +761,7 @@ static void slvid_invert_region (int top_row, int bot_row)
    register unsigned short ch, sh;
    register unsigned short *pmin = mkScreenPointer (top_row, 0);
    register unsigned short *pmax = mkScreenPointer (bot_row, 0);
    register unsigned short ch, sh;
    register unsigned short *pmin = mkScreenPointer (top_row, 0);
    register unsigned short *pmax = mkScreenPointer (bot_row, 0);
-   
+
    while (pmin < pmax)
      {
        sh = *pmin;
    while (pmin < pmax)
      {
        sh = *pmin;
@@ -773,9 +773,9 @@ static void slvid_invert_region (int top_row, int bot_row)
 #   endif      /* __GO32__ or __WATCOMC__ */
 #  endif       /* __os2__ */
 # endif        /* EMX_VIDEO */
 #   endif      /* __GO32__ or __WATCOMC__ */
 #  endif       /* __os2__ */
 # endif        /* EMX_VIDEO */
-   
+
 #endif  /* WIN32 */
 #endif  /* WIN32 */
-   
+
 }
 
 /*----------------------------------------------------------------------*\
 }
 
 /*----------------------------------------------------------------------*\
@@ -800,7 +800,7 @@ void SLtt_beep (void)
    int special = 0;            /* first row to invert */
    int visual = 0;             /* final row to invert */
    if (!SLtt_Ignore_Beep) return;
    int special = 0;            /* first row to invert */
    int visual = 0;             /* final row to invert */
    if (!SLtt_Ignore_Beep) return;
-   
+
    audible = (SLtt_Ignore_Beep & 1);
    if ( (SLtt_Ignore_Beep & 4) )
      {
    audible = (SLtt_Ignore_Beep & 1);
    if ( (SLtt_Ignore_Beep & 4) )
      {
@@ -811,16 +811,16 @@ void SLtt_beep (void)
      {
        visual = SLtt_Screen_Rows;
      }
      {
        visual = SLtt_Screen_Rows;
      }
-   
+
    if (visual) slvid_invert_region (special, visual);
 #if defined (EMX_VIDEO)
    if (audible) /*sound (1500)*/; _sleep2 (100); if (audible) /* nosound () */;
 #else
 # ifdef __os2__
    if (audible) DosBeep (1500, 100); else DosSleep (100);
    if (visual) slvid_invert_region (special, visual);
 #if defined (EMX_VIDEO)
    if (audible) /*sound (1500)*/; _sleep2 (100); if (audible) /* nosound () */;
 #else
 # ifdef __os2__
    if (audible) DosBeep (1500, 100); else DosSleep (100);
-   
+
 # elif defined(WIN32)
 # elif defined(WIN32)
-   
+
 # else
    if (audible) sound (1500); delay (100); if (audible) nosound ();
 # endif
 # else
    if (audible) sound (1500); delay (100); if (audible) nosound ();
 # endif
@@ -835,9 +835,9 @@ void SLtt_beep (void)
 \*----------------------------------------------------------------------*/
 void SLtt_del_eol (void)
 {
 \*----------------------------------------------------------------------*/
 void SLtt_del_eol (void)
 {
-   
+
 #ifndef WIN32
 #ifndef WIN32
-   
+
 # if defined (GO32_VIDEO) || defined (EMX_VIDEO)
    if (Current_Color != JNO_COLOR) SLtt_normal_video ();
    slvid_deleol (Cursor_Col);
 # if defined (GO32_VIDEO) || defined (EMX_VIDEO)
    if (Current_Color != JNO_COLOR) SLtt_normal_video ();
    slvid_deleol (Cursor_Col);
@@ -854,7 +854,7 @@ void SLtt_del_eol (void)
    unsigned short w;
 #   if defined (HAS_LINEAR_SCREEN)
    unsigned short *pmax = p + n;
    unsigned short w;
 #   if defined (HAS_LINEAR_SCREEN)
    unsigned short *pmax = p + n;
-   
+
    if (Current_Color != JNO_COLOR) SLtt_normal_video ();
    w = mkSpaceChar ();
    while (p < pmax) *p++ = w;
    if (Current_Color != JNO_COLOR) SLtt_normal_video ();
    w = mkSpaceChar ();
    while (p < pmax) *p++ = w;
@@ -868,14 +868,14 @@ void SLtt_del_eol (void)
      asm  mov cx, n
      asm  cld
      asm  rep stosw
      asm  mov cx, n
      asm  cld
      asm  rep stosw
-     
+
      asm  mov di, dx
 #   endif      /* HAS_LINEAR_SCREEN */
 #  endif       /* __os2__ */
 # endif        /* GO32_VIDEO or EMX_VIDEO */
      asm  mov di, dx
 #   endif      /* HAS_LINEAR_SCREEN */
 #  endif       /* __os2__ */
 # endif        /* GO32_VIDEO or EMX_VIDEO */
-     
+
 #endif  /* WIN32 */
 #endif  /* WIN32 */
-     
+
 }
 
 /*----------------------------------------------------------------------*\
 }
 
 /*----------------------------------------------------------------------*\
@@ -918,57 +918,57 @@ static unsigned short *video_write (register unsigned char *pp,
                                    register unsigned short *pos)
 {
    int n = (int) (p - pp);     /* num of characters of PP to write */
                                    register unsigned short *pos)
 {
    int n = (int) (p - pp);     /* num of characters of PP to write */
-   
+
    asm  push si
      asm  push ds
      asm  push di
    asm  push si
      asm  push ds
      asm  push di
-     
+
    /* set up register for BOTH fast and slow */
      asm  mov bx, SLtt_Msdos_Cheap_Video
    /* set up register for BOTH fast and slow */
      asm  mov bx, SLtt_Msdos_Cheap_Video
-     
+
    /* These are the registers needed for both fast AND slow */
      asm  mov ah, byte ptr Attribute_Byte
      asm  mov cx, n
      asm  lds si, dword ptr pp
      asm  les di, dword ptr pos
      asm  cld
    /* These are the registers needed for both fast AND slow */
      asm  mov ah, byte ptr Attribute_Byte
      asm  mov cx, n
      asm  lds si, dword ptr pp
      asm  les di, dword ptr pos
      asm  cld
-     
+
      asm  cmp bx, 0                   /* cheap video test */
      asm  je L_fast
      asm  mov bx, ax
      asm  mov dx, CGA_STATUS
      asm  jg L_slow_blank
      asm  cmp bx, 0                   /* cheap video test */
      asm  je L_fast
      asm  mov bx, ax
      asm  mov dx, CGA_STATUS
      asm  jg L_slow_blank
-     
+
    /* slow video */
      asm  cli
    /* slow video */
      asm  cli
-     
+
    /* wait for retrace */
      L_slow:
    asm  in al, dx
      asm  test al, 1
      asm  jnz L_slow
    /* wait for retrace */
      L_slow:
    asm  in al, dx
      asm  test al, 1
      asm  jnz L_slow
-     
+
      L_slow1:
    asm  in al, dx
      asm  test al, 1
      asm  jz L_slow1
      L_slow1:
    asm  in al, dx
      asm  test al, 1
      asm  jz L_slow1
-     
+
    /* move a character out */
      asm  mov ah, bh
      asm  lodsb
      asm  stosw
      asm  loop L_slow
    /* move a character out */
      asm  mov ah, bh
      asm  lodsb
      asm  stosw
      asm  loop L_slow
-     
+
      asm  sti
      asm  jmp done
      asm  sti
      asm  jmp done
-     
+
 /* -------------- slow video, vertical retace and pump --------------*/
      L_slow_blank:
    L_slow_blank_loop:
    asm  in al, dx
      asm  test al, 8
      asm  jnz L_slow_blank_loop
 /* -------------- slow video, vertical retace and pump --------------*/
      L_slow_blank:
    L_slow_blank_loop:
    asm  in al, dx
      asm  test al, 8
      asm  jnz L_slow_blank_loop
-     
+
      L_slow_blank1:
    asm  in al, dx
      asm  test al, 8
      L_slow_blank1:
    asm  in al, dx
      asm  test al, 8
@@ -979,10 +979,10 @@ static unsigned short *video_write (register unsigned char *pp,
    asm  lodsb
      asm  stosw
      asm  loop L_slow_blank2
    asm  lodsb
      asm  stosw
      asm  loop L_slow_blank2
-     
+
      asm jmp done
 /*-------------- Fast video --------------*/
      asm jmp done
 /*-------------- Fast video --------------*/
-     
+
      L_fast:
    asm  lodsb
      asm  stosw
      L_fast:
    asm  lodsb
      asm  stosw
@@ -1026,7 +1026,7 @@ static void write_attributes (unsigned short *src, int count)
    register unsigned short *pos = mkScreenPointer (Cursor_Row, 0);
 # endif
    int n = count;
    register unsigned short *pos = mkScreenPointer (Cursor_Row, 0);
 # endif
    int n = count;
-   
+
    /* write into a character/attribute pair */
    while (n-- > 0)
      {
    /* write into a character/attribute pair */
    while (n-- > 0)
      {
@@ -1044,7 +1044,7 @@ static void write_attributes (unsigned short *src, int count)
 #  endif
 # endif
      }
 #  endif
 # endif
      }
-   
+
 # if !defined (HAS_LINEAR_SCREEN)
 #  if defined (EMX_VIDEO)
    v_putline (Line_Buffer, Cursor_Col, Cursor_Row, count);
 # if !defined (HAS_LINEAR_SCREEN)
 #  if defined (EMX_VIDEO)
    v_putline (Line_Buffer, Cursor_Col, Cursor_Row, count);
@@ -1058,12 +1058,12 @@ static void write_attributes (unsigned short *src, int count)
    coord.X = Cursor_Col;
    coord.Y = Cursor_Row;
    WriteConsoleOutputCharacter(hStdout, p, count, coord, &bytes);
    coord.X = Cursor_Col;
    coord.Y = Cursor_Row;
    WriteConsoleOutputCharacter(hStdout, p, count, coord, &bytes);
-   
+
   /* write color attributes */
    p = Line_Buffer;
    n = count;
    src = (unsigned short*)org_src; /* restart the src pointer */
   /* write color attributes */
    p = Line_Buffer;
    n = count;
    src = (unsigned short*)org_src; /* restart the src pointer */
-   
+
   /* write into attributes only */
    while (n-- > 0)
      {
   /* write into attributes only */
    while (n-- > 0)
      {
@@ -1072,7 +1072,7 @@ static void write_attributes (unsigned short *src, int count)
        *(p++) = Attribute_Byte; /* attribute byte */
        *(p++) = 0; /* what's this for? */
      }
        *(p++) = Attribute_Byte; /* attribute byte */
        *(p++) = 0; /* what's this for? */
      }
-   
+
    WriteConsoleOutputAttribute(hStdout, (WORD*)Line_Buffer, count, coord, &bytes);
 #   else       /* __os2__ */
    /* ScreenUpdateLine (void *virtual_screen_line, int row); */
    WriteConsoleOutputAttribute(hStdout, (WORD*)Line_Buffer, count, coord, &bytes);
 #   else       /* __os2__ */
    /* ScreenUpdateLine (void *virtual_screen_line, int row); */
@@ -1089,7 +1089,7 @@ static void write_attributes (unsigned short *src, int count)
 #else  /* not USE_ASM */
    unsigned char ch, color;
    register unsigned short *pos = mkScreenPointer (Cursor_Row, 0);
 #else  /* not USE_ASM */
    unsigned char ch, color;
    register unsigned short *pos = mkScreenPointer (Cursor_Row, 0);
-   
+
    while (count--)
      {
        pair = *(src++);        /* character/color pair */
    while (count--)
      {
        pair = *(src++);        /* character/color pair */
@@ -1181,15 +1181,15 @@ void SLtt_cls (void)
      /* clear the WIN32 screen in one shot */
    coord.X = 0;
    coord.Y = 0;
      /* clear the WIN32 screen in one shot */
    coord.X = 0;
    coord.Y = 0;
-   
+
    ch = ' ';
    ch = ' ';
-   
+
    (void) FillConsoleOutputCharacter(hStdout,
                                     ch,
                                     csbiInfo.dwMaximumWindowSize.Y * csbiInfo.dwMaximumWindowSize.X,
                                     coord,
                                     &bytes);
    (void) FillConsoleOutputCharacter(hStdout,
                                     ch,
                                     csbiInfo.dwMaximumWindowSize.Y * csbiInfo.dwMaximumWindowSize.X,
                                     coord,
                                     &bytes);
-   
+
      /* now set screen to the current attribute */
    ch = Attribute_Byte;
    (void) FillConsoleOutputAttribute(hStdout,
      /* now set screen to the current attribute */
    ch = Attribute_Byte;
    (void) FillConsoleOutputAttribute(hStdout,
@@ -1227,7 +1227,7 @@ void SLtt_putchar (char ch)
    long bytes;
 # endif
 #endif
    long bytes;
 # endif
 #endif
-   
+
    if (Current_Color) SLtt_normal_video ();
    slvid_getxy ();             /* get current position */
    switch (ch)
    if (Current_Color) SLtt_normal_video ();
    slvid_getxy ();             /* get current position */
    switch (ch)
@@ -1253,7 +1253,7 @@ void SLtt_putchar (char ch)
 #  else        /* GO32_VIDEO */
        pp = mkScreenPointer (Cursor_Row, Cursor_Col);
        p = (Attribute_Byte << 8) | (unsigned char) ch;
 #  else        /* GO32_VIDEO */
        pp = mkScreenPointer (Cursor_Row, Cursor_Col);
        p = (Attribute_Byte << 8) | (unsigned char) ch;
-       
+
 #   ifdef USE_ASM
        SNOW_CHECK;
 #   endif
 #   ifdef USE_ASM
        SNOW_CHECK;
 #   endif
@@ -1280,12 +1280,12 @@ void SLtt_set_color (int obj, char *what, char *fg, char *bg)
 #ifdef WIN32
    int newcolor;
 #endif
 #ifdef WIN32
    int newcolor;
 #endif
-   
+
    (void) what;
    (void) what;
-   
+
    if ( !IsColor || (obj < 0) || (obj >= JMAX_COLORS))
      return;
    if ( !IsColor || (obj < 0) || (obj >= JMAX_COLORS))
      return;
-   
+
    for (i = 0; i < JMAX_COLOR_NAMES; i++ )
      {
        if (!strcmp (fg, Color_Names [i]))
    for (i = 0; i < JMAX_COLOR_NAMES; i++ )
      {
        if (!strcmp (fg, Color_Names [i]))
@@ -1294,7 +1294,7 @@ void SLtt_set_color (int obj, char *what, char *fg, char *bg)
             break;
          }
      }
             break;
          }
      }
-   
+
    for (i = 0; i < JMAX_COLOR_NAMES; i++)
      {
        if (!strcmp (bg, Color_Names [i]))
    for (i = 0; i < JMAX_COLOR_NAMES; i++)
      {
        if (!strcmp (bg, Color_Names [i]))
@@ -1307,7 +1307,7 @@ void SLtt_set_color (int obj, char *what, char *fg, char *bg)
 #if 1
    Color_Map [obj] = (b << 4) | f;
 #else
 #if 1
    Color_Map [obj] = (b << 4) | f;
 #else
-   
+
    /*
      0        1       2        3
    "black", "blue", "green", "cyan",
    /*
      0        1       2        3
    "black", "blue", "green", "cyan",
@@ -1318,32 +1318,32 @@ void SLtt_set_color (int obj, char *what, char *fg, char *bg)
         12            13            14       15
    "brightred", "brightmagenta", "yellow", "white"
    */
         12            13            14       15
    "brightred", "brightmagenta", "yellow", "white"
    */
-   
+
    /* these aren't all right yet */
    /* these aren't all right yet */
-   switch (f) 
+   switch (f)
      {
       case 0: newcolor = 0; break;
       case 1: newcolor = FOREGROUND_BLUE; break;
       case 2: newcolor = FOREGROUND_GREEN; break;
       case 3: newcolor = FOREGROUND_GREEN | FOREGROUND_BLUE; break;
      {
       case 0: newcolor = 0; break;
       case 1: newcolor = FOREGROUND_BLUE; break;
       case 2: newcolor = FOREGROUND_GREEN; break;
       case 3: newcolor = FOREGROUND_GREEN | FOREGROUND_BLUE; break;
-       
+
       case 4: newcolor = FOREGROUND_RED; break;
       case 5: newcolor = FOREGROUND_RED | FOREGROUND_BLUE; break;
       case 6: newcolor = FOREGROUND_GREEN | FOREGROUND_RED; break;
       case 7: newcolor = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
       case 4: newcolor = FOREGROUND_RED; break;
       case 5: newcolor = FOREGROUND_RED | FOREGROUND_BLUE; break;
       case 6: newcolor = FOREGROUND_GREEN | FOREGROUND_RED; break;
       case 7: newcolor = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
-       
+
       case 8: newcolor = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN; break;
       case 9: newcolor = FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
       case 10: newcolor = FOREGROUND_GREEN | FOREGROUND_INTENSITY; break;
       case 11: newcolor = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
       case 8: newcolor = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN; break;
       case 9: newcolor = FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
       case 10: newcolor = FOREGROUND_GREEN | FOREGROUND_INTENSITY; break;
       case 11: newcolor = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
-       
+
       case 12: newcolor = FOREGROUND_RED | FOREGROUND_INTENSITY; break;
       case 13: newcolor = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
       case 14: newcolor = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
       case 15: newcolor = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
      }
    // switch
       case 12: newcolor = FOREGROUND_RED | FOREGROUND_INTENSITY; break;
       case 13: newcolor = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
       case 14: newcolor = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
       case 15: newcolor = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
      }
    // switch
-   
+
    /*
      0        1       2        3
    "black", "blue", "green", "cyan",
    /*
      0        1       2        3
    "black", "blue", "green", "cyan",
@@ -1354,37 +1354,37 @@ void SLtt_set_color (int obj, char *what, char *fg, char *bg)
         12            13            14       15
    "brightred", "brightmagenta", "yellow", "white"
    */
         12            13            14       15
    "brightred", "brightmagenta", "yellow", "white"
    */
-   
-   switch (b) 
+
+   switch (b)
      {
       case 0: newcolor |= 0; break;
       case 1: newcolor |= BACKGROUND_BLUE; break;
       case 2: newcolor |= BACKGROUND_GREEN; break;
       case 3: newcolor |= BACKGROUND_GREEN | BACKGROUND_BLUE; break;
      {
       case 0: newcolor |= 0; break;
       case 1: newcolor |= BACKGROUND_BLUE; break;
       case 2: newcolor |= BACKGROUND_GREEN; break;
       case 3: newcolor |= BACKGROUND_GREEN | BACKGROUND_BLUE; break;
-       
+
       case 4: newcolor |= BACKGROUND_RED; break;
       case 5: newcolor |= BACKGROUND_RED | BACKGROUND_BLUE; break;
       case 6: newcolor |= BACKGROUND_GREEN | BACKGROUND_RED; break;
       case 7: newcolor |= BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
       case 4: newcolor |= BACKGROUND_RED; break;
       case 5: newcolor |= BACKGROUND_RED | BACKGROUND_BLUE; break;
       case 6: newcolor |= BACKGROUND_GREEN | BACKGROUND_RED; break;
       case 7: newcolor |= BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
-       
+
       case 8: newcolor |= BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE; break;
       case 9: newcolor |= BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
       case 10: newcolor |= BACKGROUND_GREEN | BACKGROUND_INTENSITY; break;
       case 11: newcolor |= BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
       case 8: newcolor |= BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE; break;
       case 9: newcolor |= BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
       case 10: newcolor |= BACKGROUND_GREEN | BACKGROUND_INTENSITY; break;
       case 11: newcolor |= BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
-       
+
       case 12: newcolor |= BACKGROUND_RED | BACKGROUND_INTENSITY; break;
       case 13: newcolor |= BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
       case 14: newcolor |= BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
       case 15: newcolor |= BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
      }
    // switch
       case 12: newcolor |= BACKGROUND_RED | BACKGROUND_INTENSITY; break;
       case 13: newcolor |= BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
       case 14: newcolor |= BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
       case 15: newcolor |= BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; break;
      }
    // switch
-   
+
    Color_Map [obj] = newcolor;
    Color_Map [obj] = newcolor;
-   
+
 #endif
     /* if we're setting the normal color, and the attribute byte hasn't
      been set yet, set it to the new color */
 #endif
     /* if we're setting the normal color, and the attribute byte hasn't
      been set yet, set it to the new color */
-   if ((obj == 0) && (Attribute_Byte == 0)) 
+   if ((obj == 0) && (Attribute_Byte == 0))
      SLtt_reverse_video (0);
 }
 
      SLtt_reverse_video (0);
 }
 
@@ -1411,15 +1411,15 @@ void SLtt_init_video (void)
 #if defined (EMX_VIDEO)
    int OldCol, OldRow;
 #endif
 #if defined (EMX_VIDEO)
    int OldCol, OldRow;
 #endif
-   
+
 #ifdef HAS_SAVE_SCREEN
    save_screen ();
 #endif
 
    Cursor_Row = Cursor_Col = 0;
 #ifdef HAS_SAVE_SCREEN
    save_screen ();
 #endif
 
    Cursor_Row = Cursor_Col = 0;
-   
+
 #if defined (EMX_VIDEO)
 #if defined (EMX_VIDEO)
-   
+
    v_init ();
    if ( v_hardware () != V_MONOCHROME ) IsColor = 1; else IsColor = 0;
 
    v_init ();
    if ( v_hardware () != V_MONOCHROME ) IsColor = 1; else IsColor = 0;
 
@@ -1444,7 +1444,7 @@ void SLtt_init_video (void)
             Blink_Killed = 1;  /* seems to work */
          }
      }
             Blink_Killed = 1;  /* seems to work */
          }
      }
-   
+
    if (!Attribute_Byte)
      {
        /* find the attribute currently under the cursor */
    if (!Attribute_Byte)
      {
        /* find the attribute currently under the cursor */
@@ -1452,7 +1452,7 @@ void SLtt_init_video (void)
        Attribute_Byte = Line_Buffer[1];
        set_color_from_attribute (Attribute_Byte);
      }
        Attribute_Byte = Line_Buffer[1];
        set_color_from_attribute (Attribute_Byte);
      }
-   
+
    v_attrib (Attribute_Byte);
    /*   SLtt_Term_Cannot_Insert = 1; */
 #else  /* EMX_VIDEO */
    v_attrib (Attribute_Byte);
    /*   SLtt_Term_Cannot_Insert = 1; */
 #else  /* EMX_VIDEO */
@@ -1466,7 +1466,7 @@ void SLtt_init_video (void)
        VioSetState (&RequestBlock, 0); /* nop if !fullscreen */
        Blink_Killed = 1;
      }
        VioSetState (&RequestBlock, 0); /* nop if !fullscreen */
        Blink_Killed = 1;
      }
-   
+
    if (!Attribute_Byte)
      {
        /* find the attribute currently under the cursor */
    if (!Attribute_Byte)
      {
        /* find the attribute currently under the cursor */
@@ -1488,7 +1488,7 @@ void SLtt_init_video (void)
 #   endif
    if (!Attribute_Byte) Attribute_Byte = 0x17;
    IsColor = 1;                        /* is it really? */
 #   endif
    if (!Attribute_Byte) Attribute_Byte = 0x17;
    IsColor = 1;                        /* is it really? */
-   
+
    if (IsColor)
      {
        union REGS r;
    if (IsColor)
      {
        union REGS r;
@@ -1516,11 +1516,11 @@ void SLtt_init_video (void)
             IsColor = 1;
          }
      }
             IsColor = 1;
          }
      }
-   
+
    /* test for video adapter type.  Of primary interest is whether there is
     * snow or not.  Assume snow if the card is color and not EGA or greater.
     */
    /* test for video adapter type.  Of primary interest is whether there is
     * snow or not.  Assume snow if the card is color and not EGA or greater.
     */
-   
+
    /* Use Ralf Brown test for EGA or greater */
    asm  mov ah, 0x12
      asm  mov bl, 0x10
    /* Use Ralf Brown test for EGA or greater */
    asm  mov ah, 0x12
      asm  mov bl, 0x10
@@ -1528,7 +1528,7 @@ void SLtt_init_video (void)
      asm  int 10h
      asm  cmp bh, 0xFF
      asm  je L1
      asm  int 10h
      asm  cmp bh, 0xFF
      asm  je L1
-     
+
    /* (V)EGA */
      asm  xor bx, bx
      asm  mov SLtt_Msdos_Cheap_Video, bx
    /* (V)EGA */
      asm  xor bx, bx
      asm  mov SLtt_Msdos_Cheap_Video, bx
@@ -1538,7 +1538,7 @@ void SLtt_init_video (void)
      asm  mov ax, 0x17
      asm  mov Attribute_Byte, ax
      asm  jmp L2
      asm  mov ax, 0x17
      asm  mov Attribute_Byte, ax
      asm  jmp L2
-     
+
      L1:
    /* Not (V)EGA */
    asm  mov ah, 0x0F
      L1:
    /* Not (V)EGA */
    asm  mov ah, 0x0F
index d7ee89a..20ebfea 100644 (file)
@@ -1,6 +1,6 @@
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
 /* Copyright (c) 1992, 1995 John E. Davis
  * All rights reserved.
- * 
+ *
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
  * You may distribute under the terms of either the GNU General Public
  * License or the Perl Artistic License.
  */
@@ -105,9 +105,9 @@ int SLang_init_tty (int abort_char, int no_flow_control, int opost)
     if (flags & ENABLE_PROCESSED_INPUT) {
       return -1;
     }
     if (flags & ENABLE_PROCESSED_INPUT) {
       return -1;
     }
-  } 
+  }
 
 
-  (void) SetConsoleCursorPosition(hStdout, newPosition);  
+  (void) SetConsoleCursorPosition(hStdout, newPosition);
 
   /* success */
   return 0;
 
   /* success */
   return 0;
@@ -136,17 +136,17 @@ int SLsys_input_pending (int tsecs)
 
    while (1)
      {
 
    while (1)
      {
-       if (PeekConsoleInput(hStdin, &record, 1, &bytesRead)) 
+       if (PeekConsoleInput(hStdin, &record, 1, &bytesRead))
          {
          {
-            if (bytesRead == 1) 
+            if (bytesRead == 1)
               {
                  if ((record.EventType == KEY_EVENT)
               {
                  if ((record.EventType == KEY_EVENT)
-                     && record.Event.KeyEvent.bKeyDown) 
+                     && record.Event.KeyEvent.bKeyDown)
                    {
                       /* ok, there is a keypress here */
                       return 1;
                    {
                       /* ok, there is a keypress here */
                       return 1;
-                   } 
-                 else 
+                   }
+                 else
                    {
                       /* something else is here, so read it and try again */
                       (void) ReadConsoleInput(hStdin, &record, 1, &bytesRead);
                    {
                       /* something else is here, so read it and try again */
                       (void) ReadConsoleInput(hStdin, &record, 1, &bytesRead);
@@ -173,7 +173,7 @@ int SLsys_input_pending (int tsecs)
    if (keyWaiting()) return 1;
    while (count > 0)
      {
    if (keyWaiting()) return 1;
    while (count > 0)
      {
-       delay (20);      20 ms or 1/50 sec 
+       delay (20);      20 ms or 1/50 sec
        if (keyWaiting()) break;
        count--;
      }
        if (keyWaiting()) break;
        count--;
      }
index 83f4baa..941895a 100644 (file)
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -163,7 +163,7 @@ static umode_t get_perm (char *s, int base)
 
     m |= (s [1] == '-') ? 0 :
        ((s[1] == '+') ? (1 << (base + 1)) : (1 << (base + 1)) & ch_cmode);
 
     m |= (s [1] == '-') ? 0 :
        ((s[1] == '+') ? (1 << (base + 1)) : (1 << (base + 1)) & ch_cmode);
-    
+
     m |= (s [2] == '-') ? 0 :
        ((s[2] == '+') ? (1 << base) : (1 << base) & ch_cmode);
 
     m |= (s [2] == '-') ? 0 :
        ((s[2] == '+') ? (1 << base) : (1 << base) & ch_cmode);
 
@@ -192,12 +192,12 @@ static void print_flags (void)
        dlg_move (ch_dlg, BY+1, 9+i);
        addch (ch_flags [i]);
     }
        dlg_move (ch_dlg, BY+1, 9+i);
        addch (ch_flags [i]);
     }
-    
+
     for (i = 0; i < 3; i++){
        dlg_move (ch_dlg, BY + 1, 17 + i);
        addch (ch_flags [i+3]);
     }
     for (i = 0; i < 3; i++){
        dlg_move (ch_dlg, BY + 1, 17 + i);
        addch (ch_flags [i+3]);
     }
-    
+
     for (i = 0; i < 3; i++){
        dlg_move (ch_dlg, BY + 1, 25 + i);
        addch (ch_flags [i+6]);
     for (i = 0; i < 3; i++){
        dlg_move (ch_dlg, BY + 1, 25 + i);
        addch (ch_flags [i+6]);
@@ -239,7 +239,7 @@ static int chl_callback (Dlg_head * h, int Par, int Msg)
        dlg_erase (h);
        draw_box (h, 0, 0, 13, 17);
        break;
        dlg_erase (h);
        draw_box (h, 0, 0, 13, 17);
        break;
-       
+
     case DLG_KEY:
        switch (Par) {
        case KEY_LEFT:
     case DLG_KEY:
        switch (Par) {
        case KEY_LEFT:
@@ -259,20 +259,20 @@ static void do_enter_key (Dlg_head *h, int f_pos)
     struct   group *chl_grp;
     WLEntry  *fe;
     int      lxx, lyy, chl_end, b_pos;
     struct   group *chl_grp;
     WLEntry  *fe;
     int      lxx, lyy, chl_end, b_pos;
-    
+
     do {
        lxx = (COLS - 74) / 2 + ((f_pos == 3) ? 35 : 53);
        lyy = (LINES - 13) / 2;
        chl_end = 0;
     do {
        lxx = (COLS - 74) / 2 + ((f_pos == 3) ? 35 : 53);
        lyy = (LINES - 13) / 2;
        chl_end = 0;
-       
+
        chl_dlg = create_dlg (lyy, lxx, 13, 17, dialog_colors, chl_callback,
                              "[Chown-advanced]", "achown_enter", DLG_NONE);
        chl_dlg = create_dlg (lyy, lxx, 13, 17, dialog_colors, chl_callback,
                              "[Chown-advanced]", "achown_enter", DLG_NONE);
-       
+
        /* get new listboxes */
        chl_list = listbox_new (1, 1, 15, 11, 0, l_call, NULL);
        /* get new listboxes */
        chl_list = listbox_new (1, 1, 15, 11, 0, l_call, NULL);
-       
+
        listbox_add_item (chl_list, 0, 0, "<Unknown>", NULL);
        listbox_add_item (chl_list, 0, 0, "<Unknown>", NULL);
-       
+
        if (f_pos == 3) {
            /* get and put user names in the listbox */
            setpwent ();
        if (f_pos == 3) {
            /* get and put user names in the listbox */
            setpwent ();
@@ -284,22 +284,22 @@ static void do_enter_key (Dlg_head *h, int f_pos)
        else
        {
            /* get and put group names in the listbox */
        else
        {
            /* get and put group names in the listbox */
-           setgrent ();        
+           setgrent ();
            while ((chl_grp = getgrent ())) {
                listbox_add_item (chl_list, 0, 0, chl_grp->gr_name, NULL);
            }
            endgrent ();
            fe = listbox_search_text (chl_list, get_group (sf_stat->st_gid));
        }
            while ((chl_grp = getgrent ())) {
                listbox_add_item (chl_list, 0, 0, chl_grp->gr_name, NULL);
            }
            endgrent ();
            fe = listbox_search_text (chl_list, get_group (sf_stat->st_gid));
        }
-       
+
        if (fe)
            listbox_select_entry (chl_list, fe);
        if (fe)
            listbox_select_entry (chl_list, fe);
-       
+
        b_pos = chl_list->pos;
        add_widget (chl_dlg, chl_list);
        b_pos = chl_list->pos;
        add_widget (chl_dlg, chl_list);
-       
+
        run_dlg (chl_dlg);
        run_dlg (chl_dlg);
-       
+
        if (b_pos != chl_list->pos){
            int ok = 0;
            if (f_pos == 3){
        if (b_pos != chl_list->pos){
            int ok = 0;
            if (f_pos == 3){
@@ -352,19 +352,19 @@ static void chown_refresh (void)
     addstr (_("group"));
     dlg_move (ch_dlg, BY - 1, 24);
     addstr (_("other"));
     addstr (_("group"));
     dlg_move (ch_dlg, BY - 1, 24);
     addstr (_("other"));
-    
+
     dlg_move (ch_dlg, BY - 1, 35);
     addstr (_("owner"));
     dlg_move (ch_dlg, BY - 1, 53);
     addstr (_("group"));
     dlg_move (ch_dlg, BY - 1, 35);
     addstr (_("owner"));
     dlg_move (ch_dlg, BY - 1, 53);
     addstr (_("group"));
-    
+
     dlg_move (ch_dlg, 3, 4);
     addstr (_("On"));
     dlg_move (ch_dlg, BY + 1, 4);
     addstr (_("Flag"));
     dlg_move (ch_dlg, BY + 2, 4);
     addstr (_("Mode"));
     dlg_move (ch_dlg, 3, 4);
     addstr (_("On"));
     dlg_move (ch_dlg, BY + 1, 4);
     addstr (_("Flag"));
     dlg_move (ch_dlg, BY + 2, 4);
     addstr (_("Mode"));
-    
+
 
     if (!single_set){
        dlg_move (ch_dlg, 3, 54);
 
     if (!single_set){
        dlg_move (ch_dlg, 3, 54);
@@ -383,13 +383,13 @@ static void chown_info_update ()
 {
     /* display file info */
     attrset (COLOR_NORMAL);
 {
     /* display file info */
     attrset (COLOR_NORMAL);
-    
+
     /* name && mode */
     dlg_move (ch_dlg, 3, 8);
     printw ("%s", name_trunc (fname, 45));
     dlg_move (ch_dlg, BY + 2, 9);
     printw ("%12o", get_mode ());
     /* name && mode */
     dlg_move (ch_dlg, 3, 8);
     printw ("%s", name_trunc (fname, 45));
     dlg_move (ch_dlg, BY + 2, 9);
     printw ("%12o", get_mode ());
-    
+
     /* permissions */
     set_perm (b_att[0]->text, sf_stat->st_mode >> 6);
     set_perm (b_att[1]->text, sf_stat->st_mode >> 3);
     /* permissions */
     set_perm (b_att[0]->text, sf_stat->st_mode >> 6);
     set_perm (b_att[1]->text, sf_stat->st_mode >> 3);
@@ -412,7 +412,7 @@ static int advanced_chown_callback (Dlg_head * h, int Par, int Msg)
        chown_refresh ();
        chown_info_update ();
        return 1;
        chown_refresh ();
        chown_info_update ();
        return 1;
-       
+
     case DLG_POST_KEY:
        if (f_pos < 3)
                b_setpos (f_pos);
     case DLG_POST_KEY:
        if (f_pos < 3)
                b_setpos (f_pos);
@@ -429,37 +429,37 @@ static int advanced_chown_callback (Dlg_head * h, int Par, int Msg)
 
     case DLG_KEY:
        switch (Par) {
 
     case DLG_KEY:
        switch (Par) {
-           
+
        case XCTRL('b'):
        case KEY_LEFT:
            if (f_pos < 5)
                return (dec_flag_pos (f_pos));
            break;
        case XCTRL('b'):
        case KEY_LEFT:
            if (f_pos < 5)
                return (dec_flag_pos (f_pos));
            break;
-           
+
        case XCTRL('f'):
        case KEY_RIGHT:
            if (f_pos < 5)
                return (inc_flag_pos (f_pos));
            break;
        case XCTRL('f'):
        case KEY_RIGHT:
            if (f_pos < 5)
                return (inc_flag_pos (f_pos));
            break;
-           
+
        case ' ':
            if (f_pos < 3)
                return 1;
            break;
        case ' ':
            if (f_pos < 3)
                return 1;
            break;
-           
+
        case '\n':
        case KEY_ENTER:
            if (f_pos <= 2 || f_pos >= 5)
                break;
            do_enter_key (h, f_pos);
            return 1;
        case '\n':
        case KEY_ENTER:
            if (f_pos <= 2 || f_pos >= 5)
                break;
            do_enter_key (h, f_pos);
            return 1;
-           
+
        case ALT ('x'):
            i++;
        case ALT ('x'):
            i++;
-           
+
        case ALT ('w'):
            i++;
        case ALT ('w'):
            i++;
-           
+
        case ALT ('r'):
            Par = i + 3;
            for (i = 0; i < 3; i++)
        case ALT ('r'):
            Par = i + 3;
            for (i = 0; i < 3; i++)
@@ -469,13 +469,13 @@ static int advanced_chown_callback (Dlg_head * h, int Par, int Msg)
            dlg_broadcast_msg (h, WIDGET_DRAW, 0);
            send_message (h, h->current->widget, WIDGET_FOCUS, 0);
            break;
            dlg_broadcast_msg (h, WIDGET_DRAW, 0);
            send_message (h, h->current->widget, WIDGET_FOCUS, 0);
            break;
-           
+
        case XCTRL ('x'):
            i++;
        case XCTRL ('x'):
            i++;
-           
+
        case XCTRL ('w'):
            i++;
        case XCTRL ('w'):
            i++;
-           
+
        case XCTRL ('r'):
            Par = i;
            for (i = 0; i < 3; i++)
        case XCTRL ('r'):
            Par = i;
            for (i = 0; i < 3; i++)
@@ -485,13 +485,13 @@ static int advanced_chown_callback (Dlg_head * h, int Par, int Msg)
            dlg_broadcast_msg (h, WIDGET_DRAW, 0);
            send_message (h, h->current->widget, WIDGET_FOCUS, 0);
            break;
            dlg_broadcast_msg (h, WIDGET_DRAW, 0);
            send_message (h, h->current->widget, WIDGET_FOCUS, 0);
            break;
-           
+
        case 'x':
            i++;
        case 'x':
            i++;
-           
+
        case 'w':
            i++;
        case 'w':
            i++;
-           
+
        case 'r':
            if (f_pos > 2)
                break;
        case 'r':
            if (f_pos > 2)
                break;
@@ -505,10 +505,10 @@ static int advanced_chown_callback (Dlg_head * h, int Par, int Msg)
 
        case '4':
            i++;
 
        case '4':
            i++;
-           
+
        case '2':
            i++;
        case '2':
            i++;
-           
+
        case '1':
            if (f_pos > 2)
                break;
        case '1':
            if (f_pos > 2)
                break;
@@ -516,15 +516,15 @@ static int advanced_chown_callback (Dlg_head * h, int Par, int Msg)
            ch_flags[flag_pos] = '=';
            update_mode (h);
            break;
            ch_flags[flag_pos] = '=';
            update_mode (h);
            break;
-           
+
        case '-':
            if (f_pos > 2)
                break;
        case '-':
            if (f_pos > 2)
                break;
-           
+
        case '*':
            if (Par == '*')
                Par = '=';
        case '*':
            if (Par == '*')
                Par = '=';
-           
+
        case '=':
        case '+':
            if (f_pos > 4)
        case '=':
        case '+':
            if (f_pos > 4)
index c812651..142429d 100644 (file)
@@ -2,14 +2,14 @@
 
 /* Background support.
    Copyright (C) 1996 The Free Software Foundation
 
 /* Background support.
    Copyright (C) 1996 The Free Software Foundation
-   
+
    Written by: 1996 Miguel de Icaza
 
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    Written by: 1996 Miguel de Icaza
 
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -78,7 +78,7 @@ static int parent_fd;
 #define mymsg "Desde el hijo\n\r"
 
 struct TaskList *task_list = NULL;
 #define mymsg "Desde el hijo\n\r"
 
 struct TaskList *task_list = NULL;
-    
+
 void
 register_task_running (pid_t pid, int fd, char *info)
 {
 void
 register_task_running (pid_t pid, int fd, char *info)
 {
@@ -130,19 +130,19 @@ do_background (char *info)
 {
     int comm [2];              /* control connection stream */
     int pid;
 {
     int comm [2];              /* control connection stream */
     int pid;
-    
+
     if (socketpair (AF_UNIX, SOCK_STREAM, 0, comm) == -1)
        return -1;
     if (socketpair (AF_UNIX, SOCK_STREAM, 0, comm) == -1)
        return -1;
-    
+
     if ((pid = fork ()) == -1)
        return -1;
     if ((pid = fork ()) == -1)
        return -1;
-    
+
     if (pid == 0){
        int nullfd;
 
        parent_fd = comm [1];
        we_are_background = 1;
     if (pid == 0){
        int nullfd;
 
        parent_fd = comm [1];
        we_are_background = 1;
-       
+
        /* Make stdin/stdout/stderr point somewhere */
        close (0);
        close (1);
        /* Make stdin/stdout/stderr point somewhere */
        close (0);
        close (1);
@@ -157,11 +157,11 @@ do_background (char *info)
        /* To make it obvious if it fails, there is a bug report on this */
        write (2, mymsg, sizeof (mymsg));
        write (1, mymsg, sizeof (mymsg));
        /* To make it obvious if it fails, there is a bug report on this */
        write (2, mymsg, sizeof (mymsg));
        write (1, mymsg, sizeof (mymsg));
-       
+
        /* Just for debugging the background back end */
        if (background_wait){
            volatile int i = 1;
        /* Just for debugging the background back end */
        if (background_wait){
            volatile int i = 1;
-           
+
            while (i)
                ;
        }
            while (i)
                ;
        }
@@ -186,12 +186,12 @@ void
 real_message_1s (enum OperationMode mode, int *flags, char *title, char *str1)
 {
     char *full_title;
 real_message_1s (enum OperationMode mode, int *flags, char *title, char *str1)
 {
     char *full_title;
-    
+
     if (mode == Background)
        full_title = background_title (title);
     else
         full_title = title;
     if (mode == Background)
        full_title = background_title (title);
     else
         full_title = title;
-    
+
     message (*flags, title, str1);
 
     if (title != full_title)
     message (*flags, title, str1);
 
     if (title != full_title)
@@ -202,14 +202,14 @@ void
 real_message_2s (enum OperationMode mode, int *flags, char *title, char *str1, char *str2)
 {
     char *full_title;
 real_message_2s (enum OperationMode mode, int *flags, char *title, char *str1, char *str2)
 {
     char *full_title;
-    
+
     if (mode == Background)
        full_title = background_title (title);
     else
         full_title = title;
     if (mode == Background)
        full_title = background_title (title);
     else
         full_title = title;
-    
+
     message (*flags, title, str1, str2);
     message (*flags, title, str1, str2);
-    
+
     if (title != full_title)
        free (full_title);
 }
     if (title != full_title)
        free (full_title);
 }
@@ -218,14 +218,14 @@ void
 real_message_3s (enum OperationMode mode, int *flags, char *title, char *str1, char *str2, const char *str3)
 {
     char *full_title;
 real_message_3s (enum OperationMode mode, int *flags, char *title, char *str1, char *str2, const char *str3)
 {
     char *full_title;
-    
+
     if (mode == Background)
        full_title = background_title (title);
     else
         full_title = title;
     if (mode == Background)
        full_title = background_title (title);
     else
         full_title = title;
-    
+
     message (*flags, title, str1, str2, str3);
     message (*flags, title, str1, str2, str3);
-    
+
     if (title != full_title)
        free (full_title);
 }
     if (title != full_title)
        free (full_title);
 }
@@ -268,7 +268,7 @@ real_message_3s (enum OperationMode mode, int *flags, char *title, char *str1, c
  */
 /*
  * Receive requests from background process and invoke the
  */
 /*
  * Receive requests from background process and invoke the
- * specified routine 
+ * specified routine
  */
 
 int
  */
 
 int
@@ -282,7 +282,7 @@ background_attention (int fd, void *xpid)
     int bytes;
     enum ReturnType type;
     char *background_process_error = _(" Background process error ");
     int bytes;
     enum ReturnType type;
     char *background_process_error = _(" Background process error ");
-    
+
     bytes = read (fd, &routine, sizeof (routine));
     if (bytes < (sizeof (routine))){
        if (errno == ECHILD)
     bytes = read (fd, &routine, sizeof (routine));
     if (bytes < (sizeof (routine))){
        if (errno == ECHILD)
@@ -300,7 +300,7 @@ background_attention (int fd, void *xpid)
        waitpid (pid, &status, 0);
        return 0;
     }
        waitpid (pid, &status, 0);
        return 0;
     }
-    
+
     read (fd, &argc, sizeof (argc));
     if (argc > MAXCALLARGS){
        message (1, _(" Background protocol error "),
     read (fd, &argc, sizeof (argc));
     if (argc > MAXCALLARGS){
        message (1, _(" Background protocol error "),
@@ -308,14 +308,14 @@ background_attention (int fd, void *xpid)
                 " than we can handle. \n"));
     }
     read (fd, &type, sizeof (type));
                 " than we can handle. \n"));
     }
     read (fd, &type, sizeof (type));
-    
+
     for (i = 0; i < argc; i++){
        int size;
     for (i = 0; i < argc; i++){
        int size;
-       
+
        read (fd, &size, sizeof (size));
        data [i] = xmalloc (size+1, "RPC Arguments");
        read (fd, data [i], size);
        read (fd, &size, sizeof (size));
        data [i] = xmalloc (size+1, "RPC Arguments");
        read (fd, data [i], size);
-       
+
        data [i][size] = 0;     /* NULL terminate the blocks (they could be strings) */
     }
 
        data [i][size] = 0;     /* NULL terminate the blocks (they could be strings) */
     }
 
@@ -338,12 +338,12 @@ background_attention (int fd, void *xpid)
                (Background, data [0], data [1], data [2], data [3]);
            break;
        }
                (Background, data [0], data [1], data [2], data [3]);
            break;
        }
-       
+
        /* Send the result code and the value for shared variables */
        write (fd, &result,           sizeof (int));
        write (fd, &do_append,        sizeof (do_append));
        write (fd, &recursive_result, sizeof (recursive_result));
        /* Send the result code and the value for shared variables */
        write (fd, &result,           sizeof (int));
        write (fd, &do_append,        sizeof (do_append));
        write (fd, &recursive_result, sizeof (recursive_result));
-       
+
     } else if (type == Return_String) {
        int len;
 
     } else if (type == Return_String) {
        int len;
 
@@ -407,7 +407,7 @@ parent_call (void *routine, int argc, ...)
 {
     va_list ap;
     int i;
 {
     va_list ap;
     int i;
-    
+
     va_start (ap, argc);
     parent_call_header (routine, argc, Return_Integer);
     for (i = 0; i < argc; i++){
     va_start (ap, argc);
     parent_call_header (routine, argc, Return_Integer);
     for (i = 0; i < argc; i++){
@@ -419,7 +419,7 @@ parent_call (void *routine, int argc, ...)
        write (parent_fd, &len, sizeof (int));
        write (parent_fd, value, len);
     }
        write (parent_fd, &len, sizeof (int));
        write (parent_fd, value, len);
     }
-    /* Besides the regular result, get the value for 
+    /* Besides the regular result, get the value for
      * variables that may be modified in the parent that affect our behaviour
      */
     read (parent_fd, &i,         sizeof (int));
      * variables that may be modified in the parent that affect our behaviour
      */
     read (parent_fd, &i,         sizeof (int));
@@ -434,7 +434,7 @@ parent_call_string (void *routine, int argc, ...)
     va_list ap;
     char *str;
     int i;
     va_list ap;
     char *str;
     int i;
-    
+
     va_start (ap, argc);
     parent_call_header (routine, argc, Return_String);
     for (i = 0; i < argc; i++){
     va_start (ap, argc);
     parent_call_header (routine, argc, Return_String);
     for (i = 0; i < argc; i++){
@@ -466,7 +466,7 @@ call_1s (int (*routine)(enum OperationMode, char *), char *str)
 {
     if (we_are_background)
        return parent_call ((void *)routine, 1, strlen (str), str);
 {
     if (we_are_background)
        return parent_call ((void *)routine, 1, strlen (str), str);
-    else 
+    else
        return (*routine)(Foreground, str);
 }
 
        return (*routine)(Foreground, str);
 }
 
index 0c0506f..7e71e0f 100644 (file)
@@ -1,15 +1,15 @@
 /* Some misc dialog boxes for the program.
 /* Some misc dialog boxes for the program.
-   
+
    Copyright (C) 1994, 1995 the Free Software Foundation
    Copyright (C) 1994, 1995 the Free Software Foundation
-   
+
    Authors: 1994, 1995 Miguel de Icaza
             1995 Jakub Jelinek
    Authors: 1994, 1995 Miguel de Icaza
             1995 Jakub Jelinek
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -82,7 +82,7 @@ static int display_callback (struct Dlg_head *h, int id, int Msg)
 #ifndef HAVE_X
     char *text;
     WInput *input;
 #ifndef HAVE_X
     char *text;
     WInput *input;
-    
+
     switch (Msg){
     case DLG_DRAW:
        attrset (COLOR_NORMAL);
     switch (Msg){
     case DLG_DRAW:
        attrset (COLOR_NORMAL);
@@ -101,7 +101,7 @@ static int display_callback (struct Dlg_head *h, int id, int Msg)
            input_set_point (status, 0);
        }
        break;
            input_set_point (status, 0);
        }
        break;
-       
+
     case DLG_KEY:
        if (id == '\n'){
            if((WRadio *) h->current->widget == my_radio){
     case DLG_KEY:
        if (id == '\n'){
            if((WRadio *) h->current->widget == my_radio){
@@ -109,13 +109,13 @@ static int display_callback (struct Dlg_head *h, int id, int Msg)
                dlg_stop (h);
                break;
            }
                dlg_stop (h);
                break;
            }
-           
+
            if ((WInput *) h->current->widget == user){
                h->ret_value = B_USER + 6;
                dlg_stop (h);
                break;
            }
            if ((WInput *) h->current->widget == user){
                h->ret_value = B_USER + 6;
                dlg_stop (h);
                break;
            }
-       
+
            if ((WInput *) h->current->widget == status){
                h->ret_value = B_USER + 7;
                dlg_stop (h);
            if ((WInput *) h->current->widget == status){
                h->ret_value = B_USER + 7;
                dlg_stop (h);
@@ -131,7 +131,7 @@ static int display_callback (struct Dlg_head *h, int id, int Msg)
            return MSG_HANDLED;
        }
     }
            return MSG_HANDLED;
        }
     }
-#endif    
+#endif
     return MSG_NOT_HANDLED;
 }
 
     return MSG_NOT_HANDLED;
 }
 
@@ -141,9 +141,9 @@ static void display_init (int radio_sel, char *init_text,
        char* user_mini_status = _("user &Mini status");
        char* ok_button = _("&Ok");
        char* cancel_button = _("&Cancel");
        char* user_mini_status = _("user &Mini status");
        char* ok_button = _("&Ok");
        char* cancel_button = _("&Cancel");
-       
+
        static int button_start = 30;
        static int button_start = 30;
-       
+
     displays_status = _status;
 
     if (!i18n_displays_flag){
     displays_status = _status;
 
     if (!i18n_displays_flag){
@@ -169,13 +169,13 @@ static void display_init (int radio_sel, char *init_text,
                i = strlen (user_mini_status) + 13;
                if (i > DISPLAY_X)
                        DISPLAY_X = i;
                i = strlen (user_mini_status) + 13;
                if (i > DISPLAY_X)
                        DISPLAY_X = i;
-                       
+
                i = strlen (display_title) + 8;
                if (i > DISPLAY_X)
                        DISPLAY_X = i;
 
                button_start = DISPLAY_X - l - 5;
                i = strlen (display_title) + 8;
                if (i > DISPLAY_X)
                        DISPLAY_X = i;
 
                button_start = DISPLAY_X - l - 5;
-               
+
                /* get hotkey of user-defined format string */
                cp = strchr(displays[LIST_TYPES-1],'&');
                if (cp != NULL && *++cp != '\0')
                /* get hotkey of user-defined format string */
                cp = strchr(displays[LIST_TYPES-1],'&');
                if (cp != NULL && *++cp != '\0')
@@ -189,12 +189,12 @@ static void display_init (int radio_sel, char *init_text,
 
     x_set_dialog_title (dd, _("Listing mode"));
     add_widgetl (dd,
 
     x_set_dialog_title (dd, _("Listing mode"));
     add_widgetl (dd,
-        button_new (4, button_start, B_CANCEL, 
+        button_new (4, button_start, B_CANCEL,
                        NORMAL_BUTTON, cancel_button, 0, 0, "cancel-button"),
        XV_WLAY_RIGHTOF);
 
     add_widgetl (dd,
                        NORMAL_BUTTON, cancel_button, 0, 0, "cancel-button"),
        XV_WLAY_RIGHTOF);
 
     add_widgetl (dd,
-               button_new (3, button_start, B_ENTER, 
+               button_new (3, button_start, B_ENTER,
                        DEFPUSH_BUTTON, ok_button, 0, 0, "ok-button"),
         XV_WLAY_CENTERROW);
 
                        DEFPUSH_BUTTON, ok_button, 0, 0, "ok-button"),
         XV_WLAY_CENTERROW);
 
@@ -204,7 +204,7 @@ static void display_init (int radio_sel, char *init_text,
 
     check_status = check_new (9, 5, _check_status, user_mini_status, "mini-status");
     add_widgetl (dd, check_status, XV_WLAY_NEXTROW);
 
     check_status = check_new (9, 5, _check_status, user_mini_status, "mini-status");
     add_widgetl (dd, check_status, XV_WLAY_NEXTROW);
-    
+
     user = input_new  (7, 9, INPUT_COLOR, DISPLAY_X-14, init_text, "user-fmt-input");
     add_widgetl (dd, user, XV_WLAY_RIGHTDOWN);
     input_set_point (user, 0);
     user = input_new  (7, 9, INPUT_COLOR, DISPLAY_X-14, init_text, "user-fmt-input");
     add_widgetl (dd, user, XV_WLAY_RIGHTDOWN);
     input_set_point (user, 0);
@@ -243,20 +243,20 @@ int display_box (WPanel *panel, char **userp, char **minip, int *use_msformat,
     }
 
     current_mode = panel->list_type;
     }
 
     current_mode = panel->list_type;
-    display_init (current_mode, panel->user_format, 
+    display_init (current_mode, panel->user_format,
        panel->user_mini_status, panel->user_status_format);
        panel->user_mini_status, panel->user_status_format);
-                 
+
     run_dlg (dd);
 
     result = -1;
     run_dlg (dd);
 
     result = -1;
-    
+
     if (section) {
         free (panel->user_format);
        for (i = 0; i < LIST_TYPES; i++)
            free (panel->user_status_format [i]);
         free (panel);
     }
     if (section) {
         free (panel->user_format);
        for (i = 0; i < LIST_TYPES; i++)
            free (panel->user_status_format [i]);
         free (panel);
     }
-    
+
     if (dd->ret_value != B_CANCEL){
        result = my_radio->sel;
        *userp = strdup (user->buffer);
     if (dd->ret_value != B_CANCEL){
        result = my_radio->sel;
        *userp = strdup (user->buffer);
@@ -303,12 +303,12 @@ sortfn *sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive)
                i = strlen (case_label) + 4;
                if (i > r)
                        r = i;
                i = strlen (case_label) + 4;
                if (i > r)
                        r = i;
-               
+
                l = strlen (ok_button) + 6;
                i = strlen (cancel_button) + 4;
                if (i > l)
                        l = i;
                l = strlen (ok_button) + 6;
                i = strlen (cancel_button) + 4;
                if (i > l)
                        l = i;
-                       
+
                i = check_pos + max(r,l) + 2;
 
                if (i > SORT_X)
                i = check_pos + max(r,l) + 2;
 
                if (i > SORT_X)
@@ -324,23 +324,23 @@ sortfn *sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive)
        }
 
     result = 0;
        }
 
     result = 0;
-    
+
     for (i = 0; i < SORT_TYPES; i++)
        if ((sortfn *) (sort_orders [i].sort_fn) == sort_fn){
            current_mode = i;
            break;
        }
     for (i = 0; i < SORT_TYPES; i++)
        if ((sortfn *) (sort_orders [i].sort_fn) == sort_fn){
            current_mode = i;
            break;
        }
-    
+
     dd = create_dlg (0, 0, SORT_Y, SORT_X, dialog_colors, common_dialog_callback,
                     "[Left and Right Menus]", "sort", DLG_CENTER | DLG_GRID);
     dd = create_dlg (0, 0, SORT_Y, SORT_X, dialog_colors, common_dialog_callback,
                     "[Left and Right Menus]", "sort", DLG_CENTER | DLG_GRID);
-                    
+
     x_set_dialog_title (dd, sort_title);
 
     x_set_dialog_title (dd, sort_title);
 
-    add_widgetl (dd, 
-               button_new (10, button_pos, B_CANCEL, NORMAL_BUTTON, cancel_button, 
+    add_widgetl (dd,
+               button_new (10, button_pos, B_CANCEL, NORMAL_BUTTON, cancel_button,
                0, 0, "cancel-button"), XV_WLAY_CENTERROW);
 
                0, 0, "cancel-button"), XV_WLAY_CENTERROW);
 
-    add_widgetl (dd, 
+    add_widgetl (dd,
                button_new (9, button_pos, B_ENTER, DEFPUSH_BUTTON, ok_button,
                0, 0, "ok-button"),     XV_WLAY_RIGHTDOWN);
 
                button_new (9, button_pos, B_ENTER, DEFPUSH_BUTTON, ok_button,
                0, 0, "ok-button"),     XV_WLAY_RIGHTDOWN);
 
@@ -351,7 +351,7 @@ sortfn *sort_box (sortfn *sort_fn, int *reverse, int *case_sensitive)
 
     my_radio = radio_new (3, 3, SORT_TYPES, sort_orders_names, 1, "radio-1");
     my_radio->sel = my_radio->pos = current_mode;
 
     my_radio = radio_new (3, 3, SORT_TYPES, sort_orders_names, 1, "radio-1");
     my_radio->sel = my_radio->pos = current_mode;
-    
+
     add_widget (dd, my_radio);
     run_dlg (dd);
 
     add_widget (dd, my_radio);
     run_dlg (dd);
 
@@ -401,7 +401,7 @@ void confirm_box ()
 
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
 
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
-       
+
        if (!i18n_flag)
        {
                register int i = sizeof(conf_widgets)/sizeof(QuickWidget) - 1;
        if (!i18n_flag)
        {
                register int i = sizeof(conf_widgets)/sizeof(QuickWidget) - 1;
@@ -434,7 +434,7 @@ void confirm_box ()
                        confirmation.xlen = i;
 
                confirmation.title = _(confirmation.title);
                        confirmation.xlen = i;
 
                confirmation.title = _(confirmation.title);
-               
+
                i18n_flag = confirmation.i18n = 1;
        }
 
                i18n_flag = confirmation.i18n = 1;
        }
 
@@ -499,7 +499,7 @@ void display_bits_box ()
                l1 = strlen (display_widgets [2].text);
                if (l1 > maxlen)
                        maxlen = l1;
                l1 = strlen (display_widgets [2].text);
                if (l1 > maxlen)
                        maxlen = l1;
-               
+
 
                display_bits.xlen = (maxlen + 5) * 6 / 4;
 
 
                display_bits.xlen = (maxlen + 5) * 6 / 4;
 
@@ -557,7 +557,7 @@ static int tree_callback (struct Dlg_head *h, int id, int msg)
            dlg_stop (h);
        }
        return MSG_HANDLED;
            dlg_stop (h);
        }
        return MSG_HANDLED;
-       
+
     case DLG_DRAW:
        common_dialog_repaint (h);
        break;
     case DLG_DRAW:
        common_dialog_repaint (h);
        break;
@@ -574,7 +574,7 @@ char *tree (char *current_dir)
 
     tree_colors [3] = dialog_colors [0];
     tree_colors [1] = dialog_colors [1];
 
     tree_colors [3] = dialog_colors [0];
     tree_colors [1] = dialog_colors [1];
-    
+
     /* Create the components */
     dlg = create_dlg (0, 0, TREE_Y, TREE_X, tree_colors,
                      tree_callback, "[Directory Tree]", "tree", DLG_CENTER);
     /* Create the components */
     dlg = create_dlg (0, 0, TREE_Y, TREE_X, tree_colors,
                      tree_callback, "[Directory Tree]", "tree", DLG_CENTER);
@@ -584,13 +584,13 @@ char *tree (char *current_dir)
     add_widget (dlg, bar);
     bar->widget.x = 0;
     bar->widget.y = LINES - 1;
     add_widget (dlg, bar);
     bar->widget.x = 0;
     bar->widget.y = LINES - 1;
-    
+
     run_dlg (dlg);
     if (dlg->ret_value == B_ENTER)
        val = strdup (mytree->selected_ptr->name);
     else
        val = 0;
     run_dlg (dlg);
     if (dlg->ret_value == B_ENTER)
        val = strdup (mytree->selected_ptr->name);
     else
        val = 0;
-    
+
     destroy_dlg (dlg);
     return val;
 }
     destroy_dlg (dlg);
     return val;
 }
@@ -662,17 +662,17 @@ static QuickWidget confvfs_widgets [] = {
 { quick_label,     4, VFSX, 8, VFSY, N_("ftp anonymous password:"),
       0, 0, 0, 0, XV_WLAY_NEXTROW, "label-pass"},
 #endif
 { quick_label,     4, VFSX, 8, VFSY, N_("ftp anonymous password:"),
       0, 0, 0, 0, XV_WLAY_NEXTROW, "label-pass"},
 #endif
-{ quick_input,    26, VFSX, 6, VFSY, "", 10, 0, 0, &ret_limit, 
+{ quick_input,    26, VFSX, 6, VFSY, "", 10, 0, 0, &ret_limit,
       XV_WLAY_RIGHTDOWN, "input-limit" },
 { quick_radio,    4, VFSX, 5, VFSY, "", 2, 0,
       &vfs_use_limit, confvfs_str, XV_WLAY_BELOWCLOSE, "radio" },
       XV_WLAY_RIGHTDOWN, "input-limit" },
 { quick_radio,    4, VFSX, 5, VFSY, "", 2, 0,
       &vfs_use_limit, confvfs_str, XV_WLAY_BELOWCLOSE, "radio" },
-{ quick_label,    4,  VFSX, 4, VFSY, N_("Gzipped tar archive extract:"), 
+{ quick_label,    4,  VFSX, 4, VFSY, N_("Gzipped tar archive extract:"),
       0, 0, 0, 0, XV_WLAY_NEXTROW, "label-tar" },
 { quick_label,    46, VFSX, 3, VFSY, "sec",
       0, 0, 0, 0, XV_WLAY_RIGHTOF, "label-sec2" },
       0, 0, 0, 0, XV_WLAY_NEXTROW, "label-tar" },
 { quick_label,    46, VFSX, 3, VFSY, "sec",
       0, 0, 0, 0, XV_WLAY_RIGHTOF, "label-sec2" },
-{ quick_input,    35, VFSX, 3, VFSY, "", 10, 0, 0, &ret_timeout, 
+{ quick_input,    35, VFSX, 3, VFSY, "", 10, 0, 0, &ret_timeout,
       XV_WLAY_RIGHTOF, "input-timo-vfs" },
       XV_WLAY_RIGHTOF, "input-timo-vfs" },
-{ quick_label,    4,  VFSX, 3, VFSY, N_("Timeout for freeing VFSs:"), 
+{ quick_label,    4,  VFSX, 3, VFSY, N_("Timeout for freeing VFSs:"),
       0, 0, 0, 0, XV_WLAY_BELOWCLOSE, "label-vfs" },
 { 0,              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, XV_WLAY_DONTCARE, 0 }
 };
       0, 0, 0, 0, XV_WLAY_BELOWCLOSE, "label-vfs" },
 { 0,              0, 0, 0, 0, 0, 0, 0, 0, 0, 0, XV_WLAY_DONTCARE, 0 }
 };
@@ -720,7 +720,7 @@ void configure_vfs ()
 
     if (quick_dialog (&confvfs_dlg) != B_CANCEL) {
         char *p;
 
     if (quick_dialog (&confvfs_dlg) != B_CANCEL) {
         char *p;
-        
+
         vfs_timeout = atoi (ret_timeout);
         free (ret_timeout);
         if (vfs_timeout < 0 || vfs_timeout > 10000)
         vfs_timeout = atoi (ret_timeout);
         free (ret_timeout);
         if (vfs_timeout < 0 || vfs_timeout > 10000)
@@ -771,10 +771,10 @@ char *cd_dialog (void)
     { quick_input,  6, 57, 5, 0, "", 50, 0, 0, 0, XV_WLAY_RIGHTOF, "input" },
     { quick_label,  3, 57, 2, 0, "",  0, 0, 0, 0, XV_WLAY_DONTCARE, "label" },
     { 0 } };
     { quick_input,  6, 57, 5, 0, "", 50, 0, 0, 0, XV_WLAY_RIGHTOF, "input" },
     { quick_label,  3, 57, 2, 0, "",  0, 0, 0, 0, XV_WLAY_DONTCARE, "label" },
     { 0 } };
-    
+
     char *my_str;
        int len;
     char *my_str;
        int len;
-    
+
     Quick_input.xlen  = 57;
     Quick_input.title = _("Quick cd");
     Quick_input.help  = "[Quick cd]";
     Quick_input.xlen  = 57;
     Quick_input.title = _("Quick cd");
     Quick_input.help  = "[Quick cd]";
@@ -788,7 +788,7 @@ char *cd_dialog (void)
        len = strlen (quick_widgets [INPUT_INDEX+1].text);
 
        quick_widgets [INPUT_INDEX+1].relative_x = 3;
        len = strlen (quick_widgets [INPUT_INDEX+1].text);
 
        quick_widgets [INPUT_INDEX+1].relative_x = 3;
-       quick_widgets [INPUT_INDEX].relative_x = 
+       quick_widgets [INPUT_INDEX].relative_x =
                quick_widgets [INPUT_INDEX+1].relative_x + len + 1;
 
     Quick_input.xlen = len + quick_widgets [INPUT_INDEX].hotkey_pos + 7;
                quick_widgets [INPUT_INDEX+1].relative_x + len + 1;
 
     Quick_input.xlen = len + quick_widgets [INPUT_INDEX].hotkey_pos + 7;
@@ -800,7 +800,7 @@ char *cd_dialog (void)
     Quick_input.ypos = LINES - 2 - Quick_input.ylen;
     quick_widgets [INPUT_INDEX].relative_y = 2;
     quick_widgets [INPUT_INDEX].str_result = &my_str;
     Quick_input.ypos = LINES - 2 - Quick_input.ylen;
     quick_widgets [INPUT_INDEX].relative_y = 2;
     quick_widgets [INPUT_INDEX].str_result = &my_str;
-    
+
     Quick_input.widgets = quick_widgets;
     if (quick_dialog (&Quick_input) != B_CANCEL){
        return *(quick_widgets [INPUT_INDEX].str_result);
     Quick_input.widgets = quick_widgets;
     if (quick_dialog (&Quick_input) != B_CANCEL){
        return *(quick_widgets [INPUT_INDEX].str_result);
@@ -808,7 +808,7 @@ char *cd_dialog (void)
        return 0;
 }
 
        return 0;
 }
 
-void symlink_dialog (char *existing, char *new, char **ret_existing, 
+void symlink_dialog (char *existing, char *new, char **ret_existing,
     char **ret_new)
 {
     QuickDialog Quick_input;
     char **ret_new)
 {
     QuickDialog Quick_input;
@@ -828,7 +828,7 @@ void symlink_dialog (char *existing, char *new, char **ret_existing,
     { quick_input,  6, 80, 3, 8, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-2" },
     { quick_label,  6, 80, 2, 8, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "label-2" },
     { 0 } };
     { quick_input,  6, 80, 3, 8, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-2" },
     { quick_label,  6, 80, 2, 8, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "label-2" },
     { 0 } };
-    
+
     Quick_input.xlen  = 64;
     Quick_input.ylen  = 8;
     Quick_input.title = "Symbolic link";
     Quick_input.xlen  = 64;
     Quick_input.ylen  = 8;
     Quick_input.title = "Symbolic link";
@@ -842,7 +842,7 @@ void symlink_dialog (char *existing, char *new, char **ret_existing,
     Quick_input.xpos = -1;
     quick_widgets [INPUT_INDEX].str_result = ret_new;
     quick_widgets [INPUT_INDEX+2].str_result = ret_existing;
     Quick_input.xpos = -1;
     quick_widgets [INPUT_INDEX].str_result = ret_new;
     quick_widgets [INPUT_INDEX+2].str_result = ret_existing;
-    
+
     Quick_input.widgets = quick_widgets;
     if (quick_dialog (&Quick_input) == B_CANCEL){
         *ret_new = NULL;
     Quick_input.widgets = quick_widgets;
     if (quick_dialog (&Quick_input) == B_CANCEL){
         *ret_new = NULL;
@@ -870,7 +870,7 @@ jobs_fill_listbox (void)
        state_str [0] = _("Running ");
        state_str [1] = _("Stopped");
     }
        state_str [0] = _("Running ");
        state_str [1] = _("Stopped");
     }
-    
+
     while (tl){
        char *s;
 
     while (tl){
        char *s;
 
@@ -880,19 +880,19 @@ jobs_fill_listbox (void)
        tl = tl->next;
     }
 }
        tl = tl->next;
     }
 }
-       
+
 static int
 task_cb (int action, void *ignored)
 {
     TaskList *tl;
     int sig;
 static int
 task_cb (int action, void *ignored)
 {
     TaskList *tl;
     int sig;
-    
+
     if (!bg_list->list)
        return 0;
 
     /* Get this instance information */
     tl = (TaskList *) bg_list->current->data;
     if (!bg_list->list)
        return 0;
 
     /* Get this instance information */
     tl = (TaskList *) bg_list->current->data;
-    
+
     if (action == B_STOP){
        sig   = SIGSTOP;
        tl->state = Task_Stopped;
     if (action == B_STOP){
        sig   = SIGSTOP;
        tl->state = Task_Stopped;
@@ -902,7 +902,7 @@ task_cb (int action, void *ignored)
     } else if (action == B_KILL){
        sig = SIGKILL;
     }
     } else if (action == B_KILL){
        sig = SIGKILL;
     }
-    
+
     if (sig == SIGINT)
        unregister_task_running (tl->pid, tl->fd);
 
     if (sig == SIGINT)
        unregister_task_running (tl->pid, tl->fd);
 
@@ -912,18 +912,18 @@ task_cb (int action, void *ignored)
 
     /* This can be optimized to just redraw this widget :-) */
     dlg_redraw (jobs_dlg);
 
     /* This can be optimized to just redraw this widget :-) */
     dlg_redraw (jobs_dlg);
-    
+
     return 0;
 }
 
     return 0;
 }
 
-static struct 
+static struct
 {
        char* name;
        int xpos;
        int value;
        int (*callback)();
        char* tkname;
 {
        char* name;
        int xpos;
        int value;
        int (*callback)();
        char* tkname;
-} 
+}
 job_buttons [] =
 {
        {N_("&Stop"),   3,  B_STOP,   task_cb, "button-stop"},
 job_buttons [] =
 {
        {N_("&Stop"),   3,  B_STOP,   task_cb, "button-stop"},
@@ -968,24 +968,24 @@ jobs_cmd (void)
                           common_dialog_callback, "[Background jobs]", "jobs",
                           DLG_CENTER | DLG_GRID);
     x_set_dialog_title (jobs_dlg, _("Background Jobs"));
                           common_dialog_callback, "[Background jobs]", "jobs",
                           DLG_CENTER | DLG_GRID);
     x_set_dialog_title (jobs_dlg, _("Background Jobs"));
-    
+
     bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, listbox_nothing, 0, "listbox");
     add_widget (jobs_dlg, bg_list);
 
        i = n_buttons;
        while (i--)
        {
     bg_list = listbox_new (2, 3, JOBS_X-7, JOBS_Y-9, listbox_nothing, 0, "listbox");
     add_widget (jobs_dlg, bg_list);
 
        i = n_buttons;
        while (i--)
        {
-               add_widget (jobs_dlg, button_new (JOBS_Y-4, 
+               add_widget (jobs_dlg, button_new (JOBS_Y-4,
                        job_buttons [i].xpos, job_buttons [i].value,
                        job_buttons [i].xpos, job_buttons [i].value,
-                       NORMAL_BUTTON, job_buttons [i].name, 
+                       NORMAL_BUTTON, job_buttons [i].name,
                        job_buttons [i].callback, 0,
                        job_buttons [i].tkname));
        }
                        job_buttons [i].callback, 0,
                        job_buttons [i].tkname));
        }
-       
+
     /* Insert all of task information in the list */
     jobs_fill_listbox ();
     run_dlg (jobs_dlg);
     /* Insert all of task information in the list */
     jobs_fill_listbox ();
     run_dlg (jobs_dlg);
-    
+
     destroy_dlg (jobs_dlg);
 }
 #endif
     destroy_dlg (jobs_dlg);
 }
 #endif
index e66f4a2..fa7e7b5 100644 (file)
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -91,7 +91,7 @@ struct {
     char *text;
     int selected;
     WCheck *check;
     char *text;
     int selected;
     WCheck *check;
-} check_perm[PERMISSIONS] = 
+} check_perm[PERMISSIONS] =
 {
     { S_IXOTH, N_("execute/search by others"), 0, 0, },
     { S_IWOTH, N_("write by others"), 0, 0, },
 {
     { S_IXOTH, N_("execute/search by others"), 0, 0, },
     { S_IWOTH, N_("write by others"), 0, 0, },
@@ -110,7 +110,7 @@ struct {
 struct {
     int ret_cmd, flags, y, x;
     char *text;
 struct {
     int ret_cmd, flags, y, x;
     char *text;
-} chmod_but[BUTTONS] = 
+} chmod_but[BUTTONS] =
 {
     { B_CANCEL, NORMAL_BUTTON,  2, 33, N_("&Cancel") },
     { B_ENTER,  DEFPUSH_BUTTON, 2, 17, N_("&Set") },
 {
     { B_CANCEL, NORMAL_BUTTON,  2, 33, N_("&Cancel") },
     { B_ENTER,  DEFPUSH_BUTTON, 2, 17, N_("&Set") },
@@ -126,7 +126,7 @@ static void chmod_toggle_select (void)
 #ifdef HAVE_TK
     char *wn = (char *) ch_dlg->current->widget->wdata;
     int  id = ch_dlg->current->dlg_id -BUTTONS + single_set * 2;
 #ifdef HAVE_TK
     char *wn = (char *) ch_dlg->current->widget->wdata;
     int  id = ch_dlg->current->dlg_id -BUTTONS + single_set * 2;
-    
+
     check_perm [id].selected ^= 1;
 
     tk_evalf ("%s configure -color $setup(%s)",
     check_perm [id].selected ^= 1;
 
     tk_evalf ("%s configure -color $setup(%s)",
@@ -151,7 +151,7 @@ static void chmod_refresh (void)
 {
     attrset (COLOR_NORMAL);
     dlg_erase (ch_dlg);
 {
     attrset (COLOR_NORMAL);
     dlg_erase (ch_dlg);
-    
+
     draw_box (ch_dlg, 1, 2, 20 - single_set, 66);
     draw_box (ch_dlg, PY, PX, PERMISSIONS + 2, 33);
     draw_box (ch_dlg, FY, FX, 10, 25);
     draw_box (ch_dlg, 1, 2, 20 - single_set, 66);
     draw_box (ch_dlg, PY, PX, PERMISSIONS + 2, 33);
     draw_box (ch_dlg, FY, FX, 10, 25);
@@ -164,7 +164,7 @@ static void chmod_refresh (void)
     addstr (_("Owner name"));
     dlg_move (ch_dlg, FY + 7, FX + 2);
     addstr (_("Group name"));
     addstr (_("Owner name"));
     dlg_move (ch_dlg, FY + 7, FX + 2);
     addstr (_("Group name"));
-    
+
     attrset (title_color);
     dlg_move (ch_dlg, 1, 28);
     addstr (_(" Chmod command "));
     attrset (title_color);
     dlg_move (ch_dlg, 1, 28);
     addstr (_(" Chmod command "));
@@ -172,7 +172,7 @@ static void chmod_refresh (void)
     addstr (_(" Permission "));
     dlg_move (ch_dlg, FY, FX + 1);
     addstr (_(" File "));
     addstr (_(" Permission "));
     dlg_move (ch_dlg, FY, FX + 1);
     addstr (_(" File "));
-    
+
     attrset (selection_color);
 
     dlg_move (ch_dlg, TY, TX);
     attrset (selection_color);
 
     dlg_move (ch_dlg, TY, TX);
@@ -189,7 +189,7 @@ static void chmod_refresh (void)
 static int chmod_callback (Dlg_head *h, int Par, int Msg)
 {
     char buffer [10];
 static int chmod_callback (Dlg_head *h, int Par, int Msg)
 {
     char buffer [10];
-    
+
     switch (Msg) {
     case DLG_ACTION:
        if (Par >= BUTTONS - single_set * 2){
     switch (Msg) {
     case DLG_ACTION:
        if (Par >= BUTTONS - single_set * 2){
@@ -236,10 +236,10 @@ static void init_chmod (void)
        title_color  = SELECTED_COLOR;
        selection_color = SELECTED_COLOR;
     }
        title_color  = SELECTED_COLOR;
        selection_color = SELECTED_COLOR;
     }
-    
+
     ch_dlg = create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
                         chmod_callback, "[Chmod]", "chmod", DLG_CENTER);
     ch_dlg = create_dlg (0, 0, 22 - single_set, 70, dialog_colors,
                         chmod_callback, "[Chmod]", "chmod", DLG_CENTER);
-                        
+
     x_set_dialog_title (ch_dlg, _("Chmod command"));
 
 #define XTRACT(i) BY+chmod_but[i].y-single_set, BX+chmod_but[i].x, \
     x_set_dialog_title (ch_dlg, _("Chmod command"));
 
 #define XTRACT(i) BY+chmod_but[i].y-single_set, BX+chmod_but[i].x, \
@@ -347,7 +347,7 @@ void chmod_cmd (void)
            destroy_dlg (ch_dlg);
            break;
        }
            destroy_dlg (ch_dlg);
            break;
        }
-       
+
        c_stat = sf_stat.st_mode;
        mode_change = 0;        /* clear changes flag */
 
        c_stat = sf_stat.st_mode;
        mode_change = 0;        /* clear changes flag */
 
@@ -369,9 +369,9 @@ void chmod_cmd (void)
        statl = label_new (FY+4, FX+2, buffer, NULL);
        add_widget (ch_dlg, statl);
        tk_end_frame ();
        statl = label_new (FY+4, FX+2, buffer, NULL);
        add_widget (ch_dlg, statl);
        tk_end_frame ();
-       
+
        run_dlg (ch_dlg);       /* retrieve an action */
        run_dlg (ch_dlg);       /* retrieve an action */
-       
+
        /* do action */
        switch (ch_dlg->ret_value){
        case B_ENTER:
        /* do action */
        switch (ch_dlg->ret_value){
        case B_ENTER:
@@ -381,11 +381,11 @@ void chmod_cmd (void)
                         fname, unix_error_string (errno));
            need_update = 1;
            break;
                         fname, unix_error_string (errno));
            need_update = 1;
            break;
-           
+
        case B_CANCEL:
            end_chmod = 1;
            break;
        case B_CANCEL:
            end_chmod = 1;
            break;
-           
+
        case B_ALL:
        case B_MARKED:
            and_mask = or_mask = 0;
        case B_ALL:
        case B_MARKED:
            and_mask = or_mask = 0;
@@ -401,7 +401,7 @@ void chmod_cmd (void)
 
            apply_mask (&sf_stat);
            break;
 
            apply_mask (&sf_stat);
            break;
-           
+
        case B_SETMRK:
            and_mask = or_mask = 0;
            and_mask = ~and_mask;
        case B_SETMRK:
            and_mask = or_mask = 0;
            and_mask = ~and_mask;
index 43f8a11..399b9a1 100644 (file)
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -85,7 +85,7 @@ static struct {
     { B_SETALL, NORMAL_BUTTON,  0, 3,  N_("Set &all") },
 };
 
     { B_SETALL, NORMAL_BUTTON,  0, 3,  N_("Set &all") },
 };
 
-#define LABELS 5 
+#define LABELS 5
 static struct {
     int y, x;
     WLabel *l;
 static struct {
     int y, x;
     WLabel *l;
@@ -119,7 +119,7 @@ static void chown_refresh (void)
     addstr (N_(" Size "));
     dlg_move (ch_dlg, TY + 9, TX + 1);
     addstr (N_(" Permission "));
     addstr (N_(" Size "));
     dlg_move (ch_dlg, TY + 9, TX + 1);
     addstr (N_(" Permission "));
-    
+
     attrset (COLOR_HOT_NORMAL);
     dlg_move (ch_dlg, 1, 28);
     addstr (N_(" Chown command "));
     attrset (COLOR_HOT_NORMAL);
     dlg_move (ch_dlg, 1, 28);
     addstr (N_(" Chown command "));
@@ -165,7 +165,7 @@ static void init_chown (void)
 
     do_refresh ();
     end_chown = need_update = current_file = 0;
 
     do_refresh ();
     end_chown = need_update = current_file = 0;
-    single_set = (cpanel->marked < 2) ? 3 : 0;    
+    single_set = (cpanel->marked < 2) ? 3 : 0;
 
     ch_dlg = create_dlg (0, 0, 18, 74, dialog_colors, chown_callback,
                         "[Chown]", "chown", DLG_CENTER);
 
     ch_dlg = create_dlg (0, 0, 18, 74, dialog_colors, chown_callback,
                         "[Chown]", "chown", DLG_CENTER);
@@ -196,13 +196,13 @@ static void init_chown (void)
        listbox_add_item (l_user, 0, 0, l_pass->pw_name, NULL);
     }
     endpwent ();
        listbox_add_item (l_user, 0, 0, l_pass->pw_name, NULL);
     }
     endpwent ();
-    
+
     setgrent ();               /* get and put group names in the listbox */
     while ((l_grp = getgrent ())) {
        listbox_add_item (l_group, 0, 0, l_grp->gr_name, NULL);
     }
     endgrent ();
     setgrent ();               /* get and put group names in the listbox */
     while ((l_grp = getgrent ())) {
        listbox_add_item (l_group, 0, 0, l_grp->gr_name, NULL);
     }
     endgrent ();
-    
+
     tk_new_frame (ch_dlg, "f.");
     add_widget (ch_dlg, l_group);
     tk_new_frame (ch_dlg, "g.");
     tk_new_frame (ch_dlg, "f.");
     add_widget (ch_dlg, l_group);
     tk_new_frame (ch_dlg, "g.");
@@ -229,13 +229,13 @@ static inline void do_chown (uid_t u, gid_t g)
 static void apply_chowns (uid_t u, gid_t g)
 {
     char *fname;
 static void apply_chowns (uid_t u, gid_t g)
 {
     char *fname;
-  
+
     need_update = end_chown = 1;
     do_chown (u,g);
     need_update = end_chown = 1;
     do_chown (u,g);
-  
+
     do {
        fname = next_file ();
     do {
        fname = next_file ();
-    
+
        do_chown (u,g);
     } while (cpanel->marked);
 }
        do_chown (u,g);
     } while (cpanel->marked);
 }
@@ -271,17 +271,17 @@ void chown_cmd (void)
            fname = next_file ();               /* next marked file */
        else
            fname = selection (cpanel)->fname;          /* single file */
            fname = next_file ();               /* next marked file */
        else
            fname = selection (cpanel)->fname;          /* single file */
-       
+
        if (!stat_file (fname, &sf_stat)){      /* get status of file */
            destroy_dlg (ch_dlg);
            break;
        }
        if (!stat_file (fname, &sf_stat)){      /* get status of file */
            destroy_dlg (ch_dlg);
            break;
        }
-       
+
        /* select in listboxes */
        fe = listbox_search_text (l_user, get_owner(sf_stat.st_uid));
        if (fe)
            listbox_select_entry (l_user, fe);
        /* select in listboxes */
        fe = listbox_search_text (l_user, get_owner(sf_stat.st_uid));
        if (fe)
            listbox_select_entry (l_user, fe);
-    
+
        fe = listbox_search_text (l_group, get_group(sf_stat.st_gid));
        if (fe)
            listbox_select_entry (l_group, fe);
        fe = listbox_search_text (l_group, get_group(sf_stat.st_gid));
        if (fe)
            listbox_select_entry (l_group, fe);
@@ -294,12 +294,12 @@ void chown_cmd (void)
        chown_label (4, string_perm (sf_stat.st_mode));
 
        run_dlg (ch_dlg);
        chown_label (4, string_perm (sf_stat.st_mode));
 
        run_dlg (ch_dlg);
-    
+
        switch (ch_dlg->ret_value) {
        case B_CANCEL:
            end_chown = 1;
            break;
        switch (ch_dlg->ret_value) {
        case B_CANCEL:
            end_chown = 1;
            break;
-           
+
        case B_SETUSR:
        {
            struct passwd *user;
        case B_SETUSR:
        {
            struct passwd *user;
@@ -310,7 +310,7 @@ void chown_cmd (void)
                apply_chowns (new_user, new_group);
            }
            break;
                apply_chowns (new_user, new_group);
            }
            break;
-       }   
+       }
        case B_SETGRP:
        {
            struct group *grp;
        case B_SETGRP:
        {
            struct group *grp;
@@ -327,7 +327,7 @@ void chown_cmd (void)
        {
            struct group *grp;
            struct passwd *user;
        {
            struct group *grp;
            struct passwd *user;
-           
+
            grp = getgrnam (l_group->current->text);
            if (grp)
                new_group = grp->gr_gid;
            grp = getgrnam (l_group->current->text);
            if (grp)
                new_group = grp->gr_gid;
@@ -344,13 +344,13 @@ void chown_cmd (void)
            break;
        }
        }
            break;
        }
        }
-       
+
        if (cpanel->marked && ch_dlg->ret_value != B_CANCEL){
            do_file_mark (cpanel, current_file, 0);
            need_update = 1;
        }
        destroy_dlg (ch_dlg);
     } while (cpanel->marked && !end_chown);
        if (cpanel->marked && ch_dlg->ret_value != B_CANCEL){
            do_file_mark (cpanel, current_file, 0);
            need_update = 1;
        }
        destroy_dlg (ch_dlg);
     } while (cpanel->marked && !end_chown);
-    
+
     chown_done ();
 }
     chown_done ();
 }
index 65eb2bf..ba09f40 100644 (file)
@@ -1,14 +1,14 @@
 /* Routines invoked by a function key
    They normally operate on the current panel.
 /* Routines invoked by a function key
    They normally operate on the current panel.
-   
+
    Copyright (C) 1994, 1995 Miguel de Icaza
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1994, 1995 Miguel de Icaza
    Copyright (C) 1994, 1995 Janne Kukonlehto
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -151,7 +151,7 @@ int view_file_at_line (char *filename, int plain_view, int internal, int start_l
         int changed_hex_mode = 0;
         int changed_nroff_flag = 0;
         int changed_magic_flag = 0;
         int changed_hex_mode = 0;
         int changed_nroff_flag = 0;
         int changed_magic_flag = 0;
-    
+
         altered_hex_mode = 0;
         altered_nroff_flag = 0;
         altered_magic_flag = 0;
         altered_hex_mode = 0;
         altered_nroff_flag = 0;
         altered_magic_flag = 0;
@@ -181,14 +181,14 @@ int view_file_at_line (char *filename, int plain_view, int internal, int start_l
            sprintf (view_entry, "View:%d", start_line);
        else
            strcpy (view_entry, "View");
            sprintf (view_entry, "View:%d", start_line);
        else
            strcpy (view_entry, "View");
-       
+
        if (!regex_command (filename, view_entry, NULL, &move_dir)){
            view (0, filename, &move_dir, start_line);
            repaint_screen ();
        }
     } else {
        char *localcopy;
        if (!regex_command (filename, view_entry, NULL, &move_dir)){
            view (0, filename, &move_dir, start_line);
            repaint_screen ();
        }
     } else {
        char *localcopy;
-       
+
        if (!viewer){
            viewer = getenv ("PAGER");
            if (!viewer)
        if (!viewer){
            viewer = getenv ("PAGER");
            if (!viewer)
@@ -203,7 +203,7 @@ int view_file_at_line (char *filename, int plain_view, int internal, int start_l
            }
            execute_internal (viewer, localcopy);
            mc_ungetlocalcopy (filename, localcopy, 0);
            }
            execute_internal (viewer, localcopy);
            mc_ungetlocalcopy (filename, localcopy, 0);
-       } else 
+       } else
            execute_internal (viewer, filename);
     }
     return move_dir;
            execute_internal (viewer, filename);
     }
     return move_dir;
@@ -243,7 +243,7 @@ static void do_view_cmd (WPanel *panel, int normal)
 {
     int dir, file_idx;
     panel = get_a_panel (panel);
 {
     int dir, file_idx;
     panel = get_a_panel (panel);
-    
+
     /* Directories are viewed by changing to them */
     if (S_ISDIR (selection (panel)->buf.st_mode) ||
        link_isdir (selection (panel))){
     /* Directories are viewed by changing to them */
     if (S_ISDIR (selection (panel)->buf.st_mode) ||
        link_isdir (selection (panel))){
@@ -255,7 +255,7 @@ static void do_view_cmd (WPanel *panel, int normal)
        }
        do_cd (selection (panel)->fname, cd_exact);
        return;
        }
        do_cd (selection (panel)->fname, cd_exact);
        return;
-       
+
     }
 
     file_idx = panel->selected;
     }
 
     file_idx = panel->selected;
@@ -369,10 +369,10 @@ void copymove_cmd_with_default (int copy, char *thedefault)
 void mkdir_cmd (WPanel *panel)
 {
     char *dir;
 void mkdir_cmd (WPanel *panel)
 {
     char *dir;
-    
+
     panel = get_a_panel (panel);
     dir = input_expand_dialog (_(" Mkdir "), _(" Enter directory name:") , "");
     panel = get_a_panel (panel);
     dir = input_expand_dialog (_(" Mkdir "), _(" Enter directory name:") , "");
-    
+
     if (!dir)
        return;
 
     if (!dir)
        return;
 
@@ -423,9 +423,9 @@ void set_panel_filter (WPanel *p)
 {
     char *reg_exp;
     char *x;
 {
     char *reg_exp;
     char *x;
-    
+
     x = p->filter ? p->filter : easy_patterns ? "*" : ".";
     x = p->filter ? p->filter : easy_patterns ? "*" : ".";
-       
+
     reg_exp = input_dialog (_(" Filter "), _(" Set expression for filtering filenames"), x);
     if (!reg_exp)
        return;
     reg_exp = input_dialog (_(" Filter "), _(" Set expression for filtering filenames"), x);
     if (!reg_exp)
        return;
@@ -454,7 +454,7 @@ void reread_cmd (void)
        flag = strcmp (cpanel->cwd, opanel->cwd) ? UP_ONLY_CURRENT : 0;
     else
        flag = UP_ONLY_CURRENT;
        flag = strcmp (cpanel->cwd, opanel->cwd) ? UP_ONLY_CURRENT : 0;
     else
        flag = UP_ONLY_CURRENT;
-       
+
     update_panels (UP_RELOAD|flag, UP_KEEPSEL);
     repaint_screen ();
 }
     update_panels (UP_RELOAD|flag, UP_KEEPSEL);
     repaint_screen ();
 }
@@ -513,7 +513,7 @@ void select_cmd_panel (WPanel *panel)
     reg_exp = input_dialog (_(" Select "), "", easy_patterns ? "*" : ".");
     if (!reg_exp)
        return;
     reg_exp = input_dialog (_(" Select "), "", easy_patterns ? "*" : ".");
     if (!reg_exp)
        return;
-    
+
     reg_exp_t = reg_exp;
 
     /* Check if they specified a directory */
     reg_exp_t = reg_exp;
 
     /* Check if they specified a directory */
@@ -565,9 +565,9 @@ void unselect_cmd_panel (WPanel *panel)
     reg_exp = input_dialog (_(" Unselect "),"", easy_patterns ? "*" : ".");
     if (!reg_exp)
        return;
     reg_exp = input_dialog (_(" Unselect "),"", easy_patterns ? "*" : ".");
     if (!reg_exp)
        return;
-    
+
     reg_exp_t = reg_exp;
     reg_exp_t = reg_exp;
-    
+
     /* Check if they specified directory matching */
     if (*reg_exp_t == PATH_SEP){
         dirflag = 1;
     /* Check if they specified directory matching */
     if (*reg_exp_t == PATH_SEP){
         dirflag = 1;
@@ -578,7 +578,7 @@ void unselect_cmd_panel (WPanel *panel)
         reg_exp_t [strlen(reg_exp_t) - 1] = 0;
     }
     for (i = 0; i < panel->count; i++){
         reg_exp_t [strlen(reg_exp_t) - 1] = 0;
     }
     for (i = 0; i < panel->count; i++){
-        if (!strcmp (panel->dir.list [i].fname, "..")) 
+        if (!strcmp (panel->dir.list [i].fname, ".."))
             continue;
        if (S_ISDIR (panel->dir.list [i].buf.st_mode)){
            if (!dirflag)
             continue;
        if (S_ISDIR (panel->dir.list [i].buf.st_mode)){
            if (!dirflag)
@@ -654,10 +654,10 @@ void menu_edit_cmd (void)
     char *buffer;
     char *menufile;
     int dir = 0;
     char *buffer;
     char *menufile;
     int dir = 0;
-    
+
     dir = query_dialog (
        _("Menu file edit"),
     dir = query_dialog (
        _("Menu file edit"),
-       _(" Which menu file will you edit? "), 
+       _(" Which menu file will you edit? "),
        0, geteuid() ? 2 : 3,
        _("&Local"), _("&Home"), _("&System Wide")
     );
        0, geteuid() ? 2 : 3,
        _("&Local"), _("&Home"), _("&System Wide")
     );
@@ -674,7 +674,7 @@ void menu_edit_cmd (void)
            buffer = concat_dir_and_file (home_dir, MC_HOME_MENU);
            check_for_default (menufile, buffer);
            break;
            buffer = concat_dir_and_file (home_dir, MC_HOME_MENU);
            check_for_default (menufile, buffer);
            break;
-       
+
        case 2:
            buffer = concat_dir_and_file (mc_home, MC_GLOBAL_MENU);
            break;
        case 2:
            buffer = concat_dir_and_file (mc_home, MC_GLOBAL_MENU);
            break;
@@ -771,12 +771,12 @@ compare_dir (WPanel *panel, WPanel *other, enum CompareMode mode)
     char *src_name, *dst_name;
 
     panel = get_a_panel (panel);
     char *src_name, *dst_name;
 
     panel = get_a_panel (panel);
-    
+
     /* No marks by default */
     panel->marked = 0;
     panel->total = 0;
     panel->dirs_marked = 0;
     /* No marks by default */
     panel->marked = 0;
     panel->total = 0;
     panel->dirs_marked = 0;
-    
+
     /* Handle all files in the panel */
     for (i = 0; i < panel->count; i++){
        file_entry *source = &panel->dir.list[i];
     /* Handle all files in the panel */
     for (i = 0; i < panel->count; i++){
        file_entry *source = &panel->dir.list[i];
@@ -806,16 +806,16 @@ compare_dir (WPanel *panel, WPanel *other, enum CompareMode mode)
                if (source->buf.st_mtime < target->buf.st_mtime)
                    continue;
            }
                if (source->buf.st_mtime < target->buf.st_mtime)
                    continue;
            }
-           
+
            /* Newer version with different size is marked */
            if (source->buf.st_size != target->buf.st_size){
                do_file_mark (panel, i, 1);
                continue;
            /* Newer version with different size is marked */
            if (source->buf.st_size != target->buf.st_size){
                do_file_mark (panel, i, 1);
                continue;
-               
+
            }
            if (mode == compare_size_only)
                continue;
            }
            if (mode == compare_size_only)
                continue;
-           
+
            if (mode == compare_quick){
                /* Thorough compare off, compare only time stamps */
                /* Mark newer version, don't mark version with the same date */
            if (mode == compare_quick){
                /* Thorough compare off, compare only time stamps */
                /* Mark newer version, don't mark version with the same date */
@@ -963,12 +963,12 @@ view_other_cmd (void)
 
        reset_prog_mode ();
        keypad(stdscr, TRUE);
 
        reset_prog_mode ();
        keypad(stdscr, TRUE);
-#ifndef HAVE_X 
+#ifndef HAVE_X
        if (use_mouse_p)
            init_mouse ();
         if (alternate_plus_minus)
             application_keypad_mode ();
        if (use_mouse_p)
            init_mouse ();
         if (alternate_plus_minus)
             application_keypad_mode ();
-#endif     
+#endif
 
 #ifdef HAVE_SUBSHELL_SUPPORT
        if (use_subshell){
 
 #ifdef HAVE_SUBSHELL_SUPPORT
        if (use_subshell){
@@ -1008,9 +1008,9 @@ do_link (int symbolic_link, char *fname)
        if (!S_ISREG (s.st_mode))
            return;
     }
        if (!S_ISREG (s.st_mode))
            return;
     }
-    
+
     if (!symbolic_link){
     if (!symbolic_link){
-        src = copy_strings (_(" Link "), name_trunc (fname, 46), 
+        src = copy_strings (_(" Link "), name_trunc (fname, 46),
             _(" to:"), NULL);
        dest = input_expand_dialog (_(" Link "), src, "");
        free (src);
             _(" to:"), NULL);
        dest = input_expand_dialog (_(" Link "), src, "");
        free (src);
@@ -1030,7 +1030,7 @@ do_link (int symbolic_link, char *fname)
        /* suggest the full path for symlink */
         char s[MC_MAXPATHLEN];
         char d[MC_MAXPATHLEN];
        /* suggest the full path for symlink */
         char s[MC_MAXPATHLEN];
         char d[MC_MAXPATHLEN];
-       
+
         strcpy(s, cpanel->cwd);
         if ( ! ((s[0] == '/') && (s[1] == 0)))
             strcat(s, "/");
         strcpy(s, cpanel->cwd);
         if ( ! ((s[0] == '/') && (s[1] == 0)))
             strcat(s, "/");
@@ -1039,7 +1039,7 @@ do_link (int symbolic_link, char *fname)
            strcpy(d, opanel->cwd);
        else
            strcpy (d,"");
            strcpy(d, opanel->cwd);
        else
            strcpy (d,"");
-       
+
         if ( ! ((d[0] == '/') && (d[1] == 0)))
             strcat(d, "/");
         symlink_dialog (s, d, &dest, &src);
         if ( ! ((d[0] == '/') && (d[1] == 0)))
             strcat(d, "/");
         symlink_dialog (s, d, &dest, &src);
@@ -1082,7 +1082,7 @@ void edit_symlink_cmd (void)
        char buffer [MC_MAXPATHLEN], *p = selection (cpanel)->fname;
        int i;
        char *dest, *q = copy_strings (_(" Symlink "), name_trunc (p, 32), _(" points to:"), NULL);
        char buffer [MC_MAXPATHLEN], *p = selection (cpanel)->fname;
        int i;
        char *dest, *q = copy_strings (_(" Symlink "), name_trunc (p, 32), _(" points to:"), NULL);
-       
+
        i = readlink (p, buffer, MC_MAXPATHLEN);
        if (i > 0) {
            buffer [i] = 0;
        i = readlink (p, buffer, MC_MAXPATHLEN);
        if (i > 0) {
            buffer [i] = 0;
@@ -1115,7 +1115,7 @@ void other_symlink_cmd (void)
         return;
     p = concat_dir_and_file (cpanel->cwd, selection (cpanel)->fname);
     r = concat_dir_and_file (opanel->cwd, selection (cpanel)->fname);
         return;
     p = concat_dir_and_file (cpanel->cwd, selection (cpanel)->fname);
     r = concat_dir_and_file (opanel->cwd, selection (cpanel)->fname);
-    
+
     q = copy_strings (_(" Link symbolically "), name_trunc (p, 32), _(" to:"), NULL);
     dest = input_expand_dialog (_(" Relative symlink "), q, r);
     if (dest) {
     q = copy_strings (_(" Link symbolically "), name_trunc (p, 32), _(" to:"), NULL);
     dest = input_expand_dialog (_(" Relative symlink "), q, r);
     if (dest) {
@@ -1173,7 +1173,7 @@ char *get_random_hint (void)
     char *hintfile;
     int  len;
     int start;
     char *hintfile;
     int  len;
     int start;
-    
+
     /* Do not change hints more often than one minute */
 
 #ifdef SCO_FLAVOR
     /* Do not change hints more often than one minute */
 
 #ifdef SCO_FLAVOR
@@ -1187,10 +1187,10 @@ char *get_random_hint (void)
 #else
     static int last_sec;
     static struct timeval tv;
 #else
     static int last_sec;
     static struct timeval tv;
-    
+
     gettimeofday (&tv, NULL);
     if (!(tv.tv_sec> last_sec+60))
     gettimeofday (&tv, NULL);
     if (!(tv.tv_sec> last_sec+60))
-       return strdup (""); 
+       return strdup ("");
     last_sec = tv.tv_sec;
 #endif
 
     last_sec = tv.tv_sec;
 #endif
 
@@ -1208,7 +1208,7 @@ char *get_random_hint (void)
     /* get a random entry */
     len = strlen (data);
     start = rand () % len;
     /* get a random entry */
     len = strlen (data);
     start = rand () % len;
-    
+
     for (;start; start--){
        if (data [start] == '\n'){
            start++;
     for (;start; start--){
        if (data [start] == '\n'){
            start++;
@@ -1249,9 +1249,9 @@ static void nice_cd (char *text, char *xtext, char *help, char *prefix, int to_h
 
     if (strncmp (prefix, machine, strlen (prefix)) == 0)
        cd_path = copy_strings (machine, to_home ? "/~/" : NULL, NULL);
 
     if (strncmp (prefix, machine, strlen (prefix)) == 0)
        cd_path = copy_strings (machine, to_home ? "/~/" : NULL, NULL);
-    else 
+    else
        cd_path = copy_strings (prefix, machine, to_home ? "/~/" : NULL, NULL);
        cd_path = copy_strings (prefix, machine, to_home ? "/~/" : NULL, NULL);
-    
+
     if (do_panel_cd (MENU_PANEL, cd_path, 0))
        directory_history_add (MENU_PANEL, (MENU_PANEL)->cwd);
     else
     if (do_panel_cd (MENU_PANEL, cd_path, 0))
        directory_history_add (MENU_PANEL, (MENU_PANEL)->cwd);
     else
@@ -1277,7 +1277,7 @@ void source_routing (void)
 {
     char *source;
     struct hostent *hp;
 {
     char *source;
     struct hostent *hp;
-    
+
     source = input_dialog (_(" Socket source routing setup "),
                           _(" Enter host name to use as a source routing hop: ")n,
                           "");
     source = input_dialog (_(" Socket source routing setup "),
                           _(" Enter host name to use as a source routing hop: ")n,
                           "");
@@ -1310,7 +1310,7 @@ void quick_cd_cmd (void)
 
     if (p && *p) {
         char *q = copy_strings ("cd ", p, NULL);
 
     if (p && *p) {
         char *q = copy_strings ("cd ", p, NULL);
-        
+
         do_cd_command (q);
         free (q);
     }
         do_cd_command (q);
         free (q);
     }
@@ -1350,7 +1350,7 @@ void dirsizes_cmd (void)
     strcpy (cmd, dirsizes_command);
     p = strchr (cmd, 0);
     for (i = 0; i < panel->count; i++)
     strcpy (cmd, dirsizes_command);
     p = strchr (cmd, 0);
     for (i = 0; i < panel->count; i++)
-        if (S_ISDIR (panel->dir.list [i].buf.st_mode) && 
+        if (S_ISDIR (panel->dir.list [i].buf.st_mode) &&
             strcmp (panel->dir.list [i].fname, "..")) {
             strcpy (p, panel->dir.list [i].fname);
             p = strchr (p, 0);
             strcmp (panel->dir.list [i].fname, "..")) {
             strcpy (p, panel->dir.list [i].fname);
             p = strchr (p, 0);
@@ -1361,8 +1361,8 @@ void dirsizes_cmd (void)
     f = popen (cmd, "r");
     free (cmd);
     if (f != NULL) {
     f = popen (cmd, "r");
     free (cmd);
     if (f != NULL) {
-        /* Assume that du will display the directories in the order 
-         * I've passed to it :( 
+        /* Assume that du will display the directories in the order
+         * I've passed to it :(
          */
         i = 0;
         p = xmalloc (1024, "dirsizes_cmd");
          */
         i = 0;
         p = xmalloc (1024, "dirsizes_cmd");
@@ -1379,8 +1379,8 @@ void dirsizes_cmd (void)
                     if (!strncmp (q, panel->dir.list [i].fname,
                         r - q)) {
                         if (panel->dir.list [i].f.marked)
                     if (!strncmp (q, panel->dir.list [i].fname,
                         r - q)) {
                         if (panel->dir.list [i].f.marked)
-                            panel->total += j - 
-                           ((panel->has_dir_sizes) ? panel->dir.list [i].buf.st_size : 0); 
+                            panel->total += j -
+                           ((panel->has_dir_sizes) ? panel->dir.list [i].buf.st_size : 0);
                         panel->dir.list [i].buf.st_size = j;
                         break;
                     }
                         panel->dir.list [i].buf.st_size = j;
                         break;
                     }
@@ -1393,7 +1393,7 @@ void dirsizes_cmd (void)
            message (0, _("Show directory sizes"), _("Pipe close failed"));
        else
 #else /* SCO_FLAVOR */
            message (0, _("Show directory sizes"), _("Pipe close failed"));
        else
 #else /* SCO_FLAVOR */
-       /* 
+       /*
        **      SCO reports about error while all seems to be ok. Just ignore it...
        **      (alex@bcs.zaporizhzhe.ua)
        */
        **      SCO reports about error while all seems to be ok. Just ignore it...
        **      (alex@bcs.zaporizhzhe.ua)
        */
@@ -1411,11 +1411,11 @@ void
 save_setup_cmd (void)
 {
     char *str;
 save_setup_cmd (void)
 {
     char *str;
-    
+
     save_setup ();
     sync_profiles ();
     str = copy_strings ( _(" Setup saved to ~/"), PROFILE_NAME, NULL);
     save_setup ();
     sync_profiles ();
     str = copy_strings ( _(" Setup saved to ~/"), PROFILE_NAME, NULL);
-    
+
 #ifdef HAVE_GNOME
     set_hintbar (str);
 #else
 #ifdef HAVE_GNOME
     set_hintbar (str);
 #else
@@ -1428,25 +1428,25 @@ void
 configure_panel_listing (WPanel *p, int view_type, int use_msformat, char *user, char *status)
 {
     int err;
 configure_panel_listing (WPanel *p, int view_type, int use_msformat, char *user, char *status)
 {
     int err;
-    
-    p->user_mini_status = use_msformat; 
+
+    p->user_mini_status = use_msformat;
     p->list_type = view_type;
     p->list_type = view_type;
-    
+
     if (view_type == list_user || use_msformat){
        free (p->user_format);
        p->user_format = user;
     if (view_type == list_user || use_msformat){
        free (p->user_format);
        p->user_format = user;
-    
+
        free (p->user_status_format [view_type]);
        p->user_status_format [view_type] = status;
        free (p->user_status_format [view_type]);
        p->user_status_format [view_type] = status;
-    
+
        err = set_panel_formats (p);
        err = set_panel_formats (p);
-       
+
        if (err){
            if (err & 0x01){
                free (p->user_format);
                p->user_format  = strdup (DEFAULT_USER_FORMAT);
            }
        if (err){
            if (err & 0x01){
                free (p->user_format);
                p->user_format  = strdup (DEFAULT_USER_FORMAT);
            }
-               
+
            if (err & 0x02){
                free (p->user_status_format [view_type]);
                p->user_status_format [view_type]  = strdup (DEFAULT_USER_FORMAT);
            if (err & 0x02){
                free (p->user_status_format [view_type]);
                p->user_status_format [view_type]  = strdup (DEFAULT_USER_FORMAT);
@@ -1460,7 +1460,7 @@ configure_panel_listing (WPanel *p, int view_type, int use_msformat, char *user,
 
     set_panel_formats (p);
     paint_panel (p);
 
     set_panel_formats (p);
     paint_panel (p);
-    
+
     do_refresh ();
 }
 
     do_refresh ();
 }
 
@@ -1541,7 +1541,7 @@ set_basic_panel_listing_to (int panel_index, int listing_mode)
     p->list_type = listing_mode;
     if (set_panel_formats (p))
        return 0;
     p->list_type = listing_mode;
     if (set_panel_formats (p))
        return 0;
-       
+
     paint_panel (p);
     do_refresh ();
     return 1;
     paint_panel (p);
     do_refresh ();
     return 1;
@@ -1554,7 +1554,7 @@ toggle_listing_cmd (void)
     WPanel *p = (WPanel *) get_panel_widget (current);
     int list_mode = p->list_type;
     int m;
     WPanel *p = (WPanel *) get_panel_widget (current);
     int list_mode = p->list_type;
     int m;
-    
+
     switch (list_mode){
     case list_full:
     case list_brief:
     switch (list_mode){
     case list_full:
     case list_brief:
index 80eaebe..5913d8d 100644 (file)
@@ -5,7 +5,7 @@ void ftplink_cmd (void);
 void undelete_cmd (void);
 void help_cmd (void);
 void dirsizes_cmd (void);
 void undelete_cmd (void);
 void help_cmd (void);
 void dirsizes_cmd (void);
-int view_file_at_line (char *filename, int plain_view, int internal, 
+int view_file_at_line (char *filename, int plain_view, int internal,
                        int start_line);
 int view_file (char *filename, int normal, int internal);
 void view_cmd (WPanel *panel);
                        int start_line);
 int view_file (char *filename, int normal, int internal);
 void view_cmd (WPanel *panel);
index 0bf2e37..ba122b0 100644 (file)
@@ -1,11 +1,11 @@
 /* Color setup
    Copyright (C) 1994 Miguel de Icaza.
 /* Color setup
    Copyright (C) 1994 Miguel de Icaza.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -25,7 +25,7 @@
 #include "color.h"
 #include "x.h"
 
 #include "color.h"
 #include "x.h"
 
-/* "$Id: color.c,v 1.1 2001/12/30 09:55:26 sedwards Exp $" */
+/* "$Id$" */
 
 /* To avoid excessive calls to ncurses' has_colors () */
 int   hascolors = 0;
 
 /* To avoid excessive calls to ncurses' has_colors () */
 int   hascolors = 0;
@@ -80,21 +80,21 @@ struct colorpair color_map [] = {
     { "dfocus=",     0, 0 },   /* Dialog focused */
     { "dhotnormal=", 0, 0 },   /* Dialog normal/hot */
     { "dhotfocus=",  0, 0 },   /* Dialog focused/hot */
     { "dfocus=",     0, 0 },   /* Dialog focused */
     { "dhotnormal=", 0, 0 },   /* Dialog normal/hot */
     { "dhotfocus=",  0, 0 },   /* Dialog focused/hot */
-    
+
     { "viewunderline=", 0, 0 },        /* _\b? sequence in view */
     { "menusel=",    0, 0 },   /* Menu selected color */
     { "menuhot=",    0, 0 },    /* Color for menu hotkeys */
     { "menuhotsel=", 0, 0 },    /* Menu hotkeys/selected entry */
     { "viewunderline=", 0, 0 },        /* _\b? sequence in view */
     { "menusel=",    0, 0 },   /* Menu selected color */
     { "menuhot=",    0, 0 },    /* Color for menu hotkeys */
     { "menuhotsel=", 0, 0 },    /* Menu hotkeys/selected entry */
-    
+
     { "helpnormal=", 0, 0 },    /* Help normal */
     { "helpitalic=", 0, 0 },    /* Italic in help */
     { "helpbold=",   0, 0 },    /* Bold in help */
     { "helplink=",   0, 0 },    /* Not selected hyperlink */
     { "helpslink=",  0, 0 },    /* Selected hyperlink */
     { "helpnormal=", 0, 0 },    /* Help normal */
     { "helpitalic=", 0, 0 },    /* Italic in help */
     { "helpbold=",   0, 0 },    /* Bold in help */
     { "helplink=",   0, 0 },    /* Not selected hyperlink */
     { "helpslink=",  0, 0 },    /* Selected hyperlink */
-    
+
     { "gauge=",      0, 0 },    /* Color of the progress bar (percentage) */
     { "input=",      0, 0 },
     { "gauge=",      0, 0 },    /* Color of the progress bar (percentage) */
     { "input=",      0, 0 },
+
     /* Per file types colors */
     { "directory=",  0, 0 },
     { "execute=",    0, 0 },
     /* Per file types colors */
     { "directory=",  0, 0 },
     { "execute=",    0, 0 },
@@ -143,7 +143,7 @@ void get_color (char *cpp, CTYPE *colp);
 static void get_color (char *cpp, CTYPE *colp)
 {
     int i;
 static void get_color (char *cpp, CTYPE *colp)
 {
     int i;
-    
+
     for (i = 0; i < ELEMENTS(color_table); i++){
        if (strcmp (cpp, color_name (i)) == 0){
            *colp = color_value (i);
     for (i = 0; i < ELEMENTS(color_table); i++){
        if (strcmp (cpp, color_name (i)) == 0){
            *colp = color_value (i);
@@ -159,7 +159,7 @@ static void get_two_colors (char **cpp, struct colorpair *colorpairp)
     int state;
 
     state = 0;
     int state;
 
     state = 0;
-    
+
     for (; *p; p++){
        if (*p == ':'){
            *p = 0;
     for (; *p; p++){
        if (*p == ':'){
            *p = 0;
@@ -219,7 +219,7 @@ static void configure_colors (void)
 #ifndef HAVE_TK
 #ifndef HAVE_XVIEW
     extern char *default_edition_colors;
 #ifndef HAVE_TK
 #ifndef HAVE_XVIEW
     extern char *default_edition_colors;
-    
+
     configure_colors_string (default_edition_colors);
 #endif
 #endif
     configure_colors_string (default_edition_colors);
 #endif
 #endif
@@ -248,7 +248,7 @@ void
 init_colors (void)
 {
        int i;
 init_colors (void)
 {
        int i;
-       
+
        use_colors = 1;
        start_color ();
        configure_colors ();
        use_colors = 1;
        start_color ();
        configure_colors ();
@@ -260,7 +260,7 @@ init_colors (void)
 void init_colors (void)
 {
     int i;
 void init_colors (void)
 {
     int i;
-    
+
     hascolors = has_colors ();
 
     if (!disable_colors && hascolors){
     hascolors = has_colors ();
 
     if (!disable_colors && hascolors){
@@ -284,14 +284,14 @@ void init_colors (void)
        if (use_colors) { /* Hack to make COLOR_PAIR(31) be the default fg/bg
                             of the terminal */
            char *Norm_Vid = SLtt_tgetstr ("me");
        if (use_colors) { /* Hack to make COLOR_PAIR(31) be the default fg/bg
                             of the terminal */
            char *Norm_Vid = SLtt_tgetstr ("me");
-           
+
            if (Norm_Vid == NULL)
                Norm_Vid = SLtt_tgetstr ("se");
            if (Norm_Vid == NULL)
                Norm_Vid = "\033[0m";
            SLtt_set_color_esc (31, Norm_Vid);
        }
            if (Norm_Vid == NULL)
                Norm_Vid = SLtt_tgetstr ("se");
            if (Norm_Vid == NULL)
                Norm_Vid = "\033[0m";
            SLtt_set_color_esc (31, Norm_Vid);
        }
-#endif 
+#endif
 
        for (i = 0; i < ELEMENTS (color_map); i++){
            init_pair (i+1, color_map_fg(i), color_map_bg(i));
 
        for (i = 0; i < ELEMENTS (color_map); i++){
            init_pair (i+1, color_map_fg(i), color_map_bg(i));
index 808b2a5..afc39b4 100644 (file)
@@ -57,18 +57,18 @@ extern int attr_pairs [];
 #define HELP_BOLD_COLOR    (PORT_COLOR (MY_COLOR_PAIR(18),A_REVERSE))
 #define HELP_LINK_COLOR    (PORT_COLOR (MY_COLOR_PAIR(19),0))
 #define HELP_SLINK_COLOR   (PORT_COLOR (MY_COLOR_PAIR(20),A_BOLD))
 #define HELP_BOLD_COLOR    (PORT_COLOR (MY_COLOR_PAIR(18),A_REVERSE))
 #define HELP_LINK_COLOR    (PORT_COLOR (MY_COLOR_PAIR(19),0))
 #define HELP_SLINK_COLOR   (PORT_COLOR (MY_COLOR_PAIR(20),A_BOLD))
-                          
+
 extern int sel_mark_color  [4];
 extern int dialog_colors   [4];
 extern int sel_mark_color  [4];
 extern int dialog_colors   [4];
-                          
+
 #define COLOR_NORMAL       (PORT_COLOR (MY_COLOR_PAIR (8),A_REVERSE))
 #define COLOR_FOCUS        (PORT_COLOR (MY_COLOR_PAIR (9),A_BOLD))
 #define COLOR_HOT_NORMAL   (PORT_COLOR (MY_COLOR_PAIR (10),0))
 #define COLOR_HOT_FOCUS    (PORT_COLOR (MY_COLOR_PAIR (11),0))
 #define COLOR_NORMAL       (PORT_COLOR (MY_COLOR_PAIR (8),A_REVERSE))
 #define COLOR_FOCUS        (PORT_COLOR (MY_COLOR_PAIR (9),A_BOLD))
 #define COLOR_HOT_NORMAL   (PORT_COLOR (MY_COLOR_PAIR (10),0))
 #define COLOR_HOT_FOCUS    (PORT_COLOR (MY_COLOR_PAIR (11),0))
-                          
+
 /* Add this to color panel, on BW all pairs are normal */
 #define STALLED_COLOR      (PORT_COLOR (MY_COLOR_PAIR (12),0))
 /* Add this to color panel, on BW all pairs are normal */
 #define STALLED_COLOR      (PORT_COLOR (MY_COLOR_PAIR (12),0))
-                          
+
 #define DIRECTORY_COLOR    (PORT_COLOR (MY_COLOR_PAIR (23),0))
 #define EXECUTABLE_COLOR   (PORT_COLOR (MY_COLOR_PAIR (24),0))
 #define LINK_COLOR         (PORT_COLOR (MY_COLOR_PAIR (25),0))
 #define DIRECTORY_COLOR    (PORT_COLOR (MY_COLOR_PAIR (23),0))
 #define EXECUTABLE_COLOR   (PORT_COLOR (MY_COLOR_PAIR (24),0))
 #define LINK_COLOR         (PORT_COLOR (MY_COLOR_PAIR (25),0))
index 2fee81b..5370f60 100644 (file)
@@ -55,7 +55,7 @@ ${var:-value}, etc. Use the eval cd 'path' command instead.
 Bugs: No quoting occurrs here, so ${VAR} and $VAR will be always
 substituted. I think we can encourage users to use in such extreme
 cases instead of >cd path< command a >eval cd 'path'< command, which works
 Bugs: No quoting occurrs here, so ${VAR} and $VAR will be always
 substituted. I think we can encourage users to use in such extreme
 cases instead of >cd path< command a >eval cd 'path'< command, which works
-as they might expect :) 
+as they might expect :)
 FIXME: Perhaps we should do wildcard matching as well? */
 static int examine_cd (char *path)
 {
 FIXME: Perhaps we should do wildcard matching as well? */
 static int examine_cd (char *path)
 {
@@ -99,7 +99,7 @@ static int examine_cd (char *path)
         }
     }
     *r = 0;
         }
     }
     *r = 0;
-    
+
     result = do_cd (q, cd_parse_command);
 
     /* CDPATH handling */
     result = do_cd (q, cd_parse_command);
 
     /* CDPATH handling */
@@ -143,7 +143,7 @@ void do_cd_command (char *cmd)
        cmd [len] = 0;
        len --;
     }
        cmd [len] = 0;
        len --;
     }
-    
+
     if (cmd [2] == 0)
        cmd = "cd ";
 
     if (cmd [2] == 0)
        cmd = "cd ";
 
@@ -180,7 +180,7 @@ void do_cd_command (char *cmd)
 static int enter (WCommand *cmdline)
 {
     Dlg_head *old_dlg;
 static int enter (WCommand *cmdline)
 {
     Dlg_head *old_dlg;
-    
+
     if (command_prompt && strlen (input_w (cmdline)->buffer)){
        char *cmd;
 
     if (command_prompt && strlen (input_w (cmdline)->buffer)){
        char *cmd;
 
@@ -203,7 +203,7 @@ static int enter (WCommand *cmdline)
            new_input (input_w (cmdline));
            return MSG_HANDLED;
        }
            new_input (input_w (cmdline));
            return MSG_HANDLED;
        }
-#endif 
+#endif
        else {
            char *command, *s;
            int i, j;
        else {
            char *command, *s;
            int i, j;
@@ -232,7 +232,7 @@ static int enter (WCommand *cmdline)
            new_input (input_w (cmdline));
            execute (command);
            free (command);
            new_input (input_w (cmdline));
            execute (command);
            free (command);
-           
+
 #ifdef HAVE_SUBSHELL_SUPPORT
            if (quit & SUBSHELL_EXIT){
                quiet_quit_cmd ();
 #ifdef HAVE_SUBSHELL_SUPPORT
            if (quit & SUBSHELL_EXIT){
                quiet_quit_cmd ();
@@ -277,7 +277,7 @@ WCommand *command_new (int y, int x, int cols)
     cmd->old_callback = (callback_fn) cmd->input.widget.callback;
     cmd->input.widget.callback = (int (*) (Dlg_head *, void *, int, int))
                        command_callback;
     cmd->old_callback = (callback_fn) cmd->input.widget.callback;
     cmd->input.widget.callback = (int (*) (Dlg_head *, void *, int, int))
                        command_callback;
-    
+
     cmd->input.completion_flags |= INPUT_COMPLETE_COMMANDS;
     return cmd;
 }
     cmd->input.completion_flags |= INPUT_COMPLETE_COMMANDS;
     return cmd;
 }
index c52e52a..7d21e75 100644 (file)
@@ -1,15 +1,15 @@
 /* Input line filename/username/hostname/variable/command completion.
    (Let mc type for you...)
 /* Input line filename/username/hostname/variable/command completion.
    (Let mc type for you...)
-   
+
    Copyright (C) 1995 The Free Software Foundation
    Copyright (C) 1995 The Free Software Foundation
-   
+
    Written by: 1995 Jakub Jelinek
    Written by: 1995 Jakub Jelinek
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -96,7 +96,7 @@ char *filename_completion_function (char *text, int state)
 
         if (dirname)
             free (dirname);
 
         if (dirname)
             free (dirname);
-        if (filename) 
+        if (filename)
             free (filename);
         if (users_dirname)
             free (users_dirname);
             free (filename);
         if (users_dirname)
             free (users_dirname);
@@ -161,7 +161,7 @@ char *filename_completion_function (char *text, int state)
        {
            char *tmp = xmalloc (3 + strlen (dirname) + NLENGTH (entry), "Filename completion");
            struct stat tempstat;
        {
            char *tmp = xmalloc (3 + strlen (dirname) + NLENGTH (entry), "Filename completion");
            struct stat tempstat;
-           
+
            strcpy (tmp, dirname);
            strcat (tmp, PATH_SEP_STR);
            strcat (tmp, entry->d_name);
            strcpy (tmp, dirname);
            strcat (tmp, PATH_SEP_STR);
            strcat (tmp, entry->d_name);
@@ -170,7 +170,7 @@ char *filename_completion_function (char *text, int state)
            if (!stat (tmp, &tempstat)){
                uid_t my_uid = getuid ();
                gid_t my_gid = getgid ();
            if (!stat (tmp, &tempstat)){
                uid_t my_uid = getuid ();
                gid_t my_gid = getgid ();
-               
+
                if (!S_ISDIR (tempstat.st_mode)){
                    isdir = 0;
                    if ((!my_uid && (tempstat.st_mode & 0111)) ||
                if (!S_ISDIR (tempstat.st_mode)){
                    isdir = 0;
                    if ((!my_uid && (tempstat.st_mode & 0111)) ||
@@ -268,7 +268,7 @@ char *username_completion_function (char *text, int state)
         return NULL;
     } else {
         char *temp = xmalloc (3 + strlen (entry->pw_name), "Username completion");
         return NULL;
     } else {
         char *temp = xmalloc (3 + strlen (entry->pw_name), "Username completion");
-        
+
         *temp = '~';
         strcpy (temp + 1, entry->pw_name);
         strcat (temp, PATH_SEP_STR);
         *temp = '~';
         strcpy (temp + 1, entry->pw_name);
         strcat (temp, PATH_SEP_STR);
@@ -374,10 +374,10 @@ static void fetch_hosts (char *filename)
            name [i - start] = 0;
            {
                char **host_p;
            name [i - start] = 0;
            {
                char **host_p;
-               
+
                if (hosts_p - hosts >= hosts_alloclen){
                    int j = hosts_p - hosts;
                if (hosts_p - hosts >= hosts_alloclen){
                    int j = hosts_p - hosts;
-               
+
                    hosts = realloc ((void *)hosts, ((hosts_alloclen += 30) + 1) * sizeof (char *));
                    hosts_p = hosts + j;
                }
                    hosts = realloc ((void *)hosts, ((hosts_alloclen += 30) + 1) * sizeof (char *));
                    hosts_p = hosts + j;
                }
@@ -402,7 +402,7 @@ char *hostname_completion_function (char *text, int state)
 
     if (!state){ /* Initialization stuff */
         char *p;
 
     if (!state){ /* Initialization stuff */
         char *p;
-        
+
        if (hosts != NULL){
            for (host_p = hosts; *host_p; host_p++)
                free (*host_p);
        if (hosts != NULL){
            for (host_p = hosts; *host_p; host_p++)
                free (*host_p);
@@ -416,7 +416,7 @@ char *hostname_completion_function (char *text, int state)
        textstart = (*text == '@') ? 1 : 0;
        textlen = strlen (text + textstart);
     }
        textstart = (*text == '@') ? 1 : 0;
        textlen = strlen (text + textstart);
     }
-    
+
     while (*host_p){
        if (!textlen)
            break; /* Match all of them */
     while (*host_p){
        if (!textlen)
            break; /* Match all of them */
@@ -424,7 +424,7 @@ char *hostname_completion_function (char *text, int state)
            break;
        host_p++;
     }
            break;
        host_p++;
     }
-    
+
     if (!*host_p){
        for (host_p = hosts; *host_p; host_p++)
            free (*host_p);
     if (!*host_p){
        for (host_p = hosts; *host_p; host_p++)
            free (*host_p);
@@ -460,13 +460,13 @@ char *command_completion_function (char *text, int state)
                                       "case", "esac", "for", "select", "while",
                                       "until", "do", "done", "in", "function" , 0};
     static char *bash_builtins [] = { "alias", "bg", "bind", "break", "builtin",
                                       "case", "esac", "for", "select", "while",
                                       "until", "do", "done", "in", "function" , 0};
     static char *bash_builtins [] = { "alias", "bg", "bind", "break", "builtin",
-                                     "cd", "command", "continue", "declare", 
+                                     "cd", "command", "continue", "declare",
                                      "dirs", "echo", "enable", "eval", "exec",
                                      "exit", "export", "fc", "fg", "getopts",
                                      "hash", "help", "history", "jobs", "kill",
                                      "let", "local", "logout", "popd", "pushd",
                                      "pwd", "read", "readonly", "return", "set",
                                      "dirs", "echo", "enable", "eval", "exec",
                                      "exit", "export", "fc", "fg", "getopts",
                                      "hash", "help", "history", "jobs", "kill",
                                      "let", "local", "logout", "popd", "pushd",
                                      "pwd", "read", "readonly", "return", "set",
-                                     "shift", "source", "suspend", "test", 
+                                     "shift", "source", "suspend", "test",
                                      "times", "trap", "type", "typeset",
                                      "ulimit", "umask", "unalias", "unset",
                                      "wait" , 0};
                                      "times", "trap", "type", "typeset",
                                      "ulimit", "umask", "unalias", "unset",
                                      "wait" , 0};
@@ -494,7 +494,7 @@ char *command_completion_function (char *text, int state)
            }
        }
     }
            }
        }
     }
-    
+
     if (isabsolute){
         p = filename_completion_function (text, state);
         if (!p)
     if (isabsolute){
         p = filename_completion_function (text, state);
         if (!p)
@@ -502,7 +502,7 @@ char *command_completion_function (char *text, int state)
         return p;
     }
 
         return p;
     }
 
-    found = NULL;    
+    found = NULL;
     switch (phase){
        case 0: /* Reserved words */
            while (*words){
     switch (phase){
        case 0: /* Reserved words */
            while (*words){
@@ -527,7 +527,7 @@ char *command_completion_function (char *text, int state)
            while (!found){
                if (!cur_word){
                    char *expanded;
            while (!found){
                if (!cur_word){
                    char *expanded;
-                   
+
                    if (!*cur_path)
                        break;
                    expanded = tilde_expand (cur_path);
                    if (!*cur_path)
                        break;
                    expanded = tilde_expand (cur_path);
@@ -553,7 +553,7 @@ char *command_completion_function (char *text, int state)
                }
            }
     }
                }
            }
     }
-    
+
     if (!found){
         look_for_executables = 0;
         if (path)
     if (!found){
         look_for_executables = 0;
         if (path)
@@ -567,7 +567,7 @@ char *command_completion_function (char *text, int state)
         return p;
     }
     return found;
         return p;
     }
     return found;
-    
+
 }
 
 int match_compare (const void *a, const void *b)
 }
 
 int match_compare (const void *a, const void *b)
@@ -580,7 +580,7 @@ int match_compare (const void *a, const void *b)
    completions follows.
    You have to supply your own CompletionFunction with the word you
    want to complete as the first argument and an count of previous matches
    completions follows.
    You have to supply your own CompletionFunction with the word you
    want to complete as the first argument and an count of previous matches
-   as the second. 
+   as the second.
    In case no matches were found we return NULL. */
 char **completion_matches (char *text, CompletionFunction entry_function)
 {
    In case no matches were found we return NULL. */
 char **completion_matches (char *text, CompletionFunction entry_function)
 {
@@ -618,11 +618,11 @@ char **completion_matches (char *text, CompletionFunction entry_function)
            match_list[1] = (char *)NULL;
         } else {
             int j;
            match_list[1] = (char *)NULL;
         } else {
             int j;
-            
+
            qsort (match_list + 1, matches, sizeof (char *), match_compare);
 
            /* And compare each member of the list with
            qsort (match_list + 1, matches, sizeof (char *), match_compare);
 
            /* And compare each member of the list with
-              the next, finding out where they stop matching. 
+              the next, finding out where they stop matching.
               If we find two equal strings, we have to put one away... */
 
            j = i + 1;
               If we find two equal strings, we have to put one away... */
 
            j = i + 1;
@@ -632,7 +632,7 @@ char **completion_matches (char *text, CompletionFunction entry_function)
 
                for (si = 0;(c1 = match_list [i][si]) && (c2 = match_list [j][si]); si++)
                    if (c1 != c2) break;
 
                for (si = 0;(c1 = match_list [i][si]) && (c2 = match_list [j][si]); si++)
                    if (c1 != c2) break;
-               
+
                if (!c1 && !match_list [j][si]){ /* Two equal strings */
                    free (match_list [j]);
                    j++;
                if (!c1 && !match_list [j][si]){ /* Two equal strings */
                    free (match_list [j]);
                    j++;
@@ -660,10 +660,10 @@ char **completion_matches (char *text, CompletionFunction entry_function)
 int check_is_cd (char *text, int start, int flags)
 {
     char *p, *q = text + start;
 int check_is_cd (char *text, int start, int flags)
 {
     char *p, *q = text + start;
-           
+
     for (p = text; *p && p < q && (*p == ' ' || *p == '\t'); p++);
     for (p = text; *p && p < q && (*p == ' ' || *p == '\t'); p++);
-    if (((flags & INPUT_COMPLETE_COMMANDS) && 
-        !strncmp (p, "cd", 2) && (p [2] == ' ' || p [2] == '\t') && 
+    if (((flags & INPUT_COMPLETE_COMMANDS) &&
+        !strncmp (p, "cd", 2) && (p [2] == ' ' || p [2] == '\t') &&
         p + 2 < q) ||
         (flags & INPUT_COMPLETE_CD))
         return 1;
         p + 2 < q) ||
         (flags & INPUT_COMPLETE_CD))
         return 1;
@@ -700,7 +700,7 @@ char **try_complete (char *text, int *start, int *end, int flags)
             register int this_char, prev_char;
 
             in_command_position++;
             register int this_char, prev_char;
 
             in_command_position++;
-            
+
             if (i){
                 /* Handle the two character tokens `>&', `<&', and `>|'.
                    We are not in a command position after one of these. */
             if (i){
                 /* Handle the two character tokens `>&', `<&', and `>|'.
                    We are not in a command position after one of these. */
@@ -720,14 +720,14 @@ char **try_complete (char *text, int *start, int *end, int flags)
        p = strrchr (word, '`');
     if (flags & (INPUT_COMPLETE_COMMANDS | INPUT_COMPLETE_VARIABLES))
         q = strrchr (word, '$');
        p = strrchr (word, '`');
     if (flags & (INPUT_COMPLETE_COMMANDS | INPUT_COMPLETE_VARIABLES))
         q = strrchr (word, '$');
-    if (flags & INPUT_COMPLETE_HOSTNAMES)    
+    if (flags & INPUT_COMPLETE_HOSTNAMES)
         r = strrchr (word, '@');
     if (q && q [1] == '(' && INPUT_COMPLETE_COMMANDS){
        if (q > p)
            p = q + 1;
        q = NULL;
     }
         r = strrchr (word, '@');
     if (q && q [1] == '(' && INPUT_COMPLETE_COMMANDS){
        if (q > p)
            p = q + 1;
        q = NULL;
     }
-    
+
     /* Command substitution? */
     if (p > q && p > r){
         matches = completion_matches (p + 1, command_completion_function);
     /* Command substitution? */
     if (p > q && p > r){
         matches = completion_matches (p + 1, command_completion_function);
@@ -742,14 +742,14 @@ char **try_complete (char *text, int *start, int *end, int flags)
             *start += q - word;
     }
 
             *start += q - word;
     }
 
-    /* Starts with '@', then look through the known hostnames for 
+    /* Starts with '@', then look through the known hostnames for
        completion first. */
     else if (r > p && r > q){
         matches = completion_matches (r, hostname_completion_function);
         if (matches)
             *start += r - word;
     }
        completion first. */
     else if (r > p && r > q){
         matches = completion_matches (r, hostname_completion_function);
         if (matches)
             *start += r - word;
     }
-        
+
     /* Starts with `~' and there is no slash in the word, then
        try completing this word as a username. */
     if (!matches && *word == '~' && (flags & INPUT_COMPLETE_USERNAMES) && !strchr (word, PATH_SEP))
     /* Starts with `~' and there is no slash in the word, then
        try completing this word as a username. */
     if (!matches && *word == '~' && (flags & INPUT_COMPLETE_USERNAMES) && !strchr (word, PATH_SEP))
@@ -761,7 +761,7 @@ char **try_complete (char *text, int *start, int *end, int flags)
        and command names. */
     if (!matches && in_command_position)
         matches = completion_matches (word, command_completion_function);
        and command names. */
     if (!matches && in_command_position)
         matches = completion_matches (word, command_completion_function);
-        
+
     else if (!matches && (flags & INPUT_COMPLETE_FILENAMES)){
        if (is_cd)
            ignore_filenames = 1;
     else if (!matches && (flags & INPUT_COMPLETE_FILENAMES)){
        if (is_cd)
            ignore_filenames = 1;
@@ -769,7 +769,7 @@ char **try_complete (char *text, int *start, int *end, int flags)
        ignore_filenames = 0;
        if (!matches && is_cd && *word != PATH_SEP && *word != '~'){
            char *p, *q = text + *start;
        ignore_filenames = 0;
        if (!matches && is_cd && *word != PATH_SEP && *word != '~'){
            char *p, *q = text + *start;
-           
+
            for (p = text; *p && p < q && (*p == ' ' || *p == '\t'); p++);
            if (!strncmp (p, "cd", 2))
                for (p += 2; *p && p < q && (*p == ' ' || *p == '\t'); p++);
            for (p = text; *p && p < q && (*p == ' ' || *p == '\t'); p++);
            if (!strncmp (p, "cd", 2))
                for (p += 2; *p && p < q && (*p == ' ' || *p == '\t'); p++);
@@ -785,7 +785,7 @@ char **try_complete (char *text, int *start, int *end, int flags)
                    s = strchr (cdpath, ':');
                    if (s == NULL)
                        s = strchr (cdpath, 0);
                    s = strchr (cdpath, ':');
                    if (s == NULL)
                        s = strchr (cdpath, 0);
-                   c = *s; 
+                   c = *s;
                    *s = 0;
                    if (*cdpath){
                        r = concat_dir_and_file (cdpath, word);
                    *s = 0;
                    if (*cdpath){
                        r = concat_dir_and_file (cdpath, word);
@@ -800,7 +800,7 @@ char **try_complete (char *text, int *start, int *end, int flags)
            }
        }
     }
            }
        }
     }
-       
+
     if (word)
        free (word);
 
     if (word)
        free (word);
 
@@ -810,7 +810,7 @@ char **try_complete (char *text, int *start, int *end, int flags)
 void free_completions (WInput *in)
 {
     char **p;
 void free_completions (WInput *in)
 {
     char **p;
-    
+
     if (!in->completions)
        return;
     for (p=in->completions; *p; p++)
     if (!in->completions)
        return;
     for (p=in->completions; *p; p++)
@@ -861,7 +861,7 @@ static int query_callback (Dlg_head * h, int Par, int Msg)
            dlg_erase (h);
            draw_box (h, 0, 0, query_height, query_width);
            break;
            dlg_erase (h);
            draw_box (h, 0, 0, query_height, query_width);
            break;
-           
+
        case DLG_KEY:
            switch (Par) {
                case KEY_LEFT:
        case DLG_KEY:
            switch (Par) {
                case KEY_LEFT:
@@ -869,7 +869,7 @@ static int query_callback (Dlg_head * h, int Par, int Msg)
                    h->ret_value = 0;
                    dlg_stop (h);
                    return 1;
                    h->ret_value = 0;
                    dlg_stop (h);
                    return 1;
-                   
+
                case 0177:
                case KEY_BACKSPACE:
                case XCTRL('h'):
                case 0177:
                case KEY_BACKSPACE:
                case XCTRL('h'):
@@ -879,7 +879,7 @@ static int query_callback (Dlg_head * h, int Par, int Msg)
                        return 1;
                    } else {
                        WLEntry *e, *e1;
                        return 1;
                    } else {
                        WLEntry *e, *e1;
-                       
+
                        e1 = e = ((WListbox *)(h->current->widget))->list;
                        do {
                            if (!strncmp (input->buffer + start, e1->text, end - start - 1)){
                        e1 = e = ((WListbox *)(h->current->widget))->list;
                        do {
                            if (!strncmp (input->buffer + start, e1->text, end - start - 1)){
@@ -894,7 +894,7 @@ static int query_callback (Dlg_head * h, int Par, int Msg)
                        } while (e != e1);
                    }
                    return 1;
                        } while (e != e1);
                    }
                    return 1;
-                   
+
                 default:
                    if (Par > 0xff || !is_printable (Par)){
                        if (is_in_input_map (input, Par) == 2){
                 default:
                    if (Par > 0xff || !is_printable (Par)){
                        if (is_in_input_map (input, Par) == 2){
@@ -911,20 +911,20 @@ static int query_callback (Dlg_head * h, int Par, int Msg)
                        int need_redraw = 0;
                        int low = 4096;
                        char *last_text = NULL;
                        int need_redraw = 0;
                        int low = 4096;
                        char *last_text = NULL;
-                       
+
                        e1 = e = ((WListbox *)(h->current->widget))->list;
                        do {
                            if (!strncmp (input->buffer + start, e1->text, end - start)){
                                if (e1->text [end - start] == Par){
                                    if (need_redraw){
                                        register int c1, c2, si;
                        e1 = e = ((WListbox *)(h->current->widget))->list;
                        do {
                            if (!strncmp (input->buffer + start, e1->text, end - start)){
                                if (e1->text [end - start] == Par){
                                    if (need_redraw){
                                        register int c1, c2, si;
-                                       
-                                       for (si = end - start + 1; 
+
+                                       for (si = end - start + 1;
                                             (c1 = last_text [si]) &&
                                             (c2 = e1->text [si]); si++)
                                            if (c1 != c2)
                                                break;
                                             (c1 = last_text [si]) &&
                                             (c2 = e1->text [si]); si++)
                                            if (c1 != c2)
                                                break;
-                                       if (low > si) 
+                                       if (low > si)
                                            low = si;
                                        last_text = e1->text;
                                        need_redraw = 2;
                                            low = si;
                                        last_text = e1->text;
                                        need_redraw = 2;
@@ -988,7 +988,7 @@ int complete_engine (WInput *in, int what_to_do)
            char **p, *q;
            Dlg_head *query_dlg;
            WListbox *query_list;
            char **p, *q;
            Dlg_head *query_dlg;
            WListbox *query_list;
-           
+
            for (p=in->completions + 1; *p; count++, p++)
                if ((i = strlen (*p)) > maxlen)
                    maxlen = i;
            for (p=in->completions + 1; *p; count++, p++)
                if ((i = strlen (*p)) > maxlen)
                    maxlen = i;
index ae53464..65f80aa 100644 (file)
@@ -1,11 +1,11 @@
 /* Client interface for General purpose Linux console save/restore server
    Copyright (C) 1994 Janne Kukonlehto <jtklehto@stekt.oulu.fi>
 /* Client interface for General purpose Linux console save/restore server
    Copyright (C) 1994 Janne Kukonlehto <jtklehto@stekt.oulu.fi>
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -194,7 +194,7 @@ void handle_console (unsigned char action)
 #endif /* #ifdef linux */
 
 #ifdef SCO_FLAVOR
 #endif /* #ifdef linux */
 
 #ifdef SCO_FLAVOR
-/* 
+/*
 **     SCO console save/restore handling routines
 **     Copyright (C) 1997 Alex Tkachenko <alex@bcs.zaporizhzhe.ua>
 */
 **     SCO console save/restore handling routines
 **     Copyright (C) 1997 Alex Tkachenko <alex@bcs.zaporizhzhe.ua>
 */
@@ -271,7 +271,7 @@ console_save()
        {
                struct vt_mode smode;
 
        {
                struct vt_mode smode;
 
-               /* 
+               /*
                **      User switched out of our vt. Let's wait until we get SIG_ACQUIRE,
                **      otherwise we could save wrong screen image
                */
                **      User switched out of our vt. Let's wait until we get SIG_ACQUIRE,
                **      otherwise we could save wrong screen image
                */
@@ -364,7 +364,7 @@ handle_console (unsigned char action)
                        console_init();
                        break;
 
                        console_init();
                        break;
 
-               case CONSOLE_DONE: 
+               case CONSOLE_DONE:
                        console_shutdown();
                        break;
 
                        console_shutdown();
                        break;
 
index f6012ff..566d2ae 100644 (file)
@@ -6,12 +6,12 @@
    This code requires root privileges.
    You may want to make the cons.saver setuid root.
    The code should be safe even if it is setuid but who knows?
    This code requires root privileges.
    You may want to make the cons.saver setuid root.
    The code should be safe even if it is setuid but who knows?
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -102,11 +102,11 @@ int check_file (char *filename, int check_console, char **msg)
        both 'open' and 'stat' operate on the same file */
 
     *msg = 0;
        both 'open' and 'stat' operate on the same file */
 
     *msg = 0;
-    
+
     fd = open (filename, O_RDWR);
     if (fd == -1)
        return -1;
     fd = open (filename, O_RDWR);
     if (fd == -1)
        return -1;
-    
+
     if (fstat (fd, &stat_buf) == -1)
        return -1;
 
     if (fstat (fd, &stat_buf) == -1)
        return -1;
 
@@ -125,19 +125,19 @@ int check_file (char *filename, int check_console, char **msg)
            *msg = "Not a console";
            return -1;
        }
            *msg = "Not a console";
            return -1;
        }
-    
+
        if ((stat_buf.st_rdev & 0x00ff) > 63){
            *msg = "Minor device number too big";
            return -1;
        }
        if ((stat_buf.st_rdev & 0x00ff) > 63){
            *msg = "Minor device number too big";
            return -1;
        }
-       
+
        /* Must be owned by the user */
        if (stat_buf.st_uid != getuid ()){
            *msg = "Not a owner";
            return -1;
        }
     }
        /* Must be owned by the user */
        if (stat_buf.st_uid != getuid ()){
            *msg = "Not a owner";
            return -1;
        }
     }
-    
+
     /* Everything seems to be okay */
     return fd;
 }
     /* Everything seems to be okay */
     return fd;
 }
@@ -150,7 +150,7 @@ char *detect_console (void)
 {
     char *msg;
     int  xlen;
 {
     char *msg;
     int  xlen;
-    
+
     /* Must be console */
     /* Handle the case for /dev/tty?? */
     if (tty_name[len-5] == 't')
     /* Must be console */
     /* Handle the case for /dev/tty?? */
     if (tty_name[len-5] == 't')
@@ -174,7 +174,7 @@ char *detect_console (void)
 #ifdef DEBUG
     fprintf (stderr, "vcs_fd = %d console_fd = %d\n", vcs_fd, console_fd);
 #endif
 #ifdef DEBUG
     fprintf (stderr, "vcs_fd = %d console_fd = %d\n", vcs_fd, console_fd);
 #endif
-    
+
     if (vcs_fd != -1){
        console_flag = 3;
     }
     if (vcs_fd != -1){
        console_flag = 3;
     }
@@ -269,9 +269,9 @@ void send_contents ()
     unsigned char message;
     unsigned short bytes;
     int bytes_per_char;
     unsigned char message;
     unsigned short bytes;
     int bytes_per_char;
-    
+
     bytes_per_char = console_flag == 1 ? 1 : 2;
     bytes_per_char = console_flag == 1 ? 1 : 2;
-    
+
     /* Calculate the number of used lines */
     if (console_flag == 2 || console_flag == 1 || console_flag == 3){
        index = (2 + rows * columns) * bytes_per_char;
     /* Calculate the number of used lines */
     if (console_flag == 2 || console_flag == 1 || console_flag == 3){
        index = (2 + rows * columns) * bytes_per_char;
@@ -327,7 +327,7 @@ int main (int argc, char **argv)
 
     /* Lose the control terminal */
     setsid ();
 
     /* Lose the control terminal */
     setsid ();
-    
+
     /* Check that the argument is a legal console */
     tty_name = argv [1];
     len = strlen(tty_name);
     /* Check that the argument is a legal console */
     tty_name = argv [1];
     len = strlen(tty_name);
@@ -353,7 +353,7 @@ int main (int argc, char **argv)
     /* If using /dev/vcs*, we don't need anymore the console fd */
     if (console_flag == 3)
        close (console_fd);
     /* If using /dev/vcs*, we don't need anymore the console fd */
     if (console_flag == 3)
        close (console_fd);
-    
+
     /* Inform the invoker about the result of the tests */
     write (cmd_output, &console_flag, 1);
 
     /* Inform the invoker about the result of the tests */
     write (cmd_output, &console_flag, 1);
 
@@ -374,14 +374,14 @@ int main (int argc, char **argv)
            send_contents ();
            break;
        } /* switch (action) */
            send_contents ();
            break;
        } /* switch (action) */
-               
+
        /* Inform the invoker that command is handled */
        write (cmd_output, &console_flag, 1);
     } /* while (read ...) */
 
     if (buffer)
        free (buffer);
        /* Inform the invoker that command is handled */
        write (cmd_output, &console_flag, 1);
     } /* while (read ...) */
 
     if (buffer)
        free (buffer);
-    return 0;   
+    return 0;
 }
 
 #else
 }
 
 #else
index cc26831..33302cf 100644 (file)
@@ -1,11 +1,11 @@
 /* Dialog managing.
    Copyright (C) 1994 Miguel de Icaza.
 /* Dialog managing.
    Copyright (C) 1994 Miguel de Icaza.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -35,7 +35,7 @@
 #include "dlg.h"               /* draw_box, yes I know, it's silly */
 #include "background.h"                /* we_are_background definition */
 
 #include "dlg.h"               /* draw_box, yes I know, it's silly */
 #include "background.h"                /* we_are_background definition */
 
-/* "$Id: dialog.c,v 1.1 2001/12/30 09:55:26 sedwards Exp $" */
+/* "$Id$" */
 
 Refresh *refresh_list = 0;
 
 
 Refresh *refresh_list = 0;
 
@@ -54,7 +54,7 @@ void push_refresh (void (*new_refresh)(void *), void *parameter, int flags)
 void pop_refresh (void)
 {
     Refresh *old;
 void pop_refresh (void)
 {
     Refresh *old;
-    
+
     if (!refresh_list)
        fprintf (stderr, _("\n\n\nrefresh stack underflow!\n\n\n"));
     else {
     if (!refresh_list)
        fprintf (stderr, _("\n\n\nrefresh stack underflow!\n\n\n"));
     else {
@@ -71,7 +71,7 @@ static void do_complete_refresh (Refresh *refresh_list)
 
     if (refresh_list->flags != REFRESH_COVERS_ALL)
        do_complete_refresh (refresh_list->next);
 
     if (refresh_list->flags != REFRESH_COVERS_ALL)
        do_complete_refresh (refresh_list->next);
-    
+
     (*(refresh_list->refresh_fn))(refresh_list->parameter);
 }
 
     (*(refresh_list->refresh_fn))(refresh_list->parameter);
 }
 
@@ -99,7 +99,7 @@ void my_wputs (int y, int x, char *text)
     while ((p = *text++) != 0){
        if (p == '\n')
            move (++y, x);
     while ((p = *text++) != 0){
        if (p == '\n')
            move (++y, x);
-       else 
+       else
            addch ((unsigned char)p);
     }
 }
            addch ((unsigned char)p);
     }
 }
index 68a7686..a522b8b 100644 (file)
@@ -1,11 +1,11 @@
 /* Directory routines
    Copyright (C) 1994 Miguel de Icaza.
 /* Directory routines
    Copyright (C) 1994 Miguel de Icaza.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -33,7 +33,7 @@
 #include "tree.h"
 #include "../vfs/vfs.h"
 
 #include "tree.h"
 #include "../vfs/vfs.h"
 
-/* "$Id: dir.c,v 1.1 2001/12/30 09:55:26 sedwards Exp $" */
+/* "$Id$" */
 
 /* If true show files starting with a dot */
 int show_dot_files = 1;
 
 /* If true show files starting with a dot */
 int show_dot_files = 1;
@@ -84,7 +84,7 @@ sort_name (const file_entry *a, const file_entry *b)
 {
     int ad = MY_ISDIR (a);
     int bd = MY_ISDIR (b);
 {
     int ad = MY_ISDIR (a);
     int bd = MY_ISDIR (b);
-    
+
     if (ad == bd || mix_all_files)
        return string_sortcomp (a->fname, b->fname) * reverse;
     return bd-ad;
     if (ad == bd || mix_all_files)
        return string_sortcomp (a->fname, b->fname) * reverse;
     return bd-ad;
@@ -115,7 +115,7 @@ sort_owner (const file_entry *a, const file_entry *b)
 {
     int ad = MY_ISDIR (a);
     int bd = MY_ISDIR (b);
 {
     int ad = MY_ISDIR (a);
     int bd = MY_ISDIR (b);
-    
+
     if (ad == bd || mix_all_files)
        return string_sortcomp (get_owner (a->buf.st_uid), get_owner (a->buf.st_uid)) * reverse;
     return bd-ad;
     if (ad == bd || mix_all_files)
        return string_sortcomp (get_owner (a->buf.st_uid), get_owner (a->buf.st_uid)) * reverse;
     return bd-ad;
@@ -126,7 +126,7 @@ sort_group (const file_entry *a, const file_entry *b)
 {
     int ad = MY_ISDIR (a);
     int bd = MY_ISDIR (b);
 {
     int ad = MY_ISDIR (a);
     int bd = MY_ISDIR (b);
-    
+
     if (ad == bd || mix_all_files)
        return string_sortcomp (get_group (a->buf.st_gid), get_group (a->buf.st_gid)) * reverse;
     return bd-ad;
     if (ad == bd || mix_all_files)
        return string_sortcomp (get_group (a->buf.st_gid), get_group (a->buf.st_gid)) * reverse;
     return bd-ad;
@@ -232,7 +232,7 @@ inline static int
 file_type_to_num (const file_entry *fe)
 {
     const struct stat *s = &fe->buf;
 file_type_to_num (const file_entry *fe)
 {
     const struct stat *s = &fe->buf;
-    
+
     if (S_ISDIR (s->st_mode))
        return 0;
     if (S_ISLNK (s->st_mode)){
     if (S_ISDIR (s->st_mode))
        return 0;
     if (S_ISLNK (s->st_mode)){
@@ -261,7 +261,7 @@ sort_type (const file_entry *a, const file_entry *b)
 {
     int aa  = file_type_to_num (a);
     int bb  = file_type_to_num (b);
 {
     int aa  = file_type_to_num (a);
     int bb  = file_type_to_num (b);
-    
+
     return bb-aa;
 }
 
     return bb-aa;
 }
 
@@ -302,13 +302,13 @@ void clean_dir (dir_list *list, int count)
     }
 }
 
     }
 }
 
-static int 
+static int
 add_dotdot_to_list (dir_list *list, int index)
 {
     char buffer [MC_MAXPATHLEN + MC_MAXPATHLEN];
     char *p, *s;
     int i = 0;
 add_dotdot_to_list (dir_list *list, int index)
 {
     char buffer [MC_MAXPATHLEN + MC_MAXPATHLEN];
     char *p, *s;
     int i = 0;
-    
+
     /* Need to grow the *list? */
     if (index == list->size) {
        list->list = realloc (list->list, sizeof (file_entry) *
     /* Need to grow the *list? */
     if (index == list->size) {
        list->list = realloc (list->list, sizeof (file_entry) *
@@ -323,7 +323,7 @@ add_dotdot_to_list (dir_list *list, int index)
     (list->list) [index].cache = NULL;
     (list->list) [index].f.link_to_dir = 0;
     (list->list) [index].f.stalled_link = 0;
     (list->list) [index].cache = NULL;
     (list->list) [index].f.link_to_dir = 0;
     (list->list) [index].f.stalled_link = 0;
-    
+
     /* FIXME: We need to get the panel definition! to use file_mark */
     (list->list) [index].f.marked = 0;
     mc_get_current_wd (buffer, sizeof (buffer) - 1 );
     /* FIXME: We need to get the panel definition! to use file_mark */
     (list->list) [index].f.marked = 0;
     mc_get_current_wd (buffer, sizeof (buffer) - 1 );
@@ -383,7 +383,7 @@ int handle_dirent (dir_list *list, char *filter, struct dirent *dp,
 
     if (S_ISDIR (buf1->st_mode))
        tree_check (dp->d_name);
 
     if (S_ISDIR (buf1->st_mode))
        tree_check (dp->d_name);
-    
+
     /* A link to a file or a directory? */
     *link_to_dir = 0;
     *stalled_link = 0;
     /* A link to a file or a directory? */
     *link_to_dir = 0;
     *stalled_link = 0;
@@ -409,9 +409,9 @@ int handle_dirent (dir_list *list, char *filter, struct dirent *dp,
     return 1;
 }
 
     return 1;
 }
 
-/* handle_path is a simplified handle_dirent. The difference is that 
+/* handle_path is a simplified handle_dirent. The difference is that
    handle_path doesn't pay attention to show_dot_files and show_backups.
    handle_path doesn't pay attention to show_dot_files and show_backups.
-   Moreover handle_path can't be used with a filemask. 
+   Moreover handle_path can't be used with a filemask.
    If you change handle_path then check also handle_dirent. */
 /* Return values: -1 = failure, 0 = don't add, 1 = add to the list */
 int handle_path (dir_list *list, char *path,
    If you change handle_path then check also handle_dirent. */
 /* Return values: -1 = failure, 0 = don't add, 1 = add to the list */
 int handle_path (dir_list *list, char *path,
@@ -425,7 +425,7 @@ int handle_path (dir_list *list, char *path,
 
     if (S_ISDIR (buf1->st_mode))
        tree_check (path);
 
     if (S_ISDIR (buf1->st_mode))
        tree_check (path);
-    
+
     /* A link to a file or a directory? */
     *link_to_dir = 0;
     *stalled_link = 0;
     /* A link to a file or a directory? */
     *link_to_dir = 0;
     *stalled_link = 0;
@@ -458,7 +458,7 @@ int do_load_dir(dir_list *list, sortfn *sort, int reverse, int case_sensitive, c
     int dotdot_found = 0;
 
     start_tree_check (NULL);
     int dotdot_found = 0;
 
     start_tree_check (NULL);
-    
+
     dirp = mc_opendir (".");
     if (!dirp){
        return set_zero_dir (list);
     dirp = mc_opendir (".");
     if (!dirp){
        return set_zero_dir (list);
@@ -472,7 +472,7 @@ int do_load_dir(dir_list *list, sortfn *sort, int reverse, int case_sensitive, c
            return next_free;
        list->list [next_free].fnamelen = NLENGTH (dp);
        list->list [next_free].fname = strdup (dp->d_name);
            return next_free;
        list->list [next_free].fnamelen = NLENGTH (dp);
        list->list [next_free].fname = strdup (dp->d_name);
-       list->list [next_free].cache = NULL; 
+       list->list [next_free].cache = NULL;
        list->list [next_free].f.marked = 0;
        list->list [next_free].f.link_to_dir = link_to_dir;
        list->list [next_free].f.stalled_link = stalled_link;
        list->list [next_free].f.marked = 0;
        list->list [next_free].f.link_to_dir = link_to_dir;
        list->list [next_free].f.stalled_link = stalled_link;
@@ -491,7 +491,7 @@ int do_load_dir(dir_list *list, sortfn *sort, int reverse, int case_sensitive, c
     }
     else
        return set_zero_dir (list);
     }
     else
        return set_zero_dir (list);
-    
+
     mc_closedir (dirp);
     end_tree_check (NULL);
     return next_free;
     mc_closedir (dirp);
     end_tree_check (NULL);
     return next_free;
@@ -500,7 +500,7 @@ int do_load_dir(dir_list *list, sortfn *sort, int reverse, int case_sensitive, c
 int link_isdir (file_entry *file)
 {
     struct stat b;
 int link_isdir (file_entry *file)
 {
     struct stat b;
-    
+
     if (S_ISLNK (file->buf.st_mode)){
        mc_stat (file->fname, &b);
        if (S_ISDIR (b.st_mode))
     if (S_ISLNK (file->buf.st_mode)){
        mc_stat (file->fname, &b);
        if (S_ISDIR (b.st_mode))
@@ -508,7 +508,7 @@ int link_isdir (file_entry *file)
     }
     return 0;
 }
     }
     return 0;
 }
+
 int if_link_is_exe (file_entry *file)
 {
     struct stat b;
 int if_link_is_exe (file_entry *file)
 {
     struct stat b;
@@ -525,7 +525,7 @@ static dir_list dir_copy = { 0, 0 };
 static void alloc_dir_copy (int size)
 {
     int i;
 static void alloc_dir_copy (int size)
 {
     int i;
-           
+
     if (dir_copy.size < size){
        if (dir_copy.list){
 
     if (dir_copy.size < size){
        if (dir_copy.list){
 
@@ -558,7 +558,7 @@ int do_reload_dir (dir_list *list, sortfn *sort, int count, int rev,
     int           i, found, status, link_to_dir, stalled_link;
     struct stat   buf;
     int                  tmp_len;  /* For optimisation */
     int           i, found, status, link_to_dir, stalled_link;
     struct stat   buf;
     int                  tmp_len;  /* For optimisation */
-    int          dotdot_found = 0; 
+    int          dotdot_found = 0;
 
     start_tree_check (NULL);
     dirp = mc_opendir (".");
 
     start_tree_check (NULL);
     dirp = mc_opendir (".");
@@ -584,19 +584,19 @@ int do_reload_dir (dir_list *list, sortfn *sort, int count, int rev,
            continue;
        if (status == -1) {
            mc_closedir (dirp);
            continue;
        if (status == -1) {
            mc_closedir (dirp);
-           /* Norbert (Feb 12, 1997): 
+           /* Norbert (Feb 12, 1997):
             Just in case someone finds this memory leak:
             Just in case someone finds this memory leak:
-            -1 means big trouble (at the moment no memory left), 
+            -1 means big trouble (at the moment no memory left),
             I don't bother with further cleanup because if one gets to
             this point he will have more problems than a few memory
             leaks and because one 'clean_dir' would not be enough (and
             I don't bother with further cleanup because if one gets to
             this point he will have more problems than a few memory
             leaks and because one 'clean_dir' would not be enough (and
-            because I don't want to spent the time to make it working, 
-             IMHO it's not worthwhile). 
+            because I don't want to spent the time to make it working,
+             IMHO it's not worthwhile).
            clean_dir (&dir_copy, count);
              */
            return next_free;
        }
            clean_dir (&dir_copy, count);
              */
            return next_free;
        }
-       
+
        tmp_len = NLENGTH (dp);
        for (found = i = 0; i < count; i++)
            if (tmp_len == dir_copy.list [i].fnamelen
        tmp_len = NLENGTH (dp);
        for (found = i = 0; i < count; i++)
            if (tmp_len == dir_copy.list [i].fnamelen
@@ -605,10 +605,10 @@ int do_reload_dir (dir_list *list, sortfn *sort, int count, int rev,
                found = 1;
                break;
            }
                found = 1;
                break;
            }
-       
+
        if (!found)
            list->list [next_free].f.marked = 0;
        if (!found)
            list->list [next_free].f.marked = 0;
-       
+
        list->list [next_free].fnamelen = tmp_len;
        list->list [next_free].fname = strdup (dp->d_name);
        list->list [next_free].cache = NULL;
        list->list [next_free].fnamelen = tmp_len;
        list->list [next_free].fname = strdup (dp->d_name);
        list->list [next_free].cache = NULL;
index b79fe92..ede8978 100644 (file)
@@ -13,7 +13,7 @@ typedef struct {
     struct stat  buf;
 
     /* Flags */
     struct stat  buf;
 
     /* Flags */
-    struct { 
+    struct {
        unsigned int marked:1;          /* File marked in pane window */
        unsigned int exists:1;          /* Use for rereading file */
        unsigned int link_to_dir:1;     /* If this is a link, does it point to directory? */
        unsigned int marked:1;          /* File marked in pane window */
        unsigned int exists:1;          /* Use for rereading file */
        unsigned int link_to_dir:1;     /* If this is a link, does it point to directory? */
@@ -38,7 +38,7 @@ int set_zero_dir (dir_list *list);
 #ifdef DIR_H_INCLUDE_HANDLE_DIRENT
 int handle_dirent (dir_list *list, char *filter, struct dirent *dp,
                   struct stat *buf1, int next_free, int *link_to_dir, int *stalled_link);
 #ifdef DIR_H_INCLUDE_HANDLE_DIRENT
 int handle_dirent (dir_list *list, char *filter, struct dirent *dp,
                   struct stat *buf1, int next_free, int *link_to_dir, int *stalled_link);
-int handle_path (dir_list *list, char *path, struct stat *buf1, int next_free, 
+int handle_path (dir_list *list, char *path, struct stat *buf1, int next_free,
                   int *link_to_dir, int *stalled_link);
 #endif
 
                   int *link_to_dir, int *stalled_link);
 #endif
 
index 9dafd2b..7aa7772 100644 (file)
@@ -17,7 +17,7 @@
  */
 
 #include <config.h>
  */
 
 #include <config.h>
-/* "$Id: dlg.c,v 1.1 2001/12/30 09:55:26 sedwards Exp $" */
+/* "$Id$" */
 #include <string.h>
 #include <stdio.h>
 #include <malloc.h>
 #include <string.h>
 #include <stdio.h>
 #include <malloc.h>
@@ -37,7 +37,7 @@
 #include "dlg.h"
 #include "dialog.h"    /* For push_refresh() and pop_refresh() */
 #include "layout.h"
 #include "dlg.h"
 #include "dialog.h"    /* For push_refresh() and pop_refresh() */
 #include "layout.h"
-#include "main.h"      
+#include "main.h"
 
 /* This is the current frame, used to group Tk packings */
 char *the_frame = "";
 
 /* This is the current frame, used to group Tk packings */
 char *the_frame = "";
@@ -74,12 +74,12 @@ static void slow_box (Dlg_head *h, int y, int x, int ys, int xs)
 void draw_box (Dlg_head *h, int y, int x, int ys, int xs)
 {
     extern int slow_terminal;
 void draw_box (Dlg_head *h, int y, int x, int ys, int xs)
 {
     extern int slow_terminal;
-       
+
     if (slow_terminal){
        slow_box (h, y, x, ys, xs);
        return;
     }
     if (slow_terminal){
        slow_box (h, y, x, ys, xs);
        return;
     }
-    
+
 #ifndef HAVE_SLANG
     waddc (h, y, x, ACS_ULCORNER);
     hline (ACS_HLINE, xs - 2);
 #ifndef HAVE_SLANG
     waddc (h, y, x, ACS_ULCORNER);
     hline (ACS_HLINE, xs - 2);
@@ -154,7 +154,7 @@ void init_widget (Widget *w, int y, int x, int lines, int cols,
        abort ();
     }
     /* Almost all widgets want to put the cursor in a suitable place */
        abort ();
     }
     /* Almost all widgets want to put the cursor in a suitable place */
-    w->options = W_WANT_CURSOR; 
+    w->options = W_WANT_CURSOR;
 }
 
 int default_proc (Dlg_head *h, int Msg, int Par)
 }
 
 int default_proc (Dlg_head *h, int Msg, int Par)
@@ -166,20 +166,20 @@ int default_proc (Dlg_head *h, int Msg, int Par)
 
     case WIDGET_INIT:          /* We could tell if something went wrong */
        return 1;
 
     case WIDGET_INIT:          /* We could tell if something went wrong */
        return 1;
-       
+
     case WIDGET_KEY:
        return 0;               /* Didn't use the key */
     case WIDGET_KEY:
        return 0;               /* Didn't use the key */
-       
+
     case WIDGET_FOCUS:         /* We accept FOCUSes */
        if (h->current)
            x_focus_widget (h->current);
        return 1;
     case WIDGET_FOCUS:         /* We accept FOCUSes */
        if (h->current)
            x_focus_widget (h->current);
        return 1;
-       
+
     case WIDGET_UNFOCUS:       /* We accept loose FOCUSes */
        if (h->current)
            x_unfocus_widget (h->current);
        return 1;
     case WIDGET_UNFOCUS:       /* We accept loose FOCUSes */
        if (h->current)
            x_unfocus_widget (h->current);
        return 1;
-       
+
     case WIDGET_DRAW:
        return 1;
 
     case WIDGET_DRAW:
        return 1;
 
@@ -248,10 +248,10 @@ Dlg_head *create_dlg (int y1, int x1, int lines, int cols,
         new_d->wdata = xtoolkit_create_dialog (new_d, flags);
     else
        new_d->wdata = xtoolkit_get_main_dialog (new_d);
         new_d->wdata = xtoolkit_create_dialog (new_d, flags);
     else
        new_d->wdata = xtoolkit_get_main_dialog (new_d);
-#endif    
+#endif
     return (new_d);
 }
     return (new_d);
 }
-                     
+
 void set_idle_proc (Dlg_head *d, int state)
 {
     d->send_idle_msg = state;
 void set_idle_proc (Dlg_head *d, int state)
 {
     d->send_idle_msg = state;
@@ -266,7 +266,7 @@ int add_widgetl (Dlg_head *where, void *what, WLay layout)
 
     /* Only used by Tk */
     widget->frame = the_frame;
 
     /* Only used by Tk */
     widget->frame = the_frame;
-    
+
     widget->layout = layout;
     /* Don't accept 0 widgets, this could be from widgets that could not */
     /* initialize properly */
     widget->layout = layout;
     /* Don't accept 0 widgets, this could be from widgets that could not */
     /* initialize properly */
@@ -303,16 +303,16 @@ int add_widgetl (Dlg_head *where, void *what, WLay layout)
                    where->current->next = where->current;
                    where->first = where->current;
            }
                    where->current->next = where->current;
                    where->first = where->current;
            }
-           
+
            where->current->prev = where->first;
            where->last = where->current;
            where->first->next = where->last;
            where->current->prev = where->first;
            where->last = where->current;
            where->first->next = where->last;
-           
+
     }
     where->current->dlg_id = where->count;
     where->current->widget = what;
     where->current->widget->parent = where;
     }
     where->current->dlg_id = where->count;
     where->current->widget = what;
     where->current->widget->parent = where;
-    
+
     where->count++;
 
     /* If the widget is inserted in a running dialog */
     where->count++;
 
     /* If the widget is inserted in a running dialog */
@@ -329,15 +329,15 @@ int add_widgetl (Dlg_head *where, void *what, WLay layout)
 int remove_widget (Dlg_head *h, void *what)
 {
     Widget_Item *first, *p;
 int remove_widget (Dlg_head *h, void *what)
 {
     Widget_Item *first, *p;
-    
+
     first = p = h->current;
     first = p = h->current;
-    
+
     do {
        if (p->widget == what){
            /* Remove links to this Widget_Item */
            p->prev->next = p->next;
            p->next->prev = p->prev;
     do {
        if (p->widget == what){
            /* Remove links to this Widget_Item */
            p->prev->next = p->next;
            p->next->prev = p->prev;
-           
+
            /* Make sure h->current is always valid */
            if (p == h->current){
                h->current = h->current->next;
            /* Make sure h->current is always valid */
            if (p == h->current){
                h->current = h->current->next;
@@ -381,7 +381,7 @@ void dlg_broadcast_msg_to (Dlg_head *h, int message, int reverse, int flags)
 
     if (!h->current)
            return;
 
     if (!h->current)
            return;
-                   
+
     if (reverse)
        first = p = h->current->prev;
     else
     if (reverse)
        first = p = h->current->prev;
     else
@@ -434,13 +434,13 @@ static void select_a_widget (Dlg_head *h, int down)
 
     if (!down)
        direction = !direction;
 
     if (!down)
        direction = !direction;
-    
+
     do {
        if (direction)
            h->current = h->current->next;
        else
            h->current = h->current->prev;
     do {
        if (direction)
            h->current = h->current->next;
        else
            h->current = h->current->prev;
-       
+
        (*h->callback) (h, h->current->dlg_id, DLG_ONE_DOWN);
     } while (!dlg_focus (h));
 }
        (*h->callback) (h, h->current->dlg_id, DLG_ONE_DOWN);
     } while (!dlg_focus (h));
 }
@@ -466,7 +466,7 @@ Widget *find_widget_type (Dlg_head *h, callback_fn signature)
 
     if (!h)
        return 0;
 
     if (!h)
        return 0;
-    
+
     w = 0;
     for (i = 0, item = h->current; i < h->count; i++, item = item->next){
        if (item->widget->callback == signature){
     w = 0;
     for (i = 0, item = h->current; i < h->count; i++, item = item->next){
        if (item->widget->callback == signature){
@@ -485,7 +485,7 @@ void dlg_one_up (Dlg_head *h)
     /* If it accepts unFOCUSion */
     if (!dlg_unfocus(h))
        return;
     /* If it accepts unFOCUSion */
     if (!dlg_unfocus(h))
        return;
-    
+
     select_a_widget (h, 0);
     if (dlg_overlap (old->widget, h->current->widget)){
        send_message (h, h->current->widget, WIDGET_DRAW, 0);
     select_a_widget (h, 0);
     if (dlg_overlap (old->widget, h->current->widget)){
        send_message (h, h->current->widget, WIDGET_DRAW, 0);
@@ -501,7 +501,7 @@ void dlg_one_down (Dlg_head *h)
     if (!dlg_unfocus (h))
        return;
 
     if (!dlg_unfocus (h))
        return;
 
-    select_a_widget (h, 1); 
+    select_a_widget (h, 1);
     if (dlg_overlap (old->widget, h->current->widget)){
        send_message (h, h->current->widget, WIDGET_DRAW, 0);
        send_message (h, h->current->widget, WIDGET_FOCUS, 0);
     if (dlg_overlap (old->widget, h->current->widget)){
        send_message (h, h->current->widget, WIDGET_DRAW, 0);
        send_message (h, h->current->widget, WIDGET_FOCUS, 0);
@@ -547,7 +547,7 @@ void update_cursor (Dlg_head *h)
        send_message (h, h->current->widget, WIDGET_CURSOR, 0);
     else {
        Widget_Item *p = h->current;
        send_message (h, h->current->widget, WIDGET_CURSOR, 0);
     else {
        Widget_Item *p = h->current;
-    
+
        do {
            if (p->widget->options & W_WANT_CURSOR)
                if ((*p->widget->callback)(h, p->widget, WIDGET_CURSOR, 0)){
        do {
            if (p->widget->options & W_WANT_CURSOR)
                if ((*p->widget->callback)(h, p->widget, WIDGET_CURSOR, 0)){
@@ -567,7 +567,7 @@ void dlg_redraw (Dlg_head *h)
     (h->callback)(h, 0, DLG_DRAW);
 
     dlg_broadcast_msg (h, WIDGET_DRAW, 1);
     (h->callback)(h, 0, DLG_DRAW);
 
     dlg_broadcast_msg (h, WIDGET_DRAW, 1);
-    
+
     update_cursor (h);
 }
 
     update_cursor (h);
 }
 
@@ -579,7 +579,7 @@ void dlg_refresh (void *parameter)
 void dlg_stop (Dlg_head *h)
 {
     h->running = 0;
 void dlg_stop (Dlg_head *h)
 {
     h->running = 0;
-    x_dialog_stop (h); 
+    x_dialog_stop (h);
 }
 
 static INLINE void dialog_handle_key (Dlg_head *h, int d_key)
 }
 
 static INLINE void dialog_handle_key (Dlg_head *h, int d_key)
@@ -591,7 +591,7 @@ static INLINE void dialog_handle_key (Dlg_head *h, int d_key)
     case KEY_UP:
        dlg_one_up (h);
        break;
     case KEY_UP:
        dlg_one_up (h);
        break;
-       
+
     case KEY_RIGHT:
     case KEY_DOWN:
        dlg_one_down (h);
     case KEY_RIGHT:
     case KEY_DOWN:
        dlg_one_down (h);
@@ -607,7 +607,7 @@ static INLINE void dialog_handle_key (Dlg_head *h, int d_key)
     case XCTRL('z'):
        suspend_cmd ();
        /* Fall through */
     case XCTRL('z'):
        suspend_cmd ();
        /* Fall through */
-           
+
     case XCTRL('l'):
 #ifndef HAVE_SLANG
        /* Use this if the refreshes fail */
     case XCTRL('l'):
 #ifndef HAVE_SLANG
        /* Use this if the refreshes fail */
@@ -619,7 +619,7 @@ static INLINE void dialog_handle_key (Dlg_head *h, int d_key)
        mc_refresh ();
        doupdate ();
        break;
        mc_refresh ();
        doupdate ();
        break;
-       
+
     case '\n':
     case KEY_ENTER:
        h->ret_value = B_ENTER;
     case '\n':
     case KEY_ENTER:
        h->ret_value = B_ENTER;
@@ -643,7 +643,7 @@ static int dlg_try_hotkey (Dlg_head *h, int d_key)
     Widget_Item *previous;
     int    handled, c;
     extern input_event ();
     Widget_Item *previous;
     int    handled, c;
     extern input_event ();
-    
+
     /*
      * Explanation: we don't send letter hotkeys to other widgets if
      * the currently selected widget is an input line
     /*
      * Explanation: we don't send letter hotkeys to other widgets if
      * the currently selected widget is an input line
@@ -653,7 +653,7 @@ static int dlg_try_hotkey (Dlg_head *h, int d_key)
                if(d_key < 255 && isalpha(d_key))
                        return 0;
     }
                if(d_key < 255 && isalpha(d_key))
                        return 0;
     }
-    
+
     /* If it's an alt key, send the message */
     c = d_key & ~ALT(0);
     if (d_key & ALT(0) && c < 255 && isalpha(c))
     /* If it's an alt key, send the message */
     c = d_key & ~ALT(0);
     if (d_key & ALT(0) && c < 255 && isalpha(c))
@@ -663,27 +663,27 @@ static int dlg_try_hotkey (Dlg_head *h, int d_key)
        /* .ado: fix problem with file_permission under Win95 */
     if (d_key == 0) return 0;
 #endif
        /* .ado: fix problem with file_permission under Win95 */
     if (d_key == 0) return 0;
 #endif
-       
+
     handled = 0;
     if (h->current->widget->options & W_WANT_HOTKEY)
        handled = callback (h) (h, h->current->widget, WIDGET_HOTKEY, d_key);
     handled = 0;
     if (h->current->widget->options & W_WANT_HOTKEY)
        handled = callback (h) (h, h->current->widget, WIDGET_HOTKEY, d_key);
-    
+
     /* If not used, send hotkey to other widgets */
     if (handled)
        return handled;
     /* If not used, send hotkey to other widgets */
     if (handled)
        return handled;
-    
+
     hot_cur = h->current;
     hot_cur = h->current;
-    
+
     /* send it to all widgets */
     do {
        if (hot_cur->widget->options & W_WANT_HOTKEY)
            handled |= (*hot_cur->widget->callback)
                (h, hot_cur->widget, WIDGET_HOTKEY, d_key);
     /* send it to all widgets */
     do {
        if (hot_cur->widget->options & W_WANT_HOTKEY)
            handled |= (*hot_cur->widget->callback)
                (h, hot_cur->widget, WIDGET_HOTKEY, d_key);
-       
+
        if (!handled)
            hot_cur = hot_cur->next;
     } while (h->current != hot_cur && !handled);
        if (!handled)
            hot_cur = hot_cur->next;
     } while (h->current != hot_cur && !handled);
-       
+
     if (!handled)
        return 0;
 
     if (!handled)
        return 0;
 
@@ -691,7 +691,7 @@ static int dlg_try_hotkey (Dlg_head *h, int d_key)
     previous = h->current;
     if (!dlg_unfocus (h))
        return handled;
     previous = h->current;
     if (!dlg_unfocus (h))
        return handled;
-    
+
     h->current = hot_cur;
     if (!dlg_focus (h)){
        h->current = previous;
     h->current = hot_cur;
     if (!dlg_focus (h)){
        h->current = previous;
@@ -703,7 +703,7 @@ static int dlg_try_hotkey (Dlg_head *h, int d_key)
 void dlg_key_event (Dlg_head *h, int d_key)
 {
     int handled;
 void dlg_key_event (Dlg_head *h, int d_key)
 {
     int handled;
-    
+
     /* TAB used to cycle */
     if (!h->raw && (d_key == '\t' || d_key == KEY_BTAB))
        if (d_key == '\t')
     /* TAB used to cycle */
     if (!h->raw && (d_key == '\t' || d_key == KEY_BTAB))
        if (d_key == '\t')
@@ -711,22 +711,22 @@ void dlg_key_event (Dlg_head *h, int d_key)
         else
            dlg_one_up (h);
     else {
         else
            dlg_one_up (h);
     else {
-       
+
        /* first can dlg_callback handle the key */
        handled = (*h->callback) (h, d_key, DLG_KEY);
 
        /* next try the hotkey */
        if (!handled)
            handled = dlg_try_hotkey (h, d_key);
        /* first can dlg_callback handle the key */
        handled = (*h->callback) (h, d_key, DLG_KEY);
 
        /* next try the hotkey */
        if (!handled)
            handled = dlg_try_hotkey (h, d_key);
-       
+
        /* not used - then try widget_callback */
        if (!handled)
            handled |= callback (h)(h, h->current->widget, WIDGET_KEY, d_key);
        /* not used - then try widget_callback */
        if (!handled)
            handled |= callback (h)(h, h->current->widget, WIDGET_KEY, d_key);
-       
+
        /* not used- try to use the unhandled case */
        if (!handled)
            handled |= (*h->callback) (h, d_key, DLG_UNHANDLED_KEY);
        /* not used- try to use the unhandled case */
        if (!handled)
            handled |= (*h->callback) (h, d_key, DLG_UNHANDLED_KEY);
-       
+
        if (!handled)
            dialog_handle_key (h, d_key);
        (*h->callback) (h, d_key, DLG_POST_KEY);
        if (!handled)
            dialog_handle_key (h, d_key);
        (*h->callback) (h, d_key, DLG_POST_KEY);
@@ -752,8 +752,8 @@ static INLINE int dlg_mouse_event (Dlg_head *h, Gpm_Event *event)
        Widget *widget = item->widget;
 
        item = item->next;
        Widget *widget = item->widget;
 
        item = item->next;
-       
-       if (!((x > widget->x) && (x <= widget->x+widget->cols) 
+
+       if (!((x > widget->x) && (x <= widget->x+widget->cols)
            && (y > widget->y) && (y <= widget->y+widget->lines)))
            continue;
 
            && (y > widget->y) && (y <= widget->y+widget->lines)))
            continue;
 
@@ -777,7 +777,7 @@ void init_dlg (Dlg_head *h)
     int refresh_mode;
 
     tk_end_frame ();
     int refresh_mode;
 
     tk_end_frame ();
-    
+
     /* Initialize dialog manager and widgets */
     (*h->callback) (h, 0, DLG_INIT);
     dlg_broadcast_msg (h, WIDGET_INIT, 0);
     /* Initialize dialog manager and widgets */
     (*h->callback) (h, 0, DLG_INIT);
     dlg_broadcast_msg (h, WIDGET_INIT, 0);
@@ -788,23 +788,23 @@ void init_dlg (Dlg_head *h)
        refresh_mode = REFRESH_COVERS_PART;
     push_refresh (dlg_refresh, h, refresh_mode);
     h->refresh_pushed = 1;
        refresh_mode = REFRESH_COVERS_PART;
     push_refresh (dlg_refresh, h, refresh_mode);
     h->refresh_pushed = 1;
-    
+
     /* Initialize direction */
     if (!h->direction)
        h->current =  h->first;
     /* Initialize direction */
     if (!h->direction)
        h->current =  h->first;
-       
+
     if (h->initfocus != NULL)
         h->current = h->initfocus;
 
     h->previous_dialog = current_dlg;
     current_dlg = h;
     if (h->initfocus != NULL)
         h->current = h->initfocus;
 
     h->previous_dialog = current_dlg;
     current_dlg = h;
-    
+
     /* Initialize the mouse status */
     h->mouse_status = 0;
 
     /* Redraw the screen */
     dlg_redraw (h);
     /* Initialize the mouse status */
     h->mouse_status = 0;
 
     /* Redraw the screen */
     dlg_redraw (h);
-    
+
     while (!dlg_focus (h))
        h->current = h->current->next;
 
     while (!dlg_focus (h))
        h->current = h->current->next;
 
@@ -830,7 +830,7 @@ void dlg_process_event (Dlg_head *h, int key, Gpm_Event *event)
        else
            return;
     }
        else
            return;
     }
-    
+
     if (key == EV_MOUSE)
        h->mouse_status = dlg_mouse_event (h, event);
     else
     if (key == EV_MOUSE)
        h->mouse_status = dlg_mouse_event (h, event);
     else
@@ -854,7 +854,7 @@ frontend_run_dlg (Dlg_head *h)
        if (is_idle ()){
            if (idle_hook)
                execute_hooks (idle_hook);
        if (is_idle ()){
            if (idle_hook)
                execute_hooks (idle_hook);
-           
+
            while (h->send_idle_msg && is_idle ()){
                (*h->callback) (h, 0, DLG_IDLE);
            }
            while (h->send_idle_msg && is_idle ()){
                (*h->callback) (h, 0, DLG_IDLE);
            }
@@ -891,7 +891,7 @@ destroy_dlg (Dlg_head *h)
     Widget_Item *c;
 
     if (h->refresh_pushed)
     Widget_Item *c;
 
     if (h->refresh_pushed)
-       pop_refresh (); 
+       pop_refresh ();
 
     x_destroy_dlg_start (h);
     dlg_broadcast_msg (h, WIDGET_DESTROY, 0);
 
     x_destroy_dlg_start (h);
     dlg_broadcast_msg (h, WIDGET_DESTROY, 0);
@@ -930,13 +930,13 @@ void dlg_replace_widget (Dlg_head *h, Widget *old, Widget *new)
 {
     Widget_Item *p = h->current;
     int should_focus = 0;
 {
     Widget_Item *p = h->current;
     int should_focus = 0;
-    
+
     do {
        if (p->widget == old){
 
            if (old == h->current->widget)
                should_focus = 1;
     do {
        if (p->widget == old){
 
            if (old == h->current->widget)
                should_focus = 1;
-           
+
            /* We found the widget */
            /* First kill the widget */
            new->focused = old->focused;
            /* We found the widget */
            /* First kill the widget */
            new->focused = old->focused;
@@ -1002,14 +1002,14 @@ int dlg_select_nth_widget (Dlg_head *h, int n)
 static void tk_frame_proc (Dlg_head *h, char *frame, int new_frame)
 {
     char *s = strdup (frame);
 static void tk_frame_proc (Dlg_head *h, char *frame, int new_frame)
 {
     char *s = strdup (frame);
-    
+
     if (frame [strlen (frame)-1] != '.'){
        fprintf (stderr, "Invalid frame name\n");
        exit (1);
     }
     s [strlen (frame)-1] = 0;
     the_frame = frame;
     if (frame [strlen (frame)-1] != '.'){
        fprintf (stderr, "Invalid frame name\n");
        exit (1);
     }
     s [strlen (frame)-1] = 0;
     the_frame = frame;
-    
+
     if (new_frame)
        tk_evalf ("frame %s.%s", (char *)h->wdata, s);
 }
     if (new_frame)
        tk_evalf ("frame %s.%s", (char *)h->wdata, s);
 }
index 097ae6d..0888834 100644 (file)
@@ -53,7 +53,7 @@ enum {
     DLG_KEY,                   /* Sent on keypress before sending to widget */
     DLG_INIT,                  /* Sent on init */
     DLG_END,                   /* Sent on shutdown */
     DLG_KEY,                   /* Sent on keypress before sending to widget */
     DLG_INIT,                  /* Sent on init */
     DLG_END,                   /* Sent on shutdown */
-    DLG_ACTION,                        
+    DLG_ACTION,
     DLG_DRAW,                  /* Sent for updating dialog managed area */
     DLG_FOCUS,                 /* Sent on give focus to a widget */
     DLG_UNFOCUS,               /* Sent on remove focus from widget */
     DLG_DRAW,                  /* Sent for updating dialog managed area */
     DLG_FOCUS,                 /* Sent on give focus to a widget */
     DLG_UNFOCUS,               /* Sent on remove focus from widget */
@@ -77,10 +77,10 @@ typedef struct Dlg_head {
 
     void *previous_dialog;     /* Pointer to the previously running Dlg_head */
     int  refresh_pushed;       /* Did the dialog actually run? */
 
     void *previous_dialog;     /* Pointer to the previously running Dlg_head */
     int  refresh_pushed;       /* Did the dialog actually run? */
-    
+
     /* position */
     int x, y;                  /* Position relative to screen origin */
     /* position */
     int x, y;                  /* Position relative to screen origin */
-    
+
     /* Flags */
     int running;
     int direction;
     /* Flags */
     int running;
     int direction;
@@ -92,7 +92,7 @@ typedef struct Dlg_head {
     /* Internal variables */
     struct Widget_Item *current, *first, *last;
     int (*callback) (struct Dlg_head *, int, int);
     /* Internal variables */
     struct Widget_Item *current, *first, *last;
     int (*callback) (struct Dlg_head *, int, int);
-    
+
     struct Widget_Item *initfocus;
 
     /* Hacks */
     struct Widget_Item *initfocus;
 
     /* Hacks */
@@ -101,10 +101,10 @@ typedef struct Dlg_head {
     int cols;
     int lines;
     void *data;
     int cols;
     int lines;
     void *data;
-    
+
     int  has_menubar;  /* GrossHack: Send events on row 1 to a menubar? */
     int  raw;          /* Should the tab key be sent to the dialog? */
     int  has_menubar;  /* GrossHack: Send events on row 1 to a menubar? */
     int  raw;          /* Should the tab key be sent to the dialog? */
-    
+
     widget_data wdata;
     int  grided;       /* Does it use the automatic layout? */
 #ifdef HAVE_GNOME
     widget_data wdata;
     int  grided;       /* Does it use the automatic layout? */
 #ifdef HAVE_GNOME
@@ -114,30 +114,30 @@ typedef struct Dlg_head {
 
 /* XView widget layout */
 
 
 /* XView widget layout */
 
-typedef enum { 
+typedef enum {
     XV_WLAY_DONTCARE, /* Place the widget wherever it is reasonable */
     XV_WLAY_DONTCARE, /* Place the widget wherever it is reasonable */
-    
+
     XV_WLAY_RIGHTOF,  /* Place the widget to the right of the last widget
                       * created - note: add_widget creates widgets from
                       *  the last to the first one.
                       */
     XV_WLAY_RIGHTOF,  /* Place the widget to the right of the last widget
                       * created - note: add_widget creates widgets from
                       *  the last to the first one.
                       */
-    
+
     XV_WLAY_BELOWOF,  /* Place it in a column like style */
     XV_WLAY_BELOWOF,  /* Place it in a column like style */
-    
+
     XV_WLAY_BELOWCLOSE,/* The same, but without any gap between them */
     XV_WLAY_BELOWCLOSE,/* The same, but without any gap between them */
-    
+
     XV_WLAY_NEXTROW,  /* Place it on the left margin with Y bellow all the
                       * previous widgets
                       */
     XV_WLAY_NEXTROW,  /* Place it on the left margin with Y bellow all the
                       * previous widgets
                       */
-    
+
     XV_WLAY_CENTERROW,/* The same as previous, but when the dialog is
                       * ready to show, tries to center that row of widgets
                       */
     XV_WLAY_CENTERROW,/* The same as previous, but when the dialog is
                       * ready to show, tries to center that row of widgets
                       */
-    
+
     XV_WLAY_NEXTCOLUMN, /* Place it on the top margin with X behind all the
                       * previous widgets
                       */
     XV_WLAY_NEXTCOLUMN, /* Place it on the top margin with X behind all the
                       * previous widgets
                       */
-                      
+
     XV_WLAY_RIGHTDOWN, /* Place the widget to the right of the last one with
                        * y set so that both y + h and yold + hold are equal.
                          This is usefull if the previous widget was a radio,
     XV_WLAY_RIGHTDOWN, /* Place the widget to the right of the last one with
                        * y set so that both y + h and yold + hold are equal.
                          This is usefull if the previous widget was a radio,
@@ -213,20 +213,20 @@ int  add_widgetl          (Dlg_head *dest, void *Widget, WLay layout);
 int  remove_widget        (Dlg_head *dest, void *Widget);
 int  destroy_widget       (Widget *w);
 
 int  remove_widget        (Dlg_head *dest, void *Widget);
 int  destroy_widget       (Widget *w);
 
-/* Runs dialog d */       
+/* Runs dialog d */
 void run_dlg              (Dlg_head *d);
 void run_dlg              (Dlg_head *d);
-                         
+
 void dlg_run_done         (Dlg_head *h);
 void dlg_process_event    (Dlg_head *h, int key, Gpm_Event *event);
 void init_dlg             (Dlg_head *h);
 
 /* To activate/deactivate the idle message generation */
 void set_idle_proc        (Dlg_head *d, int state);
 void dlg_run_done         (Dlg_head *h);
 void dlg_process_event    (Dlg_head *h, int key, Gpm_Event *event);
 void init_dlg             (Dlg_head *h);
 
 /* To activate/deactivate the idle message generation */
 void set_idle_proc        (Dlg_head *d, int state);
-                         
+
 void dlg_redraw           (Dlg_head *h);
 void dlg_refresh          (void *parameter);
 void destroy_dlg          (Dlg_head *h);
 void dlg_redraw           (Dlg_head *h);
 void dlg_refresh          (void *parameter);
 void destroy_dlg          (Dlg_head *h);
-                         
+
 void widget_set_size      (Widget *widget, int x1, int y1, int x2, int y2);
 
 void dlg_broadcast_msg_to (Dlg_head *h, int message, int reverse, int flags);
 void widget_set_size      (Widget *widget, int x1, int y1, int x2, int y2);
 
 void dlg_broadcast_msg_to (Dlg_head *h, int message, int reverse, int flags);
index 0f2b6bf..3b68afc 100644 (file)
@@ -1,14 +1,14 @@
 /* Extension dependent execution.
    Copyright (C) 1994, 1995 The Free Software Foundation
 /* Extension dependent execution.
    Copyright (C) 1994, 1995 The Free Software Foundation
-   
+
    Written by: 1995 Jakub Jelinek
                1994 Miguel de Icaza
    Written by: 1995 Jakub Jelinek
                1994 Miguel de Icaza
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #include <sys/wait.h>
 #endif /* SCO_FLAVOR */
 
 #include <sys/wait.h>
 #endif /* SCO_FLAVOR */
 
-/* "$Id: ext.c,v 1.1 2001/12/30 09:55:26 sedwards Exp $" */
+/* "$Id$" */
 
 /* If set, we execute the file command to check the file type */
 int use_file_to_check_type = 1;
 
 /* This variable points to a copy of the mc.ext file in memory
 
 /* If set, we execute the file command to check the file type */
 int use_file_to_check_type = 1;
 
 /* This variable points to a copy of the mc.ext file in memory
- * With this we avoid loading/parsing the file each time we 
- * need it 
+ * With this we avoid loading/parsing the file each time we
+ * need it
  */
 static char *data = NULL;
 
  */
 static char *data = NULL;
 
@@ -83,7 +83,7 @@ char *gettmpcmdname(){
            break;
     }
     return tmpcmdfilename;
            break;
     }
     return tmpcmdfilename;
-} 
+}
 #endif
 
 void
 #endif
 
 void
@@ -93,7 +93,7 @@ flush_extension_file (void)
         free (data);
         data = NULL;
     }
         free (data);
         data = NULL;
     }
-   
+
 }
 
 typedef char *(*quote_func_t)(const char *name, int i);
 }
 
 typedef char *(*quote_func_t)(const char *name, int i);
@@ -120,10 +120,10 @@ quote_block (quote_func_t quote_func, char **quoting_block)
                tail += temp_len + 1;
                free (temp);
        }
                tail += temp_len + 1;
                free (temp);
        }
-       
+
        return result;
 }
        return result;
 }
-            
+
 static void
 exec_extension (char *filename, char *data, char **drops, int *move_dir, int start_line)
 {
 static void
 exec_extension (char *filename, char *data, char **drops, int *move_dir, int start_line)
 {
@@ -151,7 +151,7 @@ exec_extension (char *filename, char *data, char **drops, int *move_dir, int sta
        do_local_copy = 1;
     else
        do_local_copy = 0;
        do_local_copy = 1;
     else
        do_local_copy = 0;
-    
+
     /* Note: this has to be done after the getlocalcopy call,
      * since it uses tmpnam as well
      */
     /* Note: this has to be done after the getlocalcopy call,
      * since it uses tmpnam as well
      */
@@ -159,7 +159,7 @@ exec_extension (char *filename, char *data, char **drops, int *move_dir, int sta
     file_name =  strdup (gettmpcmdname ());
 #else
     file_name =  strdup (tmpnam (NULL));
     file_name =  strdup (gettmpcmdname ());
 #else
     file_name =  strdup (tmpnam (NULL));
-#endif    
+#endif
     if ((cmd_file_fd = open (file_name, O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600)) == -1){
        message (1, MSG_ERROR, _(" Can't create temporary command file \n %s "),
                 unix_error_string (errno));
     if ((cmd_file_fd = open (file_name, O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600)) == -1){
        message (1, MSG_ERROR, _(" Can't create temporary command file \n %s "),
                 unix_error_string (errno));
@@ -206,7 +206,7 @@ exec_extension (char *filename, char *data, char **drops, int *move_dir, int sta
            else {
                int i = check_format_view (data);
                char *v;
            else {
                int i = check_format_view (data);
                char *v;
-               
+
                if (i){
                    data += i - 1;
                    run_view = 1;
                if (i){
                    data += i - 1;
                    run_view = 1;
@@ -275,11 +275,11 @@ exec_extension (char *filename, char *data, char **drops, int *move_dir, int sta
            changed_hex_mode = 1;
        if (def_nroff_flag != default_nroff_flag)
            changed_nroff_flag = 1;
            changed_hex_mode = 1;
        if (def_nroff_flag != default_nroff_flag)
            changed_nroff_flag = 1;
-       
+
        /* If we've written whitespace only, then just load filename
         * into view
         */
        /* If we've written whitespace only, then just load filename
         * into view
         */
-       if (written_nonspace) 
+       if (written_nonspace)
            view (file_name, filename, move_dir, start_line);
        else
            view (0, filename, move_dir, start_line);
            view (file_name, filename, move_dir, start_line);
        else
            view (0, filename, move_dir, start_line);
@@ -294,7 +294,7 @@ exec_extension (char *filename, char *data, char **drops, int *move_dir, int sta
        p = buffer;
        while (*p == ' ' && *p == '\t')
            p++;
        p = buffer;
        while (*p == ' ' && *p == '\t')
            p++;
-           
+
        /* Search last non-space character. Start search at the end in order
           not to short filenames containing spaces. */
        q = p + strlen (p) - 1;
        /* Search last non-space character. Start search at the end in order
           not to short filenames containing spaces. */
        q = p + strlen (p) - 1;
@@ -312,10 +312,10 @@ exec_extension (char *filename, char *data, char **drops, int *move_dir, int sta
                show_console_contents (output_start_y,
                                       LINES-keybar_visible-output_lines-1,
                                       LINES-keybar_visible-1);
                show_console_contents (output_start_y,
                                       LINES-keybar_visible-output_lines-1,
                                       LINES-keybar_visible-1);
-               
+
            }
        }
            }
        }
-       
+
 #ifdef OLD_CODE
        if (vfs_current_is_local ())
            shell_execute (file_name, EXECUTE_INTERNAL);
 #ifdef OLD_CODE
        if (vfs_current_is_local ())
            shell_execute (file_name, EXECUTE_INTERNAL);
@@ -376,12 +376,12 @@ char *regex_command (char *filename, char *action, char **drops, int *move_dir)
     int view_at_line_number;
     char *include_target;
     int include_target_len;
     int view_at_line_number;
     char *include_target;
     int include_target_len;
-    
+
 #ifdef FILE_STDIN
     int file_supports_stdin = 1;
 #else
     int file_supports_stdin = 0;
 #ifdef FILE_STDIN
     int file_supports_stdin = 1;
 #else
     int file_supports_stdin = 0;
-#endif    
+#endif
 
     /* Check for the special View:%d parameter */
     if (action && strncmp (action, "View:", 5) == 0){
 
     /* Check for the special View:%d parameter */
     if (action && strncmp (action, "View:", 5) == 0){
@@ -413,13 +413,13 @@ check_stock_mc_ext:
                data = NULL;
                if (extension_file == buffer) {
                    home_error = 1;
                data = NULL;
                if (extension_file == buffer) {
                    home_error = 1;
-                   goto check_stock_mc_ext;            
+                   goto check_stock_mc_ext;
                } else {
                     char *msg;
                     char *msg2;
                     msg = copy_strings(" ", mc_home, MC_LIB_EXT, _(" file error"), NULL);
                } else {
                     char *msg;
                     char *msg2;
                     msg = copy_strings(" ", mc_home, MC_LIB_EXT, _(" file error"), NULL);
-                    msg2 = copy_strings(_("Format of the "), 
-                                         mc_home, 
+                    msg2 = copy_strings(_("Format of the "),
+                                         mc_home,
 ("mc.ext file has changed\n\
 with version 3.0. It seems that installation\n\
 failed. Please fetch a fresh new copy from the\n\
 ("mc.ext file has changed\n\
 with version 3.0. It seems that installation\n\
 failed. Please fetch a fresh new copy from the\n\
@@ -449,7 +449,7 @@ file as an example of how to write it.\n\
         free (buffer);
     }
     mc_stat (filename, &mystat);
         free (buffer);
     }
     mc_stat (filename, &mystat);
-    
+
     if (regex_command_title){
        free (regex_command_title);
        regex_command_title = NULL;
     if (regex_command_title){
        free (regex_command_title);
        regex_command_title = NULL;
@@ -473,11 +473,11 @@ file as an example of how to write it.\n\
                       * keyword/descNL
                       */
            if (found && action == NULL) /* We have already accumulated all
                       * keyword/descNL
                       */
            if (found && action == NULL) /* We have already accumulated all
-                                         * the user actions 
+                                         * the user actions
                                          */
                break;
            found = 0;
                                          */
                break;
            found = 0;
-           q = strchr (p, '\n'); 
+           q = strchr (p, '\n');
            if (q == NULL)
                q = strchr (p, 0);
            c = *q;
            if (q == NULL)
                q = strchr (p, 0);
            c = *q;
@@ -499,7 +499,7 @@ file as an example of how to write it.\n\
            } else if (!strncmp (p, "shell/", 6)) {
                p += 6;
                if (*p == '.') {
            } else if (!strncmp (p, "shell/", 6)) {
                p += 6;
                if (*p == '.') {
-                   if (!strncmp (p, filename + file_len - (q - p), 
+                   if (!strncmp (p, filename + file_len - (q - p),
                        q - p))
                        found = 1;
                } else {
                        q - p))
                        found = 1;
                } else {
@@ -509,7 +509,7 @@ file as an example of how to write it.\n\
            } else if (!strncmp (p, "type/", 5)) {
                int islocal = vfs_file_is_local (filename);
                p += 5;
            } else if (!strncmp (p, "type/", 5)) {
                int islocal = vfs_file_is_local (filename);
                p += 5;
-               
+
                if (islocal || file_supports_stdin) {
                    char *pp;
                    int hasread = use_file_to_check_type;
                if (islocal || file_supports_stdin) {
                    char *pp;
                    int hasread = use_file_to_check_type;
@@ -523,18 +523,18 @@ file as an example of how to write it.\n\
                        char *command =
                            copy_strings (FILE_CMD, tmp, NULL);
                        FILE *f = popen (command, "r");
                        char *command =
                            copy_strings (FILE_CMD, tmp, NULL);
                        FILE *f = popen (command, "r");
-                   
+
                        free (tmp);
                        free (command);
                        if (f != NULL) {
                        free (tmp);
                        free (command);
                        if (f != NULL) {
-                           hasread = (fgets (content_string, 2047, f) 
+                           hasread = (fgets (content_string, 2047, f)
                                != NULL);
                            if (!hasread)
                                content_string [0] = 0;
                            pclose (f);
 #ifdef SCO_FLAVOR
                                != NULL);
                            if (!hasread)
                                content_string [0] = 0;
                            pclose (f);
 #ifdef SCO_FLAVOR
-                           /* 
-                           **  SCO 3.2 does has a buggy pclose(), so 
+                           /*
+                           **  SCO 3.2 does has a buggy pclose(), so
                            **  <command> become zombie (alex)
                            */
                            waitpid(-1,NULL,WNOHANG);
                            **  <command> become zombie (alex)
                            */
                            waitpid(-1,NULL,WNOHANG);
@@ -546,18 +546,18 @@ file as an example of how to write it.\n\
 #else
                        int pipehandle, remotehandle;
                        pid_t p;
 #else
                        int pipehandle, remotehandle;
                        pid_t p;
-                   
+
                        remotehandle = mc_open (filename, O_RDONLY);
                        if (remotehandle != -1) {
                        /* 8192 is HOWMANY hardcoded value in the file-3.14
                         * sources. Tell me if any other file uses larger
                        remotehandle = mc_open (filename, O_RDONLY);
                        if (remotehandle != -1) {
                        /* 8192 is HOWMANY hardcoded value in the file-3.14
                         * sources. Tell me if any other file uses larger
-                        * chunk from beginning 
+                        * chunk from beginning
                         */
                            pipehandle = mc_doublepopen
                            (remotehandle, 8192, &p,"file", "file", "-", NULL);
                            if (pipehandle != -1) {
                                int i;
                         */
                            pipehandle = mc_doublepopen
                            (remotehandle, 8192, &p,"file", "file", "-", NULL);
                            if (pipehandle != -1) {
                                int i;
-                               while ((i = read (pipehandle, content_string 
+                               while ((i = read (pipehandle, content_string
                                     + hasread, 2047 - hasread)) > 0)
                                    hasread += i;
                                mc_doublepclose (pipehandle, p);
                                     + hasread, 2047 - hasread)) > 0)
                                    hasread += i;
                                mc_doublepclose (pipehandle, p);
@@ -572,22 +572,22 @@ match_file_output:
                    if (hasread) {
                        if ((pp = strchr (content_string, '\n')) != 0)
                            *pp = 0;
                    if (hasread) {
                        if ((pp = strchr (content_string, '\n')) != 0)
                            *pp = 0;
-                       if (islocal && !strncmp (content_string, 
+                       if (islocal && !strncmp (content_string,
                            filename, file_len)) {
                            content_shift = file_len;
                            if (content_string [content_shift] == ':')
                            filename, file_len)) {
                            content_shift = file_len;
                            if (content_string [content_shift] == ':')
-                               for (content_shift++; 
-                                   content_string [content_shift] == ' '; 
+                               for (content_shift++;
+                                   content_string [content_shift] == ' ';
                                    content_shift++);
                                    content_shift++);
-                       } else if (!islocal 
-                                  && !strncmp (content_string, 
+                       } else if (!islocal
+                                  && !strncmp (content_string,
                                                "standard input:", 15)) {
                            for (content_shift = 15;
                                content_string [content_shift] == ' ';
                                content_shift++);
                        }
                                                "standard input:", 15)) {
                            for (content_shift = 15;
                                content_string [content_shift] == ' ';
                                content_shift++);
                        }
-                       if (content_string && 
-                           regexp_match (p, content_string + 
+                       if (content_string &&
+                           regexp_match (p, content_string +
                                content_shift, match_normal)){
                            found = 1;
                        }
                                content_shift, match_normal)){
                            found = 1;
                        }
@@ -623,13 +623,13 @@ match_file_output:
                        *r = c;
                        p = q;
                        found = 0;
                        *r = c;
                        p = q;
                        found = 0;
-                       
+
                        if (!*p)
                            break;
                        continue;
                    }
                    if (action == NULL) {
                        if (!*p)
                            break;
                        continue;
                    }
                    if (action == NULL) {
-                       if (strcmp (p, "Open") && 
+                       if (strcmp (p, "Open") &&
                            strcmp (p, "View") &&
                            strcmp (p, "Edit") &&
                            strcmp (p, "Drop") &&
                            strcmp (p, "View") &&
                            strcmp (p, "Edit") &&
                            strcmp (p, "Drop") &&
@@ -638,11 +638,11 @@ match_file_output:
                            strcmp (p, "Title")) {
                            /* I.e. this is a name of a user defined action */
                                static char *q;
                            strcmp (p, "Title")) {
                            /* I.e. this is a name of a user defined action */
                                static char *q;
-                               
+
                                if (to_return == NULL) {
                                    to_return = xmalloc (512, "Action list");
                                    q = to_return;
                                if (to_return == NULL) {
                                    to_return = xmalloc (512, "Action list");
                                    q = to_return;
-                               } else 
+                               } else
                                    *(q++) = '='; /* Mark separator */
                                strcpy (q, p);
                                q = strchr (q, 0);
                                    *(q++) = '='; /* Mark separator */
                                strcpy (q, p);
                                q = strchr (q, 0);
@@ -679,11 +679,11 @@ match_file_output:
                         * filename parameter invalid (ie, most of the time,
                         * we get filename as a pointer from cpanel->dir).
                         */
                         * filename parameter invalid (ie, most of the time,
                         * we get filename as a pointer from cpanel->dir).
                         */
-                       if (p < q) { 
+                       if (p < q) {
                            char *filename_copy = strdup (filename);
                            exec_extension (filename_copy, r + 1, drops, move_dir, view_at_line_number);
                            free (filename_copy);
                            char *filename_copy = strdup (filename);
                            exec_extension (filename_copy, r + 1, drops, move_dir, view_at_line_number);
                            free (filename_copy);
-                           
+
                            to_return = "Success";
                        }
                        break;
                            to_return = "Success";
                        }
                        break;
index 1d86c41..ea1da99 100644 (file)
@@ -3,7 +3,7 @@
 
 char *regex_command (char *filename, char *action, char **drops, int *move_dir);
 
 
 char *regex_command (char *filename, char *action, char **drops, int *move_dir);
 
-/* Call it after the user has edited the mc.ext file, 
+/* Call it after the user has edited the mc.ext file,
  * to flush the cached mc.ext file
  */
 void flush_extension_file (void);
  * to flush the cached mc.ext file
  */
 void flush_extension_file (void);
index df8405f..026057e 100644 (file)
@@ -1,7 +1,7 @@
 /* {{{ Copyright */
 
 /* File managing.  Important notes on this file:
 /* {{{ Copyright */
 
 /* File managing.  Important notes on this file:
-   
+
    About the use of dialogs in this file:
      If you want to add a new dialog box (or call a routine that pops
      up a dialog box), you have to provide a wrapper for background
    About the use of dialogs in this file:
      If you want to add a new dialog box (or call a routine that pops
      up a dialog box), you have to provide a wrapper for background
@@ -19,7 +19,7 @@
 
 /* File managing
    Copyright (C) 1994, 1995, 1996 The Free Software Foundation
 
 /* File managing
    Copyright (C) 1994, 1995, 1996 The Free Software Foundation
-   
+
    Written by: 1994, 1995       Janne Kukonlehto
                1994, 1995       Fred Leeflang
                1994, 1995, 1996 Miguel de Icaza
    Written by: 1994, 1995       Janne Kukonlehto
                1994, 1995       Fred Leeflang
                1994, 1995, 1996 Miguel de Icaza
@@ -40,7 +40,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -63,7 +63,7 @@
 #include <stdio.h>
 #ifdef OS2_NT
 #    include <io.h>
 #include <stdio.h>
 #ifdef OS2_NT
 #    include <io.h>
-#endif 
+#endif
 
 #include <errno.h>
 #include "tty.h"
 
 #include <errno.h>
 #include "tty.h"
@@ -129,8 +129,8 @@ int verbose = 1;
 int dive_into_subdirs = 0;
 
 /* When moving directories cross filesystem boundaries delete the successfull
 int dive_into_subdirs = 0;
 
 /* When moving directories cross filesystem boundaries delete the successfull
-   copied files when all files below the directory and its subdirectories 
-   were processed. 
+   copied files when all files below the directory and its subdirectories
+   were processed.
    If erase_at_end is zero files will be deleted immediately after their
    successful copy (Note: this behaviour is not tested and at the moment
    it can't be changed at runtime) */
    If erase_at_end is zero files will be deleted immediately after their
    successful copy (Note: this behaviour is not tested and at the moment
    it can't be changed at runtime) */
@@ -195,12 +195,12 @@ struct link *linklist = NULL;
 /* the files-to-be-erased list */
 struct link *erase_list;
 
 /* the files-to-be-erased list */
 struct link *erase_list;
 
-/* In copy_dir_dir we use two additional single linked lists: The first - 
-   variable name `parent_dirs' - holds information about already copied 
-   directories and is used to detect cyclic symbolic links. 
-   The second (`dest_dirs' below) holds information about just created 
-   target directories and is used to detect when an directory is copied 
-   into itself (we don't want to copy infinitly). 
+/* In copy_dir_dir we use two additional single linked lists: The first -
+   variable name `parent_dirs' - holds information about already copied
+   directories and is used to detect cyclic symbolic links.
+   The second (`dest_dirs' below) holds information about just created
+   target directories and is used to detect when an directory is copied
+   into itself (we don't want to copy infinitly).
    Both lists don't use the linkcount and name structure members of struct
    link. */
 struct link *dest_dirs = 0;
    Both lists don't use the linkcount and name structure members of struct
    link. */
 struct link *dest_dirs = 0;
@@ -330,7 +330,7 @@ static int
 check_buttons (void)
 {
     x_flush_events ();
 check_buttons (void)
 {
     x_flush_events ();
-    
+
     if (op_dlg->running)
         return FILE_CONT;
 
     if (op_dlg->running)
         return FILE_CONT;
 
@@ -347,7 +347,7 @@ static int
 op_win_callback (struct Dlg_head *h, int id, int msg)
 {
     switch (msg){
 op_win_callback (struct Dlg_head *h, int id, int msg)
 {
     switch (msg){
-#ifndef HAVE_X    
+#ifndef HAVE_X
     case DLG_DRAW:
        attrset (COLOR_NORMAL);
        dlg_erase (h);
     case DLG_DRAW:
        attrset (COLOR_NORMAL);
        dlg_erase (h);
@@ -365,13 +365,13 @@ create_op_win (int op, int with_eta)
     int minus = verbose ? 0 : 3;
     int eta_offset = with_eta ? (WX_ETA_EXTRA) / 2 : 0;
 
     int minus = verbose ? 0 : 3;
     int eta_offset = with_eta ? (WX_ETA_EXTRA) / 2 : 0;
 
-#ifdef HAVE_XVIEW    
+#ifdef HAVE_XVIEW
     char *sixty = "                                                                                   ";
     char *fifteen = "               ";
 #else
     char *sixty = "";
     char *fifteen = "";
     char *sixty = "                                                                                   ";
     char *fifteen = "               ";
 #else
     char *sixty = "";
     char *fifteen = "";
-#endif    
+#endif
     replace_result = 0;
     recursive_result = 0;
     showing_eta = with_eta;
     replace_result = 0;
     recursive_result = 0;
     showing_eta = with_eta;
@@ -387,7 +387,7 @@ create_op_win (int op, int with_eta)
     if ((op_dlg->y + op_dlg->lines) > last_hint_line)
        the_hint->widget.y = op_dlg->y + op_dlg->lines+1;
 #endif
     if ((op_dlg->y + op_dlg->lines) > last_hint_line)
        the_hint->widget.y = op_dlg->y + op_dlg->lines+1;
 #endif
-    
+
     x_set_dialog_title (op_dlg, "");
 
     tk_new_frame (op_dlg, "b.");
     x_set_dialog_title (op_dlg, "");
 
     tk_new_frame (op_dlg, "b.");
@@ -399,37 +399,37 @@ create_op_win (int op, int with_eta)
         XV_WLAY_CENTERROW);
 
     tk_new_frame (op_dlg, "2.");
         XV_WLAY_CENTERROW);
 
     tk_new_frame (op_dlg, "2.");
-    add_widgetl (op_dlg, ProgressGauge [2] = gauge_new (7, FCOPY_GAUGE_X, 0, 100, 0, "g-1"), 
+    add_widgetl (op_dlg, ProgressGauge [2] = gauge_new (7, FCOPY_GAUGE_X, 0, 100, 0, "g-1"),
         XV_WLAY_RIGHTOF);
         XV_WLAY_RIGHTOF);
-    add_widgetl (op_dlg, ProgressLabel [2] = label_new (7, FCOPY_LABEL_X, fifteen, "l-1"), 
+    add_widgetl (op_dlg, ProgressLabel [2] = label_new (7, FCOPY_LABEL_X, fifteen, "l-1"),
         XV_WLAY_NEXTROW);
     add_widgetl (op_dlg, bps_label = label_new (7, WX, "", "bps-label"), XV_WLAY_NEXTROW);
 
         tk_new_frame (op_dlg, "1.");
         XV_WLAY_NEXTROW);
     add_widgetl (op_dlg, bps_label = label_new (7, WX, "", "bps-label"), XV_WLAY_NEXTROW);
 
         tk_new_frame (op_dlg, "1.");
-    add_widgetl (op_dlg, ProgressGauge [1] = gauge_new (8, FCOPY_GAUGE_X, 0, 100, 0, "g-2"), 
+    add_widgetl (op_dlg, ProgressGauge [1] = gauge_new (8, FCOPY_GAUGE_X, 0, 100, 0, "g-2"),
         XV_WLAY_RIGHTOF);
         XV_WLAY_RIGHTOF);
-    add_widgetl (op_dlg, ProgressLabel [1] = label_new (8, FCOPY_LABEL_X, fifteen, "l-2"), 
+    add_widgetl (op_dlg, ProgressLabel [1] = label_new (8, FCOPY_LABEL_X, fifteen, "l-2"),
         XV_WLAY_RIGHTOF);
     add_widgetl (op_dlg, stalled_label = label_new (8, WX, "", "stalled"), XV_WLAY_NEXTROW);
         XV_WLAY_RIGHTOF);
     add_widgetl (op_dlg, stalled_label = label_new (8, WX, "", "stalled"), XV_WLAY_NEXTROW);
-       
+
     tk_new_frame (op_dlg, "0.");
     tk_new_frame (op_dlg, "0.");
-    add_widgetl (op_dlg, ProgressGauge [0] = gauge_new (6, FCOPY_GAUGE_X, 0, 100, 0, "g-3"), 
+    add_widgetl (op_dlg, ProgressGauge [0] = gauge_new (6, FCOPY_GAUGE_X, 0, 100, 0, "g-3"),
         XV_WLAY_RIGHTOF);
         XV_WLAY_RIGHTOF);
-    add_widgetl (op_dlg, ProgressLabel [0] = label_new (6, FCOPY_LABEL_X, fifteen, "l-3"), 
+    add_widgetl (op_dlg, ProgressLabel [0] = label_new (6, FCOPY_LABEL_X, fifteen, "l-3"),
         XV_WLAY_RIGHTOF);
     add_widgetl (op_dlg, eta_label = label_new (6, WX, "", "eta_label"), XV_WLAY_NEXTROW);
         XV_WLAY_RIGHTOF);
     add_widgetl (op_dlg, eta_label = label_new (6, WX, "", "eta_label"), XV_WLAY_NEXTROW);
-    
+
     tk_new_frame (op_dlg, "f1.");
     add_widgetl (op_dlg, FileString [1] = label_new (4, FCOPY_GAUGE_X, sixty, "fs-l-1"),
         XV_WLAY_RIGHTOF);
     tk_new_frame (op_dlg, "f1.");
     add_widgetl (op_dlg, FileString [1] = label_new (4, FCOPY_GAUGE_X, sixty, "fs-l-1"),
         XV_WLAY_RIGHTOF);
-    add_widgetl (op_dlg, FileLabel [1] = label_new (4, FCOPY_LABEL_X, fifteen, "fs-l-2"), 
+    add_widgetl (op_dlg, FileLabel [1] = label_new (4, FCOPY_LABEL_X, fifteen, "fs-l-2"),
         XV_WLAY_NEXTROW);
     tk_new_frame (op_dlg, "f0.");
     add_widgetl (op_dlg, FileString [0] = label_new (3, FCOPY_GAUGE_X, sixty, "fs-x-1"),
         XV_WLAY_RIGHTOF);
         XV_WLAY_NEXTROW);
     tk_new_frame (op_dlg, "f0.");
     add_widgetl (op_dlg, FileString [0] = label_new (3, FCOPY_GAUGE_X, sixty, "fs-x-1"),
         XV_WLAY_RIGHTOF);
-    add_widgetl (op_dlg, FileLabel [0] = label_new (3, FCOPY_LABEL_X, fifteen, "fs-x-2"), 
+    add_widgetl (op_dlg, FileLabel [0] = label_new (3, FCOPY_LABEL_X, fifteen, "fs-x-2"),
         XV_WLAY_NEXTROW);
         XV_WLAY_NEXTROW);
-       
+
     /* We will manage the dialog without any help, that's why
        we have to call init_dlg */
     init_dlg (op_dlg);
     /* We will manage the dialog without any help, that's why
        we have to call init_dlg */
     init_dlg (op_dlg);
@@ -477,12 +477,12 @@ show_source (char *s)
        int i = strlen (cpanel->cwd);
 
        /* We remove the full path we have added before */
        int i = strlen (cpanel->cwd);
 
        /* We remove the full path we have added before */
-        if (!strncmp (s, cpanel->cwd, i)){ 
+        if (!strncmp (s, cpanel->cwd, i)){
             if (s[i] == PATH_SEP)
                s += i + 1;
         }
 #endif /* WITH_FULL_PATHS */
             if (s[i] == PATH_SEP)
                s += i + 1;
         }
 #endif /* WITH_FULL_PATHS */
-       
+
        label_set_text (FileLabel [0], _("Source"));
        label_set_text (FileString [0], truncFileString (s));
        return check_buttons ();
        label_set_text (FileLabel [0], _("Source"));
        label_set_text (FileString [0], truncFileString (s));
        return check_buttons ();
@@ -531,7 +531,7 @@ file_eta_show ()
 
     if (!showing_eta)
        return;
 
     if (!showing_eta)
        return;
-    
+
     eta_hours = eta_secs / (60 * 60);
     eta_mins  = (eta_secs - (eta_hours * 60 * 60)) / 60;
     eta_s     = eta_secs - ((eta_hours * 60 * 60) + eta_mins * 60 );
     eta_hours = eta_secs / (60 * 60);
     eta_mins  = (eta_secs - (eta_hours * 60 * 60)) / 60;
     eta_s     = eta_secs - ((eta_hours * 60 * 60) + eta_mins * 60 );
@@ -552,7 +552,7 @@ file_bps_show ()
                    sprintf (bps_buffer, "%.2f MBS", bps / (1024*1024.0));
            } else
                    sprintf (bps_buffer, "%.2f KBS", bps / 1024.0);
                    sprintf (bps_buffer, "%.2f MBS", bps / (1024*1024.0));
            } else
                    sprintf (bps_buffer, "%.2f KBS", bps / 1024.0);
-    } else 
+    } else
            sprintf (bps_buffer, "%ld BPS", bps);
     label_set_text (bps_label, bps_buffer);
 }
            sprintf (bps_buffer, "%ld BPS", bps);
     label_set_text (bps_label, bps_buffer);
 }
@@ -628,7 +628,7 @@ do_transform_source (char *source)
     int next_reg;
     enum CaseConvs case_conv = NO_CONV;
     static char fntarget [MC_MAXPATHLEN];
     int next_reg;
     enum CaseConvs case_conv = NO_CONV;
     static char fntarget [MC_MAXPATHLEN];
-    
+
     len = strlen (fnsource);
     j = re_match (&rx, fnsource, len, 0, &regs);
     if (j != len) {
     len = strlen (fnsource);
     j = re_match (&rx, fnsource, len, 0, &regs);
     if (j != len) {
@@ -669,7 +669,7 @@ do_transform_source (char *source)
                next_reg = dest_mask [j] - '0';
                /* Fall through */
            }
                next_reg = dest_mask [j] - '0';
                /* Fall through */
            }
-                
+
        case '*':
            if (next_reg < 0 || next_reg >= RE_NREGS
                || regs.start [next_reg] < 0) {
        case '*':
            if (next_reg < 0 || next_reg >= RE_NREGS
                || regs.start [next_reg] < 0) {
@@ -681,7 +681,7 @@ do_transform_source (char *source)
                fntarget [k++] = convert_case (fnsource [l], &case_conv);
            next_reg ++;
            break;
                fntarget [k++] = convert_case (fnsource [l], &case_conv);
            next_reg ++;
            break;
-               
+
        default:
            fntarget [k++] = convert_case (dest_mask [j], &case_conv);
            break;
        default:
            fntarget [k++] = convert_case (dest_mask [j], &case_conv);
            break;
@@ -712,7 +712,7 @@ void
 free_linklist (struct link **linklist)
 {
     struct link *lp, *lp2;
 free_linklist (struct link **linklist)
 {
     struct link *lp, *lp2;
-    
+
     for (lp = *linklist; lp != NULL; lp = lp2){
        lp2 = lp -> next;
        free (lp);
     for (lp = *linklist; lp != NULL; lp = lp2){
        lp2 = lp -> next;
        free (lp);
@@ -721,13 +721,13 @@ free_linklist (struct link **linklist)
 }
 
 #ifdef USE_VFS
 }
 
 #ifdef USE_VFS
-int 
+int
 is_in_linklist (struct link *lp, char *path, struct stat *sb)
 {
    ino_t ino = sb->st_ino;
    dev_t dev = sb->st_dev;
    vfs *vfs = vfs_type (path);
 is_in_linklist (struct link *lp, char *path, struct stat *sb)
 {
    ino_t ino = sb->st_ino;
    dev_t dev = sb->st_dev;
    vfs *vfs = vfs_type (path);
-   
+
    while (lp) {
       if (lp->vfs == vfs && lp->ino == ino && lp->dev == dev )
           return 1;
    while (lp) {
       if (lp->vfs == vfs && lp->ino == ino && lp->dev == dev )
           return 1;
@@ -736,12 +736,12 @@ is_in_linklist (struct link *lp, char *path, struct stat *sb)
    return 0;
 }
 #else
    return 0;
 }
 #else
-int 
+int
 is_in_linklist (struct link *lp, char *path, struct stat *sb)
 {
    ino_t ino = sb->st_ino;
    dev_t dev = sb->st_dev;
 is_in_linklist (struct link *lp, char *path, struct stat *sb)
 {
    ino_t ino = sb->st_ino;
    dev_t dev = sb->st_dev;
-   
+
    while (lp) {
       if (lp->ino == ino && lp->dev == dev )
           return 1;
    while (lp) {
       if (lp->ino == ino && lp->dev == dev )
           return 1;
@@ -781,7 +781,7 @@ check_hardlinks (char *src_name, char *dst_name, struct stat *pstat)
             /* FIXME: Announce we couldn't make the hardlink */
             return 0;
         }
             /* FIXME: Announce we couldn't make the hardlink */
             return 0;
         }
-    lp = (struct link *) xmalloc (sizeof (struct link) + strlen (src_name) 
+    lp = (struct link *) xmalloc (sizeof (struct link) + strlen (src_name)
                                   + strlen (dst_name) + 1, "Hardlink cache");
     if (lp){
        lp->vfs = my_vfs;
                                   + strlen (dst_name) + 1, "Hardlink cache");
     if (lp){
        lp->vfs = my_vfs;
@@ -802,7 +802,7 @@ check_hardlinks (char *src_name, char *dst_name, struct stat *pstat)
    If dst_path is an existing symlink it will be deleted silently
    (upper levels take already care of existing files at dst_path).
   */
    If dst_path is an existing symlink it will be deleted silently
    (upper levels take already care of existing files at dst_path).
   */
-static int 
+static int
 make_symlink (char *src_path, char *dst_path)
 {
     char link_target[MC_MAXPATHLEN];
 make_symlink (char *src_path, char *dst_path)
 {
     char link_target[MC_MAXPATHLEN];
@@ -810,8 +810,8 @@ make_symlink (char *src_path, char *dst_path)
     int return_status;
     struct stat sb;
     int dst_is_symlink;
     int return_status;
     struct stat sb;
     int dst_is_symlink;
-    
-    if (mc_lstat (dst_path, &sb) == 0 && S_ISLNK (sb.st_mode)) 
+
+    if (mc_lstat (dst_path, &sb) == 0 && S_ISLNK (sb.st_mode))
        dst_is_symlink = 1;
     else
        dst_is_symlink = 0;
        dst_is_symlink = 1;
     else
        dst_is_symlink = 0;
@@ -827,14 +827,14 @@ make_symlink (char *src_path, char *dst_path)
     }
     link_target[len] = 0;
 
     }
     link_target[len] = 0;
 
-    if (stable_symlinks && (!vfs_file_is_local (src_path) || 
+    if (stable_symlinks && (!vfs_file_is_local (src_path) ||
                            !vfs_file_is_local (dst_path))) {
        message_1s (1, MSG_ERROR, _(" Cannot make stable symlinks across "
                                    "non-local filesystems: \n\n"
                                    " Option Stable Symlinks will be disabled "));
        stable_symlinks = 0;
     }
                            !vfs_file_is_local (dst_path))) {
        message_1s (1, MSG_ERROR, _(" Cannot make stable symlinks across "
                                    "non-local filesystems: \n\n"
                                    " Option Stable Symlinks will be disabled "));
        stable_symlinks = 0;
     }
-    
+
     if (stable_symlinks && *link_target != PATH_SEP) {
        char *p, *q, *r, *s;
 
     if (stable_symlinks && *link_target != PATH_SEP) {
        char *p, *q, *r, *s;
 
@@ -906,9 +906,9 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
     int  return_status, temp_status;
     int do_remote_copy = 0;
     int appending = 0;
     int  return_status, temp_status;
     int do_remote_copy = 0;
     int appending = 0;
-    /* bitmask used to remember which resourses we should release on return 
-       A single goto label is much easier to handle than a bunch of gotos ;-). */ 
-    unsigned resources = 0; 
+    /* bitmask used to remember which resourses we should release on return
+       A single goto label is much easier to handle than a bunch of gotos ;-). */
+    unsigned resources = 0;
 
     return_status = FILE_RETRY;
 
 
     return_status = FILE_RETRY;
 
@@ -936,8 +936,8 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
        if (return_status == FILE_RETRY)
            goto retry_src_xstat;
        return return_status;
        if (return_status == FILE_RETRY)
            goto retry_src_xstat;
        return return_status;
-    } 
-    
+    }
+
     if (dst_exists){
            /* .ado: For OS/2 or NT: no st_ino exists, it is better to just try to
             * overwrite the target file
     if (dst_exists){
            /* .ado: For OS/2 or NT: no st_ino exists, it is better to just try to
             * overwrite the target file
@@ -958,7 +958,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
                do_reget = -1;
            else
                do_reget = 0;
                do_reget = -1;
            else
                do_reget = 0;
-                   
+
            return_status = query_replace (dst_path, &sb, &sb2);
            if (return_status != FILE_CONT)
                return return_status;
            return_status = query_replace (dst_path, &sb, &sb2);
            if (return_status != FILE_CONT)
                return return_status;
@@ -967,22 +967,22 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
 
     if (!do_append) {
        /* .ado: OS2 and NT don't have hardlinks */
 
     if (!do_append) {
        /* .ado: OS2 and NT don't have hardlinks */
-#ifndef OS2_NT    
+#ifndef OS2_NT
         /* Check the hardlinks */
         /* Check the hardlinks */
-        if (!op_follow_links && sb.st_nlink > 1 && 
+        if (!op_follow_links && sb.st_nlink > 1 &&
             check_hardlinks (src_path, dst_path, &sb) == 1) {
            /* We have made a hardlink - no more processing is necessary */
            return return_status;
         }
             check_hardlinks (src_path, dst_path, &sb) == 1) {
            /* We have made a hardlink - no more processing is necessary */
            return return_status;
         }
-       
+
         if (S_ISLNK (sb.st_mode))
            return make_symlink (src_path, dst_path);
         if (S_ISLNK (sb.st_mode))
            return make_symlink (src_path, dst_path);
-           
+
 #endif /* !OS_NT */
 
         if (S_ISCHR (sb.st_mode) || S_ISBLK (sb.st_mode) || S_ISFIFO (sb.st_mode)
             || S_ISSOCK (sb.st_mode)){
 #endif /* !OS_NT */
 
         if (S_ISCHR (sb.st_mode) || S_ISBLK (sb.st_mode) || S_ISFIFO (sb.st_mode)
             || S_ISSOCK (sb.st_mode)){
-        retry_mknod:        
+        retry_mknod:
             if (mc_mknod (dst_path, sb.st_mode & umask_kill, sb.st_rdev) < 0){
                return_status = file_error
                    (_(" Cannot create special file \"%s\" \n %s "), dst_path);
             if (mc_mknod (dst_path, sb.st_mode & umask_kill, sb.st_rdev) < 0){
                return_status = file_error
                    (_(" Cannot create special file \"%s\" \n %s "), dst_path);
@@ -991,7 +991,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
                return return_status;
            }
            /* Success */
                return return_status;
            }
            /* Success */
-           
+
 #ifndef OS2_NT
        retry_mknod_uidgid:
            if (preserve_uidgid && mc_chown (dst_path, sb.st_uid, sb.st_gid)){
 #ifndef OS2_NT
        retry_mknod_uidgid:
            if (preserve_uidgid && mc_chown (dst_path, sb.st_uid, sb.st_gid)){
@@ -1014,7 +1014,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
            return FILE_CONT;
         }
     }
            return FILE_CONT;
         }
     }
-    
+
     if (!do_append && !vfs_file_is_local (src_path) && vfs_file_is_local (dst_path)){
        mc_setctl (src_path, MCCTL_SETREMOTECOPY, dst_path);
     }
     if (!do_append && !vfs_file_is_local (src_path) && vfs_file_is_local (dst_path)){
        mc_setctl (src_path, MCCTL_SETREMOTECOPY, dst_path);
     }
@@ -1030,7 +1030,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
 
     resources |= 1;
     do_remote_copy = mc_ctl (source_desc, MCCTL_ISREMOTECOPY, 0);
 
     resources |= 1;
     do_remote_copy = mc_ctl (source_desc, MCCTL_ISREMOTECOPY, 0);
-    
+
     if (!do_remote_copy) {
  retry_src_fstat:
         if (mc_fstat (source_desc, &sb)){
     if (!do_remote_copy) {
  retry_src_fstat:
         if (mc_fstat (source_desc, &sb)){
@@ -1041,8 +1041,8 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
            do_append = 0;
             goto ret;
         }
            do_append = 0;
             goto ret;
         }
-#if 0  
-    /* Im not sure if we can delete this. sb is already filled by 
+#if 0
+    /* Im not sure if we can delete this. sb is already filled by
     (*xstat)() - Norbert. */
     } else {
  retry_src_rstat:
     (*xstat)() - Norbert. */
     } else {
  retry_src_rstat:
@@ -1054,7 +1054,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
            do_append = 0;
             goto ret;
         }
            do_append = 0;
             goto ret;
         }
-#endif    
+#endif
     }
     src_mode = sb.st_mode;
 #ifndef OS2_NT
     }
     src_mode = sb.st_mode;
 #ifndef OS2_NT
@@ -1070,7 +1070,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
 
     if (!do_remote_copy) {
  retry_dst_open:
 
     if (!do_remote_copy) {
  retry_dst_open:
-        if ((do_append && 
+        if ((do_append &&
             (dest_desc = mc_open (dst_path, O_WRONLY | O_APPEND)) < 0) ||
             (!do_append &&
             (dest_desc = mc_open (dst_path, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0)) {
             (dest_desc = mc_open (dst_path, O_WRONLY | O_APPEND)) < 0) ||
             (!do_append &&
             (dest_desc = mc_open (dst_path, O_WRONLY | O_CREAT | O_TRUNC, 0600)) < 0)) {
@@ -1145,11 +1145,11 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
         int    i, size, secs, update_secs;
        long   dt;
        char   *stalled_msg;
         int    i, size, secs, update_secs;
        long   dt;
        char   *stalled_msg;
-       
+
        gettimeofday (&tv_transfer_start, (struct timezone *) NULL);
        tv_last_update = tv_transfer_start;
        eta_secs = 0.0;
        gettimeofday (&tv_transfer_start, (struct timezone *) NULL);
        tv_last_update = tv_transfer_start;
        eta_secs = 0.0;
-       
+
         for (i = 1; i;) {
             switch (size = mc_ctl (source_desc, MCCTL_REMOTECOPYCHUNK, 8192)) {
                 case MCERR_TARGETOPEN:
         for (i = 1; i;) {
             switch (size = mc_ctl (source_desc, MCCTL_REMOTECOPYCHUNK, 8192)) {
                 case MCERR_TARGETOPEN:
@@ -1163,12 +1163,12 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
                case MCERR_DATA_ON_STDIN:
                    break;
                 case MCERR_FINISH:
                case MCERR_DATA_ON_STDIN:
                    break;
                 case MCERR_FINISH:
-                    resources |= 8;  
+                    resources |= 8;
                     i = 0;
                     break;
             }
 
                     i = 0;
                     break;
             }
 
-            /* the first time we reach this line the target file has been created 
+            /* the first time we reach this line the target file has been created
               or truncated and we actually have a short target file.
               Do we really want to delete the target file when the ftp transfer
               fails? If we don't delete it we would be able to use reget later.
               or truncated and we actually have a short target file.
               Do we really want to delete the target file when the ftp transfer
               fails? If we don't delete it we would be able to use reget later.
@@ -1187,7 +1187,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
                       |(S_IXOTH|S_IWOTH|S_IROTH)  /* other */
                       |(S_IXGRP|S_IWGRP|S_IRGRP)))) /* group */
                    src_mode = S_IRUSR|S_IWUSR|S_IROTH|S_IRGRP;
                       |(S_IXOTH|S_IWOTH|S_IROTH)  /* other */
                       |(S_IXGRP|S_IWGRP|S_IRGRP)))) /* group */
                    src_mode = S_IRUSR|S_IWUSR|S_IROTH|S_IRGRP;
-               
+
                gettimeofday (&tv_last_input, NULL);
            }
            /* Timed operations: */
                gettimeofday (&tv_last_input, NULL);
            }
            /* Timed operations: */
@@ -1210,7 +1210,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
            /* 3. Compute ETA */
            if (secs > 2 || eta_secs == 0.0){
                dt = (tv_current.tv_sec - tv_transfer_start.tv_sec);
            /* 3. Compute ETA */
            if (secs > 2 || eta_secs == 0.0){
                dt = (tv_current.tv_sec - tv_transfer_start.tv_sec);
-               
+
                if (n_read_total){
                    eta_secs = ((dt / (double) n_read_total) * file_size) - dt;
                    bps = n_read_total / ((dt < 1) ? 1 : dt);
                if (n_read_total){
                    eta_secs = ((dt / (double) n_read_total) * file_size) - dt;
                    bps = n_read_total / ((dt < 1) ? 1 : dt);
@@ -1225,7 +1225,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
                    bps_time = 1;
                bps = n_read_total / bps_time;
            }
                    bps_time = 1;
                bps = n_read_total / bps_time;
            }
-           
+
            label_set_text (stalled_label, stalled_msg);
 
            return_status = show_file_progress (n_read_total, file_size);
            label_set_text (stalled_label, stalled_msg);
 
            return_status = show_file_progress (n_read_total, file_size);
@@ -1239,7 +1239,7 @@ copy_file_file (char *src_path, char *dst_path, int ask_overwrite)
 ret:
     if (buf)
        free (buf);
 ret:
     if (buf)
        free (buf);
-       
+
  retry_src_close:
     if ((resources & 1) && mc_close (source_desc) < 0){
        temp_status = file_error
  retry_src_close:
     if ((resources & 1) && mc_close (source_desc) < 0){
        temp_status = file_error
@@ -1258,7 +1258,7 @@ ret:
            goto retry_dst_close;
        return_status = temp_status;
     }
            goto retry_dst_close;
        return_status = temp_status;
     }
-       
+
     if (resources & 4) {
         /* Remove short file */
        mc_unlink (dst_path);
     if (resources & 4) {
         /* Remove short file */
        mc_unlink (dst_path);
@@ -1267,7 +1267,7 @@ ret:
        }
     } else if (resources & (2|8)) {
         /* no short file and destination file exists */
        }
     } else if (resources & (2|8)) {
         /* no short file and destination file exists */
-#ifndef OS2_NT 
+#ifndef OS2_NT
        if (!appending && preserve_uidgid) {
          retry_dst_chown:
            if (mc_chown (dst_path, src_uid, src_gid)){
        if (!appending && preserve_uidgid) {
          retry_dst_chown:
            if (mc_chown (dst_path, src_uid, src_gid)){
@@ -1291,7 +1291,7 @@ ret:
                goto retry_dst_chmod;
            return_status = temp_status;
        }
                goto retry_dst_chmod;
            return_status = temp_status;
        }
-    
+
        if (!appending && preserve)
            mc_utime (dst_path, &utb);
     }
        if (!appending && preserve)
            mc_utime (dst_path, &utb);
     }
@@ -1328,17 +1328,17 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
            goto retry_src_stat;
        return return_status;
     }
            goto retry_src_stat;
        return return_status;
     }
-    
+
     if (is_in_linklist (dest_dirs, s, &cbuf)) {
     if (is_in_linklist (dest_dirs, s, &cbuf)) {
-       /* Don't copy a directory we created before (we don't want to copy 
+       /* Don't copy a directory we created before (we don't want to copy
           infinitely if a directory is copied into itself) */
        /* FIXME: should there be an error message and FILE_SKIP? - Norbert */
        return FILE_CONT;
     }
 
           infinitely if a directory is copied into itself) */
        /* FIXME: should there be an error message and FILE_SKIP? - Norbert */
        return FILE_CONT;
     }
 
-/* Hmm, hardlink to directory??? - Norbert */    
+/* Hmm, hardlink to directory??? - Norbert */
 /* FIXME: In this step we should do something
 /* FIXME: In this step we should do something
-   in case the destination already exist */    
+   in case the destination already exist */
     /* Check the hardlinks */
     if (preserve && cbuf.st_nlink > 1 && check_hardlinks (s, d, &cbuf) == 1) {
        /* We have made a hardlink - no more processing is necessary */
     /* Check the hardlinks */
     if (preserve && cbuf.st_nlink > 1 && check_hardlinks (s, d, &cbuf) == 1) {
        /* We have made a hardlink - no more processing is necessary */
@@ -1351,15 +1351,15 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
            goto retry_src_stat;
        return return_status;
     }
            goto retry_src_stat;
        return return_status;
     }
-    
-#ifndef OS2_NT 
+
+#ifndef OS2_NT
     if (is_in_linklist (parent_dirs, s, &cbuf)) {
        /* we found a cyclic symbolic link */
           message_2s (1, MSG_ERROR, _(" Cannot copy cyclic symbolic link \n `%s' "), s);
        return FILE_SKIP;
     }
     if (is_in_linklist (parent_dirs, s, &cbuf)) {
        /* we found a cyclic symbolic link */
           message_2s (1, MSG_ERROR, _(" Cannot copy cyclic symbolic link \n `%s' "), s);
        return FILE_SKIP;
     }
-#endif    
-    
+#endif
+
     lp = xmalloc (sizeof (struct link), "parent_dirs");
     lp->vfs = vfs_type (s);
     lp->ino = cbuf.st_ino;
     lp = xmalloc (sizeof (struct link), "parent_dirs");
     lp->vfs = vfs_type (s);
     lp->ino = cbuf.st_ino;
@@ -1389,7 +1389,7 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
          */
 #if 1
 /* Again, I'm getting curious. Is not d already what we wanted, incl.
          */
 #if 1
 /* Again, I'm getting curious. Is not d already what we wanted, incl.
- *  masked source basename? Is not this just a relict of the past versions? 
+ *  masked source basename? Is not this just a relict of the past versions?
  *  I'm afraid this will lead into a two level deep dive :(
  *
  * I think this is indeed the problem.  I can not remember any case where
  *  I'm afraid this will lead into a two level deep dive :(
  *
  * I think this is indeed the problem.  I can not remember any case where
@@ -1400,7 +1400,7 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
  */
         if (toplevel && dive_into_subdirs){
            dest_dir = concat_dir_and_file (d, x_basename (s));
  */
         if (toplevel && dive_into_subdirs){
            dest_dir = concat_dir_and_file (d, x_basename (s));
-       } else 
+       } else
 #endif
        {
            dest_dir = copy_strings (d, 0);
 #endif
        {
            dest_dir = copy_strings (d, 0);
@@ -1414,7 +1414,7 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
            goto retry_dst_mkdir;
        goto ret;
     }
            goto retry_dst_mkdir;
        goto ret;
     }
-    
+
     lp = xmalloc (sizeof (struct link), "dest_dirs");
     mc_stat (dest_dir, &buf);
     lp->vfs = vfs_type (dest_dir);
     lp = xmalloc (sizeof (struct link), "dest_dirs");
     mc_stat (dest_dir, &buf);
     lp->vfs = vfs_type (dest_dir);
@@ -1422,8 +1422,8 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
     lp->dev = buf.st_dev;
     lp->next = dest_dirs;
     dest_dirs = lp;
     lp->dev = buf.st_dev;
     lp->next = dest_dirs;
     dest_dirs = lp;
-    
-#ifndef OS2_NT 
+
+#ifndef OS2_NT
     if (preserve_uidgid) {
      retry_dst_chown:
         if (mc_chown (dest_dir, cbuf.st_uid, cbuf.st_gid)){
     if (preserve_uidgid) {
      retry_dst_chown:
         if (mc_chown (dest_dir, cbuf.st_uid, cbuf.st_gid)){
@@ -1441,10 +1441,10 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
     if ((reading = mc_opendir (s)) == 0){
        goto ret;
     }
     if ((reading = mc_opendir (s)) == 0){
        goto ret;
     }
-    
+
     while ((next = mc_readdir (reading)) && return_status != FILE_ABORT){
         /*
     while ((next = mc_readdir (reading)) && return_status != FILE_ABORT){
         /*
-         * Now, we don't want '.' and '..' to be created / copied at any time 
+         * Now, we don't want '.' and '..' to be created / copied at any time
          */
         if (!strcmp (next->d_name, "."))
             continue;
          */
         if (!strcmp (next->d_name, "."))
             continue;
@@ -1453,7 +1453,7 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
 
         /* get the filename and add it to the src directory */
        path = concat_dir_and_file (s, next->d_name);
 
         /* get the filename and add it to the src directory */
        path = concat_dir_and_file (s, next->d_name);
-       
+
         (*xstat)(path, &buf);
         if (S_ISDIR (buf.st_mode)){
             mdpath = concat_dir_and_file (dest_dir, next->d_name);
         (*xstat)(path, &buf);
         if (S_ISDIR (buf.st_mode)){
             mdpath = concat_dir_and_file (dest_dir, next->d_name);
@@ -1469,7 +1469,7 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
            dest_file = concat_dir_and_file (dest_dir, x_basename (path));
             return_status = copy_file_file (path, dest_file, 1);
            free (dest_file);
            dest_file = concat_dir_and_file (dest_dir, x_basename (path));
             return_status = copy_file_file (path, dest_file, 1);
            free (dest_file);
-       }    
+       }
        if (delete && return_status == FILE_CONT) {
            if (erase_at_end) {
                 static struct link *tail;
        if (delete && return_status == FILE_CONT) {
            if (erase_at_end) {
                 static struct link *tail;
@@ -1480,7 +1480,7 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
                 if (erase_list) {
                    tail->next = lp;
                    tail = lp;
                 if (erase_list) {
                    tail->next = lp;
                    tail = lp;
-                } else 
+                } else
                   erase_list = tail = lp;
            } else {
                if (S_ISDIR (buf.st_mode)) {
                   erase_list = tail = lp;
            } else {
                if (S_ISDIR (buf.st_mode)) {
@@ -1489,7 +1489,7 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
                    return_status = erase_file (path);
            }
        }
                    return_status = erase_file (path);
            }
        }
-       
+
 #ifdef __os2__
        /* The OS/2 mc_readdir returns a block of memory DIR
         * next should be freed: .ado
 #ifdef __os2__
        /* The OS/2 mc_readdir returns a block of memory DIR
         * next should be freed: .ado
@@ -1500,7 +1500,7 @@ copy_dir_dir (char *s, char *d, int toplevel, int move_over, int delete,
         free (path);
     }
     mc_closedir (reading);
         free (path);
     }
     mc_closedir (reading);
-    
+
     /* .ado: Directories can not have permission set in OS/2 */
 #ifndef __os2__
     if (preserve) {
     /* .ado: Directories can not have permission set in OS/2 */
 #ifndef __os2__
     if (preserve) {
@@ -1575,7 +1575,7 @@ move_file_file (char *s, char *d)
                do_reget = -1;
            else
                do_reget = 0;
                do_reget = -1;
            else
                do_reget = 0;
-           
+
            return_status = query_replace (d, &src_stats, &dst_stats);
            if (return_status != FILE_CONT)
                return return_status;
            return_status = query_replace (d, &src_stats, &dst_stats);
            if (return_status != FILE_CONT)
                return return_status;
@@ -1583,7 +1583,7 @@ move_file_file (char *s, char *d)
        /* Ok to overwrite */
     }
 #if 0
        /* Ok to overwrite */
     }
 #if 0
- retry_rename: 
+ retry_rename:
 #endif
     if (!do_append) {
        if (S_ISLNK (src_stats.st_mode) && stable_symlinks) {
 #endif
     if (!do_append) {
        if (S_ISLNK (src_stats.st_mode) && stable_symlinks) {
@@ -1599,7 +1599,7 @@ move_file_file (char *s, char *d)
 #if 0
 /* Comparison to EXDEV seems not to work in nfs if you're moving from
    one nfs to the same, but on the server it is on two different
 #if 0
 /* Comparison to EXDEV seems not to work in nfs if you're moving from
    one nfs to the same, but on the server it is on two different
-   filesystems. Then nfs returns EIO instead of EXDEV. 
+   filesystems. Then nfs returns EIO instead of EXDEV.
    Hope it will not hurt if we always in case of error try to copy/delete. */
      else
        errno = EXDEV; /* Hack to copy (append) the file and then delete it */
    Hope it will not hurt if we always in case of error try to copy/delete. */
      else
        errno = EXDEV; /* Hack to copy (append) the file and then delete it */
@@ -1610,7 +1610,7 @@ move_file_file (char *s, char *d)
            goto retry_rename;
        return return_status;
     }
            goto retry_rename;
        return return_status;
     }
-#endif    
+#endif
 
     /* Failed because filesystem boundary -> copy the file instead */
     if ((return_status = copy_file_file (s, d, 0)) != FILE_CONT)
 
     /* Failed because filesystem boundary -> copy the file instead */
     if ((return_status = copy_file_file (s, d, 0)) != FILE_CONT)
@@ -1674,7 +1674,7 @@ move_dir_dir (char *s, char *d)
         free (destdir);
         return return_status;
     }
         free (destdir);
         return return_status;
     }
-    
+
  retry_rename:
     if (mc_rename (s, destdir) == 0){
        return_status = FILE_CONT;
  retry_rename:
     if (mc_rename (s, destdir) == 0){
        return_status = FILE_CONT;
@@ -1764,12 +1764,12 @@ recursive_erase (char *s)
 
     if (!strcmp (s, ".."))
        return 1;
 
     if (!strcmp (s, ".."))
        return 1;
-    
+
     reading = mc_opendir (s);
     reading = mc_opendir (s);
-    
+
     if (!reading)
        return 1;
     if (!reading)
        return 1;
-       
+
     while ((next = mc_readdir (reading)) && return_status == FILE_CONT){
        if (!strcmp (next->d_name, "."))
            continue;
     while ((next = mc_readdir (reading)) && return_status == FILE_CONT){
        if (!strcmp (next->d_name, "."))
            continue;
@@ -1779,7 +1779,7 @@ recursive_erase (char *s)
        if (mc_lstat (path, &buf)){
            free (path);
            return 1;
        if (mc_lstat (path, &buf)){
            free (path);
            return 1;
-       } 
+       }
        if (S_ISDIR (buf.st_mode))
            return_status = (recursive_erase (path) != FILE_CONT);
        else
        if (S_ISDIR (buf.st_mode))
            return_status = (recursive_erase (path) != FILE_CONT);
        else
@@ -1807,9 +1807,9 @@ recursive_erase (char *s)
     return FILE_CONT;
 }
 
     return FILE_CONT;
 }
 
-/* Return -1 on error, 1 if there are no entries besides "." and ".." 
+/* Return -1 on error, 1 if there are no entries besides "." and ".."
    in the directory path points to, 0 else. */
    in the directory path points to, 0 else. */
-static int 
+static int
 check_dir_is_empty(char *path)
 {
     DIR *dir;
 check_dir_is_empty(char *path)
 {
     DIR *dir;
@@ -1916,10 +1916,10 @@ get_file (WPanel *panel, struct stat *stat_buf)
     /* No problem with Gnome, as get_current_type never returns view_tree there */
     if (get_current_type () == view_tree){
        WTree *tree = (WTree *)get_panel_widget (get_current_index ());
     /* No problem with Gnome, as get_current_type never returns view_tree there */
     if (get_current_type () == view_tree){
        WTree *tree = (WTree *)get_panel_widget (get_current_index ());
-       
+
        mc_stat (tree->selected_ptr->name, stat_buf);
        return tree->selected_ptr->name;
        mc_stat (tree->selected_ptr->name, stat_buf);
        return tree->selected_ptr->name;
-    } 
+    }
 
     if (panel->marked){
        for (i = 0; i < panel->count; i++)
 
     if (panel->marked){
        for (i = 0; i < panel->count; i++)
@@ -1948,7 +1948,7 @@ is_wildcarded (char *p)
     return 0;
 }
 
     return 0;
 }
 
-/* Sets all global variables used by copy_file_file/move_file_file to a 
+/* Sets all global variables used by copy_file_file/move_file_file to a
    resonable default
    (file_mask_dialog sets these global variables interactively)
  */
    resonable default
    (file_mask_dialog sets these global variables interactively)
  */
@@ -1959,7 +1959,7 @@ file_mask_defaults (void)
     op_follow_links = 0;
     dive_into_subdirs = 0;
     xstat = mc_lstat;
     op_follow_links = 0;
     dive_into_subdirs = 0;
     xstat = mc_lstat;
-    
+
     preserve = 1;
     umask_kill = 0777777;
     preserve_uidgid = (geteuid () == 0) ? 1 : 0;
     preserve = 1;
     umask_kill = 0777777;
     preserve_uidgid = (geteuid () == 0) ? 1 : 0;
@@ -1976,28 +1976,28 @@ static QuickWidget fmd_widgets [] = {
        /* follow symlinks and preserve Attributes must be the first */
     { quick_checkbox, 3, 64, 8, FMDY, N_("preserve &Attributes"), 9, 0,
       &op_preserve, 0, XV_WLAY_BELOWCLOSE, "preserve" },
        /* follow symlinks and preserve Attributes must be the first */
     { quick_checkbox, 3, 64, 8, FMDY, N_("preserve &Attributes"), 9, 0,
       &op_preserve, 0, XV_WLAY_BELOWCLOSE, "preserve" },
-    { quick_checkbox, 3, 64, 7, FMDY, N_("follow &Links"), 7, 0, 
+    { quick_checkbox, 3, 64, 7, FMDY, N_("follow &Links"), 7, 0,
       &op_follow_links, 0, XV_WLAY_BELOWCLOSE, "follow" },
 #ifdef HAVE_XVIEW
 #define FMDI1 5
 #define FMDI2 2
 #define FMDC  4
       &op_follow_links, 0, XV_WLAY_BELOWCLOSE, "follow" },
 #ifdef HAVE_XVIEW
 #define FMDI1 5
 #define FMDI2 2
 #define FMDC  4
-    { quick_input, 3, 64, 6, FMDY, "", 58, 0, 
+    { quick_input, 3, 64, 6, FMDY, "", 58, 0,
       0, 0, XV_WLAY_BELOWCLOSE, "input2" },
 #endif
     { quick_label, 3, 64, 5, FMDY, N_("to:"), 0, 0, 0, 0, XV_WLAY_BELOWOF,"to"},
       0, 0, XV_WLAY_BELOWCLOSE, "input2" },
 #endif
     { quick_label, 3, 64, 5, FMDY, N_("to:"), 0, 0, 0, 0, XV_WLAY_BELOWOF,"to"},
-    { quick_checkbox, 37, 64, 4, FMDY, N_("&Using shell patterns"), 0, 0, 
+    { quick_checkbox, 37, 64, 4, FMDY, N_("&Using shell patterns"), 0, 0,
       0/* &source_easy_patterns */, 0, XV_WLAY_BELOWCLOSE, "using-shell" },
       0/* &source_easy_patterns */, 0, XV_WLAY_BELOWCLOSE, "using-shell" },
-    { quick_input, 3, 64, 3, FMDY, "", 58, 
+    { quick_input, 3, 64, 3, FMDY, "", 58,
       0, 0, 0, XV_WLAY_BELOWCLOSE, "input-def" },
       0, 0, 0, XV_WLAY_BELOWCLOSE, "input-def" },
-#ifndef HAVE_XVIEW      
+#ifndef HAVE_XVIEW
 #define FMDI1 4
 #define FMDI2 5
 #define FMDC 3
 #define FMDI1 4
 #define FMDI2 5
 #define FMDC 3
-    { quick_input, 3, 64, 6, FMDY, "", 58, 0, 
+    { quick_input, 3, 64, 6, FMDY, "", 58, 0,
       0, 0, XV_WLAY_BELOWCLOSE, "input2" },
       0, 0, XV_WLAY_BELOWCLOSE, "input2" },
-#endif      
-#define FMDI0 6          
+#endif
+#define FMDI0 6
     { quick_label, 3, 64, 2, FMDY, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "ql" },
 #define        FMBRGT 7
     { quick_button, 42, 64, 9, FMDY, N_("&Cancel"), 0, B_CANCEL, 0, 0, XV_WLAY_DONTCARE,
     { quick_label, 3, 64, 2, FMDY, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "ql" },
 #define        FMBRGT 7
     { quick_button, 42, 64, 9, FMDY, N_("&Cancel"), 0, B_CANCEL, 0, 0, XV_WLAY_DONTCARE,
@@ -2020,7 +2020,7 @@ static QuickWidget fmd_widgets [] = {
     { quick_button, 14, 64, 9, FMDY, N_("&Ok"), 0, B_ENTER, 0, 0, XV_WLAY_NEXTROW, "ok" },
     { quick_checkbox, 42, 64, 8, FMDY, N_("&Stable Symlinks"), 0, 0,
       &stable_symlinks, 0, XV_WLAY_BELOWCLOSE, "stab-sym" },
     { quick_button, 14, 64, 9, FMDY, N_("&Ok"), 0, B_ENTER, 0, 0, XV_WLAY_NEXTROW, "ok" },
     { quick_checkbox, 42, 64, 8, FMDY, N_("&Stable Symlinks"), 0, 0,
       &stable_symlinks, 0, XV_WLAY_BELOWCLOSE, "stab-sym" },
-    { quick_checkbox, 31, 64, 7, FMDY, N_("&Dive into subdir if exists"), 0, 0, 
+    { quick_checkbox, 31, 64, 7, FMDY, N_("&Dive into subdir if exists"), 0, 0,
       &dive_into_subdirs, 0, XV_WLAY_BELOWOF, "dive" },
     { 0 } };
 
       &dive_into_subdirs, 0, XV_WLAY_BELOWOF, "dive" },
     { 0 } };
 
@@ -2047,7 +2047,7 @@ fmd_init_i18n()
        len = strlen (fmd_widgets [FMCB12].text)
                + strlen (fmd_widgets [FMCB22].text) + 15;
        fmd_xlen = max (fmd_xlen, len);
        len = strlen (fmd_widgets [FMCB12].text)
                + strlen (fmd_widgets [FMCB22].text) + 15;
        fmd_xlen = max (fmd_xlen, len);
-               
+
        len = strlen (fmd_widgets [FMBRGT].text)
                + strlen (fmd_widgets [FMBLFT].text) + 11;
 
        len = strlen (fmd_widgets [FMBRGT].text)
                + strlen (fmd_widgets [FMBLFT].text) + 11;
 
@@ -2098,7 +2098,7 @@ file_mask_dialog (int operation, char *text, char *def_text, int only_one, int *
     const char *error;
     struct stat buf;
     int val;
     const char *error;
     struct stat buf;
     int val;
-    
+
     QuickDialog Quick_input;
 
        if (!fmd_i18n_flag)
     QuickDialog Quick_input;
 
        if (!fmd_i18n_flag)
@@ -2113,7 +2113,7 @@ file_mask_dialog (int operation, char *text, char *def_text, int only_one, int *
     Quick_input.help  = "[Mask Copy/Rename]";
     Quick_input.ylen  = FMDY;
     Quick_input.i18n  = 1;
     Quick_input.help  = "[Mask Copy/Rename]";
     Quick_input.ylen  = FMDY;
     Quick_input.i18n  = 1;
-    
+
     if (operation == OP_COPY) {
        Quick_input.class = "quick_file_mask_copy";
        Quick_input.widgets = fmd_widgets;
     if (operation == OP_COPY) {
        Quick_input.class = "quick_file_mask_copy";
        Quick_input.widgets = fmd_widgets;
@@ -2136,7 +2136,7 @@ ask_file_mask:
        xstat = mc_stat;
     else
        xstat = mc_lstat;
        xstat = mc_stat;
     else
        xstat = mc_lstat;
-    
+
     if (op_preserve || operation == OP_MOVE) {
        preserve = 1;
        umask_kill = 0777777;
     if (op_preserve || operation == OP_MOVE) {
        preserve = 1;
        umask_kill = 0777777;
@@ -2278,14 +2278,14 @@ generate_prompt(char* cmd_buf, WPanel* panel, int operation, int only_one,
                                        case 'f':
                                                if (only_one)
                                                {
                                        case 'f':
                                                if (only_one)
                                                {
-                                                       cp = S_ISDIR (src_stat->st_mode) ? 
+                                                       cp = S_ISDIR (src_stat->st_mode) ?
                                                                prompt_parts [2] : prompt_parts [0];
                                                }
                                                else
                                                {
                                                                prompt_parts [2] : prompt_parts [0];
                                                }
                                                else
                                                {
-                                                       cp = (panel->marked == panel->dirs_marked) 
-                                                       ? prompt_parts [3] 
-                                                       : (panel->dirs_marked ? prompt_parts [4] 
+                                                       cp = (panel->marked == panel->dirs_marked)
+                                                       ? prompt_parts [3]
+                                                       : (panel->dirs_marked ? prompt_parts [4]
                                                        : prompt_parts [1]);
                                                }
                                                break;
                                                        : prompt_parts [1]);
                                                }
                                                break;
@@ -2356,13 +2356,13 @@ panel_operate (void *source_panel, int operation, char *thedefault)
            message (1, MSG_ERROR, _(" Can't operate on \"..\"! "));
            return 0;
        }
            message (1, MSG_ERROR, _(" Can't operate on \"..\"! "));
            return 0;
        }
-    
+
     if (operation < OP_COPY || operation > OP_DELETE)
        return 0;
     if (operation < OP_COPY || operation > OP_DELETE)
        return 0;
-    
+
     /* Generate confirmation prompt */
     /* Generate confirmation prompt */
-    source = generate_prompt(cmd_buf, panel, operation, only_one, &src_stat);   
-    
+    source = generate_prompt(cmd_buf, panel, operation, only_one, &src_stat);
+
     /* Show confirmation dialog */
     if (operation == OP_DELETE && confirm_delete){
         if (know_not_what_am_i_doing)
     /* Show confirmation dialog */
     if (operation == OP_DELETE && confirm_delete){
         if (know_not_what_am_i_doing)
@@ -2373,7 +2373,7 @@ panel_operate (void *source_panel, int operation, char *thedefault)
            return 0;
     } else if (operation != OP_DELETE) {
        char *dest_dir;
            return 0;
     } else if (operation != OP_DELETE) {
        char *dest_dir;
-       
+
        if (thedefault != NULL)
            dest_dir = thedefault;
        else if (get_other_type () == view_listing)
        if (thedefault != NULL)
            dest_dir = thedefault;
        else if (get_other_type () == view_listing)
@@ -2400,7 +2400,7 @@ panel_operate (void *source_panel, int operation, char *thedefault)
     /* Did the user select to do a background operation? */
     if (do_bg){
        int v;
     /* Did the user select to do a background operation? */
     if (do_bg){
        int v;
-       
+
        v = do_background (copy_strings (operation_names [operation], ": ", panel->cwd, 0));
        if (v == -1){
            message (1, MSG_ERROR, _(" Sorry, I could not put the job in background "));
        v = do_background (copy_strings (operation_names [operation], ": ", panel->cwd, 0));
        if (v == -1){
            message (1, MSG_ERROR, _(" Sorry, I could not put the job in background "));
@@ -2418,19 +2418,19 @@ panel_operate (void *source_panel, int operation, char *thedefault)
     /* We turn on ETA display if the source is an ftp file system */
     create_op_win (operation, vfs_file_is_ftp (panel->cwd));
     ftpfs_hint_reread (0);
     /* We turn on ETA display if the source is an ftp file system */
     create_op_win (operation, vfs_file_is_ftp (panel->cwd));
     ftpfs_hint_reread (0);
-    
+
     /* Now, let's do the job */
     /* This code is only called by the tree and panel code */
     if (only_one){
        /* One file: FIXME mc_chdir will take user out of any vfs */
        if (operation != OP_COPY && get_current_type () == view_tree)
            mc_chdir (PATH_SEP_STR);
     /* Now, let's do the job */
     /* This code is only called by the tree and panel code */
     if (only_one){
        /* One file: FIXME mc_chdir will take user out of any vfs */
        if (operation != OP_COPY && get_current_type () == view_tree)
            mc_chdir (PATH_SEP_STR);
-       
+
        /* The source and src_stat variables have been initialized before */
 #ifdef WITH_FULL_PATHS
        source_with_path = concat_dir_and_file (panel->cwd, source);
 #endif
        /* The source and src_stat variables have been initialized before */
 #ifdef WITH_FULL_PATHS
        source_with_path = concat_dir_and_file (panel->cwd, source);
 #endif
-       
+
        if (operation == OP_DELETE){
            /* Delete operation */
            if (S_ISDIR (src_stat.st_mode))
        if (operation == OP_DELETE){
            /* Delete operation */
            if (S_ISDIR (src_stat.st_mode))
@@ -2591,7 +2591,7 @@ panel_operate (void *source_panel, int operation, char *thedefault)
        vfs_shut ();
        tell_parent (MSG_CHILD_EXITING);
        exit (1);
        vfs_shut ();
        tell_parent (MSG_CHILD_EXITING);
        exit (1);
-    } 
+    }
 #endif
     return 1;
 }
 #endif
     return 1;
 }
@@ -2637,10 +2637,10 @@ files_error (char *format, char *file1, char *file2)
 {
     char nfile1 [16];
     char nfile2 [16];
 {
     char nfile1 [16];
     char nfile2 [16];
-    
+
     strcpy (nfile1, name_trunc (file1, 15));
     strcpy (nfile2, name_trunc (file2, 15));
     strcpy (nfile1, name_trunc (file1, 15));
     strcpy (nfile2, name_trunc (file2, 15));
-    
+
     sprintf (cmd_buf, format, nfile1, nfile2, unix_error_string (errno));
     return do_file_error (cmd_buf);
 }
     sprintf (cmd_buf, format, nfile1, nfile2, unix_error_string (errno));
     return do_file_error (cmd_buf);
 }
@@ -2674,7 +2674,7 @@ replace_callback (struct Dlg_head *h, int Id, int Msg)
 static struct
 {
        char* text;
 static struct
 {
        char* text;
-       int   ypos, xpos;       
+       int   ypos, xpos;
        int   value;            /* 0 for labels */
        char* tkname;
        WLay  layout;
        int   value;            /* 0 for labels */
        char* tkname;
        WLay  layout;
@@ -2701,7 +2701,7 @@ rd_widgets [] =
                         6,      4,  0,              "target-date",XV_WLAY_CENTERROW},
        {N_("Source date: %s, size %d"),
                         5,      4,  0,              "source-date",XV_WLAY_CENTERROW}
                         6,      4,  0,              "target-date",XV_WLAY_CENTERROW},
        {N_("Source date: %s, size %d"),
                         5,      4,  0,              "source-date",XV_WLAY_CENTERROW}
-}; 
+};
 
 #define ADD_RD_BUTTON(i)\
        add_widgetl (replace_dlg,\
 
 #define ADD_RD_BUTTON(i)\
        add_widgetl (replace_dlg,\
@@ -2726,12 +2726,12 @@ init_replace (enum OperationMode mode)
        if (!i18n_flag)
        {
                int l1, l2, l, row;
        if (!i18n_flag)
        {
                int l1, l2, l, row;
-               register int i = sizeof (rd_widgets) / sizeof (rd_widgets [0]); 
+               register int i = sizeof (rd_widgets) / sizeof (rd_widgets [0]);
                while (i--)
                        rd_widgets [i].text = _(rd_widgets [i].text);
 
                while (i--)
                        rd_widgets [i].text = _(rd_widgets [i].text);
 
-               /* 
-                *longest of "Overwrite..." labels 
+               /*
+                *longest of "Overwrite..." labels
                 * (assume "Target date..." are short enough)
                 */
                l1 = max (strlen (rd_widgets [6].text), strlen (rd_widgets [11].text));
                 * (assume "Target date..." are short enough)
                 */
                l1 = max (strlen (rd_widgets [6].text), strlen (rd_widgets [11].text));
@@ -2758,7 +2758,7 @@ init_replace (enum OperationMode mode)
                /* Now place buttons */
                l1 += 5; /* start of first button in the row */
                i = sizeof (rd_widgets) / sizeof (rd_widgets [0]);
                /* Now place buttons */
                l1 += 5; /* start of first button in the row */
                i = sizeof (rd_widgets) / sizeof (rd_widgets [0]);
-               
+
                for (l = l1, row = 0; --i > 1;)
                {
                        if (rd_widgets [i].value != 0)
                for (l = l1, row = 0; --i > 1;)
                {
                        if (rd_widgets [i].value != 0)
@@ -2782,17 +2782,17 @@ init_replace (enum OperationMode mode)
     replace_colors [1] = COLOR_NORMAL;
     replace_colors [2] = ERROR_COLOR;
     replace_colors [3] = COLOR_NORMAL;
     replace_colors [1] = COLOR_NORMAL;
     replace_colors [2] = ERROR_COLOR;
     replace_colors [3] = COLOR_NORMAL;
-    
+
     replace_dlg = create_dlg (0, 0, 16, rd_xlen, replace_colors, replace_callback,
                              "[ Replace ]", "replace", DLG_CENTER);
     replace_dlg = create_dlg (0, 0, 16, rd_xlen, replace_colors, replace_callback,
                              "[ Replace ]", "replace", DLG_CENTER);
-    
+
     x_set_dialog_title (replace_dlg,
         mode == Foreground ? _(" File exists ") : _(" Background process: File exists "));
 
 
        ADD_RD_LABEL(0, name_trunc (replace_filename, rd_trunc - strlen (rd_widgets [0].text)), 0 );
     x_set_dialog_title (replace_dlg,
         mode == Foreground ? _(" File exists ") : _(" Background process: File exists "));
 
 
        ADD_RD_LABEL(0, name_trunc (replace_filename, rd_trunc - strlen (rd_widgets [0].text)), 0 );
-       ADD_RD_BUTTON(1);    
-    
+       ADD_RD_BUTTON(1);
+
     tk_new_frame (replace_dlg, "a.");
 
        ADD_RD_BUTTON(2);
     tk_new_frame (replace_dlg, "a.");
 
        ADD_RD_BUTTON(2);
@@ -2812,7 +2812,7 @@ init_replace (enum OperationMode mode)
        ADD_RD_BUTTON(9);
        ADD_RD_BUTTON(10);
        ADD_RD_LABEL(11,0,0);
        ADD_RD_BUTTON(9);
        ADD_RD_BUTTON(10);
        ADD_RD_LABEL(11,0,0);
-    
+
     tk_new_frame (replace_dlg, "i.");
        ADD_RD_LABEL(12, file_date (d_stat->st_mtime), (int) d_stat->st_size);
        ADD_RD_LABEL(13, file_date (s_stat->st_mtime), (int) s_stat->st_size);
     tk_new_frame (replace_dlg, "i.");
        ADD_RD_LABEL(12, file_date (d_stat->st_mtime), (int) d_stat->st_size);
        ADD_RD_LABEL(13, file_date (s_stat->st_mtime), (int) s_stat->st_size);
@@ -2849,13 +2849,13 @@ real_query_replace (enum OperationMode mode, char *destname, struct stat *_s_sta
            return FILE_SKIP;
        else
            return FILE_CONT;
            return FILE_SKIP;
        else
            return FILE_CONT;
-       
+
     case REPLACE_REGET:
        do_reget = _d_stat->st_size;
     case REPLACE_REGET:
        do_reget = _d_stat->st_size;
-       
+
     case REPLACE_APPEND:
         do_append = 1;
     case REPLACE_APPEND:
         do_append = 1;
-       
+
     case REPLACE_YES:
     case REPLACE_ALWAYS:
        do_refresh ();
     case REPLACE_YES:
     case REPLACE_ALWAYS:
        do_refresh ();
@@ -2885,8 +2885,8 @@ real_query_recursive (enum OperationMode mode, char *s)
            query_set_sel (1);
         recursive_result = query_dialog (text, msg, D_ERROR, 5,
                                     _("&Yes"), _("&No"), _("a&ll"), _("non&E"), _("&Abort"));
            query_set_sel (1);
         recursive_result = query_dialog (text, msg, D_ERROR, 5,
                                     _("&Yes"), _("&No"), _("a&ll"), _("non&E"), _("&Abort"));
-       
-       
+
+
        if (recursive_result != RECURSIVE_ABORT)
            do_refresh ();
        free (text);
        if (recursive_result != RECURSIVE_ABORT)
            do_refresh ();
        free (text);
index 84ae4b1..597a975 100644 (file)
@@ -3,12 +3,12 @@
    Written 1995 by Miguel de Icaza
 
    Complete rewrote.
    Written 1995 by Miguel de Icaza
 
    Complete rewrote.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -161,12 +161,12 @@ find_parameters (char **start_dir, char **pattern, char **content)
 
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
 
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
-       
+
        if (!i18n_flag)
        {
                register int i = sizeof(labs)/sizeof(labs[0]);
                int l1, maxlen = 0;
        if (!i18n_flag)
        {
                register int i = sizeof(labs)/sizeof(labs[0]);
                int l1, maxlen = 0;
-               
+
                while (i--)
                {
                        l1 = strlen (labs [i] = _(labs [i]));
                while (i--)
                {
                        l1 = strlen (labs [i] = _(labs [i]));
@@ -176,7 +176,7 @@ find_parameters (char **start_dir, char **pattern, char **content)
                i = maxlen + ilen + 7;
                if (i > FIND_X)
                        FIND_X = i;
                i = maxlen + ilen + 7;
                if (i > FIND_X)
                        FIND_X = i;
-               
+
                for (i = sizeof(buts)/sizeof(buts[0]), l1 = 0; i--; )
                {
                        l1 += strlen (buts [i] = _(buts [i]));
                for (i = sizeof(buts)/sizeof(buts[0]), l1 = 0; i--; )
                {
                        l1 += strlen (buts [i] = _(buts [i]));
@@ -187,13 +187,13 @@ find_parameters (char **start_dir, char **pattern, char **content)
 
                ilen = FIND_X - 7 - maxlen; /* for the case of very long buttons :) */
                istart = FIND_X - 3 - ilen;
 
                ilen = FIND_X - 7 - maxlen; /* for the case of very long buttons :) */
                istart = FIND_X - 3 - ilen;
-               
+
                b1 = b0 + strlen(buts[0]) + 7;
                b2 = FIND_X - (strlen(buts[2]) + 6);
                b1 = b0 + strlen(buts[0]) + 7;
                b2 = FIND_X - (strlen(buts[2]) + 6);
-               
+
                i18n_flag = 1;
        }
                i18n_flag = 1;
        }
-       
+
 #endif /* ENABLE_NLS */
 
 find_par_start:
 #endif /* ENABLE_NLS */
 
 find_par_start:
@@ -203,7 +203,7 @@ find_par_start:
        in_start_name = strdup (easy_patterns ? "*" : ".");
     if (!in_contents)
        in_contents = strdup ("");
        in_start_name = strdup (easy_patterns ? "*" : ".");
     if (!in_contents)
        in_contents = strdup ("");
-    
+
     find_dlg = create_dlg (0, 0, FIND_Y, FIND_X, dialog_colors,
                           common_dialog_callback, "[Find File]", "findfile",
                           DLG_CENTER | DLG_GRID);
     find_dlg = create_dlg (0, 0, FIND_Y, FIND_X, dialog_colors,
                           common_dialog_callback, "[Find File]", "findfile",
                           DLG_CENTER | DLG_GRID);
@@ -258,7 +258,7 @@ find_par_start:
        if (in_with->buffer [0]){
            *content    = strdup (in_with->buffer);
            in_contents = strdup (*content);
        if (in_with->buffer [0]){
            *content    = strdup (in_with->buffer);
            in_contents = strdup (*content);
-       } else 
+       } else
            *content = in_contents = NULL;
 
        free (in_start_dir);
            *content = in_contents = NULL;
 
        free (in_start_dir);
@@ -268,7 +268,7 @@ find_par_start:
     }
 
     destroy_dlg (find_dlg);
     }
 
     destroy_dlg (find_dlg);
-                        
+
     return return_value;
 }
 
     return return_value;
 }
 
@@ -286,7 +286,7 @@ push_directory (char *dir)
 static char*
 pop_directory (void)
 {
 static char*
 pop_directory (void)
 {
-    char *name; 
+    char *name;
     dir_stack *next;
 
     if (dir_stack_base){
     dir_stack *next;
 
     if (dir_stack_base){
@@ -326,7 +326,7 @@ insert_file (char *dir, char *file)
        old_dir = strdup (dir);
        dirname = listbox_add_item (find_list, 0, 0, dir, 0);
     }
        old_dir = strdup (dir);
        dirname = listbox_add_item (find_list, 0, 0, dir, 0);
     }
-    
+
     tmp_name = copy_strings ("    ", file, 0);
     listbox_add_item (find_list, 0, 0, tmp_name, dirname);
     free (tmp_name);
     tmp_name = copy_strings ("    ", file, 0);
     listbox_add_item (find_list, 0, 0, tmp_name, dirname);
     free (tmp_name);
@@ -338,19 +338,19 @@ find_add_match (Dlg_head *h, char *dir, char *file)
     int p = ++matches & 7;
 
     insert_file (dir, file);
     int p = ++matches & 7;
 
     insert_file (dir, file);
-    
+
     /* Scroll nicely */
     if (!p)
        listbox_select_last (find_list, 1);
     else
        listbox_select_last (find_list, 0);
     /* Scroll nicely */
     if (!p)
        listbox_select_last (find_list, 1);
     else
        listbox_select_last (find_list, 0);
-    
+
 #ifndef HAVE_X
        /* Updates the current listing */
        send_message (h, &find_list->widget, WIDGET_DRAW, 0);
        if (p == 7)
            mc_refresh ();
 #ifndef HAVE_X
        /* Updates the current listing */
        send_message (h, &find_list->widget, WIDGET_DRAW, 0);
        if (p == 7)
            mc_refresh ();
-#endif     
+#endif
 }
 
 char *
 }
 
 char *
@@ -365,7 +365,7 @@ locate_egrep (void)
     };
     struct stat s;
     char **p;
     };
     struct stat s;
     char **p;
-    
+
     for (p = &paths [0]; *p; p++){
        if (stat (*p, &s) == 0)
            return *p;
     for (p = &paths [0]; *p; p++){
        if (stat (*p, &s) == 0)
            return *p;
@@ -373,7 +373,7 @@ locate_egrep (void)
     return "egrep";
 }
 
     return "egrep";
 }
 
-/* 
+/*
  * search_content:
  *
  * Search with egrep the global (FIXME) content_pattern string in the
  * search_content:
  *
  * Search with egrep the global (FIXME) content_pattern string in the
@@ -401,10 +401,10 @@ search_content (Dlg_head *h, char *directory, char *filename)
        free (fname);
        return;
     }
        free (fname);
        return;
     }
-    
+
     file_fd = mc_open (fname, O_RDONLY);
     free (fname);
     file_fd = mc_open (fname, O_RDONLY);
     free (fname);
-    
+
     if (file_fd == -1)
        return;
 
     if (file_fd == -1)
        return;
 
@@ -416,36 +416,36 @@ search_content (Dlg_head *h, char *directory, char *filename)
 #else /* GREP_STDIN */
     pipe = mc_doublepopen (file_fd, -1, &pid, egrep_path, egrep_path, "-n", content_pattern, "-", NULL);
 #endif /* GREP STDIN */
 #else /* GREP_STDIN */
     pipe = mc_doublepopen (file_fd, -1, &pid, egrep_path, egrep_path, "-n", content_pattern, "-", NULL);
 #endif /* GREP STDIN */
-       
+
     if (pipe == -1){
        mc_close (file_fd);
        return;
     }
     if (pipe == -1){
        mc_close (file_fd);
        return;
     }
-    
+
     sprintf (buffer, _("Grepping in %s"), name_trunc (filename, FIND2_X_USE));
 
     label_set_text (status_label, buffer);
     mc_refresh ();
     p = buffer;
     ignoring = 0;
     sprintf (buffer, _("Grepping in %s"), name_trunc (filename, FIND2_X_USE));
 
     label_set_text (status_label, buffer);
     mc_refresh ();
     p = buffer;
     ignoring = 0;
-    
+
     enable_interrupt_key ();
     got_interrupt ();
     while (1){
        i = read (pipe, &c, 1);
        if (i != 1)
            break;
     enable_interrupt_key ();
     got_interrupt ();
     while (1){
        i = read (pipe, &c, 1);
        if (i != 1)
            break;
-       
+
        if (c == '\n'){
            p = buffer;
            ignoring = 0;
        }
        if (ignoring)
            continue;
        if (c == '\n'){
            p = buffer;
            ignoring = 0;
        }
        if (ignoring)
            continue;
-       
+
        if (c == ':'){
            char *the_name;
        if (c == ':'){
            char *the_name;
-           
+
            *p = 0;
            ignoring = 1;
            the_name = copy_strings (buffer, ":", filename, NULL);
            *p = 0;
            ignoring = 1;
            the_name = copy_strings (buffer, ":", filename, NULL);
@@ -456,7 +456,7 @@ search_content (Dlg_head *h, char *directory, char *filename)
                *p++ = c;
            else
                *p = 0;
                *p++ = c;
            else
                *p = 0;
-       } 
+       }
     }
     disable_interrupt_key ();
     if (i == -1)
     }
     disable_interrupt_key ();
     if (i == -1)
@@ -488,16 +488,16 @@ do_search (struct Dlg_head *h)
 
  do_search_begin:
     while (!dp){
 
  do_search_begin:
     while (!dp){
-       
+
        if (dirp){
            mc_closedir (dirp);
            dirp = 0;
        }
        if (dirp){
            mc_closedir (dirp);
            dirp = 0;
        }
-       
+
        while (!dirp){
            char *tmp;
 
        while (!dirp){
            char *tmp;
 
-#ifndef HAVE_X     
+#ifndef HAVE_X
            attrset (REVERSE_COLOR);
 #endif
            while (1) {
            attrset (REVERSE_COLOR);
 #endif
            while (1) {
@@ -516,8 +516,8 @@ do_search (struct Dlg_head *h)
                        break;
                } else
                    break;
                        break;
                } else
                    break;
-           } 
-           
+           }
+
            strcpy (directory, tmp);
            free (tmp);
 
            strcpy (directory, tmp);
            free (tmp);
 
@@ -543,10 +543,10 @@ do_search (struct Dlg_head *h)
        dp = mc_readdir (dirp);
 #ifdef HAVE_XVIEW
        xv_post_proc (h, (void (*)(void *))do_search, (void *)h);
        dp = mc_readdir (dirp);
 #ifdef HAVE_XVIEW
        xv_post_proc (h, (void (*)(void *))do_search, (void *)h);
-#endif         
+#endif
        return;
     }
        return;
     }
-    
+
     tmp_name = get_full_name (directory, dp->d_name);
 
     if (subdirs_left){
     tmp_name = get_full_name (directory, dp->d_name);
 
     if (subdirs_left){
@@ -560,10 +560,10 @@ do_search (struct Dlg_head *h)
     if (regexp_match (find_pattern, dp->d_name, match_file)){
        if (content_pattern)
            search_content (h, directory, dp->d_name);
     if (regexp_match (find_pattern, dp->d_name, match_file)){
        if (content_pattern)
            search_content (h, directory, dp->d_name);
-       else 
+       else
            find_add_match (h, directory, dp->d_name);
     }
            find_add_match (h, directory, dp->d_name);
     }
-    
+
     free (tmp_name);
     dp = mc_readdir (dirp);
 
     free (tmp_name);
     dp = mc_readdir (dirp);
 
@@ -631,7 +631,7 @@ static int
 find_callback (struct Dlg_head *h, int id, int Msg)
 {
     switch (Msg){
 find_callback (struct Dlg_head *h, int id, int Msg)
 {
     switch (Msg){
-#ifndef HAVE_X    
+#ifndef HAVE_X
     case DLG_DRAW:
         common_dialog_repaint (h);
        break;
     case DLG_DRAW:
         common_dialog_repaint (h);
        break;
@@ -688,7 +688,7 @@ static void
 init_find_vars (void)
 {
     char *dir;
 init_find_vars (void)
 {
     char *dir;
-    
+
     if (old_dir){
        free (old_dir);
        old_dir = 0;
     if (old_dir){
        free (old_dir);
        old_dir = 0;
@@ -728,7 +728,7 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname,  char
                int l1 = fbuts[2].len + fbuts[3].len + l0 + fbuts[4].len;
                int l2 = fbuts[5].len + fbuts[6].len + fbuts[7].len;
                int r1, r2;
                int l1 = fbuts[2].len + fbuts[3].len + l0 + fbuts[4].len;
                int l2 = fbuts[5].len + fbuts[6].len + fbuts[7].len;
                int r1, r2;
-               
+
                FIND2_X = COLS - 16;
 
                /* Check, if both button rows fit within FIND2_X */
                FIND2_X = COLS - 16;
 
                /* Check, if both button rows fit within FIND2_X */
@@ -750,14 +750,14 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname,  char
                fbuts [6].x = fbuts [5].x + fbuts [5].len + l2;
                fbuts [7].x = fbuts [6].x + fbuts [6].len + l2;
        }
                fbuts [6].x = fbuts [5].x + fbuts [5].len + l2;
                fbuts [7].x = fbuts [6].x + fbuts [6].len + l2;
        }
-    
+
     find_dlg = create_dlg (0, 0, FIND2_Y, FIND2_X, dialog_colors,
                           find_callback, "[Find File]", "mfind", DLG_CENTER | DLG_GRID);
     find_dlg = create_dlg (0, 0, FIND2_Y, FIND2_X, dialog_colors,
                           find_callback, "[Find File]", "mfind", DLG_CENTER | DLG_GRID);
-    
+
     x_set_dialog_title (find_dlg, _("Find file"));
 
        add_widgetl (find_dlg,
     x_set_dialog_title (find_dlg, _("Find file"));
 
        add_widgetl (find_dlg,
-               button_new (FIND2_Y-3, fbuts[7].x, B_VIEW, NORMAL_BUTTON, 
+               button_new (FIND2_Y-3, fbuts[7].x, B_VIEW, NORMAL_BUTTON,
                        fbuts[7].text, find_do_edit_file, find_dlg, "button-edit"), 0);
        add_widgetl (find_dlg,
                button_new (FIND2_Y-3, fbuts[6].x, B_VIEW, NORMAL_BUTTON,
                        fbuts[7].text, find_do_edit_file, find_dlg, "button-edit"), 0);
        add_widgetl (find_dlg,
                button_new (FIND2_Y-3, fbuts[6].x, B_VIEW, NORMAL_BUTTON,
@@ -773,9 +773,9 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname,  char
                fbuts[0].text, start_stop, find_dlg, "start-stop");
        add_widgetl (find_dlg, stop_button, XV_WLAY_RIGHTOF);
        add_widgetl (find_dlg,
                fbuts[0].text, start_stop, find_dlg, "start-stop");
        add_widgetl (find_dlg, stop_button, XV_WLAY_RIGHTOF);
        add_widgetl (find_dlg,
-               button_new (FIND2_Y-4, fbuts[3].x, B_AGAIN, NORMAL_BUTTON, 
+               button_new (FIND2_Y-4, fbuts[3].x, B_AGAIN, NORMAL_BUTTON,
                        fbuts[3].text, 0, 0, "button-again"), XV_WLAY_RIGHTOF);
                        fbuts[3].text, 0, 0, "button-again"), XV_WLAY_RIGHTOF);
-       add_widgetl (find_dlg, 
+       add_widgetl (find_dlg,
                button_new (FIND2_Y-4, fbuts[2].x, B_ENTER, DEFPUSH_BUTTON,
                        fbuts[2].text, 0, 0, "button-chdir"), XV_WLAY_CENTERROW);
 
                button_new (FIND2_Y-4, fbuts[2].x, B_ENTER, DEFPUSH_BUTTON,
                        fbuts[2].text, 0, 0, "button-chdir"), XV_WLAY_CENTERROW);
 
@@ -788,14 +788,14 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname,  char
     /* FIXME: Need to cleanup this, this ought to be passed non-globaly */
     find_pattern    = pattern;
     content_pattern = content;
     /* FIXME: Need to cleanup this, this ought to be passed non-globaly */
     find_pattern    = pattern;
     content_pattern = content;
-    
+
     set_idle_proc (find_dlg, 1);
     init_find_vars ();
     push_directory (start_dir);
 
 #ifdef HAVE_XVIEW
     xv_post_proc (find_dlg, (void (*)(void *))do_search, (void *)find_dlg);
     set_idle_proc (find_dlg, 1);
     init_find_vars ();
     push_directory (start_dir);
 
 #ifdef HAVE_XVIEW
     xv_post_proc (find_dlg, (void (*)(void *))do_search, (void *)find_dlg);
-#endif    
+#endif
     run_dlg (find_dlg);
 
     return_value = find_dlg->ret_value;
     run_dlg (find_dlg);
 
     return_value = find_dlg->ret_value;
@@ -803,7 +803,7 @@ find_file (char *start_dir, char *pattern, char *content, char **dirname,  char
     /* Remove all the items in the stack */
     while ((dir = pop_directory ()) != NULL)
        free (dir);
     /* Remove all the items in the stack */
     while ((dir = pop_directory ()) != NULL)
        free (dir);
-    
+
     listbox_get_current (find_list, &file_tmp, &dir_tmp);
 
     if (dir_tmp)
     listbox_get_current (find_list, &file_tmp, &dir_tmp);
 
     if (dir_tmp)
@@ -902,7 +902,7 @@ do_find (void)
     char *filename, *dirname;
     int  v, dir_and_file_set;
     int done = 0;
     char *filename, *dirname;
     int  v, dir_and_file_set;
     int done = 0;
-    
+
     while (!done){
        if (!find_parameters (&start_dir, &pattern, &content))
            break;
     while (!done){
        if (!find_parameters (&start_dir, &pattern, &content))
            break;
@@ -912,33 +912,33 @@ do_find (void)
        v = find_file (start_dir, pattern, content, &dirname, &filename);
        free (start_dir);
        free (pattern);
        v = find_file (start_dir, pattern, content, &dirname, &filename);
        free (start_dir);
        free (pattern);
-       
+
        if (v == B_ENTER){
            if (dirname || filename){
                if (dirname){
                    do_cd (dirname, cd_exact);
                    if (filename)
        if (v == B_ENTER){
            if (dirname || filename){
                if (dirname){
                    do_cd (dirname, cd_exact);
                    if (filename)
-                       try_to_select (cpanel, filename + (content ? 
+                       try_to_select (cpanel, filename + (content ?
                           (strchr (filename + 4, ':') - filename + 1) : 4) );
                } else if (filename)
                    do_cd (filename, cd_exact);
                paint_panel (cpanel);
                select_item (cpanel);
            }
                           (strchr (filename + 4, ':') - filename + 1) : 4) );
                } else if (filename)
                    do_cd (filename, cd_exact);
                paint_panel (cpanel);
                select_item (cpanel);
            }
-           if (dirname)  
+           if (dirname)
                free (dirname);
                free (dirname);
-           if (filename) 
+           if (filename)
                free (filename);
            break;
        }
                free (filename);
            break;
        }
-       if (content) 
+       if (content)
            free (content);
        dir_and_file_set = dirname && filename;
        if (dirname)  free (dirname);
        if (filename) free (filename);
        if (v == B_CANCEL)
            break;
            free (content);
        dir_and_file_set = dirname && filename;
        if (dirname)  free (dirname);
        if (filename) free (filename);
        if (v == B_CANCEL)
            break;
-       
+
        if (v == B_PANELIZE){
            if (dir_and_file_set){
                try_to_select (cpanel, NULL);
        if (v == B_PANELIZE){
            if (dir_and_file_set){
                try_to_select (cpanel, NULL);
index 5ebc50a..34d2c88 100644 (file)
@@ -2,7 +2,7 @@
 #define __FIND_H
 
 #define MAX_FIND_MENU      4   /* Maximum Menu */
 #define __FIND_H
 
 #define MAX_FIND_MENU      4   /* Maximum Menu */
-#define MAX_FIND_FLINES   11   /* Size of Window Where files are stored */ 
+#define MAX_FIND_FLINES   11   /* Size of Window Where files are stored */
 #define MAX_FIND_TLINES    4   /* Size of Window Where Menu and text .. */
 #define MAX_FIND_COLS     48   /* Length of Windows */
 #define FIND_DIALOG_SIZE  MAX_FIND_FLINES+MAX_FIND_TLINES
 #define MAX_FIND_TLINES    4   /* Size of Window Where Menu and text .. */
 #define MAX_FIND_COLS     48   /* Length of Windows */
 #define FIND_DIALOG_SIZE  MAX_FIND_FLINES+MAX_FIND_TLINES
@@ -14,13 +14,13 @@ typedef struct  find_list{
     int               isdir;     /* For adding a '\t' on FALSE */
     char              *fname;    /* Name of the file */
     char              *path;     /* For changing panel */
     int               isdir;     /* For adding a '\t' on FALSE */
     char              *fname;    /* Name of the file */
     char              *path;     /* For changing panel */
-    struct find_list  *up;      
+    struct find_list  *up;
     struct find_list  *down;
 }find_list;
 
 typedef struct FStack{         /* The Stack will be used to store */
     char *dir_name;             /* the directories to search */
     struct find_list  *down;
 }find_list;
 
 typedef struct FStack{         /* The Stack will be used to store */
     char *dir_name;             /* the directories to search */
-    struct FStack *next;        /*  single-linked */ 
+    struct FStack *next;        /*  single-linked */
 }FStack;
 
 void do_find(void);
 }FStack;
 
 void do_find(void);
index db3fa65..e6bae5b 100644 (file)
@@ -1,12 +1,12 @@
 /* HLP converter
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1995  Jakub Jelinek
 /* HLP converter
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1995  Jakub Jelinek
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -65,7 +65,7 @@ int string_len (char *buffer)
     for (i = 0; i < strlen (buffer); i ++)
     {
        c = buffer [i];
     for (i = 0; i < strlen (buffer); i ++)
     {
        c = buffer [i];
-       if (c == CHAR_LINK_POINTER) 
+       if (c == CHAR_LINK_POINTER)
            link_flag = 1;      /* Link target name starts */
        else if (c == CHAR_LINK_END)
            link_flag = 0;      /* Link target name ends */
            link_flag = 1;      /* Link target name starts */
        else if (c == CHAR_LINK_END)
            link_flag = 0;      /* Link target name ends */
@@ -107,7 +107,7 @@ void print_string (char *buffer)
     p = strchr (buffer, CHAR_LINK_POINTER);
     if (p) {
         char *q;
     p = strchr (buffer, CHAR_LINK_POINTER);
     if (p) {
         char *q;
-        
+
         *p = 0;
         print_string (buffer);
         q = strchr (p + 1, CHAR_LINK_END);
         *p = 0;
         print_string (buffer);
         q = strchr (p + 1, CHAR_LINK_END);
@@ -124,7 +124,7 @@ void print_string (char *buffer)
     buffer = strtok (buffer, " \t\n");
     /* Repeat for each word */
     while (buffer){
     buffer = strtok (buffer, " \t\n");
     /* Repeat for each word */
     while (buffer){
-       /* Skip empty strings */  
+       /* Skip empty strings */
        if (strlen (buffer) > 0){
            len = string_len (buffer);
            /* Change the line if about to break the right margin */
        if (strlen (buffer) > 0){
            len = string_len (buffer);
            /* Change the line if about to break the right margin */
@@ -165,7 +165,7 @@ int main (int argc, char **argv)
     int len;                   /* Length of input line */
     char buffer [BUFFER_SIZE]; /* Input line */
     int i, j;
     int len;                   /* Length of input line */
     char buffer [BUFFER_SIZE]; /* Input line */
     int i, j;
-    char *p; 
+    char *p;
     int ignore_newline = 0;
 
     /* Validity check for arguments */
     int ignore_newline = 0;
 
     /* Validity check for arguments */
@@ -173,7 +173,7 @@ int main (int argc, char **argv)
        fprintf (stderr, _("Usage: fixhlp <width> <tocname>\n"));
        return 3;
     }
        fprintf (stderr, _("Usage: fixhlp <width> <tocname>\n"));
        return 3;
     }
-    
+
     if ((toc_file = fopen (argv[2], "w")) == NULL) {
        fprintf (stderr, _("fixhlp: Cannot open toc for writing"));
        return 4;
     if ((toc_file = fopen (argv[2], "w")) == NULL) {
        fprintf (stderr, _("fixhlp: Cannot open toc for writing"));
        return 4;
@@ -209,7 +209,7 @@ int main (int argc, char **argv)
            } else {
                char *p, *q;
                int i;
            } else {
                char *p, *q;
                int i;
-               
+
                for (p = buffer, q = strchr (p, CHAR_RESERVED); q != NULL;
                    p = q + 1, q = strchr (p, CHAR_RESERVED)) {
                    *q = 0;
                for (p = buffer, q = strchr (p, CHAR_RESERVED); q != NULL;
                    p = q + 1, q = strchr (p, CHAR_RESERVED)) {
                    *q = 0;
index 343cf62..25057f3 100644 (file)
@@ -1,12 +1,12 @@
 /* Hypertext file browser.
    Copyright (C) 1994, 1995 Miguel de Icaza.
    Copyright (C) 1994, 1995 Janne Kukonlehto
 /* Hypertext file browser.
    Copyright (C) 1994, 1995 Miguel de Icaza.
    Copyright (C) 1994, 1995 Janne Kukonlehto
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -33,7 +33,7 @@
    and uses mainly the dialog to achieve the help work.  there is only
    one specialized widget and it's only used to forward the mouse messages
    to the appropiate routine.
    and uses mainly the dialog to achieve the help work.  there is only
    one specialized widget and it's only used to forward the mouse messages
    to the appropiate routine.
-   
+
 */
 
 #include <config.h>
 */
 
 #include <config.h>
@@ -65,7 +65,7 @@
 #define HISTORY_SIZE 20
 #define HELP_WINDOW_WIDTH 62
 
 #define HISTORY_SIZE 20
 #define HELP_WINDOW_WIDTH 62
 
-/* "$Id: help.c,v 1.1 2001/12/30 09:55:25 sedwards Exp $" */
+/* "$Id$" */
 
 static char *data;             /* Pointer to the loaded data file */
 static int help_lines = 18;    /* Lines in help viewer */
 
 static char *data;             /* Pointer to the loaded data file */
 static int help_lines = 18;    /* Lines in help viewer */
@@ -162,7 +162,7 @@ static char *search_string_node (char *start, char *text)
 
     if (!start)
        return 0;
 
     if (!start)
        return 0;
-    
+
     for (; *e && *e != CHAR_NODE_END; e++){
        if (*d == *e)
            d++;
     for (; *e && *e != CHAR_NODE_END; e++){
        if (*d == *e)
            d++;
@@ -181,7 +181,7 @@ static char *search_char_node (char *start, char the_char, int direction)
     char *e;
 
     e = start;
     char *e;
 
     e = start;
-    
+
     for (; *e && (*e != CHAR_NODE_END); e += direction){
        if (*e == the_char)
            return e;
     for (; *e && (*e != CHAR_NODE_END); e += direction){
        if (*e == the_char)
            return e;
@@ -265,7 +265,7 @@ char *help_follow_link (char *start, char *selected_item)
 
     if (!selected_item)
        return start;
 
     if (!selected_item)
        return start;
-    
+
     for (p = selected_item; *p && *p != CHAR_NODE_END && *p != CHAR_LINK_POINTER; p++)
        ;
     if (*p == CHAR_LINK_POINTER){
     for (p = selected_item; *p && *p != CHAR_NODE_END && *p != CHAR_LINK_POINTER; p++)
        ;
     if (*p == CHAR_LINK_POINTER){
@@ -303,11 +303,11 @@ static char *select_prev_link (char *start, char *current_link)
 
     if (!current_link)
        return 0;
 
     if (!current_link)
        return 0;
-    
+
     p = current_link - 1;
     if (p <= start)
        return 0;
     p = current_link - 1;
     if (p <= start)
        return 0;
-    
+
     p = search_char_node (p, CHAR_LINK_START, -1);
     return p;
 }
     p = search_char_node (p, CHAR_LINK_START, -1);
     return p;
 }
@@ -367,13 +367,13 @@ static void show (Dlg_head *h, char *paint_start)
     int active_col, active_line;/* Active link position */
 
     do {
     int active_col, active_line;/* Active link position */
 
     do {
-       
+
        line = col = acs = active_col = active_line = repeat_paint = 0;
        line = col = acs = active_col = active_line = repeat_paint = 0;
-    
+
        clear_link_areas ();
        if (selected_item < paint_start)
            selected_item = NULL;
        clear_link_areas ();
        if (selected_item < paint_start)
            selected_item = NULL;
-       
+
        for (p = paint_start; *p != CHAR_NODE_END && line < help_lines; p++){
            c = *p;
            switch (c){
        for (p = paint_start; *p != CHAR_NODE_END && line < help_lines; p++){
            c = *p;
            switch (c){
@@ -441,7 +441,7 @@ static void show (Dlg_head *h, char *paint_start)
                    continue;
                if (col > HELP_WINDOW_WIDTH-1)
                    continue;
                    continue;
                if (col > HELP_WINDOW_WIDTH-1)
                    continue;
-               
+
                dlg_move (h, line+2, col+2);
                if (acs){
                    if (c == ' ' || c == '.')
                dlg_move (h, line+2, col+2);
                if (acs){
                    if (c == ' ' || c == '.')
@@ -489,14 +489,14 @@ static int help_event (Gpm_Event *event, Widget *w)
 
     /* The event is relative to the dialog window, adjust it: */
     event->y -= 2;
 
     /* The event is relative to the dialog window, adjust it: */
     event->y -= 2;
-    
+
     if (event->buttons & GPM_B_RIGHT){
        currentpoint = startpoint = history [history_ptr].page;
        selected_item = history [history_ptr].link;
        history_ptr--;
        if (history_ptr < 0)
            history_ptr = HISTORY_SIZE-1;
     if (event->buttons & GPM_B_RIGHT){
        currentpoint = startpoint = history [history_ptr].page;
        selected_item = history [history_ptr].link;
        history_ptr--;
        if (history_ptr < 0)
            history_ptr = HISTORY_SIZE-1;
-       
+
        help_callback (w->parent, 0, DLG_DRAW);
        return 0;
     }
        help_callback (w->parent, 0, DLG_DRAW);
        return 0;
     }
@@ -556,9 +556,9 @@ void help_help_cmd (Dlg_head *h)
     history [history_ptr].link = selected_item;
     currentpoint = startpoint = search_string (data, "[How to use help]") + 1;
     selected_item = NULL;
     history [history_ptr].link = selected_item;
     currentpoint = startpoint = search_string (data, "[How to use help]") + 1;
     selected_item = NULL;
-#ifndef HAVE_XVIEW    
+#ifndef HAVE_XVIEW
     help_callback (h, 0, DLG_DRAW);
     help_callback (h, 0, DLG_DRAW);
-#endif    
+#endif
 }
 
 void help_index_cmd (Dlg_head *h)
 }
 
 void help_index_cmd (Dlg_head *h)
@@ -575,15 +575,15 @@ void help_index_cmd (Dlg_head *h)
     else
        currentpoint = startpoint = new_item + 1;
     selected_item = NULL;
     else
        currentpoint = startpoint = new_item + 1;
     selected_item = NULL;
-#ifndef HAVE_XVIEW    
+#ifndef HAVE_XVIEW
     help_callback (h, 0, DLG_DRAW);
     help_callback (h, 0, DLG_DRAW);
-#endif    
+#endif
 }
 
 static void quit_cmd (void *x)
 {
     Dlg_head *h = (Dlg_head *) x;
 }
 
 static void quit_cmd (void *x)
 {
     Dlg_head *h = (Dlg_head *) x;
-    
+
     dlg_stop (x);
 }
 
     dlg_stop (x);
 }
 
@@ -594,10 +594,10 @@ static void prev_node_cmd (Dlg_head *h)
     history_ptr--;
     if (history_ptr < 0)
        history_ptr = HISTORY_SIZE-1;
     history_ptr--;
     if (history_ptr < 0)
        history_ptr = HISTORY_SIZE-1;
-    
-#ifndef HAVE_XVIEW    
+
+#ifndef HAVE_XVIEW
     help_callback (h, 0, DLG_DRAW);
     help_callback (h, 0, DLG_DRAW);
-#endif    
+#endif
 }
 
 static int md_callback (Dlg_head *h, Widget *w, int msg, int par)
 }
 
 static int md_callback (Dlg_head *h, Widget *w, int msg, int par)
@@ -631,7 +631,7 @@ static int help_handle_key (struct Dlg_head *h, int c)
     case KEY_LEFT:
        prev_node_cmd (h);
        break;
     case KEY_LEFT:
        prev_node_cmd (h);
        break;
-       
+
     case '\n':
     case KEY_RIGHT:
        /* follow link */
     case '\n':
     case KEY_RIGHT:
        /* follow link */
@@ -645,7 +645,7 @@ static int help_handle_key (struct Dlg_head *h, int c)
            history_ptr--;
            if (history_ptr < 0)
                history_ptr = HISTORY_SIZE-1;
            history_ptr--;
            if (history_ptr < 0)
                history_ptr = HISTORY_SIZE-1;
-           
+
            currentpoint = startpoint = history [history_ptr].page;
            selected_item   = history [history_ptr].link;
 #endif
            currentpoint = startpoint = history [history_ptr].page;
            selected_item   = history [history_ptr].link;
 #endif
@@ -657,7 +657,7 @@ static int help_handle_key (struct Dlg_head *h, int c)
        }
        selected_item = NULL;
        break;
        }
        selected_item = NULL;
        break;
-       
+
     case KEY_DOWN:
     case '\t':
        /* select next link */
     case KEY_DOWN:
     case '\t':
        /* select next link */
@@ -675,7 +675,7 @@ static int help_handle_key (struct Dlg_head *h, int c)
        else
            selected_item = NULL;
        break;
        else
            selected_item = NULL;
        break;
-       
+
     case KEY_UP:
     case ALT ('\t'):
        /* select previous link */
     case KEY_UP:
     case ALT ('\t'):
        /* select previous link */
@@ -692,7 +692,7 @@ static int help_handle_key (struct Dlg_head *h, int c)
            }
        }
        break;
            }
        }
        break;
-       
+
     case 'n':
        /* Next node */
        new_item = currentpoint;
     case 'n':
        /* Next node */
        new_item = currentpoint;
@@ -705,7 +705,7 @@ static int help_handle_key (struct Dlg_head *h, int c)
            selected_item = NULL;
        }
        break;
            selected_item = NULL;
        }
        break;
-       
+
     case 'p':
        /* Previous node */
        new_item = currentpoint;
     case 'p':
        /* Previous node */
        new_item = currentpoint;
@@ -719,11 +719,11 @@ static int help_handle_key (struct Dlg_head *h, int c)
        currentpoint = new_item + 2;
        selected_item = NULL;
        break;
        currentpoint = new_item + 2;
        selected_item = NULL;
        break;
-       
+
     case 'c':
        help_index_cmd (h);
        break;
     case 'c':
        help_index_cmd (h);
        break;
-       
+
     case ESC_CHAR:
     case XCTRL('g'):
        dlg_stop (h);
     case ESC_CHAR:
     case XCTRL('g'):
        dlg_stop (h);
@@ -731,7 +731,7 @@ static int help_handle_key (struct Dlg_head *h, int c)
 
     default:
        return 0;
 
     default:
        return 0;
-           
+
     }
     help_callback (h, 0, DLG_DRAW);
     return 1;
     }
     help_callback (h, 0, DLG_DRAW);
     return 1;
@@ -767,7 +767,7 @@ void interactive_display (char *filename, char *node)
 {
     WButtonBar *help_bar;
     Widget     *md;
 {
     WButtonBar *help_bar;
     Widget     *md;
-    
+
     if ((data = load_file (filename)) == 0){
        message (1, MSG_ERROR, _(" Can't open file %s \n %s "),
                 filename, unix_error_string (errno));
     if ((data = load_file (filename)) == 0){
        message (1, MSG_ERROR, _(" Can't open file %s \n %s "),
                 filename, unix_error_string (errno));
@@ -789,7 +789,7 @@ void interactive_display (char *filename, char *node)
     /* allow us to process the tab key */
     whelp->raw = 1;
 
     /* allow us to process the tab key */
     whelp->raw = 1;
 
-#endif    
+#endif
     selected_item = search_string_node (main, STRING_LINK_START) - 1;
     currentpoint = startpoint = main + 1;
 
     selected_item = search_string_node (main, STRING_LINK_START) - 1;
     currentpoint = startpoint = main + 1;
 
@@ -803,9 +803,9 @@ void interactive_display (char *filename, char *node)
     help_bar = buttonbar_new (keybar_visible);
     help_bar->widget.y -= whelp->y;
     help_bar->widget.x -= whelp->x;
     help_bar = buttonbar_new (keybar_visible);
     help_bar->widget.y -= whelp->y;
     help_bar->widget.x -= whelp->x;
-    
+
     md       = mousedispatch_new (1, 1, help_lines, HELP_WINDOW_WIDTH-2);
     md       = mousedispatch_new (1, 1, help_lines, HELP_WINDOW_WIDTH-2);
-    
+
     add_widget (whelp, help_bar);
     add_widget (whelp, md);
 
     add_widget (whelp, help_bar);
     add_widget (whelp, md);
 
index 45f0eaa..e8e6b57 100644 (file)
@@ -10,7 +10,7 @@
    Janne did the original Hotlist code, Andrej made the groupable
    hotlist; the move hotlist and revamped the file format and made
    it stronger.
    Janne did the original Hotlist code, Andrej made the groupable
    hotlist; the move hotlist and revamped the file format and made
    it stronger.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    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
    the Free Software Foundation; either version 2 of the License, or
@@ -23,7 +23,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -169,7 +169,7 @@ static struct hotlist *new_hotlist (void)
     hl->head =
        hl->up =
            hl->next = 0;
     hl->head =
        hl->up =
            hl->next = 0;
-    
+
     return hl;
 }
 
     return hl;
 }
 
@@ -178,7 +178,7 @@ static void hotlist_refresh (Dlg_head *dlg)
 {
     dialog_repaint (dlg, COLOR_NORMAL, COLOR_HOT_NORMAL);
     attrset (COLOR_NORMAL);
 {
     dialog_repaint (dlg, COLOR_NORMAL, COLOR_HOT_NORMAL);
     attrset (COLOR_NORMAL);
-    draw_box (dlg, 2, 5, 
+    draw_box (dlg, 2, 5,
                dlg->lines - (hotlist_state.moving ? 6 : 10),
                dlg->cols - (UX*2));
     if (!hotlist_state.moving)
                dlg->lines - (hotlist_state.moving ? 6 : 10),
                dlg->cols - (UX*2));
     if (!hotlist_state.moving)
@@ -196,12 +196,12 @@ static INLINE void update_path_name ()
     if (list->current){
        if (list->current->data != 0) {
            struct hotlist *hlp = (struct hotlist *)list->current->data;
     if (list->current){
        if (list->current->data != 0) {
            struct hotlist *hlp = (struct hotlist *)list->current->data;
-           
+
            if (hlp->type == HL_TYPE_ENTRY)
                text = hlp->directory;
            else
                text = _("Subgroup - press ENTER to see list");
            if (hlp->type == HL_TYPE_ENTRY)
                text = hlp->directory;
            else
                text = _("Subgroup - press ENTER to see list");
-           
+
 #ifndef HAVE_X
            p = copy_strings (" ", current_group->label, " ", (char *)0);
            if (!hotlist_state.moving)
 #ifndef HAVE_X
            p = copy_strings (" ", current_group->label, " ", (char *)0);
            if (!hotlist_state.moving)
@@ -282,7 +282,7 @@ unlink_entry (struct hotlist *entry)
     entry->next =
        entry->up = 0;
 }
     entry->next =
        entry->up = 0;
 }
-    
+
 static void add_new_entry_cmd (void);
 static void init_movelist (int, struct hotlist *);
 
 static void add_new_entry_cmd (void);
 static void init_movelist (int, struct hotlist *);
 
@@ -419,11 +419,11 @@ static int hotlist_button_callback (int action, void *data)
 static int hotlist_callback (Dlg_head * h, int Par, int Msg)
 {
     switch (Msg) {
 static int hotlist_callback (Dlg_head * h, int Par, int Msg)
 {
     switch (Msg) {
-#ifndef HAVE_X    
+#ifndef HAVE_X
     case DLG_DRAW:
        hotlist_refresh (h);
        break;
     case DLG_DRAW:
        hotlist_refresh (h);
        break;
-#endif 
+#endif
 
     case DLG_UNHANDLED_KEY:
        switch (Par) {
 
     case DLG_UNHANDLED_KEY:
        switch (Par) {
@@ -583,11 +583,11 @@ init_i18n_stuff(int list_type, int cols)
 
                        row = hotlist_but [i].y;
 
 
                        row = hotlist_but [i].y;
 
-                       if (hotlist_but [i].x != 0) 
+                       if (hotlist_but [i].x != 0)
                        {
                                /* not first int the row */
                                if (!strcmp (hotlist_but [i].text, cancel_but))
                        {
                                /* not first int the row */
                                if (!strcmp (hotlist_but [i].text, cancel_but))
-                                       hotlist_but [i].x = 
+                                       hotlist_but [i].x =
                                                cols - strlen (hotlist_but [i].text) - 13;
                                else
                                        hotlist_but [i].x = cur_x [row];
                                                cols - strlen (hotlist_but [i].text) - 13;
                                else
                                        hotlist_but [i].x = cur_x [row];
@@ -597,7 +597,7 @@ init_i18n_stuff(int list_type, int cols)
                                + (hotlist_but [i].flags == DEFPUSH_BUTTON ? 5 : 3);
                }
        }
                                + (hotlist_but [i].flags == DEFPUSH_BUTTON ? 5 : 3);
                }
        }
-       
+
        return cols;
 }
 
        return cols;
 }
 
@@ -612,7 +612,7 @@ static void init_hotlist (int list_type)
                            "expanded_view_of_groups", 0, profile_name);
 
     hotlist_dlg = create_dlg (0, 0, LINES-2, hotlist_cols, dialog_colors,
                            "expanded_view_of_groups", 0, profile_name);
 
     hotlist_dlg = create_dlg (0, 0, LINES-2, hotlist_cols, dialog_colors,
-                             hotlist_callback, 
+                             hotlist_callback,
                              list_type == LIST_VFSLIST ? "[vfshot]" : "[Hotlist]",
                              list_type == LIST_VFSLIST ? "vfshot" : "hotlist",
                              DLG_CENTER|DLG_GRID);
                              list_type == LIST_VFSLIST ? "[vfshot]" : "[Hotlist]",
                              list_type == LIST_VFSLIST ? "vfshot" : "hotlist",
                              DLG_CENTER|DLG_GRID);
@@ -628,7 +628,7 @@ static void init_hotlist (int list_type)
     }
 #undef XTRACT
 
     }
 #undef XTRACT
 
-    /* We add the labels. 
+    /* We add the labels.
      *    pname       will hold entry's pathname;
      *    pname_group will hold name of current group
      */
      *    pname       will hold entry's pathname;
      *    pname_group will hold name of current group
      */
@@ -653,7 +653,7 @@ static void init_hotlist (int list_type)
     } else
        fill_listbox ();
 
     } else
        fill_listbox ();
 
-    add_widgetl (hotlist_dlg, l_hotlist, XV_WLAY_EXTENDWIDTH); 
+    add_widgetl (hotlist_dlg, l_hotlist, XV_WLAY_EXTENDWIDTH);
     /* add listbox to the dialogs */
 }
 
     /* add listbox to the dialogs */
 }
 
@@ -690,13 +690,13 @@ static void init_movelist (int list_type, struct hotlist *item)
     add_widget (movelist_dlg, movelist_group);
 #endif
     /* get new listbox */
     add_widget (movelist_dlg, movelist_group);
 #endif
     /* get new listbox */
-    l_movelist = listbox_new (UY + 1, UX + 1, 
+    l_movelist = listbox_new (UY + 1, UX + 1,
                movelist_dlg->cols - 2*UX - 2, movelist_dlg->lines - 8,
                listbox_cback, l_call, "listbox");
 
     fill_listbox ();
 
                movelist_dlg->cols - 2*UX - 2, movelist_dlg->lines - 8,
                listbox_cback, l_call, "listbox");
 
     fill_listbox ();
 
-    add_widgetl (movelist_dlg, l_movelist, XV_WLAY_EXTENDWIDTH); 
+    add_widgetl (movelist_dlg, l_movelist, XV_WLAY_EXTENDWIDTH);
     /* add listbox to the dialogs */
 }
 
     /* add listbox to the dialogs */
 }
 
@@ -818,12 +818,12 @@ static int add_new_entry_input (char *header, char *text1, char *text2, char *he
     { quick_input,  4, 80, 3, 0, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-lbl" },
     { quick_label,  3, 80, 2, 0, 0, 0, 0, 0, 0, XV_WLAY_DONTCARE, "label-lbl" },
     { 0 } };
     { quick_input,  4, 80, 3, 0, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-lbl" },
     { quick_label,  3, 80, 2, 0, 0, 0, 0, 0, 0, XV_WLAY_DONTCARE, "label-lbl" },
     { 0 } };
-    
+
     int len;
     int i;
     int lines1, lines2;
     char *my_str1, *my_str2;
     int len;
     int i;
     int lines1, lines2;
     char *my_str1, *my_str2;
-    
+
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
 #endif /* ENABLE_NLS */
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
 #endif /* ENABLE_NLS */
@@ -863,7 +863,7 @@ static int add_new_entry_input (char *header, char *text1, char *text2, char *he
 
     quick_widgets [5].str_result = &my_str1;
     quick_widgets [3].str_result = &my_str2;
 
     quick_widgets [5].str_result = &my_str1;
     quick_widgets [3].str_result = &my_str2;
-    
+
     Quick_input.widgets = quick_widgets;
     if ((i = quick_dialog (&Quick_input)) != B_CANCEL){
         *r1 = *(quick_widgets [5].str_result);
     Quick_input.widgets = quick_widgets;
     if ((i = quick_dialog (&Quick_input)) != B_CANCEL){
         *r1 = *(quick_widgets [5].str_result);
@@ -909,7 +909,7 @@ static int add_new_group_input (char *header, char *label, char **result)
     { quick_input,  4, 80,  0, 0, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input" },
     { quick_label,  3, 80,  2, 0,  0,  0, 0, 0, 0, XV_WLAY_DONTCARE, "label" },
     { 0 } };
     { quick_input,  4, 80,  0, 0, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input" },
     { quick_label,  3, 80,  2, 0,  0,  0, 0, 0, 0, XV_WLAY_DONTCARE, "label" },
     { 0 } };
-    
+
     int len;
     int i;
     int lines;
     int len;
     int i;
     int lines;
@@ -918,7 +918,7 @@ static int add_new_group_input (char *header, char *label, char **result)
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
 #endif /* ENABLE_NLS */
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
 #endif /* ENABLE_NLS */
-    
+
     len = max (strlen (header), msglen (label, &lines)) + 4;
     len = max (len, 64);
 
     len = max (strlen (header), msglen (label, &lines)) + 4;
     len = max (len, 64);
 
@@ -947,7 +947,7 @@ static int add_new_group_input (char *header, char *label, char **result)
 
     quick_widgets [3].str_result = &my_str;
     quick_widgets [3].text       = "";
 
     quick_widgets [3].str_result = &my_str;
     quick_widgets [3].text       = "";
-    
+
     Quick_input.widgets = quick_widgets;
     if ((ret = quick_dialog (&Quick_input)) != B_CANCEL){
        *result = *(quick_widgets [3].str_result);
     Quick_input.widgets = quick_widgets;
     if ((ret = quick_dialog (&Quick_input)) != B_CANCEL){
        *result = *(quick_widgets [3].str_result);
@@ -1010,7 +1010,7 @@ static void remove_group (struct hotlist *grp)
     }
 
 }
     }
 
 }
-       
+
 static void remove_from_hotlist (struct hotlist *entry)
 {
     if (entry->type == HL_TYPE_GROUP) {
 static void remove_from_hotlist (struct hotlist *entry)
 {
     if (entry->type == HL_TYPE_GROUP) {
@@ -1086,7 +1086,7 @@ void load_group (struct hotlist *grp)
     char *key, *value;
     char *group_section;
     struct hotlist *current = 0;
     char *key, *value;
     char *group_section;
     struct hotlist *current = 0;
-    
+
     group_section = find_group_section (grp);
 
     profile_keys = profile_init_iterator (group_section, profile_name);
     group_section = find_group_section (grp);
 
     profile_keys = profile_init_iterator (group_section, profile_name);
@@ -1135,7 +1135,7 @@ static int hot_skip_blanks ()
     while ((c = getc (hotlist_file)) != EOF && c != '\n' && isspace (c))
        ;
     return c;
     while ((c = getc (hotlist_file)) != EOF && c != '\n' && isspace (c))
        ;
     return c;
-    
+
 }
 
 static int hot_next_token ()
 }
 
 static int hot_next_token ()
@@ -1355,7 +1355,7 @@ void load_hotlist (void)
 
     if (hotlist_state.loaded) {
        stat (hotlist_file_name, &stat_buf);
 
     if (hotlist_state.loaded) {
        stat (hotlist_file_name, &stat_buf);
-       if (hotlist_file_mtime < stat_buf.st_mtime) 
+       if (hotlist_file_mtime < stat_buf.st_mtime)
            done_hotlist ();
        else
            return;
            done_hotlist ();
        else
            return;
@@ -1363,7 +1363,7 @@ void load_hotlist (void)
 
     if (!hotlist_file_name)
        hotlist_file_name = concat_dir_and_file (home_dir, HOTLIST_FILENAME);
 
     if (!hotlist_file_name)
        hotlist_file_name = concat_dir_and_file (home_dir, HOTLIST_FILENAME);
-    
+
     hotlist           = new_hotlist ();
     hotlist->type      = HL_TYPE_GROUP;
     hotlist->label     = strdup (_(" Top level group "));
     hotlist           = new_hotlist ();
     hotlist->type      = HL_TYPE_GROUP;
     hotlist->label     = strdup (_(" Top level group "));
@@ -1387,7 +1387,7 @@ void load_hotlist (void)
                            _(" and then delete [Hotlist] section there"), NULL);
        message (0, _(" Hotlist Load "), msg);
        free (msg);
                            _(" and then delete [Hotlist] section there"), NULL);
        message (0, _(" Hotlist Load "), msg);
        free (msg);
-       
+
        load_group (hotlist);
        hotlist_state.loaded   = 1;
        /*
        load_group (hotlist);
        hotlist_state.loaded   = 1;
        /*
@@ -1477,7 +1477,7 @@ void save_group (struct hotlist *grp)
     char           *group_section;
 
     group_section = find_group_section (grp);
     char           *group_section;
 
     group_section = find_group_section (grp);
-    
+
     profile_clean_section (group_section, profile_name);
     for (;current && current->type == HL_TYPE_GROUP; current = current->next){
        WritePrivateProfileString (group_section,
     profile_clean_section (group_section, profile_name);
     for (;current && current->type == HL_TYPE_GROUP; current = current->next){
        WritePrivateProfileString (group_section,
@@ -1491,7 +1491,7 @@ void save_group (struct hotlist *grp)
         current && current->type == HL_TYPE_GROUP;
         current = current->next)
         save_group (current);
         current && current->type == HL_TYPE_GROUP;
         current = current->next)
         save_group (current);
-    
+
     profile_clean_section (grp->directory, profile_name);
     for (;current; current = current->next){
        WritePrivateProfileString (grp->directory,
     profile_clean_section (grp->directory, profile_name);
     for (;current; current = current->next){
        WritePrivateProfileString (grp->directory,
@@ -1565,7 +1565,7 @@ int save_hotlist (void)
 {
     int                saved = 0;
     struct      stat stat_buf;
 {
     int                saved = 0;
     struct      stat stat_buf;
-    
+
     if (!hotlist_state.readonly && hotlist_state.modified && hotlist_file_name) {
        char    *fbak = copy_strings (hotlist_file_name, ".bak", 0);
 
     if (!hotlist_state.readonly && hotlist_state.modified && hotlist_file_name) {
        char    *fbak = copy_strings (hotlist_file_name, ".bak", 0);
 
index ead75e3..94d97e3 100644 (file)
@@ -1,12 +1,12 @@
 /* Panel managing.
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1995 Miguel de Icaza
 /* Panel managing.
    Copyright (C) 1994, 1995 Janne Kukonlehto
    Copyright (C) 1995 Miguel de Icaza
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -88,7 +88,7 @@ void info_show_info (WInfo *info)
 
     if (!info->ready)
        return;
 
     if (!info->ready)
        return;
-    
+
     my_statfs (&myfs_stats, cpanel->cwd);
     buf = cpanel->dir.list [cpanel->selected].buf;
 #ifdef OS2_NT
     my_statfs (&myfs_stats, cpanel->cwd);
     buf = cpanel->dir.list [cpanel->selected].buf;
 #ifdef OS2_NT
@@ -96,12 +96,12 @@ void info_show_info (WInfo *info)
     if ((signed char) buf.st_dev < 0)
            return;
 #endif
     if ((signed char) buf.st_dev < 0)
            return;
 #endif
-    
+
 #ifndef HAVE_X
     /* Print only lines which fit */
     switch (info->widget.y-2){
        /* Note: all cases are fall-throughs */
 #ifndef HAVE_X
     /* Print only lines which fit */
     switch (info->widget.y-2){
        /* Note: all cases are fall-throughs */
-       
+
     default:
 
     case 16:
     default:
 
     case 16:
@@ -114,7 +114,7 @@ void info_show_info (WInfo *info)
                    myfs_stats.nodes);
        else
            addstr (_("No node information"));
                    myfs_stats.nodes);
        else
            addstr (_("No node information"));
-       
+
     case 15:
        widget_move (&info->widget, 15, 3);
        if (myfs_stats.avail > 0 || myfs_stats.total > 0){
     case 15:
        widget_move (&info->widget, 15, 3);
        if (myfs_stats.avail > 0 || myfs_stats.total > 0){
@@ -144,11 +144,11 @@ void info_show_info (WInfo *info)
     case 11:
        widget_move (&info->widget, 11, 3);
        printw (_("Accessed:  %s"), file_date (buf.st_atime));
     case 11:
        widget_move (&info->widget, 11, 3);
        printw (_("Accessed:  %s"), file_date (buf.st_atime));
-       
+
     case 10:
        widget_move (&info->widget, 10, 3);
        printw (_("Modified:  %s"), file_date (buf.st_mtime));
     case 10:
        widget_move (&info->widget, 10, 3);
        printw (_("Modified:  %s"), file_date (buf.st_mtime));
-       
+
     case 9:
        widget_move (&info->widget, 9, 3);
        printw (_("Created:   %s"), file_date (buf.st_ctime));
     case 9:
        widget_move (&info->widget, 9, 3);
        printw (_("Created:   %s"), file_date (buf.st_ctime));
@@ -170,25 +170,25 @@ void info_show_info (WInfo *info)
            printw (_(" (%d blocks)"), buf.st_blocks);
 #endif
        }
            printw (_(" (%d blocks)"), buf.st_blocks);
 #endif
        }
-       
+
     case 7:
        widget_move (&info->widget, 7, 3);
        printw (_("Owner:     %s/%s"), get_owner (buf.st_uid),
                get_group (buf.st_gid));
     case 7:
        widget_move (&info->widget, 7, 3);
        printw (_("Owner:     %s/%s"), get_owner (buf.st_uid),
                get_group (buf.st_gid));
-       
+
     case 6:
        widget_move (&info->widget, 6, 3);
        printw (_("Links:     %d"), buf.st_nlink);
     case 6:
        widget_move (&info->widget, 6, 3);
        printw (_("Links:     %d"), buf.st_nlink);
-       
+
     case 5:
        widget_move (&info->widget, 5, 3);
        printw (_("Mode:      %s (%04o)"),
                string_perm (buf.st_mode), buf.st_mode & 07777);
     case 5:
        widget_move (&info->widget, 5, 3);
        printw (_("Mode:      %s (%04o)"),
                string_perm (buf.st_mode), buf.st_mode & 07777);
-       
+
     case 4:
        widget_move (&info->widget, 4, 3);
        printw (_("Location:  %Xh:%Xh"), buf.st_dev, buf.st_ino);
     case 4:
        widget_move (&info->widget, 4, 3);
        printw (_("Location:  %Xh:%Xh"), buf.st_dev, buf.st_ino);
-       
+
     case 3:
        widget_move (&info->widget, 3, 2);
        /* .ado: fname is invalid if selected == 0 && ifno called from current panel */
     case 3:
        widget_move (&info->widget, 3, 2);
        /* .ado: fname is invalid if selected == 0 && ifno called from current panel */
@@ -198,7 +198,7 @@ void info_show_info (WInfo *info)
                                    info->widget.cols - 15));
        } else
                printw (_("File:       None"));
                                    info->widget.cols - 15));
        } else
                printw (_("File:       None"));
-     
+
     case 2:
     case 1:
     case 0:
     case 2:
     case 1:
     case 0:
@@ -213,13 +213,13 @@ static void info_hook (void *data)
 {
     WInfo *info = (WInfo *) data;
     Widget *other_widget;
 {
     WInfo *info = (WInfo *) data;
     Widget *other_widget;
-    
+
     other_widget = get_panel_widget (get_current_index ());
     if (!other_widget)
        return;
     if (dlg_overlap (&info->widget, other_widget))
        return;
     other_widget = get_panel_widget (get_current_index ());
     if (!other_widget)
        return;
     if (dlg_overlap (&info->widget, other_widget))
        return;
-    
+
     info->ready = 1;
     info_show_info (info);
 }
     info->ready = 1;
     info_show_info (info);
 }
@@ -241,19 +241,19 @@ static int info_callback (Dlg_head *h, WInfo *info, int msg, int par)
 #endif
        break;
 
 #endif
        break;
 
-#ifndef HAVE_X           
+#ifndef HAVE_X
     case WIDGET_DRAW:
        info_hook (info);
        info_show_info (info);
        return 1;
     case WIDGET_DRAW:
        info_hook (info);
        info_show_info (info);
        return 1;
-#endif 
+#endif
 
     case WIDGET_FOCUS:
        return 0;
     }
     return default_proc (h, msg, par);
 }
 
     case WIDGET_FOCUS:
        return 0;
     }
     return default_proc (h, msg, par);
 }
-                          
+
 WInfo *info_new ()
 {
     WInfo *info = xmalloc (sizeof (WInfo), "panel_info");
 WInfo *info_new ()
 {
     WInfo *info = xmalloc (sizeof (WInfo), "panel_info");
index e803eed..f462c95 100644 (file)
@@ -6,12 +6,12 @@
                1994, 1995 Janne Kukonlehto.
               1995  Jakub Jelinek.
               1997  Norbert Warmuth
                1994, 1995 Janne Kukonlehto.
               1995  Jakub Jelinek.
               1997  Norbert Warmuth
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -40,7 +40,7 @@
 #include "tty.h"
 #include <ctype.h>
 #include <errno.h>
 #include "tty.h"
 #include <ctype.h>
 #include <errno.h>
-#include <malloc.h> 
+#include <malloc.h>
 #include "util.h"              /* For xmalloc prototype */
 #include "mad.h"               /* The memory debugger */
 #include "global.h"
 #include "util.h"              /* For xmalloc prototype */
 #include "mad.h"               /* The memory debugger */
 #include "global.h"
 
 #include "x.h"
 
 
 #include "x.h"
 
-/* "$Id: key.c,v 1.1 2001/12/30 09:55:25 sedwards Exp $" */
+/* "$Id$" */
 
 /* This macros were stolen from gpm 0.15 */
 #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL))
 #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \
                         (t2.tv_usec-t1.tv_usec)/1000)
 
 /* This macros were stolen from gpm 0.15 */
 #define GET_TIME(tv) (gettimeofday(&tv, (struct timezone *)NULL))
 #define DIF_TIME(t1,t2) ((t2.tv_sec -t1.tv_sec) *1000+ \
                         (t2.tv_usec-t1.tv_usec)/1000)
-                        
+
 /* timeout for old_esc_mode in usec */
 #define ESCMODE_TIMEOUT 1000000
 
 /* timeout for old_esc_mode in usec */
 #define ESCMODE_TIMEOUT 1000000
 
@@ -126,7 +126,7 @@ void delete_select_channel (int fd)
 {
     SelectList *p = select_list;
     SelectList *prev = 0;
 {
     SelectList *p = select_list;
     SelectList *prev = 0;
-    
+
     while (p){
        if (p->fd == fd){
            if (prev)
     while (p){
        if (p->fd == fd){
            if (prev)
@@ -147,7 +147,7 @@ inline static int add_selects (fd_set *select_set)
 
     if (disabled_channels)
        return 0;
 
     if (disabled_channels)
        return 0;
-    
+
     for (p = select_list; p; p = p->next){
        FD_SET (p->fd, select_set);
        if (p->fd > top_fd)
     for (p = select_list; p; p = p->next){
        FD_SET (p->fd, select_set);
        if (p->fd > top_fd)
@@ -162,7 +162,7 @@ static void check_selects (fd_set *select_set)
 
     if (disabled_channels)
        return;
 
     if (disabled_channels)
        return;
-    
+
     for (p = select_list; p; p = p->next)
        if (FD_ISSET (p->fd, select_set))
            (*p->callback)(p->fd, p->info);
     for (p = select_list; p; p = p->next)
        if (FD_ISSET (p->fd, select_set))
            (*p->callback)(p->fd, p->info);
@@ -230,10 +230,10 @@ void define_sequences (key_define_t *kd)
 {
 #ifndef HAVE_X
     int i;
 {
 #ifndef HAVE_X
     int i;
-    
+
     for (i = 0; kd [i].code; i++)
        define_sequence(kd [i].code, kd [i].seq, kd [i].action);
     for (i = 0; kd [i].code; i++)
        define_sequence(kd [i].code, kd [i].seq, kd [i].action);
-#endif 
+#endif
 }
 
 /* This has to be called before slang_init or whatever routine
 }
 
 /* This has to be called before slang_init or whatever routine
@@ -242,31 +242,31 @@ void init_key (void)
 {
 #ifndef HAVE_X
     char *term = (char *) getenv ("TERM");
 {
 #ifndef HAVE_X
     char *term = (char *) getenv ("TERM");
-    
+
     /* This has to be the first define_sequence */
     /* So, we can assume that the first keys member has ESC */
     define_sequences (mc_default_keys);
     /* This has to be the first define_sequence */
     /* So, we can assume that the first keys member has ESC */
     define_sequences (mc_default_keys);
-    
+
     /* Terminfo on irix does not have some keys */
     if ((!strncmp (term, "iris-ansi", 9)) || (!strncmp (term, "xterm", 5)))
        define_sequences (xterm_key_defines);
     /* Terminfo on irix does not have some keys */
     if ((!strncmp (term, "iris-ansi", 9)) || (!strncmp (term, "xterm", 5)))
        define_sequences (xterm_key_defines);
-    
+
     define_sequences (mc_bindings);
     define_sequences (mc_bindings);
-    
+
     /* load some additional keys (e.g. direct Alt-? support) */
     load_xtra_key_defines();
     /* load some additional keys (e.g. direct Alt-? support) */
     load_xtra_key_defines();
-    
+
 #ifdef __QNX__
     if (strncmp(term, "qnx", 3) == 0){
        /* Modify the default value of use_8th_bit_as_meta: we would
         * like to provide a working mc for a newbie who knows nothing
         * about [Options|Display bits|Full 8 bits input]...
 #ifdef __QNX__
     if (strncmp(term, "qnx", 3) == 0){
        /* Modify the default value of use_8th_bit_as_meta: we would
         * like to provide a working mc for a newbie who knows nothing
         * about [Options|Display bits|Full 8 bits input]...
-        * 
-        * Don't use 'meta'-bit, when we are dealing with a 
+        *
+        * Don't use 'meta'-bit, when we are dealing with a
         * 'qnx*'-type terminal: clear the default value!
         * These terminal types use 0xFF as an escape character,
         * so use_8th_bit_as_meta==1 must not be enabled!
         * 'qnx*'-type terminal: clear the default value!
         * These terminal types use 0xFF as an escape character,
         * so use_8th_bit_as_meta==1 must not be enabled!
-        * 
+        *
         * [mc-4.1.21+,slint.c/getch(): the DEC_8BIT_HACK stuff
         * is not used now (doesn't even depend on use_8th_bit_as_meta
         * as in mc-3.1.2)...GREAT!...no additional code is required!]
         * [mc-4.1.21+,slint.c/getch(): the DEC_8BIT_HACK stuff
         * is not used now (doesn't even depend on use_8th_bit_as_meta
         * as in mc-3.1.2)...GREAT!...no additional code is required!]
@@ -301,7 +301,7 @@ void xmouse_get_event (Gpm_Event *ev)
     /* Variable btn has following meaning: */
     /* 0 = btn1 dn, 1 = btn2 dn, 2 = btn3 dn, 3 = btn up */
     btn = xgetch () - 32;
     /* Variable btn has following meaning: */
     /* 0 = btn1 dn, 1 = btn2 dn, 2 = btn3 dn, 3 = btn up */
     btn = xgetch () - 32;
-    
+
     /* There seems to be no way of knowing which button was released */
     /* So we assume all the buttons were released */
 
     /* There seems to be no way of knowing which button was released */
     /* So we assume all the buttons were released */
 
@@ -318,7 +318,7 @@ void xmouse_get_event (Gpm_Event *ev)
            clicks %= 3;
        } else
            clicks = 0;
            clicks %= 3;
        } else
            clicks = 0;
-       
+
         switch (btn) {
        case 0:
             ev->buttons = GPM_B_LEFT;
         switch (btn) {
        case 0:
             ev->buttons = GPM_B_LEFT;
@@ -348,7 +348,7 @@ static key_def *create_sequence (char *seq, int code, int action)
        p = xmalloc (sizeof (key_def), "create_sequence");
        if (!base) base = p;
        if (attach) attach->child = p;
        p = xmalloc (sizeof (key_def), "create_sequence");
        if (!base) base = p;
        if (attach) attach->child = p;
-       
+
        p->ch   = *seq;
        p->code = code;
        p->child = p->next = NULL;
        p->ch   = *seq;
        p->code = code;
        p->child = p->next = NULL;
@@ -369,7 +369,7 @@ static int push_char (int c)
 {
     if (!seq_append)
        seq_append = seq_buffer;
 {
     if (!seq_append)
        seq_append = seq_buffer;
-    
+
     if (seq_append == &(seq_buffer [sizeof (seq_buffer)-2]))
        return 0;
     *(seq_append++) = c;
     if (seq_append == &(seq_buffer [sizeof (seq_buffer)-2]))
        return 0;
     *(seq_append++) = c;
@@ -385,7 +385,7 @@ void define_sequence (int code, char *seq, int action)
 
     if (strlen (seq) > sizeof (seq_buffer)-1)
        return;
 
     if (strlen (seq) > sizeof (seq_buffer)-1)
        return;
-    
+
     for (base = keys; (base != 0) && *seq; ){
        if (*seq == base->ch){
            if (base->child == 0){
     for (base = keys; (base != 0) && *seq; ){
        if (*seq == base->ch){
            if (base->child == 0){
@@ -410,7 +410,7 @@ void define_sequence (int code, char *seq, int action)
        }
     }
     keys = create_sequence (seq, code, action);
        }
     }
     keys = create_sequence (seq, code, action);
-#endif    
+#endif
 }
 
 #ifndef HAVE_X
 }
 
 #ifndef HAVE_X
@@ -432,7 +432,7 @@ int correct_key_code (int c)
     if (c == KEY_F(0))
        return KEY_F(10);
 
     if (c == KEY_F(0))
        return KEY_F(10);
 
-    if (!alternate_plus_minus) 
+    if (!alternate_plus_minus)
         switch (c) {
             case KEY_KP_ADD: c = '+'; break;
             case KEY_KP_SUBTRACT: c = '-'; break;
         switch (c) {
             case KEY_KP_ADD: c = '+'; break;
             case KEY_KP_SUBTRACT: c = '-'; break;
@@ -449,7 +449,7 @@ int get_key_code (int no_delay)
     static key_def *this = NULL, *parent;
     static struct timeval esctime = { -1, -1 };
     static int lastnodelay = -1;
     static key_def *this = NULL, *parent;
     static struct timeval esctime = { -1, -1 };
     static int lastnodelay = -1;
-    
+
     if (no_delay != lastnodelay) {
         this = NULL;
         lastnodelay = no_delay;
     if (no_delay != lastnodelay) {
         this = NULL;
         lastnodelay = no_delay;
@@ -489,10 +489,10 @@ int get_key_code (int no_delay)
         nodelay (stdscr, FALSE);
 #endif
         if (c == ERR) {
         nodelay (stdscr, FALSE);
 #endif
         if (c == ERR) {
-            if (this != NULL && parent != NULL && 
+            if (this != NULL && parent != NULL &&
                 parent->action == MCKEY_ESCAPE && old_esc_mode) {
                 struct timeval current, timeout;
                 parent->action == MCKEY_ESCAPE && old_esc_mode) {
                 struct timeval current, timeout;
-                
+
                 if (esctime.tv_sec == -1)
                     return ERR;
                 GET_TIME (current);
                 if (esctime.tv_sec == -1)
                     return ERR;
                 GET_TIME (current);
@@ -504,7 +504,7 @@ int get_key_code (int no_delay)
                 }
                 if (current.tv_sec < timeout.tv_sec)
                     return ERR;
                 }
                 if (current.tv_sec < timeout.tv_sec)
                     return ERR;
-                if (current.tv_sec == timeout.tv_sec && 
+                if (current.tv_sec == timeout.tv_sec &&
                     current.tv_usec < timeout.tv_usec)
                     return ERR;
                 this = NULL;
                     current.tv_usec < timeout.tv_usec)
                     return ERR;
                 this = NULL;
@@ -524,7 +524,7 @@ int get_key_code (int no_delay)
        this = NULL;
        return ERR;
     }
        this = NULL;
        return ERR;
     }
-    
+
     /* Search the key on the root */
     if (!no_delay || this == NULL) {
         this = keys;
     /* Search the key on the root */
     if (!no_delay || this == NULL) {
         this = keys;
@@ -572,7 +572,7 @@ int get_key_code (int no_delay)
            } else {
                /* We got a complete match, return and reset search */
                int code;
            } else {
                /* We got a complete match, return and reset search */
                int code;
-               
+
                pending_keys = seq_append = NULL;
                code = this->code;
                this = NULL;
                pending_keys = seq_append = NULL;
                code = this->code;
                this = NULL;
@@ -587,7 +587,7 @@ int get_key_code (int no_delay)
                    if (isalpha(c)
                        || (c == '\n') || (c == '\t') || (c == XCTRL('h'))
                        || (c == KEY_BACKSPACE) || (c == '!') || (c == '\r')
                    if (isalpha(c)
                        || (c == '\n') || (c == '\t') || (c == XCTRL('h'))
                        || (c == KEY_BACKSPACE) || (c == '!') || (c == '\r')
-                       || c == 127 || c == '+' || c == '-' || c == '\\' 
+                       || c == 127 || c == '+' || c == '-' || c == '\\'
                        || c == '?')
                        c = ALT(c);
                    else if (isdigit(c))
                        || c == '?')
                        c = ALT(c);
                    else if (isdigit(c))
@@ -627,7 +627,7 @@ void try_channels (int set_timeout)
        FD_ZERO (&select_set);
        FD_SET  (input_fd, &select_set);        /* Add stdin */
        add_selects (&select_set);
        FD_ZERO (&select_set);
        FD_SET  (input_fd, &select_set);        /* Add stdin */
        add_selects (&select_set);
-       
+
        if (set_timeout){
            timeout.tv_sec = 0;
            timeout.tv_usec = 100000;
        if (set_timeout){
            timeout.tv_sec = 0;
            timeout.tv_usec = 100000;
@@ -699,7 +699,7 @@ int get_event (Gpm_Event *event, int redo_event, int block)
        dirty++;
 
     vfs_timeout_handler ();
        dirty++;
 
     vfs_timeout_handler ();
-    
+
     /* Ok, we use (event->x < 0) to signal that the event does not contain
        a suitable position for the mouse, so we can't use show_mouse_pointer
        on it.
     /* Ok, we use (event->x < 0) to signal that the event does not contain
        a suitable position for the mouse, so we can't use show_mouse_pointer
        on it.
@@ -732,7 +732,7 @@ int get_event (Gpm_Event *event, int redo_event, int block)
                time_addr = &timeout;
            } else {
                int seconds;
                time_addr = &timeout;
            } else {
                int seconds;
-               
+
                if ((seconds = vfs_timeouts ())){
                    /* the timeout could be improved and actually be
                     * the number of seconds until the next vfs entry
                if ((seconds = vfs_timeouts ())){
                    /* the timeout could be improved and actually be
                     * the number of seconds until the next vfs entry
@@ -754,7 +754,7 @@ int get_event (Gpm_Event *event, int redo_event, int block)
            enable_interrupt_key ();
            flag = select (FD_SETSIZE, &select_set, NULL, NULL, time_addr);
            disable_interrupt_key ();
            enable_interrupt_key ();
            flag = select (FD_SETSIZE, &select_set, NULL, NULL, time_addr);
            disable_interrupt_key ();
-           
+
            /* select timed out: it could be for any of the following reasons:
             * redo_event -> it was because of the MOU_REPEAT handler
             * !block     -> we did not block in the select call
            /* select timed out: it could be for any of the following reasons:
             * redo_event -> it was because of the MOU_REPEAT handler
             * !block     -> we did not block in the select call
@@ -771,7 +771,7 @@ int get_event (Gpm_Event *event, int redo_event, int block)
                return EV_NONE;
 
            check_selects (&select_set);
                return EV_NONE;
 
            check_selects (&select_set);
-           
+
            if (FD_ISSET (input_fd, &select_set))
                break;
        }
            if (FD_ISSET (input_fd, &select_set))
                break;
        }
@@ -792,12 +792,12 @@ int get_event (Gpm_Event *event, int redo_event, int block)
 #   endif
 
     c = block ? getch_with_delay () : get_key_code(1);
 #   endif
 
     c = block ? getch_with_delay () : get_key_code(1);
-    
+
 #   ifndef HAVE_SLANG
     if (flag)
         touchwin (stdscr);
 #   endif
 #   ifndef HAVE_SLANG
     if (flag)
         touchwin (stdscr);
 #   endif
-    
+
     if (c == MCKEY_MOUSE) { /* Mouse event */
         xmouse_get_event (event);
         return EV_MOUSE;
     if (c == MCKEY_MOUSE) { /* Mouse event */
         xmouse_get_event (event);
         return EV_MOUSE;
@@ -877,7 +877,7 @@ char *learn_key (void)
     int c = xgetch ();
     char buffer [256];
     char *p = buffer;
     int c = xgetch ();
     char buffer [256];
     char *p = buffer;
-    
+
     while (c == ERR)
         c = xgetch (); /* Sanity check, should be unnecessary */
     learn_store_key (buffer, &p, c);
     while (c == ERR)
         c = xgetch (); /* Sanity check, should be unnecessary */
     learn_store_key (buffer, &p, c);
@@ -908,7 +908,7 @@ char *learn_key (void)
         }
         if (c == ERR)
             break;
         }
         if (c == ERR)
             break;
-       learn_store_key (buffer, &p, c);        
+       learn_store_key (buffer, &p, c);
     }
 #ifdef BUGGY_CURSES
     notimeout (stdscr, TRUE);
     }
 #ifdef BUGGY_CURSES
     notimeout (stdscr, TRUE);
@@ -935,7 +935,7 @@ void
 application_keypad_mode (void)
 {
     if (console_flag || xterm_flag) {
 application_keypad_mode (void)
 {
     if (console_flag || xterm_flag) {
-        fprintf (stdout, "\033="); 
+        fprintf (stdout, "\033=");
         fflush (stdout);
     }
 }
         fflush (stdout);
     }
 }
@@ -1014,7 +1014,7 @@ void done_key ()
 
 #else
 
 
 #else
 
-void done_key () 
+void done_key ()
 {
 }
 
 {
 }
 
index 055552c..2525534 100644 (file)
@@ -5,12 +5,12 @@
    Copyright (C) 1998 the Free Software Foundation.
 
    Written by: 1998, Gyorgy Tamasi
    Copyright (C) 1998 the Free Software Foundation.
 
    Written by: 1998, Gyorgy Tamasi
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 /*
  * PURPOSE:
 
 /*
  * PURPOSE:
- * 
+ *
  *   We would like to support the direct ALT-?/META-? and some other 'extra'
  *   keyboard functionality provided by some terminals under some OSes (and
  *   not supported by the 'learn keys...' facility of 'mc'.
  *   (First target platform: QNX.)
  *   We would like to support the direct ALT-?/META-? and some other 'extra'
  *   keyboard functionality provided by some terminals under some OSes (and
  *   not supported by the 'learn keys...' facility of 'mc'.
  *   (First target platform: QNX.)
- * 
+ *
  * REMARK:
  * REMARK:
- * 
+ *
  *   Implementation strategy: we don't want to rely on a specific terminal
  *   information database management API (termcap,terminfo,SLang,...), so we
  *   try to define a superset of the possible key identifiers here.
  *   Implementation strategy: we don't want to rely on a specific terminal
  *   information database management API (termcap,terminfo,SLang,...), so we
  *   try to define a superset of the possible key identifiers here.
 
 /* define the OS/implementation-specific __TK() format */
 #define __TK(_tis,_tcs,_tisx,_qtisn)  __QTISX(_qtisn)
 
 /* define the OS/implementation-specific __TK() format */
 #define __TK(_tis,_tcs,_tisx,_qtisn)  __QTISX(_qtisn)
-    
+
 #endif /* __USE_QNX_TI */
 #endif /* __USE_QNX_TI */
-    
+
 #endif /* __QNX__ */
 
 
 /* {{{ */
 #endif /* __QNX__ */
 
 
 /* {{{ */
-    
+
 /* general key definitions:
 /* general key definitions:
- * 
+ *
  * format:
  * format:
- * 
+ *
  *   terminfo name,
  *   termcap name,
  *   index in the terminfo string table (ncurses),
  *   field name in the QNX terminfo strings struct
  */
  *   terminfo name,
  *   termcap name,
  *   index in the terminfo string table (ncurses),
  *   field name in the QNX terminfo strings struct
  */
-    
+
 #define Key_backspace   __TK("kbs",   "kb",  55, _ky_backspace )
 #define Key_catab       __TK("ktbc",  "ka",  56, _ky_catab )
 #define Key_clear       __TK("kclr",  "kC",  57, _ky_clear )
 #define Key_backspace   __TK("kbs",   "kb",  55, _ky_backspace )
 #define Key_catab       __TK("ktbc",  "ka",  56, _ky_catab )
 #define Key_clear       __TK("kclr",  "kC",  57, _ky_clear )
 
 /* don't force pre-defining of base keys under QNX */
 #define FORCE_BASE_KEY_DEFS 0
 
 /* don't force pre-defining of base keys under QNX */
 #define FORCE_BASE_KEY_DEFS 0
-    
+
 /* OS specific key aliases */
 #define Key_alt_a       Key_clear
 #define Key_alt_b       Key_stab
 /* OS specific key aliases */
 #define Key_alt_a       Key_clear
 #define Key_alt_b       Key_stab
 #define Key_alt_enter   Key_ctl_enter       /* map ALT-ENTER to CTRL-ENTER */
 
 #ifdef __USE_QNX_TI
 #define Key_alt_enter   Key_ctl_enter       /* map ALT-ENTER to CTRL-ENTER */
 
 #ifdef __USE_QNX_TI
-    
+
 /* OS/implementation specific key-define struct */
 typedef struct qnx_key_define_s {
     int mc_code;
 /* OS/implementation specific key-define struct */
 typedef struct qnx_key_define_s {
     int mc_code;
@@ -385,7 +385,7 @@ void load_qnx_key_defines (void)
         if (term_setup_ok != 1)
             return;
 
         if (term_setup_ok != 1)
             return;
 
-        for (idx = 0; 
+        for (idx = 0;
              idx < sizeof(xtra_key_defines) / sizeof(xtra_key_defines[0]);
              idx++) {
             str_idx = xtra_key_defines[idx].str_idx;
              idx < sizeof(xtra_key_defines) / sizeof(xtra_key_defines[0]);
              idx++) {
             str_idx = xtra_key_defines[idx].str_idx;
index 767eb37..b2586d8 100644 (file)
@@ -1,6 +1,6 @@
 /* Panel layout module for the Midnight Commander
    Copyright (C) 1995 the Free Software Foundation
 /* Panel layout module for the Midnight Commander
    Copyright (C) 1995 the Free Software Foundation
-   
+
    Written: 1995 Janne Kukonlehto
             1995 Miguel de Icaza
 
    Written: 1995 Janne Kukonlehto
             1995 Miguel de Icaza
 
@@ -16,7 +16,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -75,7 +75,7 @@
 
 #include "x.h"
 
 
 #include "x.h"
 
-/* "$Id: layout.c,v 1.1 2001/12/30 09:55:24 sedwards Exp $" */
+/* "$Id$" */
 
 /* Controls the display of the rotating dash on the verbose mode */
 int nice_rotating_dash = 1;
 
 /* Controls the display of the rotating dash on the verbose mode */
 int nice_rotating_dash = 1;
@@ -157,7 +157,7 @@ static int height;
 static Dlg_head *layout_dlg;
 
 static char *s_split_direction [2] = {
 static Dlg_head *layout_dlg;
 
 static char *s_split_direction [2] = {
-    N_("&Vertical"), 
+    N_("&Vertical"),
     N_("&Horizontal")
 };
 WRadio *radio_widget;
     N_("&Horizontal")
 };
 WRadio *radio_widget;
@@ -209,7 +209,7 @@ static void update_split (void)
     /* Check split has to be done before testing if it changed, since
        it can change due to calling _check_split() as well*/
     _check_split ();
     /* Check split has to be done before testing if it changed, since
        it can change due to calling _check_split() as well*/
     _check_split ();
-    
+
     /* To avoid setting the cursor to the wrong place */
     if ((old_first_panel_size == _first_panel_size) &&
        (old_horizontal_split == _horizontal_split)){
     /* To avoid setting the cursor to the wrong place */
     if ((old_first_panel_size == _first_panel_size) &&
        (old_horizontal_split == _horizontal_split)){
@@ -217,8 +217,8 @@ static void update_split (void)
     }
 
     old_first_panel_size = _first_panel_size;
     }
 
     old_first_panel_size = _first_panel_size;
-    old_horizontal_split = _horizontal_split; 
-   
+    old_horizontal_split = _horizontal_split;
+
     attrset (COLOR_NORMAL);
     dlg_move (layout_dlg, 6, 6);
     printw ("%03d", _first_panel_size);
     attrset (COLOR_NORMAL);
     dlg_move (layout_dlg, 6, 6);
     printw ("%03d", _first_panel_size);
@@ -371,19 +371,19 @@ static void init_layout (void)
        char* ok_button = _("&Ok");
        char* cancel_button = _("&Cancel");
        char* save_button = _("&Save");
        char* ok_button = _("&Ok");
        char* cancel_button = _("&Cancel");
        char* save_button = _("&Save");
-    
+
     if (!i18n_layt_flag)
     {
                register int l1;
     if (!i18n_layt_flag)
     {
                register int l1;
-               
+
                first_width = 19; /* length of line with '<' '>' buttons */
                first_width = 19; /* length of line with '<' '>' buttons */
-               
+
                layout_title = _(" Layout ");
                title1 = _(" Panel split ");
                title2 = _(" Highlight... ");
                title3 = _(" Other options ");
                output_lines_label = _("output lines");
                layout_title = _(" Layout ");
                title1 = _(" Panel split ");
                title2 = _(" Highlight... ");
                title3 = _(" Other options ");
                output_lines_label = _("output lines");
-               
+
                while (i--)
                {
                    s_split_direction [i] = _(s_split_direction [i]);
                while (i--)
                {
                    s_split_direction [i] = _(s_split_direction [i]);
@@ -403,11 +403,11 @@ static void init_layout (void)
                l1 = strlen (title1) + 1;
                if (l1 > first_width)
                        first_width = l1;
                l1 = strlen (title1) + 1;
                if (l1 > first_width)
                        first_width = l1;
-               
+
                l1 = strlen (title2) + 1;
                if (l1 > first_width)
                        first_width = l1;
                l1 = strlen (title2) + 1;
                if (l1 > first_width)
                        first_width = l1;
-               
+
 
                second_width = strlen (title3) + 1;
                for (i = 0; i < 6; i++)
 
                second_width = strlen (title3) + 1;
                for (i = 0; i < 6; i++)
@@ -424,7 +424,7 @@ static void init_layout (void)
                                second_width = l1;
                }
 
                                second_width = l1;
                }
 
-               /* 
+               /*
                 * alex@bcs.zp.ua:
                 * To be completely correct, one need to check if layout_title
                 * does not exceed dialog length and total length of 3 buttons
                 * alex@bcs.zp.ua:
                 * To be completely correct, one need to check if layout_title
                 * does not exceed dialog length and total length of 3 buttons
@@ -436,7 +436,7 @@ static void init_layout (void)
                l1 = 11 + strlen (ok_button)   /* 14 - all brackets and inner space */
                        + strlen (save_button)     /* notice: it is 3 char less because */
                        + strlen (cancel_button);  /* of '&' char in button text */
                l1 = 11 + strlen (ok_button)   /* 14 - all brackets and inner space */
                        + strlen (save_button)     /* notice: it is 3 char less because */
                        + strlen (cancel_button);  /* of '&' char in button text */
-               
+
                i = (first_width + second_width - l1) / 4;
                b1 = 5 + i;
                b2 = b1 + strlen(ok_button) + i + 6;
                i = (first_width + second_width - l1) / 4;
                b1 = 5 + i;
                b2 = b1 + strlen(ok_button) + i + 6;
@@ -445,14 +445,14 @@ static void init_layout (void)
                i18n_layt_flag = 1;
     }
 
                i18n_layt_flag = 1;
     }
 
-    layout_dlg = create_dlg (0, 0, 15, first_width + second_width + 9, 
+    layout_dlg = create_dlg (0, 0, 15, first_width + second_width + 9,
                dialog_colors, layout_callback,
                "[Layout]", "layout", DLG_CENTER | DLG_GRID);
                dialog_colors, layout_callback,
                "[Layout]", "layout", DLG_CENTER | DLG_GRID);
-                            
+
     x_set_dialog_title (layout_dlg, _("Layout"));
 
     add_widgetl (layout_dlg,
     x_set_dialog_title (layout_dlg, _("Layout"));
 
     add_widgetl (layout_dlg,
-               button_new (BY, b3, B_CANCEL, NORMAL_BUTTON, cancel_button, 0, 0, "c"), 
+               button_new (BY, b3, B_CANCEL, NORMAL_BUTTON, cancel_button, 0, 0, "c"),
                XV_WLAY_RIGHTOF);
     add_widgetl (layout_dlg,
                button_new (BY, b2, B_EXIT, NORMAL_BUTTON, save_button, 0, 0, "s"),
                XV_WLAY_RIGHTOF);
     add_widgetl (layout_dlg,
                button_new (BY, b2, B_EXIT, NORMAL_BUTTON, save_button, 0, 0, "s"),
@@ -466,10 +466,10 @@ static void init_layout (void)
                    button_new (9, 12 + first_width, B_MINUS, NARROW_BUTTON, "&-",
                        bminus_cback, 0, NULL));
        add_widget (layout_dlg,
                    button_new (9, 12 + first_width, B_MINUS, NARROW_BUTTON, "&-",
                        bminus_cback, 0, NULL));
        add_widget (layout_dlg,
-                   button_new (9, 7 + first_width, B_PLUS, NARROW_BUTTON, "&+", 
+                   button_new (9, 7 + first_width, B_PLUS, NARROW_BUTTON, "&+",
                        bplus_cback, 0, NULL));
     }
                        bplus_cback, 0, NULL));
     }
-#endif    
+#endif
 
 #define XTRACT(i) *check_options[i].variable, check_options[i].text, check_options[i].tkname
 
 
 #define XTRACT(i) *check_options[i].variable, check_options[i].text, check_options[i].tkname
 
@@ -484,7 +484,7 @@ static void init_layout (void)
         XV_WLAY_NEXTCOLUMN);
     add_widgetl (layout_dlg, label_new (2, 5, _("Panel split"), "ps"),
         XV_WLAY_NEXTCOLUMN);
         XV_WLAY_NEXTCOLUMN);
     add_widgetl (layout_dlg, label_new (2, 5, _("Panel split"), "ps"),
         XV_WLAY_NEXTCOLUMN);
-#endif        
+#endif
     check_options [8].widget = check_new (10, 6, XTRACT(8));
     add_widgetl (layout_dlg, check_options [8].widget, XV_WLAY_BELOWCLOSE);
     check_options [7].widget = check_new (9, 6, XTRACT(7));
     check_options [8].widget = check_new (10, 6, XTRACT(8));
     add_widgetl (layout_dlg, check_options [8].widget, XV_WLAY_BELOWCLOSE);
     check_options [7].widget = check_new (9, 6, XTRACT(7));
@@ -508,7 +508,7 @@ static void init_layout (void)
     old_first_panel_size = -1;
     old_horizontal_split = -1;
     old_output_lines     = -1;
     old_first_panel_size = -1;
     old_horizontal_split = -1;
     old_output_lines     = -1;
-    
+
     _first_panel_size = first_panel_size;
     _output_lines = output_lines;
 #ifndef HAVE_X
     _first_panel_size = first_panel_size;
     _output_lines = output_lines;
 #ifndef HAVE_X
@@ -524,7 +524,7 @@ void layout_change (void)
     setup_panels ();
     layout_do_change = 0;
 #ifndef HAVE_X
     setup_panels ();
     layout_do_change = 0;
 #ifndef HAVE_X
-    /* re-init the menu, because perhaps there was a change in the way 
+    /* re-init the menu, because perhaps there was a change in the way
        how the panel are split (horizontal/vertical). */
     done_menu();
     init_menu();
        how the panel are split (horizontal/vertical). */
     done_menu();
     init_menu();
@@ -545,12 +545,12 @@ void layout_cmd (void)
        for (i = 0; check_options [i].text; i++)
            if (check_options [i].widget)
                *check_options [i].variable = check_options [i].widget->state & C_BOOL;
        for (i = 0; check_options [i].text; i++)
            if (check_options [i].widget)
                *check_options [i].variable = check_options [i].widget->state & C_BOOL;
-#ifndef HAVE_X         
+#ifndef HAVE_X
        horizontal_split = radio_widget->sel;
        first_panel_size = _first_panel_size;
        output_lines = _output_lines;
        layout_do_change = 1;
        horizontal_split = radio_widget->sel;
        first_panel_size = _first_panel_size;
        output_lines = _output_lines;
        layout_do_change = 1;
-#endif 
+#endif
     }
     if (result == B_EXIT){
        save_layout ();
     }
     if (result == B_EXIT){
        save_layout ();
@@ -615,16 +615,16 @@ void init_curses (void)
     init_colors ();
 }
 #endif /* ! HAVE_SLANG */
     init_colors ();
 }
 #endif /* ! HAVE_SLANG */
-void done_screen ()                                                      
-{                                                                               
-    if (!(quit & SUBSHELL_EXIT))                                                
-       clr_scr ();                                                             
-    reset_shell_mode ();                                                        
-    mc_noraw_mode ();                                                           
-    if (use_mouse_p)                                                            
-       shut_mouse ();                                                          
-    keypad (stdscr, FALSE);                                                     
-}                                                                               
+void done_screen ()
+{
+    if (!(quit & SUBSHELL_EXIT))
+       clr_scr ();
+    reset_shell_mode ();
+    mc_noraw_mode ();
+    if (use_mouse_p)
+       shut_mouse ();
+    keypad (stdscr, FALSE);
+}
 #else
 void init_curses ()
 {
 #else
 void init_curses ()
 {
@@ -655,7 +655,7 @@ setup_panels (void)
     if (panels [0].type == view_listing){
        x_panel_set_size (0);
     }
     if (panels [0].type == view_listing){
        x_panel_set_size (0);
     }
-    
+
     if (panels [1].type == view_listing){
        x_panel_set_size (1);
     }
     if (panels [1].type == view_listing){
        x_panel_set_size (1);
     }
@@ -664,7 +664,7 @@ setup_panels (void)
 #ifdef HAVE_XVIEW
     panel_do_cols (0);
     panel_do_cols (1);
 #ifdef HAVE_XVIEW
     panel_do_cols (0);
     panel_do_cols (1);
-#endif    
+#endif
 }
 
 #else
 }
 
 #else
@@ -696,9 +696,9 @@ void setup_panels (void)
 
     /* The column computing is defered until panel_do_cols */
     if (horizontal_split){
 
     /* The column computing is defered until panel_do_cols */
     if (horizontal_split){
-       widget_set_size (panels [0].widget, start_y, 0, 
+       widget_set_size (panels [0].widget, start_y, 0,
                         first_panel_size, 0);
                         first_panel_size, 0);
-                       
+
        widget_set_size (panels [1].widget, start_y+first_panel_size, 0,
                         height-first_panel_size, 0);
     } else {
        widget_set_size (panels [1].widget, start_y+first_panel_size, 0,
                         height-first_panel_size, 0);
     } else {
@@ -709,11 +709,11 @@ void setup_panels (void)
 
        widget_set_size (panels [1].widget, start_y, first_x,
                         height, 0);
 
        widget_set_size (panels [1].widget, start_y, first_x,
                         height, 0);
-                       
+
     }
     panel_do_cols (0);
     panel_do_cols (1);
     }
     panel_do_cols (0);
     panel_do_cols (1);
-    
+
     promptl = strlen (prompt);
 
     widget_set_size (&the_menubar->widget, 0, 0, 1, COLS);
     promptl = strlen (prompt);
 
     widget_set_size (&the_menubar->widget, 0, 0, 1, COLS);
@@ -730,11 +730,11 @@ void setup_panels (void)
            widget_set_size (&cmdline->input.widget, 0, 0, 0, 0);
            winput_set_origin (&cmdline->input, 0, 0);
            widget_set_size (&the_prompt->widget, LINES, COLS, 0, 0);
            widget_set_size (&cmdline->input.widget, 0, 0, 0, 0);
            winput_set_origin (&cmdline->input, 0, 0);
            widget_set_size (&the_prompt->widget, LINES, COLS, 0, 0);
-    }                       
+    }
 
     widget_set_size (&the_bar->widget, LINES-1, 0, 1, COLS);
     the_bar->visible = keybar_visible;
 
     widget_set_size (&the_bar->widget, LINES-1, 0, 1, COLS);
     the_bar->visible = keybar_visible;
-    
+
     /* Output window */
     if (console_flag && output_lines){
        output_start_y = LINES -command_prompt-keybar_visible-
     /* Output window */
     if (console_flag && output_lines){
        output_start_y = LINES -command_prompt-keybar_visible-
@@ -742,12 +742,12 @@ void setup_panels (void)
        show_console_contents (output_start_y,
                               LINES-output_lines-keybar_visible-1,
                               LINES-keybar_visible-1);
        show_console_contents (output_start_y,
                               LINES-output_lines-keybar_visible-1,
                               LINES-keybar_visible-1);
-    } 
+    }
     if (message_visible && (!xterm_hintbar || !xterm_flag))
        widget_set_size (&the_hint->widget, height+start_y, 0, 1,COLS);
     else
        widget_set_size (&the_hint->widget, 0, 0, 0, 0);
     if (message_visible && (!xterm_hintbar || !xterm_flag))
        widget_set_size (&the_hint->widget, height+start_y, 0, 1,COLS);
     else
        widget_set_size (&the_hint->widget, 0, 0, 0, 0);
-    
+
     load_hint ();
 }
 #endif
     load_hint ();
 }
 #endif
@@ -791,7 +791,7 @@ void change_screen_size (void)
 #if defined TIOCGWINSZ && !defined SCO_FLAVOR
     extern Dlg_head *view_dlg;
     extern Dlg_head *edit_dlg;
 #if defined TIOCGWINSZ && !defined SCO_FLAVOR
     extern Dlg_head *view_dlg;
     extern Dlg_head *edit_dlg;
-    
+
 #ifndef NCURSES_VERSION
     mc_noraw_mode ();
     endwin ();
 #ifndef NCURSES_VERSION
     mc_noraw_mode ();
     endwin ();
@@ -814,11 +814,11 @@ void change_screen_size (void)
     if (current_dlg == edit_dlg)
        edit_adjust_size (edit_dlg);
 #endif
     if (current_dlg == edit_dlg)
        edit_adjust_size (edit_dlg);
 #endif
-    
+
 #ifdef RESIZABLE_MENUBAR
        menubar_arrange(the_menubar);
 #endif
 #ifdef RESIZABLE_MENUBAR
        menubar_arrange(the_menubar);
 #endif
-               
+
     /* Now, force the redraw */
     do_refresh ();
     touchwin (stdscr);
     /* Now, force the redraw */
     do_refresh ();
     touchwin (stdscr);
@@ -839,7 +839,7 @@ void use_dash (int flag)
        ok_to_refresh--;
 }
 
        ok_to_refresh--;
 }
 
-void set_hintbar(char *str) 
+void set_hintbar(char *str)
 {
 #ifndef HAVE_X
     if (xterm_flag && xterm_hintbar) {
 {
 #ifndef HAVE_X
     if (xterm_flag && xterm_hintbar) {
@@ -863,7 +863,7 @@ void print_vfs_message(char *msg, ...)
     va_end(ap);
     if (midnight_shutdown || !the_hint || !the_hint->widget.parent)
        return;
     va_end(ap);
     if (midnight_shutdown || !the_hint || !the_hint->widget.parent)
        return;
-    
+
     if (message_visible || (xterm_flag && xterm_hintbar)) {
         set_hintbar(str);
     }
     if (message_visible || (xterm_flag && xterm_hintbar)) {
         set_hintbar(str);
     }
@@ -900,16 +900,16 @@ void remove_dash (void)
        send a draw message only to the affected views.  But for now
        this is fine.
     */
        send a draw message only to the affected views.  But for now
        this is fine.
     */
-    
+
     move (0, COLS-1);
     addch (' ');
     move (0, COLS-1);
     addch (' ');
-#endif    
+#endif
 }
 
 char *get_nth_panel_name (int num)
 {
     static char buffer [20];
 }
 
 char *get_nth_panel_name (int num)
 {
     static char buffer [20];
-    
+
     if (!num)
         return "New Left Panel";
     else if (num == 1)
     if (!num)
         return "New Left Panel";
     else if (num == 1)
@@ -955,12 +955,12 @@ void set_display_type (int num, int type)
            return;
 
     }
            return;
 
     }
-    
+
     /* Get rid of it */
     if (panels [num].widget){
        Widget *w = panels [num].widget;
        WPanel *panel = (WPanel *) panels [num].widget;
     /* Get rid of it */
     if (panels [num].widget){
        Widget *w = panels [num].widget;
        WPanel *panel = (WPanel *) panels [num].widget;
-       
+
        x = w->x;
        y = w->y;
        cols  = w->cols;
        x = w->x;
        y = w->y;
        cols  = w->cols;
@@ -980,15 +980,15 @@ void set_display_type (int num, int type)
     }
 
     new_widget = 0;
     }
 
     new_widget = 0;
-    
+
     switch (type){
     case view_listing:
        new_widget = (Widget *) panel_new (get_nth_panel_name (num));
        break;
     switch (type){
     case view_listing:
        new_widget = (Widget *) panel_new (get_nth_panel_name (num));
        break;
-       
+
     case view_info:
        new_widget = (Widget *) info_new ();
     case view_info:
        new_widget = (Widget *) info_new ();
-       
+
        break;
 
     case view_tree:
        break;
 
     case view_tree:
@@ -1003,16 +1003,16 @@ void set_display_type (int num, int type)
                the_other_panel->dir.list[the_other_panel->selected].fname;
        else
            file_name = "";
                the_other_panel->dir.list[the_other_panel->selected].fname;
        else
            file_name = "";
-       
+
        view_init ((WView *) new_widget, 0, file_name, 0);
        break;
     }
     panels [num].type = type;
     panels [num].widget = (Widget *) new_widget;
        view_init ((WView *) new_widget, 0, file_name, 0);
        break;
     }
     panels [num].type = type;
     panels [num].widget = (Widget *) new_widget;
-    
+
     /* We set the same size the old widget had */
     widget_set_size ((Widget *) new_widget, y, x, lines, cols);
     /* We set the same size the old widget had */
     widget_set_size ((Widget *) new_widget, y, x, lines, cols);
-    
+
     /* We wanna the new widget at the same position */
     /* XView sets wcontainer to !0 <- Not XView, but we, when we create it */
     /* Ok, the XView support code does it */
     /* We wanna the new widget at the same position */
     /* XView sets wcontainer to !0 <- Not XView, but we, when we create it */
     /* Ok, the XView support code does it */
@@ -1061,7 +1061,7 @@ void swap_panels ()
     WPanel panel;
     WPanel *panel1, *panel2;
     int tmp_type;
     WPanel panel;
     WPanel *panel1, *panel2;
     int tmp_type;
-    
+
 #if 0
 #ifdef HAVE_PORTABLE_TOKEN_PASTING
 #define panelswap(e) panel.##e = panel1->##e; panel1->##e = panel2->##e; panel2->##e = panel.##e;
 #if 0
 #ifdef HAVE_PORTABLE_TOKEN_PASTING
 #define panelswap(e) panel.##e = panel1->##e; panel1->##e = panel2->##e; panel2->##e = panel.##e;
@@ -1093,7 +1093,7 @@ void swap_panels ()
         panelswap (selected);
         panelswap (is_panelized);
         panelswap (dir_stat);
         panelswap (selected);
         panelswap (is_panelized);
         panelswap (dir_stat);
-       
+
         panel1->searching = 0;
         panel2->searching = 0;
         if (cpanel == panel1)
         panel1->searching = 0;
         panel2->searching = 0;
         if (cpanel == panel1)
@@ -1106,11 +1106,11 @@ void swap_panels ()
             dlg_select_widget (midnight_dlg, (void *) panels [0].widget);
     } else {
        WPanel *tmp_panel;
             dlg_select_widget (midnight_dlg, (void *) panels [0].widget);
     } else {
        WPanel *tmp_panel;
-       
+
        tmp_panel=right_panel;
        right_panel=left_panel;
        left_panel=tmp_panel;
        tmp_panel=right_panel;
        right_panel=left_panel;
        left_panel=tmp_panel;
-       
+
        if (panels [0].type == view_listing) {
             if (!strcmp (panel1->panel_name, get_nth_panel_name (0))) {
                 free (panel1->panel_name);
        if (panels [0].type == view_listing) {
             if (!strcmp (panel1->panel_name, get_nth_panel_name (0))) {
                 free (panel1->panel_name);
@@ -1123,7 +1123,7 @@ void swap_panels ()
                 panel2->panel_name = strdup (get_nth_panel_name (0));
             }
         }
                 panel2->panel_name = strdup (get_nth_panel_name (0));
             }
         }
-        
+
         tmp.x = panels [0].widget->x;
         tmp.y = panels [0].widget->y;
         tmp.cols = panels [0].widget->cols;
         tmp.x = panels [0].widget->x;
         tmp.y = panels [0].widget->y;
         tmp.cols = panels [0].widget->cols;
@@ -1138,7 +1138,7 @@ void swap_panels ()
         panels [1].widget->y = tmp.y;
         panels [1].widget->cols = tmp.cols;
         panels [1].widget->lines = tmp.lines;
         panels [1].widget->y = tmp.y;
         panels [1].widget->cols = tmp.cols;
         panels [1].widget->lines = tmp.lines;
-        
+
         tmp_widget = panels [0].widget;
         panels [0].widget = panels [1].widget;
         panels [1].widget = tmp_widget;
         tmp_widget = panels [0].widget;
         panels [0].widget = panels [1].widget;
         panels [1].widget = tmp_widget;
index 76a7663..cccf3a7 100644 (file)
@@ -1,6 +1,6 @@
 /* Learn keys
    Copyright (C) 1995 The Free Software Foundation
 /* Learn keys
    Copyright (C) 1995 The Free Software Foundation
-   
+
    Written by: 1995 Jakub Jelinek
 
    This program is free software; you can redistribute it and/or modify
    Written by: 1995 Jakub Jelinek
 
    This program is free software; you can redistribute it and/or modify
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -77,9 +77,9 @@ static void learn_refresh (void)
 {
     attrset (COLOR_NORMAL);
     dlg_erase (learn_dlg);
 {
     attrset (COLOR_NORMAL);
     dlg_erase (learn_dlg);
-    
+
     draw_box (learn_dlg, 1, 2, learn_dlg->lines - 2, learn_dlg->cols - 4);
     draw_box (learn_dlg, 1, 2, learn_dlg->lines - 2, learn_dlg->cols - 4);
-    
+
     attrset (COLOR_HOT_NORMAL);
     dlg_move (learn_dlg, 1, (learn_dlg->cols - strlen (learn_title)) / 2);
     addstr (learn_title);
     attrset (COLOR_HOT_NORMAL);
     dlg_move (learn_dlg, 1, (learn_dlg->cols - strlen (learn_title)) / 2);
     addstr (learn_title);
@@ -95,7 +95,7 @@ _("Please press the %s\n"
 "Then, press it again to see if OK appears\n"
 "next to its button.\n\n"
 "If you want to escape, press a single Escape key\n"
 "Then, press it again to see if OK appears\n"
 "next to its button.\n\n"
 "If you want to escape, press a single Escape key\n"
-"and wait as well."), 
+"and wait as well."),
         _(key_name_conv_tab [action - B_USER].longname));
     mc_refresh ();
     if (learnkeys [action - B_USER].sequence != NULL) {
         _(key_name_conv_tab [action - B_USER].longname));
     mc_refresh ();
     if (learnkeys [action - B_USER].sequence != NULL) {
@@ -109,22 +109,22 @@ _("Please press the %s\n"
         * regular characters
         */
        if (*seq && strcmp (seq, "\\e") && strcmp (seq, "\\e\\e")
         * regular characters
         */
        if (*seq && strcmp (seq, "\\e") && strcmp (seq, "\\e\\e")
-           && strcmp (seq, "^m" ) 
+           && strcmp (seq, "^m" )
             && (seq [1] || (*seq < ' ' || *seq > '~'))){
             && (seq [1] || (*seq < ' ' || *seq > '~'))){
-           
+
            learnchanged = 1;
            learnkeys [action - B_USER].sequence = seq;
            seq = convert_controls (seq);
            learnchanged = 1;
            learnkeys [action - B_USER].sequence = seq;
            seq = convert_controls (seq);
-           define_sequence (key_name_conv_tab [action - B_USER].code, seq, 
+           define_sequence (key_name_conv_tab [action - B_USER].code, seq,
                             MCKEY_NOACTION);
        } else {
            message (0, _(" Cannot accept this key "),
                _(" You have entered \"%s\""), seq);
        }
                             MCKEY_NOACTION);
        } else {
            message (0, _(" Cannot accept this key "),
                _(" You have entered \"%s\""), seq);
        }
-       
+
        free (seq);
     }
        free (seq);
     }
-    
+
     dlg_run_done (d);
     destroy_dlg (d);
     dlg_select_widget (learn_dlg, learnkeys [action - B_USER].button);
     dlg_run_done (d);
     destroy_dlg (d);
     dlg_select_widget (learn_dlg, learnkeys [action - B_USER].button);
@@ -134,14 +134,14 @@ _("Please press the %s\n"
 static int learn_move (int right)
 {
     int i, totalcols;
 static int learn_move (int right)
 {
     int i, totalcols;
-    
+
     totalcols = (learn_total - 1) / ROWS + 1;
     for (i = 0; i < learn_total; i++)
         if (learnkeys [i].button == learn_dlg->current->widget) {
             if (right) {
                 if (i < learn_total - ROWS)
                     i += ROWS;
     totalcols = (learn_total - 1) / ROWS + 1;
     for (i = 0; i < learn_total; i++)
         if (learnkeys [i].button == learn_dlg->current->widget) {
             if (right) {
                 if (i < learn_total - ROWS)
                     i += ROWS;
-                else 
+                else
                     i %= ROWS;
             } else {
                 if (i / ROWS)
                     i %= ROWS;
             } else {
                 if (i / ROWS)
@@ -172,7 +172,7 @@ static int learn_check_key (int c)
                if (learnok >= learn_total) {
                    learn_dlg->ret_value = B_CANCEL;
                    if (learnchanged) {
                if (learnok >= learn_total) {
                    learn_dlg->ret_value = B_CANCEL;
                    if (learnchanged) {
-                       if (query_dialog (learn_title, 
+                       if (query_dialog (learn_title,
                            _("It seems that all your keys already\n"
                              "work fine. That's great."),
                            1, 2, _("&Save"), _("&Discard")) == 0)
                            _("It seems that all your keys already\n"
                              "work fine. That's great."),
                            1, 2, _("&Save"), _("&Discard")) == 0)
@@ -201,7 +201,7 @@ static int learn_check_key (int c)
         case 'k':
             dlg_one_up (learn_dlg);
             return 1;
         case 'k':
             dlg_one_up (learn_dlg);
             return 1;
-    }    
+    }
 
     /* Prevent from disappearing if a non-defined sequence is pressed
        and contains s or c. Use ALT('s') or ALT('c'). */
 
     /* Prevent from disappearing if a non-defined sequence is pressed
        and contains s or c. Use ALT('s') or ALT('c'). */
@@ -241,7 +241,7 @@ static void init_learn (void)
        if (!i18n_flag)
        {
                char* cp;
        if (!i18n_flag)
        {
                char* cp;
-               
+
                learn_but [0].text = _(learn_but [0].text);
                learn_but [0].x = 78 / 2 + 4;
 
                learn_but [0].text = _(learn_but [0].text);
                learn_but [0].x = 78 / 2 + 4;
 
@@ -269,7 +269,7 @@ static void init_learn (void)
 
     for (i = 0; i < BUTTONS; i++)
        add_widget (learn_dlg, button_new (XTRACT (i)));
 
     for (i = 0; i < BUTTONS; i++)
        add_widget (learn_dlg, button_new (XTRACT (i)));
-    
+
     x = UX;
     y = UY;
     for (key = key_name_conv_tab, j = 0; key->name != NULL &&
     x = UX;
     y = UY;
     for (key = key_name_conv_tab, j = 0; key->name != NULL &&
@@ -323,10 +323,10 @@ void learn_save (void)
         }
     }
 
         }
     }
 
-    /* On the one hand no good idea to save the complete setup but 
-     * without 'Auto save setup' the new key-definitions will not be 
-     * saved unless the user does an 'Options/Save Setup'. 
-     * On the other hand a save-button that does not save anything to 
+    /* On the one hand no good idea to save the complete setup but
+     * without 'Auto save setup' the new key-definitions will not be
+     * saved unless the user does an 'Options/Save Setup'.
+     * On the other hand a save-button that does not save anything to
      * disk is much worse.
      */
     if (profile_changed)
      * disk is much worse.
      */
     if (profile_changed)
@@ -337,7 +337,7 @@ void learn_keys (void)
 {
     int save_old_esc_mode = old_esc_mode;
     int save_alternate_plus_minus = alternate_plus_minus;
 {
     int save_old_esc_mode = old_esc_mode;
     int save_alternate_plus_minus = alternate_plus_minus;
-    
+
     old_esc_mode = 0; /* old_esc_mode cannot work in learn keys dialog */
     alternate_plus_minus = 1; /* don't translate KP_ADD, KP_SUBTRACT and
                                  KP_MULTIPLY to '+', '-' and '*' in
     old_esc_mode = 0; /* old_esc_mode cannot work in learn keys dialog */
     alternate_plus_minus = 1; /* don't translate KP_ADD, KP_SUBTRACT and
                                  KP_MULTIPLY to '+', '-' and '*' in
@@ -348,7 +348,7 @@ void learn_keys (void)
     init_learn ();
 
     run_dlg (learn_dlg);
     init_learn ();
 
     run_dlg (learn_dlg);
-    
+
     old_esc_mode = save_old_esc_mode;
     alternate_plus_minus = save_alternate_plus_minus;
 
     old_esc_mode = save_old_esc_mode;
     alternate_plus_minus = save_alternate_plus_minus;
 
@@ -357,7 +357,7 @@ void learn_keys (void)
         numeric_keypad_mode ();
 
 #endif
         numeric_keypad_mode ();
 
 #endif
-    
+
     switch (learn_dlg->ret_value) {
     case B_ENTER:
         learn_save ();
     switch (learn_dlg->ret_value) {
     case B_ENTER:
         learn_save ();
index 42b4693..624a87d 100644 (file)
@@ -16,7 +16,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -109,7 +109,7 @@ static void listmode_refresh (void)
 {
     attrset (COLOR_NORMAL);
     dlg_erase (listmode_dlg);
 {
     attrset (COLOR_NORMAL);
     dlg_erase (listmode_dlg);
-    
+
     draw_box (listmode_dlg, 1, 2, 20, 70);
     draw_box (listmode_dlg, UY, UX, 4, 63);
     draw_box (listmode_dlg, UY + 4, UX, 11, 18);
     draw_box (listmode_dlg, 1, 2, 20, 70);
     draw_box (listmode_dlg, UY, UX, 4, 63);
     draw_box (listmode_dlg, UY + 4, UX, 11, 18);
@@ -130,11 +130,11 @@ static int bminus_cback (int action, void *data)
 static int listmode_callback (Dlg_head * h, int Par, int Msg)
 {
     switch (Msg) {
 static int listmode_callback (Dlg_head * h, int Par, int Msg)
 {
     switch (Msg) {
-#ifndef HAVE_X    
+#ifndef HAVE_X
     case DLG_DRAW:
        listmode_refresh ();
        break;
     case DLG_DRAW:
        listmode_refresh ();
        break;
-#endif 
+#endif
 
     case DLG_POST_KEY:
        /* fall */
 
     case DLG_POST_KEY:
        /* fall */
@@ -165,7 +165,7 @@ static void init_listmode (char *oldlistformat)
     listmode_dlg = create_dlg (0, 0, 22, 74, dialog_colors,
                              listmode_callback, listmode_section, "listmode",
                              DLG_CENTER);
     listmode_dlg = create_dlg (0, 0, 22, 74, dialog_colors,
                              listmode_callback, listmode_section, "listmode",
                              DLG_CENTER);
-    x_set_dialog_title (listmode_dlg, "Listing format edit");      
+    x_set_dialog_title (listmode_dlg, "Listing format edit");
 
 #define XTRACT(i) BY+listmode_but[i].y, BX+listmode_but[i].x, listmode_but[i].ret_cmd, listmode_but[i].flags, listmode_but[i].text, 0, 0, NULL
 
 
 #define XTRACT(i) BY+listmode_but[i].y, BX+listmode_but[i].x, listmode_but[i].ret_cmd, listmode_but[i].flags, listmode_but[i].text, 0, 0, NULL
 
index d89ae91..faddf87 100644 (file)
@@ -7,7 +7,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -193,13 +193,13 @@ char *mad_strdup (const char *s, char *file, int line)
 void mad_free (void *ptr, char *file, int line)
 {
     int i;
 void mad_free (void *ptr, char *file, int line)
 {
     int i;
-    
+
     mad_check (file, line);
 
     if (watch_free_pointer && ptr == watch_free_pointer){
        printf ("watch free pointer found\n");
     }
     mad_check (file, line);
 
     if (watch_free_pointer && ptr == watch_free_pointer){
        printf ("watch free pointer found\n");
     }
-    
+
     if (ptr == NULL){
        fprintf (stderr, "MAD: Attempted to free a NULL pointer in file \"%s\" at line %d.\n",
                 file, line);
     if (ptr == NULL){
        fprintf (stderr, "MAD: Attempted to free a NULL pointer in file \"%s\" at line %d.\n",
                 file, line);
@@ -229,7 +229,7 @@ void mad_free (void *ptr, char *file, int line)
 void mad_finalize (char *file, int line)
 {
     int i;
 void mad_finalize (char *file, int line)
 {
     int i;
-    
+
     mad_check (file, line);
 
     /* Following can be commented out if you don't want to see the
     mad_check (file, line);
 
     /* Following can be commented out if you don't want to see the
index 0119e1c..51af4e4 100644 (file)
@@ -2,7 +2,7 @@
 #define __MAD_H
 
 #ifdef HAVE_MAD
 #define __MAD_H
 
 #ifdef HAVE_MAD
-#   define INLINE 
+#   define INLINE
 #else
 #   ifndef INLINE
 #       define INLINE inline
 #else
 #   ifndef INLINE
 #       define INLINE inline
index ec6f87c..4554db0 100644 (file)
@@ -1,15 +1,15 @@
 /* Main program for the Midnight Commander
    Copyright (C) 1994, 1995, 1996, 1997 The Free Software Foundation
 /* Main program for the Midnight Commander
    Copyright (C) 1994, 1995, 1996, 1997 The Free Software Foundation
-   
+
    Written by: 1994, 1995, 1996, 1997 Miguel de Icaza
                1994, 1995 Janne Kukonlehto
               1997 Norbert Warmuth
    Written by: 1994, 1995, 1996, 1997 Miguel de Icaza
                1994, 1995 Janne Kukonlehto
               1997 Norbert Warmuth
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
 #include "popt.h"
 
 
 #include "popt.h"
 
-/* "$Id: main.c,v 1.1 2001/12/30 09:55:24 sedwards Exp $" */
+/* "$Id$" */
 
 /* When the modes are active, left_panel, right_panel and tree_panel */
 /* Point to a proper data structure.  You should check with the functions */
 
 /* When the modes are active, left_panel, right_panel and tree_panel */
 /* Point to a proper data structure.  You should check with the functions */
@@ -221,8 +221,8 @@ int force_ugly_line_drawing = 0;
 /* If true message "The shell is already running a command" never */
 int force_subshell_execution = 0;
 
 /* If true message "The shell is already running a command" never */
 int force_subshell_execution = 0;
 
-/* If true program softkeys (HP terminals only) on startup and after every 
-   command ran in the subshell to the description found in the termcap/terminfo 
+/* If true program softkeys (HP terminals only) on startup and after every
+   command ran in the subshell to the description found in the termcap/terminfo
    database */
 int reset_hp_softkeys = 0;
 
    database */
 int reset_hp_softkeys = 0;
 
@@ -388,10 +388,10 @@ cd_try_to_select (WPanel *panel)
        try_to_select (panel, panel->lwd);
     else
 #ifdef USE_VFS
        try_to_select (panel, panel->lwd);
     else
 #ifdef USE_VFS
-       if ((!strncmp (panel->lwd, "tar:", 4) && 
+       if ((!strncmp (panel->lwd, "tar:", 4) &&
              !strncmp (panel->lwd + 4, panel->cwd, strlen (panel->cwd))) ||
              !strncmp (panel->lwd + 4, panel->cwd, strlen (panel->cwd))) ||
-             ((i = extfs_prefix_to_type (panel->lwd)) != -1 && 
-             !strncmp (panel->lwd + (j = strlen (extfs_get_prefix (i)) + 1), 
+             ((i = extfs_prefix_to_type (panel->lwd)) != -1 &&
+             !strncmp (panel->lwd + (j = strlen (extfs_get_prefix (i)) + 1),
              panel->cwd, strlen (panel->cwd)))) {
         p = strdup (panel->lwd + j + strlen (panel->cwd));
         q = strchr (p, PATH_SEP);
              panel->cwd, strlen (panel->cwd)))) {
         p = strdup (panel->lwd + j + strlen (panel->cwd));
         q = strchr (p, PATH_SEP);
@@ -409,12 +409,12 @@ reload_panelized (WPanel *panel)
 {
     int i, j;
     dir_list *list = &panel->dir;
 {
     int i, j;
     dir_list *list = &panel->dir;
-    
+
     if (panel != cpanel)
        mc_chdir (panel->cwd);
 
     for (i = 0, j = 0; i < panel->count; i++){
     if (panel != cpanel)
        mc_chdir (panel->cwd);
 
     for (i = 0, j = 0; i < panel->count; i++){
-       if (list->list [i].f.marked) { 
+       if (list->list [i].f.marked) {
            /* Unmark the file in advance. In case the following mc_lstat
             * fails we are done, else we have to mark the file again
             * (Note: do_file_mark depends on a valid "list->list [i].buf").
            /* Unmark the file in advance. In case the following mc_lstat
             * fails we are done, else we have to mark the file again
             * (Note: do_file_mark depends on a valid "list->list [i].buf").
@@ -453,14 +453,14 @@ update_one_panel_widget (WPanel *panel, int force_update, char *current_file)
        ftpfs_flushdir ();
        bzero (&(panel->dir_stat), sizeof (panel->dir_stat));
     }
        ftpfs_flushdir ();
        bzero (&(panel->dir_stat), sizeof (panel->dir_stat));
     }
-    
+
     /* If current_file == -1 (an invalid pointer) then preserve selection */
     if (current_file == UP_KEEPSEL){
        free_pointer = 1;
        current_file = strdup (panel->dir.list [panel->selected].fname);
     } else
        free_pointer = 0;
     /* If current_file == -1 (an invalid pointer) then preserve selection */
     if (current_file == UP_KEEPSEL){
        free_pointer = 1;
        current_file = strdup (panel->dir.list [panel->selected].fname);
     } else
        free_pointer = 0;
-    
+
     if (panel->is_panelized)
        reload_panelized (panel);
     else
     if (panel->is_panelized)
        reload_panelized (panel);
     else
@@ -537,23 +537,23 @@ static void select_by_index (WPanel *panel, int i)
 {
     if (i >= panel->count)
        return;
 {
     if (i >= panel->count)
        return;
-    
+
     unselect_item (panel);
     panel->selected = i;
 
     unselect_item (panel);
     panel->selected = i;
 
-#ifndef HAVE_X    
+#ifndef HAVE_X
     while (panel->selected - panel->top_file >= ITEMS (panel)){
        /* Scroll window half screen */
        panel->top_file += ITEMS (panel)/2;
        paint_dir (panel);
        select_item (panel);
     while (panel->selected - panel->top_file >= ITEMS (panel)){
        /* Scroll window half screen */
        panel->top_file += ITEMS (panel)/2;
        paint_dir (panel);
        select_item (panel);
-    } 
+    }
     while (panel->selected < panel->top_file){
        /* Scroll window half screen */
        panel->top_file -= ITEMS (panel)/2;
        if (panel->top_file < 0) panel->top_file = 0;
        paint_dir (panel);
     while (panel->selected < panel->top_file){
        /* Scroll window half screen */
        panel->top_file -= ITEMS (panel)/2;
        if (panel->top_file < 0) panel->top_file = 0;
        paint_dir (panel);
-    } 
+    }
 #endif
     select_item (panel);
 }
 #endif
     select_item (panel);
 }
@@ -568,7 +568,7 @@ static void parse_control_file (void)
     int i;
     FILE *file;
     struct stat s;
     int i;
     FILE *file;
     struct stat s;
-    
+
     if ((file = fopen (control_file, "r")) == NULL){
        return;
     }
     if ((file = fopen (control_file, "r")) == NULL){
        return;
     }
@@ -597,7 +597,7 @@ static void parse_control_file (void)
     }
     data [s.st_size] = 0;
     fclose (file);
     }
     data [s.st_size] = 0;
     fclose (file);
-    
+
     /* The Control file has now been loaded to memory -> start parsing. */
     current = strtok (data, " \t\n");
     while (current && *current){
     /* The Control file has now been loaded to memory -> start parsing. */
     current = strtok (data, " \t\n");
     while (current && *current){
@@ -790,7 +790,7 @@ do_execute (const char *shell, const char *command, int flags)
 #endif
 
     update_panels (UP_OPTIMIZE, UP_KEEPSEL);
 #endif
 
     update_panels (UP_OPTIMIZE, UP_KEEPSEL);
-    
+
     parse_control_file ();
 #ifndef __os2__
     unlink (control_file);
     parse_control_file ();
 #ifndef __os2__
     unlink (control_file);
@@ -936,7 +936,7 @@ directory_history_add (WPanel * panel, char *s)
     }
     panel->dir_history = panel->dir_history->next;
     panel->dir_history->text = strdup (s);
     }
     panel->dir_history = panel->dir_history->next;
     panel->dir_history->text = strdup (s);
-    
+
     panel_update_marks (panel);
 }
 
     panel_update_marks (panel);
 }
 
@@ -946,19 +946,19 @@ _do_panel_cd (WPanel *panel, char *new_dir, enum cd_enum cd_type)
 {
     char *directory, *olddir;
     char temp [MC_MAXPATHLEN];
 {
     char *directory, *olddir;
     char temp [MC_MAXPATHLEN];
-#ifdef USE_VFS    
+#ifdef USE_VFS
     vfs *oldvfs;
     vfsid oldvfsid;
     struct vfs_stamping *parent;
     vfs *oldvfs;
     vfsid oldvfsid;
     struct vfs_stamping *parent;
-#endif    
+#endif
     olddir = strdup (panel->cwd);
 
     /* Convert *new_path to a suitable pathname, handle ~user */
     olddir = strdup (panel->cwd);
 
     /* Convert *new_path to a suitable pathname, handle ~user */
-    
+
     if (cd_type == cd_parse_command){
        while (*new_dir == ' ')
            new_dir++;
     if (cd_type == cd_parse_command){
        while (*new_dir == ' ')
            new_dir++;
-    
+
        if (!strcmp (new_dir, "-")){
            strcpy (temp, panel->lwd);
            new_dir = temp;
        if (!strcmp (new_dir, "-")){
            strcpy (temp, panel->lwd);
            new_dir = temp;
@@ -975,7 +975,7 @@ _do_panel_cd (WPanel *panel, char *new_dir, enum cd_enum cd_type)
     /* Success: save previous directory, shutdown status of previous dir */
     strcpy (panel->lwd, olddir);
     free_completions (input_w (cmdline));
     /* Success: save previous directory, shutdown status of previous dir */
     strcpy (panel->lwd, olddir);
     free_completions (input_w (cmdline));
-    
+
     mc_get_current_wd (panel->cwd, sizeof (panel->cwd) - 2);
 
 #ifdef USE_VFS
     mc_get_current_wd (panel->cwd, sizeof (panel->cwd) - 2);
 
 #ifdef USE_VFS
@@ -1008,7 +1008,7 @@ int
 do_panel_cd (WPanel *panel, char *new_dir, enum cd_enum cd_type)
 {
     int r;
 do_panel_cd (WPanel *panel, char *new_dir, enum cd_enum cd_type)
 {
     int r;
-    
+
     r = _do_panel_cd (panel, new_dir, cd_type);
     if (r)
        directory_history_add (cpanel, cpanel->cwd);
     r = _do_panel_cd (panel, new_dir, cd_type);
     if (r)
        directory_history_add (cpanel, cpanel->cwd);
@@ -1066,7 +1066,7 @@ load_prompt (int fd, void *unused)
 {
     if (!read_subshell_prompt (QUIETLY))
        return 0;
 {
     if (!read_subshell_prompt (QUIETLY))
        return 0;
-    
+
     if (command_prompt){
        int  prompt_len;
 
     if (command_prompt){
        int  prompt_len;
 
@@ -1081,7 +1081,7 @@ load_prompt (int fd, void *unused)
        label_set_text (the_prompt, prompt);
        winput_set_origin ((WInput *)cmdline, prompt_len, COLS-prompt_len);
 
        label_set_text (the_prompt, prompt);
        winput_set_origin ((WInput *)cmdline, prompt_len, COLS-prompt_len);
 
-       /* since the prompt has changed, and we are called from one of the 
+       /* since the prompt has changed, and we are called from one of the
         * get_event channels, the prompt updating does not take place
         * automatically: force a cursor update and a screen refresh
         */
         * get_event channels, the prompt updating does not take place
         * automatically: force a cursor update and a screen refresh
         */
@@ -1129,11 +1129,11 @@ void
 set_sort_to (WPanel *p, sortfn *sort_order)
 {
     p->sort_type = sort_order;
 set_sort_to (WPanel *p, sortfn *sort_order)
 {
     p->sort_type = sort_order;
-    
+
     /* The directory is already sorted, we have to load the unsorted stuff */
     if (sort_order == (sortfn *) unsorted){
        char *current_file;
     /* The directory is already sorted, we have to load the unsorted stuff */
     if (sort_order == (sortfn *) unsorted){
        char *current_file;
-       
+
        current_file = strdup (cpanel->dir.list [cpanel->selected].fname);
        panel_reload (cpanel);
        try_to_select (cpanel, current_file);
        current_file = strdup (cpanel->dir.list [cpanel->selected].fname);
        panel_reload (cpanel);
        try_to_select (cpanel, current_file);
@@ -1162,7 +1162,7 @@ sort_cmd (void)
     /* The directory is already sorted, we have to load the unsorted stuff */
     if (sort_order == (sortfn *) unsorted){
        char *current_file;
     /* The directory is already sorted, we have to load the unsorted stuff */
     if (sort_order == (sortfn *) unsorted){
        char *current_file;
-       
+
        current_file = strdup (cpanel->dir.list [cpanel->selected].fname);
        panel_reload (cpanel);
        try_to_select (cpanel, current_file);
        current_file = strdup (cpanel->dir.list [cpanel->selected].fname);
        panel_reload (cpanel);
        try_to_select (cpanel, current_file);
@@ -1201,15 +1201,15 @@ void done_menu () {};
 /* NOTICE: hotkeys specified here are overriden in menubar_paint_idx (alex) */
 static menu_entry PanelMenu [] = {
     { ' ', N_("&Listing mode..."),          'L', listing_cmd },
 /* NOTICE: hotkeys specified here are overriden in menubar_paint_idx (alex) */
 static menu_entry PanelMenu [] = {
     { ' ', N_("&Listing mode..."),          'L', listing_cmd },
-    { ' ', N_("&Quick view     C-x q"),     'Q', quick_view_cmd }, 
+    { ' ', N_("&Quick view     C-x q"),     'Q', quick_view_cmd },
     { ' ', N_("&Info           C-x i"),     'I', info_cmd },
     { ' ', N_("&Tree"),                     'T', tree_cmd },
     { ' ', N_("&Info           C-x i"),     'I', info_cmd },
     { ' ', N_("&Tree"),                     'T', tree_cmd },
-    { ' ', "", ' ', 0 },                   
+    { ' ', "", ' ', 0 },
     { ' ', N_("&Sort order..."),            'S', sort_cmd },
     { ' ', N_("&Sort order..."),            'S', sort_cmd },
-    { ' ', "", ' ', 0 },                   
+    { ' ', "", ' ', 0 },
     { ' ', N_("&Filter..."),                'F', filter_cmd },
     { ' ', N_("&Filter..."),                'F', filter_cmd },
-#ifdef USE_NETCODE                         
-    { ' ', "", ' ', 0 },                   
+#ifdef USE_NETCODE
+    { ' ', "", ' ', 0 },
     { ' ', N_("&Network link..."),          'N', netlink_cmd },
     { ' ', N_("FT&P link..."),              'P', ftplink_cmd },
 #endif
     { ' ', N_("&Network link..."),          'N', netlink_cmd },
     { ' ', N_("FT&P link..."),              'P', ftplink_cmd },
 #endif
@@ -1222,15 +1222,15 @@ static menu_entry PanelMenu [] = {
 
 static menu_entry RightMenu [] = {
     { ' ', N_("&Listing mode..."),       'L', listing_cmd },
 
 static menu_entry RightMenu [] = {
     { ' ', N_("&Listing mode..."),       'L', listing_cmd },
-    { ' ', N_("&Quick view     C-x q"),  'Q', quick_view_cmd }, 
+    { ' ', N_("&Quick view     C-x q"),  'Q', quick_view_cmd },
     { ' ', N_("&Info           C-x i"),  'I', info_cmd },
     { ' ', N_("&Tree"),                  'T', tree_cmd },
     { ' ', N_("&Info           C-x i"),  'I', info_cmd },
     { ' ', N_("&Tree"),                  'T', tree_cmd },
-    { ' ', "", ' ', 0 },                   
+    { ' ', "", ' ', 0 },
     { ' ', N_("&Sort order..."),         'S', sort_cmd },
     { ' ', N_("&Sort order..."),         'S', sort_cmd },
-    { ' ', "", ' ', 0 },                   
+    { ' ', "", ' ', 0 },
     { ' ', N_("&Filter..."),             'F', filter_cmd },
     { ' ', N_("&Filter..."),             'F', filter_cmd },
-#ifdef USE_NETCODE                         
-    { ' ', "", ' ', 0 },                   
+#ifdef USE_NETCODE
+    { ' ', "", ' ', 0 },
     { ' ', N_("&Network link..."),       'N', netlink_cmd },
     { ' ', N_("FT&P link..."),           'P', ftplink_cmd },
 #endif
     { ' ', N_("&Network link..."),       'N', netlink_cmd },
     { ' ', N_("FT&P link..."),           'P', ftplink_cmd },
 #endif
@@ -1248,13 +1248,13 @@ static menu_entry FileMenu [] = {
     { ' ', N_("&Edit               F4"), 'E', edit_cmd },
     { ' ', N_("&Copy               F5"), 'C', copy_cmd },
     { ' ', N_("c&Hmod           C-x c"), 'H', chmod_cmd },
     { ' ', N_("&Edit               F4"), 'E', edit_cmd },
     { ' ', N_("&Copy               F5"), 'C', copy_cmd },
     { ' ', N_("c&Hmod           C-x c"), 'H', chmod_cmd },
-#ifndef OS2_NT                                
+#ifndef OS2_NT
     { ' ', N_("&Link            C-x l"), 'L', link_cmd },
     { ' ', N_("&SymLink         C-x s"), 'S', symlink_cmd },
     { ' ', N_("edit s&Ymlink  C-x C-s"), 'Y', edit_symlink_cmd },
     { ' ', N_("ch&Own           C-x o"), 'O', chown_cmd },
     { ' ', N_("&Advanced chown       "), 'A', chown_advanced_cmd },
     { ' ', N_("&Link            C-x l"), 'L', link_cmd },
     { ' ', N_("&SymLink         C-x s"), 'S', symlink_cmd },
     { ' ', N_("edit s&Ymlink  C-x C-s"), 'Y', edit_symlink_cmd },
     { ' ', N_("ch&Own           C-x o"), 'O', chown_cmd },
     { ' ', N_("&Advanced chown       "), 'A', chown_advanced_cmd },
-#endif                                        
+#endif
     { ' ', N_("&Rename/Move        F6"), 'R', ren_cmd },
     { ' ', N_("&Mkdir              F7"), 'M', mkdir_cmd },
     { ' ', N_("&Delete             F8"), 'D', delete_cmd },
     { ' ', N_("&Rename/Move        F6"), 'R', ren_cmd },
     { ' ', N_("&Mkdir              F7"), 'M', mkdir_cmd },
     { ' ', N_("&Delete             F8"), 'D', delete_cmd },
@@ -1275,10 +1275,10 @@ static menu_entry CmdMenu [] = {
      */
     { ' ', N_("&Directory tree"),               'D', tree_box },
     { ' ', N_("&Find file            M-?"),     'F', find_cmd },
      */
     { ' ', N_("&Directory tree"),               'D', tree_box },
     { ' ', N_("&Find file            M-?"),     'F', find_cmd },
-#ifndef HAVE_XVIEW    
+#ifndef HAVE_XVIEW
     { ' ', N_("s&Wap panels          C-u"),     'W', swap_cmd },
     { ' ', N_("switch &Panels on/off C-o"),     'P', view_other_cmd },
     { ' ', N_("s&Wap panels          C-u"),     'W', swap_cmd },
     { ' ', N_("switch &Panels on/off C-o"),     'P', view_other_cmd },
-#endif    
+#endif
     { ' ', N_("&Compare directories  C-x d"),   'C', compare_dirs_cmd },
     { ' ', N_("e&Xternal panelize    C-x !"),   'X', external_panelize },
 #ifdef HAVE_DUSUM
     { ' ', N_("&Compare directories  C-x d"),   'C', compare_dirs_cmd },
     { ' ', N_("e&Xternal panelize    C-x !"),   'X', external_panelize },
 #ifdef HAVE_DUSUM
@@ -1313,10 +1313,10 @@ static menu_entry OptMenu [] = {
 #if !defined(HAVE_X) && !defined(OS2_NT)
     { ' ', N_("learn &Keys..."),       'K', learn_keys },
 #endif
 #if !defined(HAVE_X) && !defined(OS2_NT)
     { ' ', N_("learn &Keys..."),       'K', learn_keys },
 #endif
-#ifdef USE_VFS    
+#ifdef USE_VFS
     { ' ', N_("&Virtual FS..."),       'V', configure_vfs },
 #endif
     { ' ', N_("&Virtual FS..."),       'V', configure_vfs },
 #endif
-    { ' ', "", ' ', 0 }, 
+    { ' ', "", ' ', 0 },
     { ' ', N_("&Save setup"),          'S', save_setup_cmd }
 };
 
     { ' ', N_("&Save setup"),          'S', save_setup_cmd }
 };
 
@@ -1332,10 +1332,10 @@ init_menu (void)
 {
     int i;
 
 {
     int i;
 
-#ifdef HAVE_X    
+#ifdef HAVE_X
     MenuBar [0] = create_menu (_(" Left "), PanelMenu, menu_entries (PanelMenu));
 #else
     MenuBar [0] = create_menu (_(" Left "), PanelMenu, menu_entries (PanelMenu));
 #else
-    MenuBar [0] = create_menu ( horizontal_split ? _(" Above ") : _(" Left "), 
+    MenuBar [0] = create_menu ( horizontal_split ? _(" Above ") : _(" Left "),
                                 PanelMenu, menu_entries (PanelMenu));
 #endif
     MenuBar [1] = create_menu (_(" File "), FileMenu, menu_entries (FileMenu));
                                 PanelMenu, menu_entries (PanelMenu));
 #endif
     MenuBar [1] = create_menu (_(" File "), FileMenu, menu_entries (FileMenu));
@@ -1345,7 +1345,7 @@ init_menu (void)
 #ifdef HAVE_X
     MenuBar [4] = create_menu (_(" Right "), RightMenu, menu_entries (PanelMenu));
 #else
 #ifdef HAVE_X
     MenuBar [4] = create_menu (_(" Right "), RightMenu, menu_entries (PanelMenu));
 #else
-    MenuBar [4] = create_menu (horizontal_split ? _(" Below ") : _(" Right "), 
+    MenuBar [4] = create_menu (horizontal_split ? _(" Below ") : _(" Right "),
                               RightMenu, menu_entries (PanelMenu));
     for (i = 0; i < 5; i++)
        MenuBarEmpty [i] = create_menu (MenuBar [i]->name, 0, 0);
                               RightMenu, menu_entries (PanelMenu));
     for (i = 0; i < 5; i++)
        MenuBarEmpty [i] = create_menu (MenuBar [i]->name, 0, 0);
@@ -1371,7 +1371,7 @@ done_menu (void)
     }
 }
 #endif
     }
 }
 #endif
-    
+
 static void
 menu_last_selected_cmd (void)
 {
 static void
 menu_last_selected_cmd (void)
 {
@@ -1386,7 +1386,7 @@ menu_cmd (void)
 {
     if (the_menubar->active)
        return;
 {
     if (the_menubar->active)
        return;
-    
+
     if (get_current_index () == 0)
        the_menubar->selected = 0;
     else
     if (get_current_index () == 0)
        the_menubar->selected = 0;
     else
@@ -1462,7 +1462,7 @@ create_panels (void)
     char original_dir [1024];
 
     original_dir [0] = 0;
     char original_dir [1024];
 
     original_dir [0] = 0;
-    
+
     if (boot_current_is_left){
        current_index = 0;
        other_index = 1;
     if (boot_current_is_left){
        current_index = 0;
        other_index = 1;
@@ -1516,7 +1516,7 @@ create_panels (void)
     the_hint->auto_adjust_cols = 0;
     the_hint->widget.cols = COLS;
 #endif
     the_hint->auto_adjust_cols = 0;
     the_hint->widget.cols = COLS;
 #endif
-    
+
 #ifndef HAVE_XVIEW
     the_menubar = menubar_new (0, 0, COLS, MenuBar, 5);
 #else
 #ifndef HAVE_XVIEW
     the_menubar = menubar_new (0, 0, COLS, MenuBar, 5);
 #else
@@ -1557,7 +1557,7 @@ static void copy_readlink (WPanel *panel)
        char buffer [MC_MAXPATHLEN];
        char *p = concat_dir_and_file (panel->cwd, selection (panel)->fname);
        int i;
        char buffer [MC_MAXPATHLEN];
        char *p = concat_dir_and_file (panel->cwd, selection (panel)->fname);
        int i;
-       
+
        i = mc_readlink (p, buffer, MC_MAXPATHLEN);
        free (p);
        if (i > 0) {
        i = mc_readlink (p, buffer, MC_MAXPATHLEN);
        free (p);
        if (i > 0) {
@@ -1594,7 +1594,7 @@ void copy_prog_name (void)
        tmp = name_quote (selection (cpanel)->fname, 1);
     stuff (input_w (cmdline), tmp, 1);
     free (tmp);
        tmp = name_quote (selection (cpanel)->fname, 1);
     stuff (input_w (cmdline), tmp, 1);
     free (tmp);
-}   
+}
 
 static void copy_tagged (WPanel *panel)
 {
 
 static void copy_tagged (WPanel *panel)
 {
@@ -1617,7 +1617,7 @@ static void copy_tagged (WPanel *panel)
     }
     input_enable_update (input_w (cmdline));
 }
     }
     input_enable_update (input_w (cmdline));
 }
-    
+
 static void copy_current_tagged (void)
 {
     copy_tagged (cpanel);
 static void copy_current_tagged (void)
 {
     copy_tagged (cpanel);
@@ -1640,22 +1640,22 @@ static void do_suspend_cmd (void)
 #ifndef OS2_NT
     {
        struct sigaction sigtstp_action;
 #ifndef OS2_NT
     {
        struct sigaction sigtstp_action;
-       
+
        /* Make sure that the SIGTSTP below will suspend us directly,
           without calling ncurses' SIGTSTP handler; we *don't* want
           ncurses to redraw the screen immediately after the SIGCONT */
        sigaction (SIGTSTP, &startup_handler, &sigtstp_action);
        /* Make sure that the SIGTSTP below will suspend us directly,
           without calling ncurses' SIGTSTP handler; we *don't* want
           ncurses to redraw the screen immediately after the SIGCONT */
        sigaction (SIGTSTP, &startup_handler, &sigtstp_action);
-    
+
        kill (getpid (), SIGTSTP);
 
        /* Restore previous SIGTSTP action */
        sigaction (SIGTSTP, &sigtstp_action, NULL);
     }
 #endif
        kill (getpid (), SIGTSTP);
 
        /* Restore previous SIGTSTP action */
        sigaction (SIGTSTP, &sigtstp_action, NULL);
     }
 #endif
-    
+
     if (console_flag && !use_subshell)
        handle_console (CONSOLE_SAVE);
     if (console_flag && !use_subshell)
        handle_console (CONSOLE_SAVE);
-    
+
     edition_post_exec ();
 }
 
     edition_post_exec ();
 }
 
@@ -1734,7 +1734,7 @@ static key_map default_map [] = {
     { ALT('\r'),  copy_prog_name },
     { ALT('a'),   copy_current_pathname },
     { ALT('A'),   copy_other_pathname },
     { ALT('\r'),  copy_prog_name },
     { ALT('a'),   copy_current_pathname },
     { ALT('A'),   copy_other_pathname },
-    
+
     { ALT('c'),          quick_cd_cmd },
 
     /* To access the directory hotlist */
     { ALT('c'),          quick_cd_cmd },
 
     /* To access the directory hotlist */
@@ -1745,15 +1745,15 @@ static key_map default_map [] = {
 #endif
     /* The filtered view command */
     { ALT('!'),   filtered_view_cmd_cpanel },
 #endif
     /* The filtered view command */
     { ALT('!'),   filtered_view_cmd_cpanel },
-    
+
     /* Find file */
     { ALT('?'),          find_cmd },
     /* Find file */
     { ALT('?'),          find_cmd },
-       
+
     /* Panel refresh */
     { XCTRL('r'), reread_cmd },
 
     { ALT('t'),   toggle_listing_cmd },
     /* Panel refresh */
     { XCTRL('r'), reread_cmd },
 
     { ALT('t'),   toggle_listing_cmd },
-    
+
 #ifndef HAVE_X
     /* Swap panels */
     { XCTRL('u'), swap_cmd },
 #ifndef HAVE_X
     /* Swap panels */
     { XCTRL('u'), swap_cmd },
@@ -1761,7 +1761,7 @@ static key_map default_map [] = {
     /* View output */
     { XCTRL('o'), view_other_cmd },
 #endif
     /* View output */
     { XCTRL('o'), view_other_cmd },
 #endif
-    
+
     /* Control-X keybindings */
     { XCTRL('x'), ctl_x_cmd },
 
     /* Control-X keybindings */
     { XCTRL('x'), ctl_x_cmd },
 
@@ -1778,7 +1778,7 @@ static void setup_sigwinch ()
 {
 #ifndef OS2_NT
     struct sigaction act, oact;
 {
 #ifndef OS2_NT
     struct sigaction act, oact;
-    
+
 #   if defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4
 #       ifdef SIGWINCH
             act.sa_handler = flag_winch;
 #   if defined(HAVE_SLANG) || NCURSES_VERSION_MAJOR >= 4
 #       ifdef SIGWINCH
             act.sa_handler = flag_winch;
@@ -1812,7 +1812,7 @@ static void
 setup_post ()
 {
     setup_sigwinch ();
 setup_post ()
 {
     setup_sigwinch ();
-    
+
     init_uid_gid_cache ();
 
 #ifndef HAVE_X
     init_uid_gid_cache ();
 
 #ifndef HAVE_X
@@ -1839,12 +1839,12 @@ static void setup_mc (void)
     return;
 #endif
     setup_panels ();
     return;
 #endif
     setup_panels ();
-    
+
 #ifdef HAVE_SUBSHELL_SUPPORT
     if (use_subshell)
        add_select_channel (subshell_pty, load_prompt, 0);
 #endif
 #ifdef HAVE_SUBSHELL_SUPPORT
     if (use_subshell)
        add_select_channel (subshell_pty, load_prompt, 0);
 #endif
-    
+
     setup_post ();
 }
 
     setup_post ();
 }
 
@@ -1868,7 +1868,7 @@ static void setup_dummy_mc (const char *file)
 static void done_mc ()
 {
     done_menu ();
 static void done_mc ()
 {
     done_menu ();
-    
+
     /* Setup shutdown
      *
      * We sync the profiles since the hotlist may have changed, while
     /* Setup shutdown
      *
      * We sync the profiles since the hotlist may have changed, while
@@ -1904,7 +1904,7 @@ void make_panels_dirty ()
 {
     if (cpanel->dirty)
        panel_update_contents (cpanel);
 {
     if (cpanel->dirty)
        panel_update_contents (cpanel);
-    
+
     if ((get_other_type () == view_listing) && opanel->dirty)
        panel_update_contents (opanel);
 }
     if ((get_other_type () == view_listing) && opanel->dirty)
        panel_update_contents (opanel);
 }
@@ -1919,7 +1919,7 @@ void make_panels_dirty ()
 int midnight_callback (struct Dlg_head *h, int id, int msg)
 {
     int i;
 int midnight_callback (struct Dlg_head *h, int id, int msg)
 {
     int i;
-    
+
     switch (msg){
 #ifndef HAVE_XVIEW
 
     switch (msg){
 #ifndef HAVE_XVIEW
 
@@ -1927,7 +1927,7 @@ int midnight_callback (struct Dlg_head *h, int id, int msg)
     case DLG_PRE_EVENT:
        make_panels_dirty ();
        return MSG_HANDLED;
     case DLG_PRE_EVENT:
        make_panels_dirty ();
        return MSG_HANDLED;
-       
+
     case DLG_KEY:
        if (ctl_x_map_enabled){
                ctl_x_map_enabled = 0;
     case DLG_KEY:
        if (ctl_x_map_enabled){
                ctl_x_map_enabled = 0;
@@ -1937,7 +1937,7 @@ int midnight_callback (struct Dlg_head *h, int id, int msg)
                                return MSG_HANDLED;
                        }
        }
                                return MSG_HANDLED;
                        }
        }
-           
+
        if (id == KEY_F(10) && !the_menubar->active){
            quit_cmd ();
            return MSG_HANDLED;
        if (id == KEY_F(10) && !the_menubar->active){
            quit_cmd ();
            return MSG_HANDLED;
@@ -1976,37 +1976,37 @@ int midnight_callback (struct Dlg_head *h, int id, int msg)
                    return MSG_HANDLED;
                }
            } else if (command_prompt && !strlen (input_w (cmdline)->buffer)) {
                    return MSG_HANDLED;
                }
            } else if (command_prompt && !strlen (input_w (cmdline)->buffer)) {
-               /* Special treatement '+', '-', '\', '*' only when this is 
+               /* Special treatement '+', '-', '\', '*' only when this is
                 * first char on input line
                 */
                 * first char on input line
                 */
-               
+
                if (id == '+') {
                    select_cmd ();
                    return MSG_HANDLED;
                }
                if (id == '+') {
                    select_cmd ();
                    return MSG_HANDLED;
                }
-               
+
                if (check_key_backslash (id) || id == '-') {
                    unselect_cmd ();
                    return MSG_HANDLED;
                }
                if (check_key_backslash (id) || id == '-') {
                    unselect_cmd ();
                    return MSG_HANDLED;
                }
-               
+
                if (id == '*') {
                    reverse_selection_cmd ();
                    return MSG_HANDLED;
                }
                if (id == '*') {
                    reverse_selection_cmd ();
                    return MSG_HANDLED;
                }
-           }   
-       } 
+           }
+       }
        break;
 
     case DLG_HOTKEY_HANDLED:
        if (get_current_type () == view_listing)
            cpanel->searching = 0;
        break;
        break;
 
     case DLG_HOTKEY_HANDLED:
        if (get_current_type () == view_listing)
            cpanel->searching = 0;
        break;
-       
+
     case DLG_UNHANDLED_KEY:
        if (command_prompt){
            int v;
     case DLG_UNHANDLED_KEY:
        if (command_prompt){
            int v;
-           
+
            v = send_message_to (h, (Widget *) cmdline, WIDGET_KEY, id);
            if (v)
                return v;
            v = send_message_to (h, (Widget *) cmdline, WIDGET_KEY, id);
            if (v)
                return v;
@@ -2027,7 +2027,7 @@ int midnight_callback (struct Dlg_head *h, int id, int msg)
                }
        }
        return MSG_NOT_HANDLED;
                }
        }
        return MSG_NOT_HANDLED;
-       
+
 #endif
 #ifndef HAVE_X
        /* We handle the special case of the output lines */
 #endif
 #ifndef HAVE_X
        /* We handle the special case of the output lines */
@@ -2039,7 +2039,7 @@ int midnight_callback (struct Dlg_head *h, int id, int msg)
                                   LINES-keybar_visible-1);
        break;
 #endif
                                   LINES-keybar_visible-1);
        break;
 #endif
-       
+
     }
     return default_dlg_callback (h, id, msg);
 }
     }
     return default_dlg_callback (h, id, msg);
 }
@@ -2088,7 +2088,7 @@ void load_hint ()
 
     if (!the_hint->widget.parent)
        return;
 
     if (!the_hint->widget.parent)
        return;
-       
+
     if (!message_visible && (!xterm_flag || !xterm_hintbar)){
         label_set_text (the_hint, 0);
        return;
     if (!message_visible && (!xterm_flag || !xterm_hintbar)){
         label_set_text (the_hint, 0);
        return;
@@ -2133,7 +2133,7 @@ setup_panels_and_run_mc ()
     add_widget (midnight_dlg, get_panel_widget (first));
     add_widget (midnight_dlg, get_panel_widget (second));
     add_widget (midnight_dlg, the_menubar);
     add_widget (midnight_dlg, get_panel_widget (first));
     add_widget (midnight_dlg, get_panel_widget (second));
     add_widget (midnight_dlg, the_menubar);
-    
+
     init_labels (get_panel_widget (0));
     init_labels (get_panel_widget (1));
 
     init_labels (get_panel_widget (0));
     init_labels (get_panel_widget (1));
 
@@ -2171,7 +2171,7 @@ mc_maybe_editor_or_viewer (void)
 
     if (!(view_one_file || edit_one_file))
            return 0;
 
     if (!(view_one_file || edit_one_file))
            return 0;
-    
+
     /* Invoke the internal view/edit routine with:
      * the default processing and forcing the internal viewer/editor
      */
     /* Invoke the internal view/edit routine with:
      * the default processing and forcing the internal viewer/editor
      */
@@ -2206,13 +2206,13 @@ do_nc (void)
     if (mc_maybe_editor_or_viewer ())
            return;
 #endif
     if (mc_maybe_editor_or_viewer ())
            return;
 #endif
-    
+
     setup_mc ();
 
 #ifndef HAVE_GNOME
     setup_panels_and_run_mc ();
 #endif
     setup_mc ();
 
 #ifndef HAVE_GNOME
     setup_panels_and_run_mc ();
 #endif
-    
+
     /* Program end */
     midnight_shutdown = 1;
 
     /* Program end */
     midnight_shutdown = 1;
 
@@ -2224,7 +2224,7 @@ do_nc (void)
            last_wd_string = strdup (cpanel->cwd);
     }
     done_mc ();
            last_wd_string = strdup (cpanel->cwd);
     }
     done_mc ();
-    
+
 #ifndef HAVE_GNOME
     destroy_dlg (midnight_dlg);
     current_panel = 0;
 #ifndef HAVE_GNOME
     destroy_dlg (midnight_dlg);
     current_panel = 0;
@@ -2240,7 +2240,7 @@ version (int verbose)
     fprintf (stderr, "The Midnight Commander %s\n", VERSION);
     if (!verbose)
        return;
     fprintf (stderr, "The Midnight Commander %s\n", VERSION);
     if (!verbose)
        return;
-    
+
 #ifndef HAVE_X
     fprintf (stderr,
            _("with mouse support on xterm%s.\n"),
 #ifndef HAVE_X
     fprintf (stderr,
            _("with mouse support on xterm%s.\n"),
@@ -2261,11 +2261,11 @@ void
 OS_Setup ()
 {
     SetConsoleTitle ("GNU Midnight Commander");
 OS_Setup ()
 {
     SetConsoleTitle ("GNU Midnight Commander");
-    
+
     shell = getenv ("COMSPEC");
     if (!shell || !*shell)
        shell = get_default_shell ();
     shell = getenv ("COMSPEC");
     if (!shell || !*shell)
        shell = get_default_shell ();
-    
+
     /* Default opening mode for files is binary, not text (CR/LF translation) */
 #ifndef __EMX__
     _fmode = O_BINARY;
     /* Default opening mode for files is binary, not text (CR/LF translation) */
 #ifndef __EMX__
     _fmode = O_BINARY;
@@ -2336,7 +2336,7 @@ OS_Setup ()
 {
     char   *termvalue;
     char   *mc_libdir;
 {
     char   *termvalue;
     char   *mc_libdir;
-       
+
     termvalue = getenv ("TERM");
     if (!termvalue){
        fprintf (stderr, _("The TERM environment variable is unset!\n"));
     termvalue = getenv ("TERM");
     if (!termvalue){
        fprintf (stderr, _("The TERM environment variable is unset!\n"));
@@ -2359,7 +2359,7 @@ OS_Setup ()
 
     sprintf (control_file, CONTROL_FILE, getpid ());
     my_putenv ("MC_CONTROL_FILE", control_file);
 
     sprintf (control_file, CONTROL_FILE, getpid ());
     my_putenv ("MC_CONTROL_FILE", control_file);
-    
+
     /* This is the directory, where MC was installed, on Unix this is LIBDIR */
     /* and can be overriden by the MCHOME environment variable */
     if ((mc_libdir = getenv ("MCHOME")) != NULL) {
     /* This is the directory, where MC was installed, on Unix this is LIBDIR */
     /* and can be overriden by the MCHOME environment variable */
     if ((mc_libdir = getenv ("MCHOME")) != NULL) {
@@ -2377,7 +2377,7 @@ sigchld_handler_no_subshell (int sig)
 
     if (!console_flag)
        return;
 
     if (!console_flag)
        return;
-    
+
     /* COMMENT: if it were true that after the call to handle_console(..INIT)
        the value of console_flag never changed, we could simply not install
        this handler at all if (!console_flag && !use_subshell). */
     /* COMMENT: if it were true that after the call to handle_console(..INIT)
        the value of console_flag never changed, we could simply not install
        this handler at all if (!console_flag && !use_subshell). */
@@ -2387,7 +2387,7 @@ sigchld_handler_no_subshell (int sig)
 
 #ifndef SCO_FLAVOR
     pid = waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG);
 
 #ifndef SCO_FLAVOR
     pid = waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG);
-    
+
     if (pid == cons_saver_pid){
        /* {{{ Someone has stopped or killed cons.saver; restart it */
 
     if (pid == cons_saver_pid){
        /* {{{ Someone has stopped or killed cons.saver; restart it */
 
@@ -2452,13 +2452,13 @@ init_sigfatals (void)
     sa.sa_hanlder = mc_fatal_signal;
     sa.sa_mask    = 0;
     sa.sa_flags   = 0;
     sa.sa_hanlder = mc_fatal_signal;
     sa.sa_mask    = 0;
     sa.sa_flags   = 0;
-    
+
     sigaction (SIGSEGV, &sa, NULL);
     sigaction (SIGBUS,  &sa, NULL);
     sigaction (SIGFPE,  &sa, NULL);
 }
 #else
     sigaction (SIGSEGV, &sa, NULL);
     sigaction (SIGBUS,  &sa, NULL);
     sigaction (SIGFPE,  &sa, NULL);
 }
 #else
-#define init_sigfatals() 
+#define init_sigfatals()
 #endif
 
 void
 #endif
 
 void
@@ -2481,7 +2481,7 @@ init_sigchld (void)
 #endif
 
     sigaction (SIGCHLD, &sigchld_action, NULL);
 #endif
 
     sigaction (SIGCHLD, &sigchld_action, NULL);
-}      
+}
 
 #endif /* _OS_NT, __os2__, UNIX */
 
 
 #endif /* _OS_NT, __os2__, UNIX */
 
@@ -2496,7 +2496,7 @@ print_mc_usage (void)
     version (0);
     fprintf (stderr,
        "Usage is:\n\n"
     version (0);
     fprintf (stderr,
        "Usage is:\n\n"
-        "mc [flags] [this_dir] [other_panel_dir]\n\n"  
+        "mc [flags] [this_dir] [other_panel_dir]\n\n"
 #if defined(HAVE_SLANG) && !defined(OS2_NT)
     "-a, --stickchars   Force use of +, -, | for line drawing.\n"
 #endif
 #if defined(HAVE_SLANG) && !defined(OS2_NT)
     "-a, --stickchars   Force use of +, -, | for line drawing.\n"
 #endif
@@ -2525,7 +2525,7 @@ print_mc_usage (void)
 #if defined(HAVE_SLANG) && defined(OS2_NT)
     "-S, --createcmdile Create command file to set default directory upon exit.\n"
 #endif
 #if defined(HAVE_SLANG) && defined(OS2_NT)
     "-S, --createcmdile Create command file to set default directory upon exit.\n"
 #endif
-                
+
 #ifdef HAVE_SUBSHELL_SUPPORT
     "-u, --nosubshell   Disable the concurrent subshell mode.\n"
     "-U, --subshell     Force the concurrent subshell mode.\n"
 #ifdef HAVE_SUBSHELL_SUPPORT
     "-u, --nosubshell   Disable the concurrent subshell mode.\n"
     "-U, --subshell     Force the concurrent subshell mode.\n"
@@ -2587,53 +2587,53 @@ process_args (int c, char *option_arg)
        version (1);
        finish_program = 1;
        break;
        version (1);
        finish_program = 1;
        break;
-               
+
     case 'c':
        disable_colors = 0;
 #ifdef HAVE_SLANG
        force_colors = 1;
 #endif
        break;
     case 'c':
        disable_colors = 0;
 #ifdef HAVE_SLANG
        force_colors = 1;
 #endif
        break;
-               
+
     case 'f':
        fprintf (stderr, _("Library directory for the Midnight Commander: %s\n"), mc_home);
        finish_program = 1;
        break;
     case 'f':
        fprintf (stderr, _("Library directory for the Midnight Commander: %s\n"), mc_home);
        finish_program = 1;
        break;
-               
+
     case 'm':
        fprintf (stderr, _("Option -m is obsolete. Please look at Display Bits... in the Option's menu\n"));
        finish_program = 1;
        break;
     case 'm':
        fprintf (stderr, _("Option -m is obsolete. Please look at Display Bits... in the Option's menu\n"));
        finish_program = 1;
        break;
-               
+
 #ifdef USE_NETCODE
     case 'l':
        ftpfs_set_debug (option_arg);
        break;
 #endif
 #ifdef USE_NETCODE
     case 'l':
        ftpfs_set_debug (option_arg);
        break;
 #endif
-               
+
 #ifdef OS2_NT
     case 'S':
        print_last_wd = 2;
        batch_file_name = option_arg;
        break;
 #endif
 #ifdef OS2_NT
     case 'S':
        print_last_wd = 2;
        batch_file_name = option_arg;
        break;
 #endif
-               
+
     case 'd':
        use_mouse_p = NO_MOUSE;
        break;
     case 'd':
        use_mouse_p = NO_MOUSE;
        break;
-               
+
     case 'X':
 #ifdef HAVE_SUBSHELL_SUPPORT
        debug_subshell = 1;
 #endif
        break;
     case 'X':
 #ifdef HAVE_SUBSHELL_SUPPORT
        debug_subshell = 1;
 #endif
        break;
-               
+
     case 'U':
 #ifdef HAVE_SUBSHELL_SUPPORT
        use_subshell = 1;
 #endif
        break;
     case 'U':
 #ifdef HAVE_SUBSHELL_SUPPORT
        use_subshell = 1;
 #endif
        break;
-               
+
     case 'u':
 #ifdef HAVE_SUBSHELL_SUPPORT
        use_subshell = 0;
     case 'u':
 #ifdef HAVE_SUBSHELL_SUPPORT
        use_subshell = 0;
@@ -2645,12 +2645,12 @@ process_args (int c, char *option_arg)
        force_subshell_execution = 1;
 #endif
        break;
        force_subshell_execution = 1;
 #endif
        break;
-           
+
     case 'H':
        print_color_usage ();
        finish_program = 1;
        break;
     case 'H':
        print_color_usage ();
        finish_program = 1;
        break;
-           
+
     case 'h':
 #ifndef PORT_WANTS_ARGP
        print_mc_usage ();
     case 'h':
 #ifndef PORT_WANTS_ARGP
        print_mc_usage ();
@@ -2666,7 +2666,7 @@ static struct argp_option argp_options [] = {
 #endif
 #if defined(HAVE_SLANG) && defined(OS2_NT)
     { "createcmdfile", 'S', "CMDFILE", , 0, N_("Create command file to set default directory upon exit."), 1 },
 #endif
 #if defined(HAVE_SLANG) && defined(OS2_NT)
     { "createcmdfile", 'S', "CMDFILE", , 0, N_("Create command file to set default directory upon exit."), 1 },
-#endif                      
+#endif
     { "color",          'c', NULL, 0, N_("Force color mode."), 0 },
     { "colors",        'C', "COLORS", 0, N_("Specify colors (use --help-colors to get a list)."), 1 },
 #ifdef HAVE_SUBSHELL_SUPPORT
     { "color",          'c', NULL, 0, N_("Force color mode."), 0 },
     { "colors",        'C', "COLORS", 0, N_("Specify colors (use --help-colors to get a list)."), 1 },
 #ifdef HAVE_SUBSHELL_SUPPORT
@@ -2722,11 +2722,11 @@ parse_an_arg (int key, char *arg, struct argp_state *state)
        case 'b':
            disable_colors = 1;
            return 0;
        case 'b':
            disable_colors = 1;
            return 0;
-           
+
        case 'P':
            print_last_wd = 1;
            return 0;
        case 'P':
            print_last_wd = 1;
            return 0;
-           
+
        case 'k':
            reset_hp_softkeys = 1;
            return 0;
        case 'k':
            reset_hp_softkeys = 1;
            return 0;
@@ -2742,7 +2742,7 @@ parse_an_arg (int key, char *arg, struct argp_state *state)
        case 'x':
            force_xterm = 1;
            return 0;
        case 'x':
            force_xterm = 1;
            return 0;
-           
+
 #if defined(HAVE_SLANG) && !defined(OS2_NT)
        case 't':
            SLtt_Try_Termcap = 1;
 #if defined(HAVE_SLANG) && !defined(OS2_NT)
        case 't':
            SLtt_Try_Termcap = 1;
@@ -2755,14 +2755,14 @@ parse_an_arg (int key, char *arg, struct argp_state *state)
 
        case NOWIN_KEY:
            nowindows = 1;
 
        case NOWIN_KEY:
            nowindows = 1;
-           
+
        case ARGP_KEY_ARG:
            break;
 
        case ARGP_KEY_INIT:
        case ARGP_KEY_FINI:
            return 0;
        case ARGP_KEY_ARG:
            break;
 
        case ARGP_KEY_INIT:
        case ARGP_KEY_FINI:
            return 0;
-           
+
        default:
            process_args (key, arg);
        }
        default:
            process_args (key, arg);
        }
@@ -2772,7 +2772,7 @@ parse_an_arg (int key, char *arg, struct argp_state *state)
                edit_one_file = strdup (arg);
            else if (view_one_file)
                view_one_file = strdup (arg);
                edit_one_file = strdup (arg);
            else if (view_one_file)
                view_one_file = strdup (arg);
-           else 
+           else
                directory_list = g_list_append (directory_list, arg);
        }
        return 0;
                directory_list = g_list_append (directory_list, arg);
        }
        return 0;
@@ -2782,7 +2782,7 @@ static struct argp mc_argp_parser = {
        argp_options, parse_an_arg, N_("[this dir] [other dir]"), NULL, NULL, NULL, NULL
 };
 
        argp_options, parse_an_arg, N_("[this dir] [other dir]"), NULL, NULL, NULL, NULL
 };
 
-#else 
+#else
 
 static struct poptOption argumentTable[] = {
 #ifdef WITH_BACKGROUND
 
 static struct poptOption argumentTable[] = {
 #ifdef WITH_BACKGROUND
@@ -2851,8 +2851,8 @@ handle_args (int argc, char *argv [])
 
     if (c < -1){
        print_mc_usage ();
 
     if (c < -1){
        print_mc_usage ();
-       fprintf(stderr, "%s: %s\n", 
-               poptBadOption(optCon, POPT_BADOPTION_NOALIAS), 
+       fprintf(stderr, "%s: %s\n",
+               poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
                poptStrerror(c));
        finish_program = 1;
     }
                poptStrerror(c));
        finish_program = 1;
     }
@@ -2905,7 +2905,7 @@ do_mc_filename_rename (char *mc_dir, char *o_name, char *n_name)
        char *full_o_name = concat_dir_and_file (home_dir, o_name);
        char *full_n_name = copy_strings (home_dir, MC_BASE, n_name, NULL);
        int move;
        char *full_o_name = concat_dir_and_file (home_dir, o_name);
        char *full_n_name = copy_strings (home_dir, MC_BASE, n_name, NULL);
        int move;
-       
+
        move = 0 == rename (full_o_name, full_n_name);
        free (full_o_name);
        free (full_n_name);
        move = 0 == rename (full_o_name, full_n_name);
        free (full_o_name);
        free (full_n_name);
@@ -2917,12 +2917,12 @@ do_compatibility_move (char *mc_dir)
 {
        struct stat s;
        int move;
 {
        struct stat s;
        int move;
-       
+
        if (stat (mc_dir, &s) == 0)
                return;
        if (errno != ENOENT)
                return;
        if (stat (mc_dir, &s) == 0)
                return;
        if (errno != ENOENT)
                return;
-       
+
        if (mkdir (mc_dir, 0777) == -1)
                return;
 
        if (mkdir (mc_dir, 0777) == -1)
                return;
 
@@ -2945,7 +2945,7 @@ void
 compatibility_move_mc_files (void)
 {
        char *mc_dir = concat_dir_and_file (home_dir, ".mc");
 compatibility_move_mc_files (void)
 {
        char *mc_dir = concat_dir_and_file (home_dir, ".mc");
-       
+
        do_compatibility_move (mc_dir);
        free (mc_dir);
 }
        do_compatibility_move (mc_dir);
        free (mc_dir);
 }
@@ -2970,7 +2970,7 @@ int main (int argc, char *argv [])
 
     /* Initialize list of all user group for timur_clr_mode */
     init_groups ();
 
     /* Initialize list of all user group for timur_clr_mode */
     init_groups ();
-    
+
     OS_Setup ();
 
     vfs_init ();
     OS_Setup ();
 
     vfs_init ();
@@ -2986,7 +2986,7 @@ int main (int argc, char *argv [])
        if (base){
            if (strcmp (base, "mcedit") == 0)
                edit_one_file = "";
        if (base){
            if (strcmp (base, "mcedit") == 0)
                edit_one_file = "";
-           
+
            if (strcmp (base, "mcview") == 0)
                view_one_file = "";
        }
            if (strcmp (base, "mcview") == 0)
                view_one_file = "";
        }
@@ -2994,12 +2994,12 @@ int main (int argc, char *argv [])
     gnome_init ("gmc", &mc_argp_parser, argc, argv, 0, NULL);
     probably_finish_program ();
 #endif
     gnome_init ("gmc", &mc_argp_parser, argc, argv, 0, NULL);
     probably_finish_program ();
 #endif
-    
+
     if (xtoolkit_init (&argc, argv) == -1)
        exit (1);
 #endif /* HAVE_X */
 
     if (xtoolkit_init (&argc, argv) == -1)
        exit (1);
 #endif /* HAVE_X */
 
-    
+
 #ifdef HAVE_SLANG
     SLtt_Ignore_Beep = 1;
 #endif
 #ifdef HAVE_SLANG
     SLtt_Ignore_Beep = 1;
 #endif
@@ -3011,17 +3011,17 @@ int main (int argc, char *argv [])
 #ifndef PORT_WANTS_ARGP
     handle_args (argc, argv);
 #endif
 #ifndef PORT_WANTS_ARGP
     handle_args (argc, argv);
 #endif
-    
+
     /* Used to report the last working directory at program end */
     if (print_last_wd){
     /* Used to report the last working directory at program end */
     if (print_last_wd){
-#ifndef OS2_NT 
+#ifndef OS2_NT
        stdout_fd = dup (1);
        close (1);
        if (open (ttyname (0), O_RDWR) < 0)
            if (open ("/dev/tty", O_RDWR) < 0) {
            /* Try if stderr is not redirected as the last chance */
                char *p = strdup (ttyname (0));
        stdout_fd = dup (1);
        close (1);
        if (open (ttyname (0), O_RDWR) < 0)
            if (open ("/dev/tty", O_RDWR) < 0) {
            /* Try if stderr is not redirected as the last chance */
                char *p = strdup (ttyname (0));
-               
+
                if (!strcmp (p, ttyname (2)))
                    dup2 (2, 1);
                else {
                if (!strcmp (p, ttyname (2)))
                    dup2 (2, 1);
                else {
@@ -3045,15 +3045,15 @@ int main (int argc, char *argv [])
     /* Must be done before installing the SIGCHLD handler [[FIXME]] */
     handle_console (CONSOLE_INIT);
 #   endif
     /* Must be done before installing the SIGCHLD handler [[FIXME]] */
     handle_console (CONSOLE_INIT);
 #   endif
-    
+
 #   ifdef HAVE_SUBSHELL_SUPPORT
     subshell_get_console_attributes ();
 #   endif
 #   ifdef HAVE_SUBSHELL_SUPPORT
     subshell_get_console_attributes ();
 #   endif
-    
+
     /* Install the SIGCHLD handler; must be done before init_subshell() */
     init_sigchld ();
     init_sigfatals ();
     /* Install the SIGCHLD handler; must be done before init_subshell() */
     init_sigchld ();
     init_sigfatals ();
-    
+
     /* This variable is used by the subshell */
     home_dir = getenv ("HOME");
     if (!home_dir) {
     /* This variable is used by the subshell */
     home_dir = getenv ("HOME");
     if (!home_dir) {
@@ -3065,7 +3065,7 @@ int main (int argc, char *argv [])
     }
 
     compatibility_move_mc_files ();
     }
 
     compatibility_move_mc_files ();
-    
+
 #   ifdef HAVE_X
     /* We need this, since ncurses endwin () doesn't restore the signals */
     save_stop_handler ();
 #   ifdef HAVE_X
     /* We need this, since ncurses endwin () doesn't restore the signals */
     save_stop_handler ();
@@ -3075,7 +3075,7 @@ int main (int argc, char *argv [])
     /* FIXME: Should be removed and LINES and COLS computed on subshell */
     slang_init ();
     /* NOTE: This call has to be after slang_init. It's the small part from
     /* FIXME: Should be removed and LINES and COLS computed on subshell */
     slang_init ();
     /* NOTE: This call has to be after slang_init. It's the small part from
-    the previous init_key which had to be moved after the call of slang_init */ 
+    the previous init_key which had to be moved after the call of slang_init */
     init_key_input_fd ();
 
     load_setup ();
     init_key_input_fd ();
 
     load_setup ();
@@ -3089,13 +3089,13 @@ int main (int argc, char *argv [])
 #ifdef HAVE_GNOME
     use_subshell = 0;
 #endif
 #ifdef HAVE_GNOME
     use_subshell = 0;
 #endif
-    
+
 #   ifdef HAVE_SUBSHELL_SUPPORT
        /* Done here to ensure that the subshell doesn't  */
        /* inherit the file descriptors opened below, etc */
 
        if (use_subshell)
 #   ifdef HAVE_SUBSHELL_SUPPORT
        /* Done here to ensure that the subshell doesn't  */
        /* inherit the file descriptors opened below, etc */
 
        if (use_subshell)
-           init_subshell ();  
+           init_subshell ();
 #   endif
 
 #   ifndef HAVE_X
 #   endif
 
 #   ifndef HAVE_X
@@ -3105,7 +3105,7 @@ int main (int argc, char *argv [])
     /* Also done after init_subshell, to save any shell init file messages */
     if (console_flag)
        handle_console (CONSOLE_SAVE);
     /* Also done after init_subshell, to save any shell init file messages */
     if (console_flag)
        handle_console (CONSOLE_SAVE);
-    
+
     if (alternate_plus_minus)
         application_keypad_mode ();
 #   endif
     if (alternate_plus_minus)
         application_keypad_mode ();
 #   endif
@@ -3119,7 +3119,7 @@ int main (int argc, char *argv [])
                   " are now stored in the ~/.mc directory, the \n"
                   " files have been moved now\n"));
     }
                   " are now stored in the ~/.mc directory, the \n"
                   " files have been moved now\n"));
     }
-    
+
 #   ifdef HAVE_SUBSHELL_SUPPORT
        if (use_subshell){
            prompt = strip_ctrl_codes (subshell_prompt);
 #   ifdef HAVE_SUBSHELL_SUPPORT
        if (use_subshell){
            prompt = strip_ctrl_codes (subshell_prompt);
@@ -3131,7 +3131,7 @@ int main (int argc, char *argv [])
 
     /* Program main loop */
     do_nc ();
 
     /* Program main loop */
     do_nc ();
-    
+
     /* Virtual File System shutdown */
     vfs_shut ();
 
     /* Virtual File System shutdown */
     vfs_shut ();
 
@@ -3157,7 +3157,7 @@ int main (int argc, char *argv [])
 #ifndef OS2_NT
     signal (SIGCHLD, SIG_DFL);  /* Disable the SIGCHLD handler */
 #endif
 #ifndef OS2_NT
     signal (SIGCHLD, SIG_DFL);  /* Disable the SIGCHLD handler */
 #endif
-    
+
 #   ifndef HAVE_X
     if (console_flag)
        handle_console (CONSOLE_DONE);
 #   ifndef HAVE_X
     if (console_flag)
        handle_console (CONSOLE_DONE);
index d216c29..6a37234 100644 (file)
@@ -1,11 +1,11 @@
 /* Man page to help file converter
    Copyright (C) 1994, 1995 Janne Kukonlehto
 /* Man page to help file converter
    Copyright (C) 1994, 1995 Janne Kukonlehto
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -66,7 +66,7 @@ int string_len (char *buffer)
     for (i = 0; i < strlen (buffer); i ++)
     {
        c = buffer [i];
     for (i = 0; i < strlen (buffer); i ++)
     {
        c = buffer [i];
-       if (c == CHAR_LINK_POINTER) 
+       if (c == CHAR_LINK_POINTER)
            link_flag = 1;      /* Link target name starts */
        else if (c == CHAR_LINK_END)
            link_flag = 0;      /* Link target name ends */
            link_flag = 1;      /* Link target name starts */
        else if (c == CHAR_LINK_END)
            link_flag = 0;      /* Link target name ends */
@@ -118,7 +118,7 @@ void print_string (char *buffer)
        buffer = strtok (buffer, " \t\n");
        /* Repeat for each word */
        while (buffer){
        buffer = strtok (buffer, " \t\n");
        /* Repeat for each word */
        while (buffer){
-           /* Skip empty strings */  
+           /* Skip empty strings */
            if (strlen (buffer) > 0){
                len = string_len (buffer);
                /* Change the line if about to break the right margin */
            if (strlen (buffer) > 0){
                len = string_len (buffer);
                /* Change the line if about to break the right margin */
@@ -326,8 +326,8 @@ void handle_command (char *buffer)
                printf_string ("<%c>%s</%c>", type, buffer, type);
                newline ();
            } else /* HLP format */
                printf_string ("<%c>%s</%c>", type, buffer, type);
                newline ();
            } else /* HLP format */
-               printf_string ("%c%s%c", 
-                   (type == 'I') ? CHAR_ITALIC_ON : CHAR_BOLD_ON, 
+               printf_string ("%c%s%c",
+                   (type == 'I') ? CHAR_ITALIC_ON : CHAR_BOLD_ON,
                    buffer, CHAR_BOLD_OFF);
        }
     }
                    buffer, CHAR_BOLD_OFF);
        }
     }
index a1ba18f..a2ca069 100644 (file)
@@ -12,7 +12,7 @@
 #define index strchr
 #   endif
 
 #define index strchr
 #   endif
 
-#   ifndef rindex 
+#   ifndef rindex
 #       define rindex strrchr
 #   endif
 
 #       define rindex strrchr
 #   endif
 
index d94ff9e..67bf3fc 100644 (file)
@@ -1,11 +1,11 @@
 /* Pulldown menu code.
    Copyright (C) 1994 Miguel de Icaza.
 /* Pulldown menu code.
    Copyright (C) 1994 Miguel de Icaza.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -33,7 +33,7 @@
 #include "win.h"
 #include "key.h"       /* For mi_getch() */
 
 #include "win.h"
 #include "key.h"       /* For mi_getch() */
 
-/* "$Id: menu.c,v 1.1 2001/12/30 09:55:23 sedwards Exp $" */
+/* "$Id$" */
 
 extern int is_right;
 int menubar_visible = 1;       /* This is the new default */
 
 extern int is_right;
 int menubar_visible = 1;       /* This is the new default */
@@ -143,7 +143,7 @@ static void menubar_draw (WMenu *menubar)
 {
     const int items = menubar->items;
     int   i;
 {
     const int items = menubar->items;
     int   i;
-    
+
     /* First draw the complete menubar */
     attrset (SELECTED_COLOR);
     widget_move (&menubar->widget, 0, 0);
     /* First draw the complete menubar */
     attrset (SELECTED_COLOR);
     widget_move (&menubar->widget, 0, 0);
@@ -163,8 +163,8 @@ static void menubar_draw (WMenu *menubar)
 
     if (menubar->dropped)
        menubar_draw_drop (menubar);
 
     if (menubar->dropped)
        menubar_draw_drop (menubar);
-    else 
-       widget_move (&menubar->widget, 0, 
+    else
+       widget_move (&menubar->widget, 0,
                menubar-> menu[menubar->selected]->start_x);
 }
 
                menubar-> menu[menubar->selected]->start_x);
 }
 
@@ -219,7 +219,7 @@ static void menubar_drop (WMenu *menubar, int selected)
 static void menubar_execute (WMenu *menubar, int entry)
 {
     const Menu menu = menubar->menu [menubar->selected];
 static void menubar_execute (WMenu *menubar, int entry)
 {
     const Menu menu = menubar->menu [menubar->selected];
-    
+
     is_right = menubar->selected != 0;
     (*menu->entries [entry].call_back)(0);
     menubar_finish (menubar);
     is_right = menubar->selected != 0;
     (*menu->entries [entry].call_back)(0);
     menubar_finish (menubar);
@@ -234,7 +234,7 @@ static void menubar_move (WMenu *menubar, int step)
        menubar->subsel += step;
        if (menubar->subsel < 0)
            menubar->subsel = menu->count - 1;
        menubar->subsel += step;
        if (menubar->subsel < 0)
            menubar->subsel = menu->count - 1;
-       
+
        menubar->subsel %= menu->count;
     } while  (!menu->entries [menubar->subsel].call_back);
     menubar_paint_idx (menubar, menubar->subsel, MENU_SELECTED_COLOR);
        menubar->subsel %= menu->count;
     } while  (!menu->entries [menubar->subsel].call_back);
     menubar_paint_idx (menubar, menubar->subsel, MENU_SELECTED_COLOR);
@@ -247,7 +247,7 @@ static int menubar_handle_key (WMenu *menubar, int key)
     /* Lowercase */
     if (key < 256 && isalpha (key)) /* Linux libc.so.5.x.x bug fix */
        key = tolower (key);
     /* Lowercase */
     if (key < 256 && isalpha (key)) /* Linux libc.so.5.x.x bug fix */
        key = tolower (key);
-    
+
     if (is_abort_char (key)){
        menubar_finish (menubar);
        return 1;
     if (is_abort_char (key)){
        menubar_finish (menubar);
        return 1;
@@ -275,7 +275,7 @@ static int menubar_handle_key (WMenu *menubar, int key)
            /* Hack, we should check for the upper case letter */
            if (tolower (menu->name [1]) == key){
                menubar_drop (menubar, i);
            /* Hack, we should check for the upper case letter */
            if (tolower (menu->name [1]) == key){
                menubar_drop (menubar, i);
-               return 1; 
+               return 1;
            }
        }
        if (key == KEY_ENTER || key == XCTRL ('n') || key == KEY_DOWN
            }
        }
        if (key == KEY_ENTER || key == XCTRL ('n') || key == KEY_DOWN
@@ -288,14 +288,14 @@ static int menubar_handle_key (WMenu *menubar, int key)
        const int selected = menubar->selected;
        const Menu menu = menubar->menu [selected];
        const int items = menu->count;
        const int selected = menubar->selected;
        const Menu menu = menubar->menu [selected];
        const int items = menu->count;
-       
+
        for (i = 0; i < items; i++){
            if (!menu->entries [i].call_back)
                continue;
        for (i = 0; i < items; i++){
            if (!menu->entries [i].call_back)
                continue;
-           
+
                if (key != menu->entries [i].hot_key)
                        continue;
                if (key != menu->entries [i].hot_key)
                        continue;
-           
+
            menubar_execute (menubar, i);
            return 1;
        }
            menubar_execute (menubar, i);
            return 1;
        }
@@ -304,11 +304,11 @@ static int menubar_handle_key (WMenu *menubar, int key)
            menubar_execute (menubar, menubar->subsel);
            return 1;
        }
            menubar_execute (menubar, menubar->subsel);
            return 1;
        }
-       
-       
+
+
        if (key == KEY_DOWN || key == XCTRL ('n'))
            menubar_move (menubar, 1);
        if (key == KEY_DOWN || key == XCTRL ('n'))
            menubar_move (menubar, 1);
-       
+
        if (key == KEY_UP || key == XCTRL ('p'))
            menubar_move (menubar, -1);
     }
        if (key == KEY_UP || key == XCTRL ('p'))
            menubar_move (menubar, -1);
     }
@@ -347,7 +347,7 @@ static int menubar_callback (Dlg_head *h, WMenu *menubar, int msg, int par)
     case WIDGET_CURSOR:
        /* Put the cursor in a suitable place */
        return 0;
     case WIDGET_CURSOR:
        /* Put the cursor in a suitable place */
        return 0;
-       
+
     case WIDGET_UNFOCUS:
        if (menubar->active)
            return 0;
     case WIDGET_UNFOCUS:
        if (menubar->active)
            return 0;
@@ -372,7 +372,7 @@ menubar_event    (Gpm_Event *event, WMenu *menubar)
 
     if (!(event->type & (GPM_UP|GPM_DOWN|GPM_DRAG)))
        return MOU_NORMAL;
 
     if (!(event->type & (GPM_UP|GPM_DOWN|GPM_DRAG)))
        return MOU_NORMAL;
-    
+
     if (!menubar->dropped){
        menubar->previous_selection = dlg_item_number(menubar->widget.parent);
        menubar->active = 1;
     if (!menubar->dropped){
        menubar->previous_selection = dlg_item_number(menubar->widget.parent);
        menubar->active = 1;
@@ -385,16 +385,16 @@ menubar_event    (Gpm_Event *event, WMenu *menubar)
     if (event->y == 1 || !was_active){
        if (event->type & GPM_UP)
            return MOU_NORMAL;
     if (event->y == 1 || !was_active){
        if (event->type & GPM_UP)
            return MOU_NORMAL;
-    
+
        new_selection = 0;
        new_selection = 0;
-       while (new_selection < menubar->items 
+       while (new_selection < menubar->items
                && event->x > menubar->menu[new_selection]->start_x
        )
                new_selection++;
 
        if (new_selection) /* Don't set the invalid value -1 */
                --new_selection;
                && event->x > menubar->menu[new_selection]->start_x
        )
                new_selection++;
 
        if (new_selection) /* Don't set the invalid value -1 */
                --new_selection;
-       
+
        if (!was_active){
            menubar->selected = new_selection;
            dlg_select_widget (menubar->widget.parent, menubar);
        if (!was_active){
            menubar->selected = new_selection;
            dlg_select_widget (menubar->widget.parent, menubar);
@@ -402,7 +402,7 @@ menubar_event    (Gpm_Event *event, WMenu *menubar)
            menubar_draw (menubar);
            return MOU_NORMAL;
        }
            menubar_draw (menubar);
            return MOU_NORMAL;
        }
-       
+
        menubar_remove (menubar);
 
        menubar->selected = new_selection;
        menubar_remove (menubar);
 
        menubar->selected = new_selection;
@@ -414,11 +414,11 @@ menubar_event    (Gpm_Event *event, WMenu *menubar)
 
     if (!menubar->dropped)
        return MOU_NORMAL;
 
     if (!menubar->dropped)
        return MOU_NORMAL;
-    
+
     /* Ignore the events on anything below the third line */
     if (event->y <= 2)
        return MOU_NORMAL;
     /* Ignore the events on anything below the third line */
     if (event->y <= 2)
        return MOU_NORMAL;
-    
+
     /* Else, the mouse operation is on the menus or it is not */
        left_x = menubar->menu[menubar->selected]->start_x;
        right_x = left_x + menubar->max_entry_len + 4;
     /* Else, the mouse operation is on the menus or it is not */
        left_x = menubar->menu[menubar->selected]->start_x;
        right_x = left_x + menubar->max_entry_len + 4;
@@ -435,7 +435,7 @@ menubar_event    (Gpm_Event *event, WMenu *menubar)
 
        if (!menubar->menu [menubar->selected]->entries [pos].call_back)
            return MOU_NORMAL;
 
        if (!menubar->menu [menubar->selected]->entries [pos].call_back)
            return MOU_NORMAL;
-       
+
        menubar_paint_idx (menubar, menubar->subsel, MENU_ENTRY_COLOR);
        menubar->subsel = pos;
        menubar_paint_idx (menubar, menubar->subsel, MENU_SELECTED_COLOR);
        menubar_paint_idx (menubar, menubar->subsel, MENU_ENTRY_COLOR);
        menubar->subsel = pos;
        menubar_paint_idx (menubar, menubar->subsel, MENU_SELECTED_COLOR);
@@ -445,7 +445,7 @@ menubar_event    (Gpm_Event *event, WMenu *menubar)
     } else
        if (event->type & GPM_DOWN)
            menubar_finish (menubar);
     } else
        if (event->type & GPM_DOWN)
            menubar_finish (menubar);
-        
+
     return MOU_NORMAL;
 }
 
     return MOU_NORMAL;
 }
 
@@ -511,7 +511,7 @@ destroy_menu (Menu menu)
 WMenu *menubar_new (int y, int x, int cols, Menu menu [], int items)
 {
     WMenu *menubar = (WMenu *) xmalloc (sizeof (WMenu), "menubar_new");
 WMenu *menubar_new (int y, int x, int cols, Menu menu [], int items)
 {
     WMenu *menubar = (WMenu *) xmalloc (sizeof (WMenu), "menubar_new");
-   
+
     memset(menubar, 0, sizeof(*menubar)); /* FIXME: subsel used w/o being set */
     init_widget (&menubar->widget, y, x, 1, cols,
                  (callback_fn) menubar_callback,
     memset(menubar, 0, sizeof(*menubar)); /* FIXME: subsel used w/o being set */
     init_widget (&menubar->widget, y, x, 1, cols,
                  (callback_fn) menubar_callback,
index 5abd4d4..8be1d29 100644 (file)
@@ -5,7 +5,7 @@
  * include this header, you have to move it to the group of HAVE_X dependant
  * modules in {xv|tk}/Makefile.in !!!
  */
  * include this header, you have to move it to the group of HAVE_X dependant
  * modules in {xv|tk}/Makefile.in !!!
  */
+
 #include "dlg.h"
 #include "widget.h"
 
 #include "dlg.h"
 #include "widget.h"
 
index 5327710..a4753e9 100644 (file)
@@ -21,15 +21,15 @@ omain (void)
     enum states state = header;
     int prev = 0;
     int c;
     enum states state = header;
     int prev = 0;
     int c;
-    
+
     while ((c = getchar ()) != EOF){
        if (c != '\n'){
     while ((c = getchar ()) != EOF){
        if (c != '\n'){
-           switch (state){ 
+           switch (state){
            case header:
                putchar ('_');
                putchar ('\b');
                break;
            case header:
                putchar ('_');
                putchar ('\b');
                break;
-               
+
            case definition:
                putchar (c);
                putchar ('\b');
            case definition:
                putchar (c);
                putchar ('\b');
@@ -47,7 +47,7 @@ omain (void)
 
        if (state == definition && c == '\n')
            state = header;
 
        if (state == definition && c == '\n')
            state = header;
-       
+
        prev = c;
     }
 }
        prev = c;
     }
 }
@@ -58,7 +58,7 @@ main (void)
     int state = newline;
     int space_seen;
     int c;
     int state = newline;
     int space_seen;
     int c;
-    
+
     while ((c = getchar ()) != EOF){
        switch (state){
        case plain:
     while ((c = getchar ()) != EOF){
        switch (state){
        case plain:
@@ -66,7 +66,7 @@ main (void)
                state = newline;
            putchar (c);
            break;
                state = newline;
            putchar (c);
            break;
-           
+
        case newline:
            if (c == 'F')
                state = seen_f;
        case newline:
            if (c == 'F')
                state = seen_f;
@@ -75,7 +75,7 @@ main (void)
                putchar (c);
            }
            break;
                putchar (c);
            }
            break;
-           
+
        case seen_f:
            if (c == 'r')
                state = seen_r;
        case seen_f:
            if (c == 'r')
                state = seen_r;
@@ -91,7 +91,7 @@ main (void)
            else {
                state = plain;
                printf ("Fr%c", c);
            else {
                state = plain;
                printf ("Fr%c", c);
-           } 
+           }
            break;
 
        case seen_o:
            break;
 
        case seen_o:
@@ -112,7 +112,7 @@ main (void)
                printf ("From%c", c);
            }
            break;
                printf ("From%c", c);
            }
            break;
-               
+
        case header_new:
            space_seen = 0;
             if (c == ' ' || c == '\t') {
        case header_new:
            space_seen = 0;
             if (c == ' ' || c == '\t') {
@@ -125,7 +125,7 @@ main (void)
                putchar (c);
                break;
            }
                putchar (c);
                break;
            }
-           
+
        case header:
            if (c == '\n'){
                putchar (c);
        case header:
            if (c == '\n'){
                putchar (c);
index ddb9b64..24edee6 100644 (file)
@@ -1,11 +1,11 @@
 /* Mouse managing
    Copyright (C) 1994 Miguel de Icaza.
 /* Mouse managing
    Copyright (C) 1994 Miguel de Icaza.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -18,7 +18,7 @@
 /* Events received by clients of this library have their coordinates 0 */
 /* based */
 
 /* Events received by clients of this library have their coordinates 0 */
 /* based */
 
-/* "$Id: mouse.c,v 1.1 2001/12/30 09:55:23 sedwards Exp $" */
+/* "$Id$" */
 
 #include <config.h>
 #include <sys/types.h>
 
 #include <config.h>
 #include <sys/types.h>
@@ -149,7 +149,7 @@ int mouse_handler (Gpm_Event *gpm_event)
     int x = last_x = gpm_event->x;
     int y = last_y = gpm_event->y;
     int redo = 0;
     int x = last_x = gpm_event->x;
     int y = last_y = gpm_event->y;
     int redo = 0;
-    
+
 /*    DEBUGM ((log, "Mouse [%d, %d]\n", x, y)); */
 
     /* Call any registered event handlers */
 /*    DEBUGM ((log, "Mouse [%d, %d]\n", x, y)); */
 
     /* Call any registered event handlers */
@@ -231,14 +231,14 @@ void init_mouse (void)
 
                fflush (stdout);
                /* turn on */
 
                fflush (stdout);
                /* turn on */
-               xmouse_flag = 1; 
+               xmouse_flag = 1;
                define_sequence (MCKEY_MOUSE, ESC_STR "[M", MCKEY_NOACTION);
            }
            break;
        default:
            /* nothing */
        break;
                define_sequence (MCKEY_MOUSE, ESC_STR "[M", MCKEY_NOACTION);
            }
            break;
        default:
            /* nothing */
        break;
-    } /* switch (use_mouse_p) */ 
+    } /* switch (use_mouse_p) */
 }
 
 void shut_mouse (void)
 }
 
 void shut_mouse (void)
index 2e42c23..acff71e 100644 (file)
@@ -15,7 +15,7 @@
 #define GPM_B_LEFT      4
 #define GPM_B_MIDDLE    2
 #define GPM_B_RIGHT     1
 #define GPM_B_LEFT      4
 #define GPM_B_MIDDLE    2
 #define GPM_B_RIGHT     1
+
 /* Xterm mouse support supports only GPM_DOWN and GPM_UP */
 /* If you use others make sure your code also works without them */
 enum Gpm_Etype {
 /* Xterm mouse support supports only GPM_DOWN and GPM_UP */
 /* If you use others make sure your code also works without them */
 enum Gpm_Etype {
@@ -29,7 +29,7 @@ enum Gpm_Etype {
   GPM_SINGLE=16,            /* at most one in three is set */
   GPM_DOUBLE=32,
   GPM_TRIPLE=64,
   GPM_SINGLE=16,            /* at most one in three is set */
   GPM_DOUBLE=32,
   GPM_TRIPLE=64,
-      
+
   GPM_MFLAG=128,            /* motion during click? */
   GPM_HARD=256             /* if set in the defaultMask, force an already
                               used event to pass over to another handler */
   GPM_MFLAG=128,            /* motion during click? */
   GPM_HARD=256             /* if set in the defaultMask, force an already
                               used event to pass over to another handler */
@@ -73,7 +73,7 @@ int redo_mouse (Gpm_Event *event);
 #ifdef DEBUGMOUSE
 #define DEBUGM(data) fprintf data
 #else
 #ifdef DEBUGMOUSE
 #define DEBUGM(data) fprintf data
 #else
-#define DEBUGM(data) 
+#define DEBUGM(data)
 #endif
 
 #ifdef HAVE_LIBGPM
 #endif
 
 #ifdef HAVE_LIBGPM
index 7ab7bba..c4d1ef7 100644 (file)
@@ -131,10 +131,10 @@ void init_pair (int, char *, char *);
     /* This is fast, but unusefull if ! pc_system - doesn't use
        Alt_Char_Pairs [] :( */
 #else
     /* This is fast, but unusefull if ! pc_system - doesn't use
        Alt_Char_Pairs [] :( */
 #else
-    /* This is slow, but works well :| */ 
-#   define one_vline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_VLINE) 
-#   define one_hline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_HLINE) 
-#endif    
+    /* This is slow, but works well :| */
+#   define one_vline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_VLINE)
+#   define one_hline() SLsmg_draw_object (SLsmg_get_row(), SLsmg_get_column(), slow_terminal ? ' ' : ACS_HLINE)
+#endif
 
 void enable_interrupt_key ();
 void disable_interrupt_key ();
 
 void enable_interrupt_key ();
 void disable_interrupt_key ();
index beb1116..263ba45 100644 (file)
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -107,7 +107,7 @@ static int configure_callback (struct Dlg_head *h, int Id, int Msg)
 {
     switch (Msg) {
     case DLG_DRAW:
 {
     switch (Msg) {
     case DLG_DRAW:
-#ifndef HAVE_X    
+#ifndef HAVE_X
        attrset (COLOR_NORMAL);
        dlg_erase (h);
        draw_box (h, 1, 2, h->lines - 2, h->cols - 4);
        attrset (COLOR_NORMAL);
        dlg_erase (h);
        draw_box (h, 1, 2, h->lines - 2, h->cols - 4);
@@ -190,7 +190,7 @@ static void init_configure (void)
                l1 = 11 + strlen (ok_button)
                        + strlen (save_button)
                        + strlen (cancel_button);
                l1 = 11 + strlen (ok_button)
                        + strlen (save_button)
                        + strlen (cancel_button);
-               
+
                i = (first_width + second_width - l1) / 4;
                b1 = 5 + i;
                b2 = b1 + strlen(ok_button) + i + 6;
                i = (first_width + second_width - l1) / 4;
                b1 = 5 + i;
                b2 = b1 + strlen(ok_button) + i + 6;
@@ -212,7 +212,7 @@ static void init_configure (void)
     add_widgetl (conf_dlg,
        button_new (BY, b2, B_EXIT, NORMAL_BUTTON, save_button, 0, 0, "button-save"),
        XV_WLAY_RIGHTOF);
     add_widgetl (conf_dlg,
        button_new (BY, b2, B_EXIT, NORMAL_BUTTON, save_button, 0, 0, "button-save"),
        XV_WLAY_RIGHTOF);
-    
+
     add_widgetl (conf_dlg,
         button_new (BY, b1, B_ENTER, DEFPUSH_BUTTON, ok_button, 0, 0, "button-ok"),
         XV_WLAY_CENTERROW);
     add_widgetl (conf_dlg,
         button_new (BY, b1, B_ENTER, DEFPUSH_BUTTON, ok_button, 0, 0, "button-ok"),
         XV_WLAY_CENTERROW);
@@ -251,7 +251,7 @@ static void init_configure (void)
 void configure_box (void)
 {
     int result, i;
 void configure_box (void)
 {
     int result, i;
-    
+
     init_configure ();
     run_dlg (conf_dlg);
 
     init_configure ();
     run_dlg (conf_dlg);
 
index 923ea19..86f2e50 100644 (file)
@@ -1,4 +1,4 @@
 #ifndef __OPTION_H
 #define __OPTION_H
 void configure_box (void);
 #ifndef __OPTION_H
 #define __OPTION_H
 void configure_box (void);
-#endif 
+#endif
index 643379c..656eb7c 100644 (file)
@@ -65,7 +65,7 @@ typedef struct format_e {
 typedef struct {
     Widget   widget;
     dir_list dir;              /* Directory contents */
 typedef struct {
     Widget   widget;
     dir_list dir;              /* Directory contents */
-    
+
     int      list_type;                /* listing type (was view_type) */
     int      active;           /* If panel is currently selected */
     char     cwd [MC_MAXPATHLEN];/* Current Working Directory */
     int      list_type;                /* listing type (was view_type) */
     int      active;           /* If panel is currently selected */
     char     cwd [MC_MAXPATHLEN];/* Current Working Directory */
@@ -97,7 +97,7 @@ typedef struct {
     format_e *status_format;    /* Mini status format */
 
     int      format_modified;  /* If the format was changed this is set */
     format_e *status_format;    /* Mini status format */
 
     int      format_modified;  /* If the format was changed this is set */
-    
+
     char     *panel_name;      /* The panel name */
     struct   stat dir_stat;    /* Stat of current dir: used by execute () */
 
     char     *panel_name;      /* The panel name */
     struct   stat dir_stat;    /* Stat of current dir: used by execute () */
 
@@ -107,17 +107,17 @@ typedef struct {
     int             total_width;
     int             ascent;
     int             descent;
     int             total_width;
     int             ascent;
     int             descent;
-    
+
     int      searching;
     char     search_buffer [256];
     int      searching;
     char     search_buffer [256];
-   
+
     int      has_dir_sizes;    /* Set if directories have sizes = to du -s */
 
 #ifdef HAVE_GNOME
     /* These are standard GtkWidgets */
     int      has_dir_sizes;    /* Set if directories have sizes = to du -s */
 
 #ifdef HAVE_GNOME
     /* These are standard GtkWidgets */
-       
+
     void *xwindow;             /* The toplevel window */
     void *xwindow;             /* The toplevel window */
-       
+
     void *table;
     void *list;
     void *icons;
     void *table;
     void *list;
     void *icons;
index de5fc1b..dec0a97 100644 (file)
@@ -1,6 +1,6 @@
 /* External panelize
    Copyright (C) 1995 The Free Software Foundation
 /* External panelize
    Copyright (C) 1995 The Free Software Foundation
-   
+
    Written by: 1995 Janne Kukonlehto
                1995 Jakub Jelinek
 
    Written by: 1995 Janne Kukonlehto
                1995 Jakub Jelinek
 
@@ -16,7 +16,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
@@ -107,10 +107,10 @@ panelize_refresh (void)
 {
     attrset (COLOR_NORMAL);
     dlg_erase (panelize_dlg);
 {
     attrset (COLOR_NORMAL);
     dlg_erase (panelize_dlg);
-    
+
     draw_box (panelize_dlg, 1, 2, panelize_dlg->lines-2, panelize_dlg->cols-4);
     draw_box (panelize_dlg, UY, UX, panelize_dlg->lines-10, panelize_dlg->cols-10);
     draw_box (panelize_dlg, 1, 2, panelize_dlg->lines-2, panelize_dlg->cols-4);
     draw_box (panelize_dlg, UY, UX, panelize_dlg->lines-10, panelize_dlg->cols-10);
-    
+
     attrset (COLOR_HOT_NORMAL);
     dlg_move (panelize_dlg, 1, (panelize_dlg->cols - strlen(panelize_title)) / 2);
     addstr (panelize_title);
     attrset (COLOR_HOT_NORMAL);
     dlg_move (panelize_dlg, 1, (panelize_dlg->cols - strlen(panelize_title)) / 2);
     addstr (panelize_title);
@@ -122,7 +122,7 @@ update_command ()
 {
     if (l_panelize->pos != last_listitem) {
        last_listitem = l_panelize->pos;
 {
     if (l_panelize->pos != last_listitem) {
        last_listitem = l_panelize->pos;
-        assign_text (pname, 
+        assign_text (pname,
             ((struct panelize *) l_panelize->current->data)->command);
        pname->point = 0;
         update_input (pname, 1);
             ((struct panelize *) l_panelize->current->data)->command);
        pname->point = 0;
         update_input (pname, 1);
@@ -133,11 +133,11 @@ static int
 panelize_callback (Dlg_head * h, int Par, int Msg)
 {
     switch (Msg) {
 panelize_callback (Dlg_head * h, int Par, int Msg)
 {
     switch (Msg) {
-#ifndef HAVE_X    
+#ifndef HAVE_X
     case DLG_DRAW:
        panelize_refresh ();
        break;
     case DLG_DRAW:
        panelize_refresh ();
        break;
-#endif 
+#endif
 
     case DLG_POST_KEY:
        /* fall */
 
     case DLG_POST_KEY:
        /* fall */
@@ -162,7 +162,7 @@ static void init_panelize (void)
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
        static int maxlen = 0;
 #ifdef ENABLE_NLS
        static int i18n_flag = 0;
        static int maxlen = 0;
-       
+
        if (!i18n_flag)
        {
                i = sizeof(panelize_but) / sizeof(panelize_but[0]);
        if (!i18n_flag)
        {
                i = sizeof(panelize_but) / sizeof(panelize_but[0]);
@@ -177,18 +177,18 @@ static void init_panelize (void)
                i18n_flag = 1;
        }
        panelize_cols = max(panelize_cols, maxlen);
                i18n_flag = 1;
        }
        panelize_cols = max(panelize_cols, maxlen);
-               
-       panelize_but [2].x = panelize_but [3].x 
+
+       panelize_but [2].x = panelize_but [3].x
                + strlen (panelize_but [3].text) + 7;
                + strlen (panelize_but [3].text) + 7;
-       panelize_but [1].x = panelize_but [2].x 
+       panelize_but [1].x = panelize_but [2].x
                + strlen (panelize_but [2].text) + 5;
                + strlen (panelize_but [2].text) + 5;
-       panelize_but [0].x = panelize_cols 
+       panelize_but [0].x = panelize_cols
                - strlen (panelize_but[0].text) - 8 - BX;
 
 #endif /* ENABLE_NLS */
                - strlen (panelize_but[0].text) - 8 - BX;
 
 #endif /* ENABLE_NLS */
-    
+
     last_listitem = 0;
     last_listitem = 0;
-    
+
     do_refresh ();
 
     panelize_dlg = create_dlg (0, 0, 22, panelize_cols, dialog_colors,
     do_refresh ();
 
     panelize_dlg = create_dlg (0, 0, 22, panelize_cols, dialog_colors,
@@ -216,9 +216,9 @@ static void init_panelize (void)
     }
 
     /* add listbox to the dialogs */
     }
 
     /* add listbox to the dialogs */
-    add_widgetl (panelize_dlg, l_panelize, XV_WLAY_EXTENDWIDTH); 
+    add_widgetl (panelize_dlg, l_panelize, XV_WLAY_EXTENDWIDTH);
 
 
-    listbox_select_entry (l_panelize, 
+    listbox_select_entry (l_panelize,
         listbox_search_text (l_panelize, _("Other command")));
 }
 
         listbox_search_text (l_panelize, _("Other command")));
 }
 
@@ -259,8 +259,8 @@ void add2panelize_cmd (void)
     char *label;
 
     if (pname->buffer && (*pname->buffer)) {
     char *label;
 
     if (pname->buffer && (*pname->buffer)) {
-       label = input_dialog (_(" Add to external panelize "), 
-               _(" Enter command label: "), 
+       label = input_dialog (_(" Add to external panelize "),
+               _(" Enter command label: "),
                              "");
        if (!label)
            return;
                              "");
        if (!label)
            return;
@@ -268,7 +268,7 @@ void add2panelize_cmd (void)
            free (label);
            return;
        }
            free (label);
            return;
        }
-       
+
        add2panelize (label, strdup(pname->buffer));
     }
 }
        add2panelize (label, strdup(pname->buffer));
     }
 }
@@ -304,7 +304,7 @@ void external_panelize (void)
     }
 
     init_panelize ();
     }
 
     init_panelize ();
-    
+
     /* display file info */
     attrset (SELECTED_COLOR);
 
     /* display file info */
     attrset (SELECTED_COLOR);
 
@@ -342,9 +342,9 @@ void load_panelize (void)
 {
     void *profile_keys;
     char *key, *value;
 {
     void *profile_keys;
     char *key, *value;
-    
+
     profile_keys = profile_init_iterator (panelize_section, profile_name);
     profile_keys = profile_init_iterator (panelize_section, profile_name);
-    
+
     add2panelize (strdup (_("Other command")), strdup (""));
 
     if (!profile_keys){
     add2panelize (strdup (_("Other command")), strdup (""));
 
     if (!profile_keys){
@@ -353,7 +353,7 @@ void load_panelize (void)
        add2panelize (strdup (_("Find SUID and SGID programs")), strdup ("find . \\( \\( -perm -04000 -a -perm +011 \\) -o \\( -perm -02000 -a -perm +01 \\) \\) -print"));
        return;
     }
        add2panelize (strdup (_("Find SUID and SGID programs")), strdup ("find . \\( \\( -perm -04000 -a -perm +011 \\) -o \\( -perm -02000 -a -perm +01 \\) \\) -print"));
        return;
     }
-    
+
     while (profile_keys){
        profile_keys = profile_iterator_next (profile_keys, &key, &value);
        add2panelize (strdup (key), strdup (value));
     while (profile_keys){
        profile_keys = profile_iterator_next (profile_keys, &key, &value);
        add2panelize (strdup (key), strdup (value));
@@ -363,7 +363,7 @@ void load_panelize (void)
 void save_panelize (void)
 {
     struct panelize *current = panelize;
 void save_panelize (void)
 {
     struct panelize *current = panelize;
-    
+
     profile_clean_section (panelize_section, profile_name);
     for (;current; current = current->next){
        if (strcmp (current->label, _("Other command")))
     profile_clean_section (panelize_section, profile_name);
     for (;current; current = current->next){
        if (strcmp (current->label, _("Other command")))
index edffee1..b025ec3 100644 (file)
@@ -48,7 +48,7 @@ struct poptContext_s {
     int flags;
 };
 
     int flags;
 };
 
-poptContext poptGetContext(char * name ,int argc, char ** argv, 
+poptContext poptGetContext(char * name ,int argc, char ** argv,
                           struct poptOption * options, int flags) {
     poptContext con = malloc(sizeof(*con));
 
                           struct poptOption * options, int flags) {
     poptContext con = malloc(sizeof(*con));
 
@@ -72,7 +72,7 @@ poptContext poptGetContext(char * name ,int argc, char ** argv,
     con->aliases = NULL;
     con->numAliases = 0;
     con->flags = 0;
     con->aliases = NULL;
     con->numAliases = 0;
     con->flags = 0;
-    
+
     if (!name)
        con->appName = NULL;
     else
     if (!name)
        con->appName = NULL;
     else
@@ -105,14 +105,14 @@ int poptGetNextOpt(poptContext con) {
     int i;
 
     while (!done) {
     int i;
 
     while (!done) {
-       while (!con->os->nextCharArg && con->os->next == con->os->argc 
+       while (!con->os->nextCharArg && con->os->next == con->os->argc
                && con->os > con->optionStack)
            con->os--;
        if (!con->os->nextCharArg && con->os->next == con->os->argc)
            return -1;
 
        if (!con->os->nextCharArg) {
                && con->os > con->optionStack)
            con->os--;
        if (!con->os->nextCharArg && con->os->next == con->os->argc)
            return -1;
 
        if (!con->os->nextCharArg) {
-               
+
            origOptString = con->os->argv[con->os->next++];
 
            if (con->restLeftover || *origOptString != '-') {
            origOptString = con->os->argv[con->os->next++];
 
            if (con->restLeftover || *origOptString != '-') {
@@ -124,8 +124,8 @@ int poptGetNextOpt(poptContext con) {
                return POPT_ERROR_BADOPT;
 
            /* Make a copy we can hack at */
                return POPT_ERROR_BADOPT;
 
            /* Make a copy we can hack at */
-           localOptString = optString = 
-                       strcpy(malloc(strlen(origOptString) + 1), 
+           localOptString = optString =
+                       strcpy(malloc(strlen(origOptString) + 1),
                        origOptString);
 
            if (optString[1] == '-' && !optString[2]) {
                        origOptString);
 
            if (optString[1] == '-' && !optString[2]) {
@@ -135,7 +135,7 @@ int poptGetNextOpt(poptContext con) {
            } else if (optString[1] == '-') {
                optString += 2;
 
            } else if (optString[1] == '-') {
                optString += 2;
 
-               if (!con->os->currAlias || !con->os->currAlias->longName || 
+               if (!con->os->currAlias || !con->os->currAlias->longName ||
                    strcmp(con->os->currAlias->longName, optString)) {
 
                    i = con->numAliases - 1;
                    strcmp(con->os->currAlias->longName, optString)) {
 
                    i = con->numAliases - 1;
@@ -144,7 +144,7 @@ int poptGetNextOpt(poptContext con) {
 
                    if (i >= 0) {
                        free(localOptString);
 
                    if (i >= 0) {
                        free(localOptString);
-                       if ((con->os - con->optionStack + 1) 
+                       if ((con->os - con->optionStack + 1)
                                == POPT_OPTION_DEPTH)
                            return POPT_ERROR_OPTSTOODEEP;
 
                                == POPT_OPTION_DEPTH)
                            return POPT_ERROR_OPTSTOODEEP;
 
@@ -176,17 +176,17 @@ int poptGetNextOpt(poptContext con) {
                     free(localOptString);
                     return POPT_ERROR_BADOPT;
                 }
                     free(localOptString);
                     return POPT_ERROR_BADOPT;
                 }
-           } else 
+           } else
                con->os->nextCharArg = origOptString + 1;
            free(localOptString);
        }
                con->os->nextCharArg = origOptString + 1;
            free(localOptString);
        }
-       
+
        if (con->os->nextCharArg) {
            origOptString = con->os->nextCharArg;
 
            con->os->nextCharArg = NULL;
 
        if (con->os->nextCharArg) {
            origOptString = con->os->nextCharArg;
 
            con->os->nextCharArg = NULL;
 
-           if (!con->os->currAlias || *origOptString != 
+           if (!con->os->currAlias || *origOptString !=
                con->os->currAlias->shortName) {
 
                i = con->numAliases - 1;
                con->os->currAlias->shortName) {
 
                i = con->numAliases - 1;
@@ -213,7 +213,7 @@ int poptGetNextOpt(poptContext con) {
            }
 
            opt = con->options;
            }
 
            opt = con->options;
-           while ((opt->longName || opt->shortName) && 
+           while ((opt->longName || opt->shortName) &&
                    *origOptString != opt->shortName) opt++;
            if (!opt->longName && !opt->shortName) return POPT_ERROR_BADOPT;
 
                    *origOptString != opt->shortName) opt++;
            if (!opt->longName && !opt->shortName) return POPT_ERROR_BADOPT;
 
@@ -222,7 +222,7 @@ int poptGetNextOpt(poptContext con) {
                con->os->nextCharArg = origOptString;
        }
 
                con->os->nextCharArg = origOptString;
        }
 
-       if (opt->arg && opt->argInfo == POPT_ARG_NONE) 
+       if (opt->arg && opt->argInfo == POPT_ARG_NONE)
            *((int *)opt->arg) = 1;
        else if (opt->argInfo != POPT_ARG_NONE) {
            if (longArg) {
            *((int *)opt->arg) = 1;
        else if (opt->argInfo != POPT_ARG_NONE) {
            if (longArg) {
@@ -230,8 +230,8 @@ int poptGetNextOpt(poptContext con) {
            } else if (con->os->nextCharArg) {
                con->os->nextArg = con->os->nextCharArg;
                con->os->nextCharArg = NULL;
            } else if (con->os->nextCharArg) {
                con->os->nextArg = con->os->nextCharArg;
                con->os->nextCharArg = NULL;
-           } else { 
-               while (con->os->next == con->os->argc && 
+           } else {
+               while (con->os->next == con->os->argc &&
                       con->os > con->optionStack)
                    con->os--;
                if (con->os->next == con->os->argc)
                       con->os > con->optionStack)
                    con->os--;
                if (con->os->next == con->os->argc)
@@ -249,7 +249,7 @@ int poptGetNextOpt(poptContext con) {
                  case POPT_ARG_INT:
                  case POPT_ARG_LONG:
                    aLong = strtol(con->os->nextArg, &end, 0);
                  case POPT_ARG_INT:
                  case POPT_ARG_LONG:
                    aLong = strtol(con->os->nextArg, &end, 0);
-                   if (*end) 
+                   if (*end)
                        return POPT_ERROR_BADNUMBER;
 
                    if (aLong == LONG_MIN || aLong == LONG_MAX)
                        return POPT_ERROR_BADNUMBER;
 
                    if (aLong == LONG_MIN || aLong == LONG_MAX)
@@ -323,13 +323,13 @@ int poptAddAlias(poptContext con, struct poptAlias newAlias, int flags) {
     if (!con->aliases)
        con->aliases = malloc(sizeof(newAlias) * con->numAliases);
     else
     if (!con->aliases)
        con->aliases = malloc(sizeof(newAlias) * con->numAliases);
     else
-       con->aliases = realloc(con->aliases, 
+       con->aliases = realloc(con->aliases,
                               sizeof(newAlias) * con->numAliases);
     alias = con->aliases + aliasNum;
                               sizeof(newAlias) * con->numAliases);
     alias = con->aliases + aliasNum;
-    
+
     *alias = newAlias;
     if (alias->longName)
     *alias = newAlias;
     if (alias->longName)
-       alias->longName = strcpy(malloc(strlen(alias->longName) + 1), 
+       alias->longName = strcpy(malloc(strlen(alias->longName) + 1),
                                    alias->longName);
     else
        alias->longName = NULL;
                                    alias->longName);
     else
        alias->longName = NULL;
@@ -424,7 +424,7 @@ static void configLine(poptContext con, char * line) {
     int nameLength = strlen(con->appName);
     char * opt;
     struct poptAlias alias;
     int nameLength = strlen(con->appName);
     char * opt;
     struct poptAlias alias;
-    
+
     if (strncmp(line, con->appName, nameLength)) return;
     line += nameLength;
     if (!*line || !isspace(*line)) return;
     if (strncmp(line, con->appName, nameLength)) return;
     line += nameLength;
     if (!*line || !isspace(*line)) return;
@@ -469,7 +469,7 @@ int poptReadConfigFile(poptContext con, char * fn) {
     if (fd < 0) {
        if (errno == ENOENT)
            return 0;
     if (fd < 0) {
        if (errno == ENOENT)
            return 0;
-       else 
+       else
            return POPT_ERROR_ERRNO;
     }
 
            return POPT_ERROR_ERRNO;
     }
 
@@ -521,8 +521,8 @@ int poptReadConfigFile(poptContext con, char * fn) {
          case '\\':
            *dst++ = *chptr++;
            if (chptr < end) {
          case '\\':
            *dst++ = *chptr++;
            if (chptr < end) {
-               if (*chptr == '\n') 
-                   dst--, chptr++;     
+               if (*chptr == '\n')
+                   dst--, chptr++;
                    /* \ at the end of a line does not insert a \n */
                else
                    *dst++ = *chptr++;
                    /* \ at the end of a line does not insert a \n */
                else
                    *dst++ = *chptr++;
@@ -586,7 +586,7 @@ int poptReadDefaultConfig(poptContext con, int useEnv) {
                alias.longName = envValue + 2;
                alias.shortName = '\0';
            } else if (*envValue == '-' && strlen(envValue) == 2) {
                alias.longName = envValue + 2;
                alias.shortName = '\0';
            } else if (*envValue == '-' && strlen(envValue) == 2) {
-               alias.longName = NULL;  
+               alias.longName = NULL;
                alias.shortName = envValue[1];
            } else {
                skip = 1;
                alias.shortName = envValue[1];
            } else {
                skip = 1;
index c341a83..b84727c 100644 (file)
@@ -37,7 +37,7 @@ struct poptAlias {
 
 typedef struct poptContext_s * poptContext;
 
 
 typedef struct poptContext_s * poptContext;
 
-poptContext poptGetContext(char * name, int argc, char ** argv, 
+poptContext poptGetContext(char * name, int argc, char ** argv,
                           struct poptOption * options, int flags);
 void poptResetContext(poptContext con);
 
                           struct poptOption * options, int flags);
 void poptResetContext(poptContext con);
 
@@ -55,7 +55,7 @@ void poptFreeContext(poptContext con);
 int poptStuffArgs(poptContext con, char ** argv);
 int poptAddAlias(poptContext con, struct poptAlias alias, int flags);
 int poptReadConfigFile(poptContext con, char * fn);
 int poptStuffArgs(poptContext con, char ** argv);
 int poptAddAlias(poptContext con, struct poptAlias alias, int flags);
 int poptReadConfigFile(poptContext con, char * fn);
-/* like above, but reads /etc/popt and $HOME/.popt along with environment 
+/* like above, but reads /etc/popt and $HOME/.popt along with environment
    vars */
 int poptReadDefaultConfig(poptContext con, int useEnv);
 /* argv should be freed -- this allows ', ", and \ quoting, but ' is treated
    vars */
 int poptReadDefaultConfig(poptContext con, int useEnv);
 /* argv should be freed -- this allows ', ", and \ quoting, but ' is treated
index 3b84d0f..3edb38a 100644 (file)
@@ -4,12 +4,12 @@
  * From the Wine project
 
    Copyright (C) 1993, 1994 Miguel de Icaza.
  * From the Wine project
 
    Copyright (C) 1993, 1994 Miguel de Icaza.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
  */
 
-/* "$Id: profile.c,v 1.1 2001/12/30 09:55:22 sedwards Exp $" */
+/* "$Id$" */
 
 #include <config.h>
 #include <stdio.h>
 
 #include <config.h>
 #include <stdio.h>
@@ -49,7 +49,7 @@ typedef struct TSecHeader {
     TKeys *Keys;
     struct TSecHeader *link;
 } TSecHeader;
     TKeys *Keys;
     struct TSecHeader *link;
 } TSecHeader;
-    
+
 typedef struct TProfile {
     char *FileName;
     TSecHeader *Section;
 typedef struct TProfile {
     char *FileName;
     TSecHeader *Section;
@@ -151,7 +151,7 @@ static TSecHeader *load (char *file)
     char CharBuffer [STRSIZE];
     char *next = "";           /* Not needed */
     int c;
     char CharBuffer [STRSIZE];
     char *next = "";           /* Not needed */
     int c;
-    
+
     if ((f = fopen (file, "r"))==NULL)
        return NULL;
 
     if ((f = fopen (file, "r"))==NULL)
        return NULL;
 
@@ -159,7 +159,7 @@ static TSecHeader *load (char *file)
     while ((c = getc (f)) != EOF){
        if (c == '\r')          /* Ignore Carriage Return */
            continue;
     while ((c = getc (f)) != EOF){
        if (c == '\r')          /* Ignore Carriage Return */
            continue;
-       
+
        switch (state){
 
        case OnSecHeader:
        switch (state){
 
        case OnSecHeader:
@@ -184,7 +184,7 @@ static TSecHeader *load (char *file)
        case KeyDefOnKey:
            if (c == '['){
                TSecHeader *temp;
        case KeyDefOnKey:
            if (c == '['){
                TSecHeader *temp;
-               
+
                temp = SecHeader;
                SecHeader = (TSecHeader *) xmalloc (sizeof (TSecHeader),
                                                    "KeyDef");
                temp = SecHeader;
                SecHeader = (TSecHeader *) xmalloc (sizeof (TSecHeader),
                                                    "KeyDef");
@@ -196,13 +196,13 @@ static TSecHeader *load (char *file)
            }
            if (state == FirstBrace) /* On first pass, don't allow dangling keys */
                break;
            }
            if (state == FirstBrace) /* On first pass, don't allow dangling keys */
                break;
-           
+
            if ((c == ' ' && state != KeyDefOnKey) || c == '\t')
                break;
            if ((c == ' ' && state != KeyDefOnKey) || c == '\t')
                break;
-           
+
            if (c == '\n' || overflow) /* Abort Definition */
                next = CharBuffer;
            if (c == '\n' || overflow) /* Abort Definition */
                next = CharBuffer;
-           
+
            if (c == '=' || overflow){
                TKeys *temp;
 
            if (c == '=' || overflow){
                TKeys *temp;
 
@@ -232,9 +232,9 @@ static TSecHeader *load (char *file)
            } else
                *next++ = c;
            break;
            } else
                *next++ = c;
            break;
-           
+
        } /* switch */
        } /* switch */
-       
+
     } /* while ((c = getc (f)) != EOF) */
     if (c == EOF && state == KeyValue){
        *next = '\0';
     } /* while ((c = getc (f)) != EOF) */
     if (c == EOF && state == KeyValue){
        *next = '\0';
@@ -247,7 +247,7 @@ static TSecHeader *load (char *file)
 static void new_key (TSecHeader *section, char *KeyName, char *Value)
 {
     TKeys *key;
 static void new_key (TSecHeader *section, char *KeyName, char *Value)
 {
     TKeys *key;
-    
+
     key = (TKeys *) xmalloc (sizeof (TKeys), "new_key");
     key->KeyName = strdup (KeyName);
     key->Value   = strdup (Value);
     key = (TKeys *) xmalloc (sizeof (TKeys), "new_key");
     key->KeyName = strdup (KeyName);
     key->Value   = strdup (Value);
@@ -258,7 +258,7 @@ static void new_key (TSecHeader *section, char *KeyName, char *Value)
 char *GetSetProfileChar (int set, char *AppName, char *KeyName,
                         char *Default, char *FileName)
 {
 char *GetSetProfileChar (int set, char *AppName, char *KeyName,
                         char *Default, char *FileName)
 {
-    
+
     TProfile   *New;
     TSecHeader *section;
     TKeys      *key;
     TProfile   *New;
     TSecHeader *section;
     TKeys      *key;
@@ -272,7 +272,7 @@ char *GetSetProfileChar (int set, char *AppName, char *KeyName,
        section = New->Section;
        Current = New;
     }
        section = New->Section;
        Current = New;
     }
-    
+
     /* Start search */
     for (; section; section = section->link){
        if (section->AppName == 0 || strcasecmp (section->AppName, AppName))
     /* Start search */
     for (; section; section = section->link){
        if (section->AppName == 0 || strcasecmp (section->AppName, AppName))
@@ -294,7 +294,7 @@ char *GetSetProfileChar (int set, char *AppName, char *KeyName,
            return 0;
        }
     }
            return 0;
        }
     }
-    
+
     /* Non existent section */
     if (set && Default){
        section = (TSecHeader *) xmalloc (sizeof (TSecHeader), "GSP3");
     /* Non existent section */
     if (set && Default){
        section = (TSecHeader *) xmalloc (sizeof (TSecHeader), "GSP3");
@@ -303,7 +303,7 @@ char *GetSetProfileChar (int set, char *AppName, char *KeyName,
        new_key (section, KeyName, Default);
        section->link = Current->Section;
        Current->Section = section;
        new_key (section, KeyName, Default);
        section->link = Current->Section;
        Current->Section = section;
-    } 
+    }
     return Default;
 }
 
     return Default;
 }
 
@@ -312,7 +312,7 @@ short GetSetProfile (int set, char * AppName, char * KeyName, char * Default,
 
 {
     char  *s;
 
 {
     char  *s;
-    
+
     s = GetSetProfileChar (set, AppName, KeyName, Default, FileName);
     if (!set){
        ReturnedString [Size-1] = 0;
     s = GetSetProfileChar (set, AppName, KeyName, Default, FileName);
     if (!set){
        ReturnedString [Size-1] = 0;
@@ -335,7 +335,7 @@ char *get_profile_string (char *AppName, char *KeyName, char *Default,
 }
 
 #if 0
 }
 
 #if 0
-int GetProfileString (char * AppName, char * KeyName, char * Default, 
+int GetProfileString (char * AppName, char * KeyName, char * Default,
                      char * ReturnedString, int Size)
 {
     return GetPrivateProfileString (AppName, KeyName, Default,
                      char * ReturnedString, int Size)
 {
     return GetPrivateProfileString (AppName, KeyName, Default,
@@ -350,7 +350,7 @@ int GetPrivateProfileInt (char * AppName, char * KeyName, int Default,
     static char buf [15];
 
     sprintf (buf, "%d", Default);
     static char buf [15];
 
     sprintf (buf, "%d", Default);
-    
+
     /* Check the exact semantic with the SDK */
     GetPrivateProfileString (AppName, KeyName, buf, IntBuf, 15, File);
     if (!strcasecmp (IntBuf, "true"))
     /* Check the exact semantic with the SDK */
     GetPrivateProfileString (AppName, KeyName, buf, IntBuf, 15, File);
     if (!strcasecmp (IntBuf, "true"))
@@ -405,7 +405,7 @@ static void dump_sections (FILE *profile, TSecHeader *p)
 static void dump_profile (TProfile *p)
 {
     FILE *profile;
 static void dump_profile (TProfile *p)
 {
     FILE *profile;
-    
+
     if (!p)
        return;
     dump_profile (p->link);
     if (!p)
        return;
     dump_profile (p->link);
@@ -461,10 +461,10 @@ static void free_profile (TProfile *p)
 void free_profile_name (char *s)
 {
     TProfile *p;
 void free_profile_name (char *s)
 {
     TProfile *p;
-    
+
     if (!s)
        return;
     if (!s)
        return;
-    
+
     for (p = Base; p; p = p->link){
        if (strcmp (s, p->FileName) == 0){
            free_sections (p->Section);
     for (p = Base; p; p = p->link){
        if (strcmp (s, p->FileName) == 0){
            free_sections (p->Section);
@@ -484,7 +484,7 @@ void *profile_init_iterator (char *appname, char *file)
 {
     TProfile   *New;
     TSecHeader *section;
 {
     TProfile   *New;
     TSecHeader *section;
-    
+
     if (!is_loaded (file, &section)){
        New = (TProfile *) xmalloc (sizeof (TProfile), "GetSetProfile");
        New->link = Base;
     if (!is_loaded (file, &section)){
        New = (TProfile *) xmalloc (sizeof (TProfile), "GetSetProfile");
        New->link = Base;
index 70724ea..db202bf 100644 (file)
@@ -7,7 +7,7 @@ short GetPrivateProfileString (char * AppName, char * KeyName,
                               char * Default, char * ReturnedString,
                               short Size, char * FileName);
 
                               char * Default, char * ReturnedString,
                               short Size, char * FileName);
 
-int GetProfileString (char * AppName, char * KeyName, char * Default, 
+int GetProfileString (char * AppName, char * KeyName, char * Default,
                      char * ReturnedString, int Size);
 
 int GetPrivateProfileInt (char * AppName, char * KeyName, int Default,
                      char * ReturnedString, int Size);
 
 int GetPrivateProfileInt (char * AppName, char * KeyName, int Default,
index bb80ea0..f511df8 100644 (file)
@@ -96,7 +96,7 @@ char *realloc ();
 
 /* This must be nonzero for the wordchar and notwordchar pattern
    commands in re_match_2.  */
 
 /* This must be nonzero for the wordchar and notwordchar pattern
    commands in re_match_2.  */
-#ifndef Sword 
+#ifndef Sword
 #define Sword 1
 #endif
 
 #define Sword 1
 #endif
 
@@ -213,8 +213,8 @@ init_syntax_once ()
    use `alloca' instead of `malloc'.  This is because using malloc in
    re_search* or re_match* could cause memory leaks when C-g is used in
    Emacs; also, malloc is slower and causes storage fragmentation.  On
    use `alloca' instead of `malloc'.  This is because using malloc in
    re_search* or re_match* could cause memory leaks when C-g is used in
    Emacs; also, malloc is slower and causes storage fragmentation.  On
-   the other hand, malloc is more portable, and easier to debug.  
-   
+   the other hand, malloc is more portable, and easier to debug.
+
    Because we sometimes use alloca, some routines have to be macros,
    not functions -- `alloca'-allocated space disappears at the end of the
    function it is called in.  */
    Because we sometimes use alloca, some routines have to be macros,
    not functions -- `alloca'-allocated space disappears at the end of the
    function it is called in.  */
@@ -240,7 +240,7 @@ init_syntax_once ()
 #ifndef _AIX /* Already did AIX, up at the top.  */
 char *alloca ();
 #endif /* not _AIX */
 #ifndef _AIX /* Already did AIX, up at the top.  */
 char *alloca ();
 #endif /* not _AIX */
-#endif /* not HAVE_ALLOCA_H */ 
+#endif /* not HAVE_ALLOCA_H */
 #endif /* not __GNUC__ */
 
 #endif /* not alloca */
 #endif /* not __GNUC__ */
 
 #endif /* not alloca */
@@ -381,9 +381,9 @@ typedef enum
 
         /* Analogously, for end of buffer/string.  */
   endbuf,
 
         /* Analogously, for end of buffer/string.  */
   endbuf,
+
         /* Followed by two byte relative address to which to jump.  */
         /* Followed by two byte relative address to which to jump.  */
-  jump, 
+  jump,
 
        /* Same as jump, but marks the end of an alternative.  */
   jump_past_alt,
 
        /* Same as jump, but marks the end of an alternative.  */
   jump_past_alt,
@@ -391,11 +391,11 @@ typedef enum
         /* Followed by two-byte relative address of place to resume at
            in case of failure.  */
   on_failure_jump,
         /* Followed by two-byte relative address of place to resume at
            in case of failure.  */
   on_failure_jump,
-       
+
         /* Like on_failure_jump, but pushes a placeholder instead of the
            current string position when executed.  */
   on_failure_keep_string_jump,
         /* Like on_failure_jump, but pushes a placeholder instead of the
            current string position when executed.  */
   on_failure_keep_string_jump,
-  
+
         /* Throw away latest failure point and then jump to following
            two-byte relative address.  */
   pop_failure_jump,
         /* Throw away latest failure point and then jump to following
            two-byte relative address.  */
   pop_failure_jump,
@@ -491,7 +491,7 @@ extract_number (dest, source)
     int *dest;
     unsigned char *source;
 {
     int *dest;
     unsigned char *source;
 {
-  int temp = SIGN_EXTEND_CHAR (*(source + 1)); 
+  int temp = SIGN_EXTEND_CHAR (*(source + 1));
   *dest = *source & 0377;
   *dest += temp << 8;
 }
   *dest = *source & 0377;
   *dest += temp << 8;
 }
@@ -517,7 +517,7 @@ static void
 extract_number_and_incr (destination, source)
     int *destination;
     unsigned char **source;
 extract_number_and_incr (destination, source)
     int *destination;
     unsigned char **source;
-{ 
+{
   extract_number (destination, *source);
   *source += 2;
 }
   extract_number (destination, *source);
   *source += 2;
 }
@@ -564,8 +564,8 @@ print_fastmap (fastmap)
     char *fastmap;
 {
   unsigned was_a_range = 0;
     char *fastmap;
 {
   unsigned was_a_range = 0;
-  unsigned i = 0;  
-  
+  unsigned i = 0;
+
   while (i < (1 << BYTEWIDTH))
     {
       if (fastmap[i++])
   while (i < (1 << BYTEWIDTH))
     {
       if (fastmap[i++])
@@ -584,7 +584,7 @@ print_fastmap (fastmap)
             }
         }
     }
             }
         }
     }
-  putchar ('\n'); 
+  putchar ('\n');
 }
 
 
 }
 
 
@@ -605,7 +605,7 @@ print_partial_compiled_pattern (start, end)
       printf ("(null)\n");
       return;
     }
       printf ("(null)\n");
       return;
     }
-    
+
   /* Loop over pattern commands.  */
   while (p < pend)
     {
   /* Loop over pattern commands.  */
   while (p < pend)
     {
@@ -654,7 +654,7 @@ print_partial_compiled_pattern (start, end)
 
            printf ("/charset [%s",
                    (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
 
            printf ("/charset [%s",
                    (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
-            
+
             assert (p + *p < pend);
 
             for (c = 0; c < 256; c++)
             assert (p + *p < pend);
 
             for (c = 0; c < 256; c++)
@@ -673,7 +673,7 @@ print_partial_compiled_pattern (start, end)
                      putchar (last);
                      in_range = 0;
                    }
                      putchar (last);
                      in_range = 0;
                    }
-                
+
                  if (! in_range)
                    putchar (c);
 
                  if (! in_range)
                    putchar (c);
 
@@ -715,7 +715,7 @@ print_partial_compiled_pattern (start, end)
        case push_dummy_failure:
           printf ("/push_dummy_failure");
           break;
        case push_dummy_failure:
           printf ("/push_dummy_failure");
           break;
-          
+
         case maybe_pop_jump:
           extract_number_and_incr (&mcnt, &p);
          printf ("/maybe_pop_jump to %d", p + mcnt - start);
         case maybe_pop_jump:
           extract_number_and_incr (&mcnt, &p);
          printf ("/maybe_pop_jump to %d", p + mcnt - start);
@@ -724,36 +724,36 @@ print_partial_compiled_pattern (start, end)
         case pop_failure_jump:
          extract_number_and_incr (&mcnt, &p);
          printf ("/pop_failure_jump to %d", p + mcnt - start);
         case pop_failure_jump:
          extract_number_and_incr (&mcnt, &p);
          printf ("/pop_failure_jump to %d", p + mcnt - start);
-         break;          
-          
+         break;
+
         case jump_past_alt:
          extract_number_and_incr (&mcnt, &p);
          printf ("/jump_past_alt to %d", p + mcnt - start);
         case jump_past_alt:
          extract_number_and_incr (&mcnt, &p);
          printf ("/jump_past_alt to %d", p + mcnt - start);
-         break;          
-          
+         break;
+
         case jump:
          extract_number_and_incr (&mcnt, &p);
          printf ("/jump to %d", p + mcnt - start);
          break;
 
         case jump:
          extract_number_and_incr (&mcnt, &p);
          printf ("/jump to %d", p + mcnt - start);
          break;
 
-        case succeed_n: 
+        case succeed_n:
           extract_number_and_incr (&mcnt, &p);
           extract_number_and_incr (&mcnt2, &p);
          printf ("/succeed_n to %d, %d times", p + mcnt - start, mcnt2);
           break;
           extract_number_and_incr (&mcnt, &p);
           extract_number_and_incr (&mcnt2, &p);
          printf ("/succeed_n to %d, %d times", p + mcnt - start, mcnt2);
           break;
-        
-        case jump_n: 
+
+        case jump_n:
           extract_number_and_incr (&mcnt, &p);
           extract_number_and_incr (&mcnt2, &p);
          printf ("/jump_n to %d, %d times", p + mcnt - start, mcnt2);
           break;
           extract_number_and_incr (&mcnt, &p);
           extract_number_and_incr (&mcnt2, &p);
          printf ("/jump_n to %d, %d times", p + mcnt - start, mcnt2);
           break;
-        
-        case set_number_at: 
+
+        case set_number_at:
           extract_number_and_incr (&mcnt, &p);
           extract_number_and_incr (&mcnt2, &p);
          printf ("/set_number_at location %d to %d", p + mcnt - start, mcnt2);
           break;
           extract_number_and_incr (&mcnt, &p);
           extract_number_and_incr (&mcnt2, &p);
          printf ("/set_number_at location %d to %d", p + mcnt - start, mcnt2);
           break;
-        
+
         case wordbound:
          printf ("/wordbound");
          break;
         case wordbound:
          printf ("/wordbound");
          break;
@@ -765,10 +765,10 @@ print_partial_compiled_pattern (start, end)
        case wordbeg:
          printf ("/wordbeg");
          break;
        case wordbeg:
          printf ("/wordbeg");
          break;
-          
+
        case wordend:
          printf ("/wordend");
        case wordend:
          printf ("/wordend");
-          
+
 #ifdef emacs
        case before_dot:
          printf ("/before_dot");
 #ifdef emacs
        case before_dot:
          printf ("/before_dot");
@@ -787,7 +787,7 @@ print_partial_compiled_pattern (start, end)
          mcnt = *p++;
          printf ("/%d", mcnt);
           break;
          mcnt = *p++;
          printf ("/%d", mcnt);
           break;
-         
+
        case notsyntaxspec:
           printf ("/notsyntaxspec");
          mcnt = *p++;
        case notsyntaxspec:
           printf ("/notsyntaxspec");
          mcnt = *p++;
@@ -798,7 +798,7 @@ print_partial_compiled_pattern (start, end)
        case wordchar:
          printf ("/wordchar");
           break;
        case wordchar:
          printf ("/wordchar");
           break;
-         
+
        case notwordchar:
          printf ("/notwordchar");
           break;
        case notwordchar:
          printf ("/notwordchar");
           break;
@@ -858,7 +858,7 @@ print_double_string (where, string1, size1, string2, size2)
     int size2;
 {
   unsigned this_char;
     int size2;
 {
   unsigned this_char;
-  
+
   if (where == NULL)
     printf ("(null)");
   else
   if (where == NULL)
     printf ("(null)");
   else
@@ -868,7 +868,7 @@ print_double_string (where, string1, size1, string2, size2)
           for (this_char = where - string1; this_char < size1; this_char++)
             putchar (string1[this_char]);
 
           for (this_char = where - string1; this_char < size1; this_char++)
             putchar (string1[this_char]);
 
-          where = string2;    
+          where = string2;
         }
 
       for (this_char = where - string2; this_char < size2; this_char++)
         }
 
       for (this_char = where - string2; this_char < size2; this_char++)
@@ -911,7 +911,7 @@ re_set_syntax (syntax)
     reg_syntax_t syntax;
 {
   reg_syntax_t ret = re_syntax_options;
     reg_syntax_t syntax;
 {
   reg_syntax_t ret = re_syntax_options;
-  
+
   re_syntax_options = syntax;
   return ret;
 }
   re_syntax_options = syntax;
   return ret;
 }
@@ -951,7 +951,7 @@ static const char *re_error_msgid[] =
    ralloc heap) shift the data out from underneath the regexp
    routines.
 
    ralloc heap) shift the data out from underneath the regexp
    routines.
 
-   Here's another reason to avoid allocation: Emacs 
+   Here's another reason to avoid allocation: Emacs
    processes input from X in a signal handler; processing X input may
    call malloc; if input arrives while a matching routine is calling
    malloc, then we're scrod.  But Emacs can't just block input while
    processes input from X in a signal handler; processing X input may
    call malloc; if input arrives while a matching routine is calling
    malloc, then we're scrod.  But Emacs can't just block input while
@@ -982,7 +982,7 @@ static const char *re_error_msgid[] =
 /* Failure stack declarations and macros; both re_compile_fastmap and
    re_match_2 use a failure stack.  These have to be macros because of
    REGEX_ALLOCATE_STACK.  */
 /* Failure stack declarations and macros; both re_compile_fastmap and
    re_match_2 use a failure stack.  These have to be macros because of
    REGEX_ALLOCATE_STACK.  */
-   
+
 
 /* Number of failure points for which to initially allocate space
    when matching.  If this number is exceeded, we allocate more
 
 /* Number of failure points for which to initially allocate space
    when matching.  If this number is exceeded, we allocate more
@@ -1051,8 +1051,8 @@ typedef struct
 /* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
 
    Return 1 if succeeds, and 0 if either ran out of memory
 /* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
 
    Return 1 if succeeds, and 0 if either ran out of memory
-   allocating space for it or it was already too large.  
-   
+   allocating space for it or it was already too large.
+
    REGEX_REALLOCATE_STACK requires `destination' be declared.   */
 
 #define DOUBLE_FAIL_STACK(fail_stack)                                  \
    REGEX_REALLOCATE_STACK requires `destination' be declared.   */
 
 #define DOUBLE_FAIL_STACK(fail_stack)                                  \
@@ -1069,7 +1069,7 @@ typedef struct
          1)))
 
 
          1)))
 
 
-/* Push pointer POINTER on FAIL_STACK. 
+/* Push pointer POINTER on FAIL_STACK.
    Return 1 if was able to do so and 0 if ran out of memory allocating
    space to do so.  */
 #define PUSH_PATTERN_OP(POINTER, FAIL_STACK)                           \
    Return 1 if was able to do so and 0 if ran out of memory allocating
    space to do so.  */
 #define PUSH_PATTERN_OP(POINTER, FAIL_STACK)                           \
@@ -1114,12 +1114,12 @@ typedef struct
 
 
 /* Push the information about the state we will need
 
 
 /* Push the information about the state we will need
-   if we ever fail back to it.  
-   
+   if we ever fail back to it.
+
    Requires variables fail_stack, regstart, regend, reg_info, and
    num_regs be declared.  DOUBLE_FAIL_STACK requires `destination' be
    declared.
    Requires variables fail_stack, regstart, regend, reg_info, and
    num_regs be declared.  DOUBLE_FAIL_STACK requires `destination' be
    declared.
-   
+
    Does `return FAILURE_CODE' if runs out of memory.  */
 
 #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code)  \
    Does `return FAILURE_CODE' if runs out of memory.  */
 
 #define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code)  \
@@ -1228,7 +1228,7 @@ typedef struct
      LOW_REG, HIGH_REG -- the highest and lowest active registers.
      REGSTART, REGEND -- arrays of string positions.
      REG_INFO -- array of information about each subexpression.
      LOW_REG, HIGH_REG -- the highest and lowest active registers.
      REGSTART, REGEND -- arrays of string positions.
      REG_INFO -- array of information about each subexpression.
-   
+
    Also assumes the variables `fail_stack' and (if debugging), `bufp',
    `pend', `string1', `size1', `string2', and `size2'.  */
 
    Also assumes the variables `fail_stack' and (if debugging), `bufp',
    `pend', `string1', `size1', `string2', and `size2'.  */
 
@@ -1296,8 +1296,8 @@ typedef struct
    Other register information, such as the
    starting and ending positions (which are addresses), and the list of
    inner groups (which is a bits list) are maintained in separate
    Other register information, such as the
    starting and ending positions (which are addresses), and the list of
    inner groups (which is a bits list) are maintained in separate
-   variables.  
-   
+   variables.
+
    We are making a (strictly speaking) nonportable assumption here: that
    the compiler will pack our bit fields into something that fits into
    the type of `word', i.e., is something that fits into one item on the
    We are making a (strictly speaking) nonportable assumption here: that
    the compiler will pack our bit fields into something that fits into
    the type of `word', i.e., is something that fits into one item on the
@@ -1357,7 +1357,7 @@ static boolean at_begline_loc_p (), at_endline_loc_p ();
 static boolean group_in_compile_stack ();
 static reg_errcode_t compile_range ();
 
 static boolean group_in_compile_stack ();
 static reg_errcode_t compile_range ();
 
-/* Fetch the next character in the uncompiled pattern---translating it 
+/* Fetch the next character in the uncompiled pattern---translating it
    if necessary.  Also cast from a signed character in the constant
    string passed to us by the user to an unsigned char that we can use
    as an array index (in, e.g., `translate').  */
    if necessary.  Also cast from a signed character in the constant
    string passed to us by the user to an unsigned char that we can use
    as an array index (in, e.g., `translate').  */
@@ -1497,7 +1497,7 @@ typedef struct
   pattern_offset_t begalt_offset;
   pattern_offset_t fixup_alt_jump;
   pattern_offset_t inner_group_offset;
   pattern_offset_t begalt_offset;
   pattern_offset_t fixup_alt_jump;
   pattern_offset_t inner_group_offset;
-  pattern_offset_t laststart_offset;  
+  pattern_offset_t laststart_offset;
   regnum_t regnum;
 } compile_stack_elt_t;
 
   regnum_t regnum;
 } compile_stack_elt_t;
 
@@ -1540,7 +1540,7 @@ typedef struct
            PATFETCH (c);                                               \
          }                                                             \
        }                                                               \
            PATFETCH (c);                                               \
          }                                                             \
        }                                                               \
-    }          
+    }
 
 #define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */
 
 
 #define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */
 
@@ -1571,7 +1571,7 @@ static int regs_allocated_size;
 static const char **     regstart, **     regend;
 static const char ** old_regstart, ** old_regend;
 static const char **best_regstart, **best_regend;
 static const char **     regstart, **     regend;
 static const char ** old_regstart, ** old_regend;
 static const char **best_regstart, **best_regend;
-static register_info_type *reg_info; 
+static register_info_type *reg_info;
 static const char **reg_dummy;
 static register_info_type *reg_info_dummy;
 
 static const char **reg_dummy;
 static register_info_type *reg_info_dummy;
 
@@ -1614,7 +1614,7 @@ regex_grow_registers (num_regs)
      `fastmap_accurate' is zero;
      `re_nsub' is the number of subexpressions in PATTERN;
      `not_bol' and `not_eol' are zero;
      `fastmap_accurate' is zero;
      `re_nsub' is the number of subexpressions in PATTERN;
      `not_bol' and `not_eol' are zero;
-   
+
    The `fastmap' and `newline_anchor' fields are neither
    examined nor set.  */
 
    The `fastmap' and `newline_anchor' fields are neither
    examined nor set.  */
 
@@ -1633,20 +1633,20 @@ regex_compile (pattern, size, syntax, bufp)
      `char *' (i.e., signed), we declare these variables as unsigned, so
      they can be reliably used as array indices.  */
   register unsigned char c, c1;
      `char *' (i.e., signed), we declare these variables as unsigned, so
      they can be reliably used as array indices.  */
   register unsigned char c, c1;
-  
+
   /* A random temporary spot in PATTERN.  */
   const char *p1;
 
   /* Points to the end of the buffer, where we should append.  */
   register unsigned char *b;
   /* A random temporary spot in PATTERN.  */
   const char *p1;
 
   /* Points to the end of the buffer, where we should append.  */
   register unsigned char *b;
-  
+
   /* Keeps track of unclosed groups.  */
   compile_stack_type compile_stack;
 
   /* Points to the current (ending) position in the pattern.  */
   const char *p = pattern;
   const char *pend = pattern + size;
   /* Keeps track of unclosed groups.  */
   compile_stack_type compile_stack;
 
   /* Points to the current (ending) position in the pattern.  */
   const char *p = pattern;
   const char *pend = pattern + size;
-  
+
   /* How to translate the characters in the pattern.  */
   char *translate = bufp->translate;
 
   /* How to translate the characters in the pattern.  */
   char *translate = bufp->translate;
 
@@ -1667,7 +1667,7 @@ regex_compile (pattern, size, syntax, bufp)
   /* Place in the uncompiled pattern (i.e., the {) to
      which to go back if the interval is invalid.  */
   const char *beg_interval;
   /* Place in the uncompiled pattern (i.e., the {) to
      which to go back if the interval is invalid.  */
   const char *beg_interval;
-                
+
   /* Address of the place where a forward jump should go to the end of
      the containing expression.  Each alternative of an `or' -- except the
      last -- ends with a forward jump of this sort.  */
   /* Address of the place where a forward jump should go to the end of
      the containing expression.  Each alternative of an `or' -- except the
      last -- ends with a forward jump of this sort.  */
@@ -1683,7 +1683,7 @@ regex_compile (pattern, size, syntax, bufp)
   if (debug)
     {
       unsigned debug_count;
   if (debug)
     {
       unsigned debug_count;
-      
+
       for (debug_count = 0; debug_count < size; debug_count++)
         putchar (pattern[debug_count]);
       putchar ('\n');
       for (debug_count = 0; debug_count < size; debug_count++)
         putchar (pattern[debug_count]);
       putchar ('\n');
@@ -1707,9 +1707,9 @@ regex_compile (pattern, size, syntax, bufp)
      printer (for debugging) will think there's no pattern.  We reset it
      at the end.  */
   bufp->used = 0;
      printer (for debugging) will think there's no pattern.  We reset it
      at the end.  */
   bufp->used = 0;
-  
+
   /* Always count groups, whether or not bufp->no_sub is set.  */
   /* Always count groups, whether or not bufp->no_sub is set.  */
-  bufp->re_nsub = 0;                           
+  bufp->re_nsub = 0;
 
 #if !defined (emacs) && !defined (SYNTAX_TABLE)
   /* Initialize the syntax table.  */
 
 #if !defined (emacs) && !defined (SYNTAX_TABLE)
   /* Initialize the syntax table.  */
@@ -1760,7 +1760,7 @@ regex_compile (pattern, size, syntax, bufp)
         case '$':
           {
             if (   /* If at end of pattern, it's an operator.  */
         case '$':
           {
             if (   /* If at end of pattern, it's an operator.  */
-                   p == pend 
+                   p == pend
                    /* If context independent, it's an operator.  */
                 || syntax & RE_CONTEXT_INDEP_ANCHORS
                    /* Otherwise, depends on what's next.  */
                    /* If context independent, it's an operator.  */
                 || syntax & RE_CONTEXT_INDEP_ANCHORS
                    /* Otherwise, depends on what's next.  */
@@ -1791,7 +1791,7 @@ regex_compile (pattern, size, syntax, bufp)
           {
             /* Are we optimizing this jump?  */
             boolean keep_string_p = false;
           {
             /* Are we optimizing this jump?  */
             boolean keep_string_p = false;
-            
+
             /* 1 means zero (many) matches is allowed.  */
             char zero_times_ok = 0, many_times_ok = 0;
 
             /* 1 means zero (many) matches is allowed.  */
             char zero_times_ok = 0, many_times_ok = 0;
 
@@ -1839,7 +1839,7 @@ regex_compile (pattern, size, syntax, bufp)
 
             /* Star, etc. applied to an empty pattern is equivalent
                to an empty pattern.  */
 
             /* Star, etc. applied to an empty pattern is equivalent
                to an empty pattern.  */
-            if (!laststart)  
+            if (!laststart)
               break;
 
             /* Now we know whether or not zero matches is allowed
               break;
 
             /* Now we know whether or not zero matches is allowed
@@ -1848,7 +1848,7 @@ regex_compile (pattern, size, syntax, bufp)
               { /* More than one repetition is allowed, so put in at the
                    end a backward relative jump from `b' to before the next
                    jump we're going to put in below (which jumps from
               { /* More than one repetition is allowed, so put in at the
                    end a backward relative jump from `b' to before the next
                    jump we're going to put in below (which jumps from
-                   laststart to after this jump).  
+                   laststart to after this jump).
 
                    But if we are at the `*' in the exact sequence `.*\n',
                    insert an unconditional jump backwards to the .,
 
                    But if we are at the `*' in the exact sequence `.*\n',
                    insert an unconditional jump backwards to the .,
@@ -1925,7 +1925,7 @@ regex_compile (pattern, size, syntax, bufp)
 
             /* We test `*p == '^' twice, instead of using an if
                statement, so we only need one BUF_PUSH.  */
 
             /* We test `*p == '^' twice, instead of using an if
                statement, so we only need one BUF_PUSH.  */
-            BUF_PUSH (*p == '^' ? charset_not : charset); 
+            BUF_PUSH (*p == '^' ? charset_not : charset);
             if (*p == '^')
               p++;
 
             if (*p == '^')
               p++;
 
@@ -1975,8 +1975,8 @@ regex_compile (pattern, size, syntax, bufp)
                    was a character: if this is a hyphen not at the
                    beginning or the end of a list, then it's the range
                    operator.  */
                    was a character: if this is a hyphen not at the
                    beginning or the end of a list, then it's the range
                    operator.  */
-                if (c == '-' 
-                    && !(p - 2 >= pattern && p[-2] == '[') 
+                if (c == '-'
+                    && !(p - 2 >= pattern && p[-2] == '[')
                     && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
                     && *p != ']')
                   {
                     && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
                     && *p != ']')
                   {
@@ -1991,7 +1991,7 @@ regex_compile (pattern, size, syntax, bufp)
 
                    /* Move past the `-'.  */
                     PATFETCH (c1);
 
                    /* Move past the `-'.  */
                     PATFETCH (c1);
-                    
+
                     ret = compile_range (&p, pend, translate, syntax, b);
                     if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
                   }
                     ret = compile_range (&p, pend, translate, syntax, b);
                     if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
                   }
@@ -2020,7 +2020,7 @@ regex_compile (pattern, size, syntax, bufp)
                     str[c1] = '\0';
 
                     /* If isn't a word bracketed by `[:' and:`]':
                     str[c1] = '\0';
 
                     /* If isn't a word bracketed by `[:' and:`]':
-                       undo the ending character, the letters, and leave 
+                       undo the ending character, the letters, and leave
                        the leading `:' and `[' (but set bits for them).  */
                     if (c == ':' && *p == ']')
                       {
                        the leading `:' and `[' (but set bits for them).  */
                     if (c == ':' && *p == ']')
                       {
@@ -2037,13 +2037,13 @@ regex_compile (pattern, size, syntax, bufp)
                         boolean is_space = STREQ (str, "space");
                         boolean is_upper = STREQ (str, "upper");
                         boolean is_xdigit = STREQ (str, "xdigit");
                         boolean is_space = STREQ (str, "space");
                         boolean is_upper = STREQ (str, "upper");
                         boolean is_xdigit = STREQ (str, "xdigit");
-                        
+
                         if (!IS_CHAR_CLASS (str))
                          FREE_STACK_RETURN (REG_ECTYPE);
 
                         /* Throw away the ] at the end of the character
                            class.  */
                         if (!IS_CHAR_CLASS (str))
                          FREE_STACK_RETURN (REG_ECTYPE);
 
                         /* Throw away the ] at the end of the character
                            class.  */
-                        PATFETCH (c);                                  
+                        PATFETCH (c);
 
                         if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
 
 
                         if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
 
@@ -2072,7 +2072,7 @@ regex_compile (pattern, size, syntax, bufp)
                     else
                       {
                         c1++;
                     else
                       {
                         c1++;
-                        while (c1--)    
+                        while (c1--)
                           PATUNFETCH;
                         SET_LIST_BIT ('[');
                         SET_LIST_BIT (':');
                           PATUNFETCH;
                         SET_LIST_BIT ('[');
                         SET_LIST_BIT (':');
@@ -2088,8 +2088,8 @@ regex_compile (pattern, size, syntax, bufp)
 
             /* Discard any (non)matching list bytes that are all 0 at the
                end of the map.  Decrease the map-length byte too.  */
 
             /* Discard any (non)matching list bytes that are all 0 at the
                end of the map.  Decrease the map-length byte too.  */
-            while ((int) b[-1] > 0 && b[b[-1] - 1] == 0) 
-              b[-1]--; 
+            while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+              b[-1]--;
             b += b[-1];
           }
           break;
             b += b[-1];
           }
           break;
@@ -2149,7 +2149,7 @@ regex_compile (pattern, size, syntax, bufp)
               regnum++;
 
               if (COMPILE_STACK_FULL)
               regnum++;
 
               if (COMPILE_STACK_FULL)
-                { 
+                {
                   RETALLOC (compile_stack.stack, compile_stack.size << 1,
                             compile_stack_elt_t);
                   if (compile_stack.stack == NULL) return REG_ESPACE;
                   RETALLOC (compile_stack.stack, compile_stack.size << 1,
                             compile_stack_elt_t);
                   if (compile_stack.stack == NULL) return REG_ESPACE;
@@ -2162,7 +2162,7 @@ regex_compile (pattern, size, syntax, bufp)
                  whole pattern moves because of realloc, they will still
                  be valid.  */
               COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
                  whole pattern moves because of realloc, they will still
                  be valid.  */
               COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
-              COMPILE_STACK_TOP.fixup_alt_jump 
+              COMPILE_STACK_TOP.fixup_alt_jump
                 = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
               COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
               COMPILE_STACK_TOP.regnum = regnum;
                 = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
               COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
               COMPILE_STACK_TOP.regnum = regnum;
@@ -2176,7 +2176,7 @@ regex_compile (pattern, size, syntax, bufp)
                   COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
                   BUF_PUSH_3 (start_memory, regnum, 0);
                 }
                   COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
                   BUF_PUSH_3 (start_memory, regnum, 0);
                 }
-                
+
               compile_stack.avail++;
 
               fixup_alt_jump = 0;
               compile_stack.avail++;
 
               fixup_alt_jump = 0;
@@ -2205,7 +2205,7 @@ regex_compile (pattern, size, syntax, bufp)
                      `pop_failure_jump' to pop.  See comments at
                      `push_dummy_failure' in `re_match_2'.  */
                   BUF_PUSH (push_dummy_failure);
                      `pop_failure_jump' to pop.  See comments at
                      `push_dummy_failure' in `re_match_2'.  */
                   BUF_PUSH (push_dummy_failure);
-                  
+
                   /* We allocated space for this jump when we assigned
                      to `fixup_alt_jump', in the `handle_alt' case below.  */
                   STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
                   /* We allocated space for this jump when we assigned
                      to `fixup_alt_jump', in the `handle_alt' case below.  */
                   STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
@@ -2227,11 +2227,11 @@ regex_compile (pattern, size, syntax, bufp)
                    as in `(ab)c(de)' -- the second group is #2.  */
                 regnum_t this_group_regnum;
 
                    as in `(ab)c(de)' -- the second group is #2.  */
                 regnum_t this_group_regnum;
 
-                compile_stack.avail--;         
+                compile_stack.avail--;
                 begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
                 fixup_alt_jump
                   = COMPILE_STACK_TOP.fixup_alt_jump
                 begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
                 fixup_alt_jump
                   = COMPILE_STACK_TOP.fixup_alt_jump
-                    ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 
+                    ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
                     : 0;
                 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
                 this_group_regnum = COMPILE_STACK_TOP.regnum;
                     : 0;
                 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
                 this_group_regnum = COMPILE_STACK_TOP.regnum;
@@ -2246,7 +2246,7 @@ regex_compile (pattern, size, syntax, bufp)
                   {
                     unsigned char *inner_group_loc
                       = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
                   {
                     unsigned char *inner_group_loc
                       = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
-                    
+
                     *inner_group_loc = regnum - this_group_regnum;
                     BUF_PUSH_3 (stop_memory, this_group_regnum,
                                 regnum - this_group_regnum);
                     *inner_group_loc = regnum - this_group_regnum;
                     BUF_PUSH_3 (stop_memory, this_group_regnum,
                                 regnum - this_group_regnum);
@@ -2275,10 +2275,10 @@ regex_compile (pattern, size, syntax, bufp)
                  jump (put in below, which in turn will jump to the next
                  (if any) alternative's such jump, etc.).  The last such
                  jump jumps to the correct final destination.  A picture:
                  jump (put in below, which in turn will jump to the next
                  (if any) alternative's such jump, etc.).  The last such
                  jump jumps to the correct final destination.  A picture:
-                          _____ _____ 
-                          |   | |   |   
-                          |   v |   v 
-                         a | b   | c   
+                          _____ _____
+                          |   | |   |
+                          |   v |   v
+                         a | b   | c
 
                  If we are at `b', then fixup_alt_jump right now points to a
                  three-byte space after `a'.  We'll put in the jump, set
 
                  If we are at `b', then fixup_alt_jump right now points to a
                  three-byte space after `a'.  We'll put in the jump, set
@@ -2300,10 +2300,10 @@ regex_compile (pattern, size, syntax, bufp)
               break;
 
 
               break;
 
 
-            case '{': 
+            case '{':
               /* If \{ is a literal.  */
               if (!(syntax & RE_INTERVALS)
               /* If \{ is a literal.  */
               if (!(syntax & RE_INTERVALS)
-                     /* If we're at `\{' and it's not the open-interval 
+                     /* If we're at `\{' and it's not the open-interval
                         operator.  */
                   || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
                   || (p - 2 == pattern  &&  p == pend))
                         operator.  */
                   || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
                   || (p - 2 == pattern  &&  p == pend))
@@ -2342,11 +2342,11 @@ regex_compile (pattern, size, syntax, bufp)
                   {
                     if (syntax & RE_NO_BK_BRACES)
                       goto unfetch_interval;
                   {
                     if (syntax & RE_NO_BK_BRACES)
                       goto unfetch_interval;
-                    else 
+                    else
                       FREE_STACK_RETURN (REG_BADBR);
                   }
 
                       FREE_STACK_RETURN (REG_BADBR);
                   }
 
-                if (!(syntax & RE_NO_BK_BRACES)) 
+                if (!(syntax & RE_NO_BK_BRACES))
                   {
                     if (c != '\\') FREE_STACK_RETURN (REG_EBRACE);
 
                   {
                     if (c != '\\') FREE_STACK_RETURN (REG_EBRACE);
 
@@ -2357,7 +2357,7 @@ regex_compile (pattern, size, syntax, bufp)
                   {
                     if (syntax & RE_NO_BK_BRACES)
                       goto unfetch_interval;
                   {
                     if (syntax & RE_NO_BK_BRACES)
                       goto unfetch_interval;
-                    else 
+                    else
                       FREE_STACK_RETURN (REG_BADBR);
                   }
 
                       FREE_STACK_RETURN (REG_BADBR);
                   }
 
@@ -2393,7 +2393,7 @@ regex_compile (pattern, size, syntax, bufp)
                       jump_n <succeed_n addr> <jump count>
                     (The upper bound and `jump_n' are omitted if
                     `upper_bound' is 1, though.)  */
                       jump_n <succeed_n addr> <jump count>
                     (The upper bound and `jump_n' are omitted if
                     `upper_bound' is 1, though.)  */
-                 else 
+                 else
                    { /* If the upper bound is > 1, we need to insert
                         more at the end of the loop.  */
                      unsigned nbytes = 10 + (upper_bound > 1) * 10;
                    { /* If the upper bound is > 1, we need to insert
                         more at the end of the loop.  */
                      unsigned nbytes = 10 + (upper_bound > 1) * 10;
@@ -2410,7 +2410,7 @@ regex_compile (pattern, size, syntax, bufp)
                                    lower_bound);
                      b += 5;
 
                                    lower_bound);
                      b += 5;
 
-                     /* Code to initialize the lower bound.  Insert 
+                     /* Code to initialize the lower bound.  Insert
                         before the `succeed_n'.  The `5' is the last two
                         bytes of this `set_number_at', plus 3 bytes of
                         the following `succeed_n'.  */
                         before the `succeed_n'.  The `5' is the last two
                         bytes of this `set_number_at', plus 3 bytes of
                         the following `succeed_n'.  */
@@ -2421,7 +2421,7 @@ regex_compile (pattern, size, syntax, bufp)
                        { /* More than one repetition is allowed, so
                             append a backward jump to the `succeed_n'
                             that starts this interval.
                        { /* More than one repetition is allowed, so
                             append a backward jump to the `succeed_n'
                             that starts this interval.
-                            
+
                             When we've reached this during matching,
                             we'll have matched the interval once, so
                             jump back only `upper_bound - 1' times.  */
                             When we've reached this during matching,
                             we'll have matched the interval once, so
                             jump back only `upper_bound - 1' times.  */
@@ -2439,7 +2439,7 @@ regex_compile (pattern, size, syntax, bufp)
                             so everything is getting moved up by 5.
                             Conclusion: (b - 2) - (laststart + 3) + 5,
                             i.e., b - laststart.
                             so everything is getting moved up by 5.
                             Conclusion: (b - 2) - (laststart + 3) + 5,
                             i.e., b - laststart.
-                            
+
                             We insert this at the beginning of the loop
                             so that if we fail during matching, we'll
                             reinitialize the bounds.  */
                             We insert this at the beginning of the loop
                             so that if we fail during matching, we'll
                             reinitialize the bounds.  */
@@ -2460,7 +2460,7 @@ regex_compile (pattern, size, syntax, bufp)
                beg_interval = NULL;
 
                /* normal_char and normal_backslash need `c'.  */
                beg_interval = NULL;
 
                /* normal_char and normal_backslash need `c'.  */
-               PATFETCH (c);   
+               PATFETCH (c);
 
                if (!(syntax & RE_NO_BK_BRACES))
                  {
 
                if (!(syntax & RE_NO_BK_BRACES))
                  {
@@ -2476,7 +2476,7 @@ regex_compile (pattern, size, syntax, bufp)
               BUF_PUSH (at_dot);
               break;
 
               BUF_PUSH (at_dot);
               break;
 
-            case 's':  
+            case 's':
               laststart = b;
               PATFETCH (c);
               BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
               laststart = b;
               PATFETCH (c);
               BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
@@ -2567,11 +2567,11 @@ regex_compile (pattern, size, syntax, bufp)
         /* Expects the character in `c'.  */
        normal_char:
              /* If no exactn currently being built.  */
         /* Expects the character in `c'.  */
        normal_char:
              /* If no exactn currently being built.  */
-          if (!pending_exact 
+          if (!pending_exact
 
               /* If last exactn not at current position.  */
               || pending_exact + *pending_exact + 1 != b
 
               /* If last exactn not at current position.  */
               || pending_exact + *pending_exact + 1 != b
-              
+
               /* We have only one byte following the exactn for the count.  */
              || *pending_exact == (1 << BYTEWIDTH) - 1
 
               /* We have only one byte following the exactn for the count.  */
              || *pending_exact == (1 << BYTEWIDTH) - 1
 
@@ -2586,26 +2586,26 @@ regex_compile (pattern, size, syntax, bufp)
                       : (p[0] == '\\' && p[1] == '{'))))
            {
              /* Start building a new exactn.  */
                       : (p[0] == '\\' && p[1] == '{'))))
            {
              /* Start building a new exactn.  */
-              
+
               laststart = b;
 
              BUF_PUSH_2 (exactn, 0);
              pending_exact = b - 1;
             }
               laststart = b;
 
              BUF_PUSH_2 (exactn, 0);
              pending_exact = b - 1;
             }
-            
+
          BUF_PUSH (c);
           (*pending_exact)++;
          break;
         } /* switch (c) */
     } /* while p != pend */
 
          BUF_PUSH (c);
           (*pending_exact)++;
          break;
         } /* switch (c) */
     } /* while p != pend */
 
-  
+
   /* Through the pattern now.  */
   /* Through the pattern now.  */
-  
+
   if (fixup_alt_jump)
     STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
 
   if (fixup_alt_jump)
     STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
 
-  if (!COMPILE_STACK_EMPTY) 
+  if (!COMPILE_STACK_EMPTY)
     FREE_STACK_RETURN (REG_EPAREN);
 
   /* If we don't want backtracking, force success
     FREE_STACK_RETURN (REG_EPAREN);
 
   /* If we don't want backtracking, force success
@@ -2643,7 +2643,7 @@ regex_compile (pattern, size, syntax, bufp)
 #ifdef emacs
        if (! fail_stack.stack)
          fail_stack.stack
 #ifdef emacs
        if (! fail_stack.stack)
          fail_stack.stack
-           = (fail_stack_elt_t *) xmalloc (fail_stack.size 
+           = (fail_stack_elt_t *) xmalloc (fail_stack.size
                                            * sizeof (fail_stack_elt_t));
        else
          fail_stack.stack
                                            * sizeof (fail_stack_elt_t));
        else
          fail_stack.stack
@@ -2653,7 +2653,7 @@ regex_compile (pattern, size, syntax, bufp)
 #else /* not emacs */
        if (! fail_stack.stack)
          fail_stack.stack
 #else /* not emacs */
        if (! fail_stack.stack)
          fail_stack.stack
-           = (fail_stack_elt_t *) malloc (fail_stack.size 
+           = (fail_stack_elt_t *) malloc (fail_stack.size
                                           * sizeof (fail_stack_elt_t));
        else
          fail_stack.stack
                                           * sizeof (fail_stack_elt_t));
        else
          fail_stack.stack
@@ -2707,14 +2707,14 @@ insert_op1 (op, loc, arg, end)
     re_opcode_t op;
     unsigned char *loc;
     int arg;
     re_opcode_t op;
     unsigned char *loc;
     int arg;
-    unsigned char *end;    
+    unsigned char *end;
 {
   register unsigned char *pfrom = end;
   register unsigned char *pto = end + 3;
 
   while (pfrom != loc)
     *--pto = *--pfrom;
 {
   register unsigned char *pfrom = end;
   register unsigned char *pto = end + 3;
 
   while (pfrom != loc)
     *--pto = *--pfrom;
-    
+
   store_op1 (op, loc, arg);
 }
 
   store_op1 (op, loc, arg);
 }
 
@@ -2726,14 +2726,14 @@ insert_op2 (op, loc, arg1, arg2, end)
     re_opcode_t op;
     unsigned char *loc;
     int arg1, arg2;
     re_opcode_t op;
     unsigned char *loc;
     int arg1, arg2;
-    unsigned char *end;    
+    unsigned char *end;
 {
   register unsigned char *pfrom = end;
   register unsigned char *pto = end + 5;
 
   while (pfrom != loc)
     *--pto = *--pfrom;
 {
   register unsigned char *pfrom = end;
   register unsigned char *pto = end + 5;
 
   while (pfrom != loc)
     *--pto = *--pfrom;
-    
+
   store_op2 (op, loc, arg1, arg2);
 }
 
   store_op2 (op, loc, arg1, arg2);
 }
 
@@ -2749,7 +2749,7 @@ at_begline_loc_p (pattern, p, syntax)
 {
   const char *prev = p - 2;
   boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
 {
   const char *prev = p - 2;
   boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
-  
+
   return
        /* After a subexpression?  */
        (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
   return
        /* After a subexpression?  */
        (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
@@ -2769,7 +2769,7 @@ at_endline_loc_p (p, pend, syntax)
   const char *next = p;
   boolean next_backslash = *next == '\\';
   const char *next_next = p + 1 < pend ? p + 1 : 0;
   const char *next = p;
   boolean next_backslash = *next == '\\';
   const char *next_next = p + 1 < pend ? p + 1 : 0;
-  
+
   return
        /* Before a subexpression?  */
        (syntax & RE_NO_BK_PARENS ? *next == ')'
   return
        /* Before a subexpression?  */
        (syntax & RE_NO_BK_PARENS ? *next == ')'
@@ -2780,7 +2780,7 @@ at_endline_loc_p (p, pend, syntax)
 }
 
 
 }
 
 
-/* Returns true if REGNUM is in one of COMPILE_STACK's elements and 
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
    false if it's not.  */
 
 static boolean
    false if it's not.  */
 
 static boolean
@@ -2790,8 +2790,8 @@ group_in_compile_stack (compile_stack, regnum)
 {
   int this_element;
 
 {
   int this_element;
 
-  for (this_element = compile_stack.avail - 1;  
-       this_element >= 0; 
+  for (this_element = compile_stack.avail - 1;
+       this_element >= 0;
        this_element--)
     if (compile_stack.stack[this_element].regnum == regnum)
       return true;
        this_element--)
     if (compile_stack.stack[this_element].regnum == regnum)
       return true;
@@ -2805,9 +2805,9 @@ group_in_compile_stack (compile_stack, regnum)
    starting character is in `P[-2]'.  (`P[-1]' is the character `-'.)
    Then we set the translation of all bits between the starting and
    ending characters (inclusive) in the compiled pattern B.
    starting character is in `P[-2]'.  (`P[-1]' is the character `-'.)
    Then we set the translation of all bits between the starting and
    ending characters (inclusive) in the compiled pattern B.
-   
+
    Return an error code.
    Return an error code.
-   
+
    We use these short variable names so we can use the same macros as
    `regex_compile' itself.  */
 
    We use these short variable names so we can use the same macros as
    `regex_compile' itself.  */
 
@@ -2822,7 +2822,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
 
   const char *p = *p_ptr;
   int range_start, range_end;
 
   const char *p = *p_ptr;
   int range_start, range_end;
-  
+
   if (p == pend)
     return REG_ERANGE;
 
   if (p == pend)
     return REG_ERANGE;
 
@@ -2831,7 +2831,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
      is set, the range endpoints will be negative if we fetch using a
      signed char *.
 
      is set, the range endpoints will be negative if we fetch using a
      signed char *.
 
-     We also want to fetch the endpoints without translating them; the 
+     We also want to fetch the endpoints without translating them; the
      appropriate translation is done in the bit-setting loop below.  */
   /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *.  */
   range_start = ((const unsigned char *) p)[-2];
      appropriate translation is done in the bit-setting loop below.  */
   /* The SVR4 compiler on the 3B2 had trouble with unsigned const char *.  */
   range_start = ((const unsigned char *) p)[-2];
@@ -2853,7 +2853,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
     {
       SET_LIST_BIT (TRANSLATE (this_char));
     }
     {
       SET_LIST_BIT (TRANSLATE (this_char));
     }
-  
+
   return REG_NOERROR;
 }
 \f
   return REG_NOERROR;
 }
 \f
@@ -2864,7 +2864,7 @@ compile_range (p_ptr, pend, translate, syntax, b)
 
    The caller must supply the address of a (1 << BYTEWIDTH)-byte data
    area as BUFP->fastmap.
 
    The caller must supply the address of a (1 << BYTEWIDTH)-byte data
    area as BUFP->fastmap.
-   
+
    We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
    the pattern buffer.
 
    We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
    the pattern buffer.
 
@@ -2883,7 +2883,7 @@ re_compile_fastmap (bufp)
 #endif
   /* We don't push any register information onto the failure stack.  */
   unsigned num_regs = 0;
 #endif
   /* We don't push any register information onto the failure stack.  */
   unsigned num_regs = 0;
-  
+
   register char *fastmap = bufp->fastmap;
   unsigned char *pattern = bufp->buffer;
   unsigned long size = bufp->used;
   register char *fastmap = bufp->fastmap;
   unsigned char *pattern = bufp->buffer;
   unsigned long size = bufp->used;
@@ -2906,12 +2906,12 @@ re_compile_fastmap (bufp)
   boolean succeed_n_p = false;
 
   assert (fastmap != NULL && p != NULL);
   boolean succeed_n_p = false;
 
   assert (fastmap != NULL && p != NULL);
-  
+
   INIT_FAIL_STACK ();
   bzero (fastmap, 1 << BYTEWIDTH);  /* Assume nothing's valid.  */
   bufp->fastmap_accurate = 1;      /* It will be when we're done.  */
   bufp->can_be_null = 0;
   INIT_FAIL_STACK ();
   bzero (fastmap, 1 << BYTEWIDTH);  /* Assume nothing's valid.  */
   bufp->fastmap_accurate = 1;      /* It will be when we're done.  */
   bufp->can_be_null = 0;
-      
+
   while (1)
     {
       if (p == pend || *p == succeed)
   while (1)
     {
       if (p == pend || *p == succeed)
@@ -2934,7 +2934,7 @@ re_compile_fastmap (bufp)
 
       /* We should never be about to go beyond the end of the pattern.  */
       assert (p < pend);
 
       /* We should never be about to go beyond the end of the pattern.  */
       assert (p < pend);
-      
+
       switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
        {
 
       switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
        {
 
@@ -3057,10 +3057,10 @@ re_compile_fastmap (bufp)
         case jump_past_alt:
        case dummy_failure_jump:
           EXTRACT_NUMBER_AND_INCR (j, p);
         case jump_past_alt:
        case dummy_failure_jump:
           EXTRACT_NUMBER_AND_INCR (j, p);
-         p += j;       
+         p += j;
          if (j > 0)
            continue;
          if (j > 0)
            continue;
-            
+
           /* Jump backward implies we just went through the body of a
              loop and matched nothing.  Opcode jumped to should be
              `on_failure_jump' or `succeed_n'.  Just treat it like an
           /* Jump backward implies we just went through the body of a
              loop and matched nothing.  Opcode jumped to should be
              `on_failure_jump' or `succeed_n'.  Just treat it like an
@@ -3072,10 +3072,10 @@ re_compile_fastmap (bufp)
 
           p++;
           EXTRACT_NUMBER_AND_INCR (j, p);
 
           p++;
           EXTRACT_NUMBER_AND_INCR (j, p);
-          p += j;              
-         
+          p += j;
+
           /* If what's on the stack is where we are now, pop it.  */
           /* If what's on the stack is where we are now, pop it.  */
-          if (!FAIL_STACK_EMPTY () 
+          if (!FAIL_STACK_EMPTY ()
              && fail_stack.stack[fail_stack.avail - 1].pointer == p)
             fail_stack.avail--;
 
              && fail_stack.stack[fail_stack.avail - 1].pointer == p)
             fail_stack.avail--;
 
@@ -3116,7 +3116,7 @@ re_compile_fastmap (bufp)
 
        case succeed_n:
           /* Get to the number of times to succeed.  */
 
        case succeed_n:
           /* Get to the number of times to succeed.  */
-          p += 2;              
+          p += 2;
 
           /* Increment p past the n for when k != 0.  */
           EXTRACT_NUMBER_AND_INCR (k, p);
 
           /* Increment p past the n for when k != 0.  */
           EXTRACT_NUMBER_AND_INCR (k, p);
@@ -3210,7 +3210,7 @@ re_search (bufp, string, size, startpos, range, regs)
      int size, startpos, range;
      struct re_registers *regs;
 {
      int size, startpos, range;
      struct re_registers *regs;
 {
-  return re_search_2 (bufp, NULL, 0, string, size, startpos, range, 
+  return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
                      regs, size);
 }
 
                      regs, size);
 }
 
@@ -3218,17 +3218,17 @@ re_search (bufp, string, size, startpos, range, regs)
 /* Using the compiled pattern in BUFP->buffer, first tries to match the
    virtual concatenation of STRING1 and STRING2, starting first at index
    STARTPOS, then at STARTPOS + 1, and so on.
 /* Using the compiled pattern in BUFP->buffer, first tries to match the
    virtual concatenation of STRING1 and STRING2, starting first at index
    STARTPOS, then at STARTPOS + 1, and so on.
-   
+
    STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
    STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
-   
+
    RANGE is how far to scan while trying to match.  RANGE = 0 means try
    only at STARTPOS; in general, the last start tried is STARTPOS +
    RANGE.
    RANGE is how far to scan while trying to match.  RANGE = 0 means try
    only at STARTPOS; in general, the last start tried is STARTPOS +
    RANGE.
-   
+
    In REGS, return the indices of the virtual concatenation of STRING1
    and STRING2 that matched the entire BUFP->buffer and its contained
    subexpressions.
    In REGS, return the indices of the virtual concatenation of STRING1
    and STRING2 that matched the entire BUFP->buffer and its contained
    subexpressions.
-   
+
    Do not consider matching one past the index STOP in the virtual
    concatenation of STRING1 and STRING2.
 
    Do not consider matching one past the index STOP in the virtual
    concatenation of STRING1 and STRING2.
 
@@ -3255,7 +3255,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
   /* Check for out-of-range STARTPOS.  */
   if (startpos < 0 || startpos > total_size)
     return -1;
   /* Check for out-of-range STARTPOS.  */
   if (startpos < 0 || startpos > total_size)
     return -1;
-    
+
   /* Fix up RANGE if it might eventually take us outside
      the virtual concatenation of STRING1 and STRING2.  */
   if (endpos < -1)
   /* Fix up RANGE if it might eventually take us outside
      the virtual concatenation of STRING1 and STRING2.  */
   if (endpos < -1)
@@ -3277,10 +3277,10 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
   if (fastmap && !bufp->fastmap_accurate)
     if (re_compile_fastmap (bufp) == -2)
       return -2;
   if (fastmap && !bufp->fastmap_accurate)
     if (re_compile_fastmap (bufp) == -2)
       return -2;
-  
+
   /* Loop through the string, looking for a place to start matching.  */
   for (;;)
   /* Loop through the string, looking for a place to start matching.  */
   for (;;)
-    { 
+    {
       /* If a fastmap is supplied, skip quickly over characters that
          cannot be the start of a match.  If the pattern can match the
          null string, however, we don't need to skip characters; we want
       /* If a fastmap is supplied, skip quickly over characters that
          cannot be the start of a match.  If the pattern can match the
          null string, however, we don't need to skip characters; we want
@@ -3297,7 +3297,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
                 lim = range - (size1 - startpos);
 
              d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
                 lim = range - (size1 - startpos);
 
              d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
-   
+
               /* Written out as an if-else to avoid testing `translate'
                  inside the loop.  */
              if (translate)
               /* Written out as an if-else to avoid testing `translate'
                  inside the loop.  */
              if (translate)
@@ -3314,7 +3314,7 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
          else                          /* Searching backwards.  */
            {
              register char c = (size1 == 0 || startpos >= size1
          else                          /* Searching backwards.  */
            {
              register char c = (size1 == 0 || startpos >= size1
-                                 ? string2[startpos - size1] 
+                                 ? string2[startpos - size1]
                                  : string1[startpos]);
 
              if (!fastmap[(unsigned char) TRANSLATE (c)])
                                  : string1[startpos]);
 
              if (!fastmap[(unsigned char) TRANSLATE (c)])
@@ -3337,21 +3337,21 @@ re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
 
       if (val >= 0)
        return startpos;
 
       if (val >= 0)
        return startpos;
-        
+
       if (val == -2)
        return -2;
 
     advance:
       if (val == -2)
        return -2;
 
     advance:
-      if (!range) 
+      if (!range)
         break;
         break;
-      else if (range > 0) 
+      else if (range > 0)
         {
         {
-          range--; 
+          range--;
           startpos++;
         }
       else
         {
           startpos++;
         }
       else
         {
-          range++; 
+          range++;
           startpos--;
         }
     }
           startpos--;
         }
     }
@@ -3393,7 +3393,7 @@ static boolean alt_match_null_string_p (),
 /* Test if at very beginning or at very end of the virtual concatenation
    of `string1' and `string2'.  If only one string, it's `string2'.  */
 #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
 /* Test if at very beginning or at very end of the virtual concatenation
    of `string1' and `string2'.  If only one string, it's `string2'.  */
 #define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
-#define AT_STRINGS_END(d) ((d) == end2)        
+#define AT_STRINGS_END(d) ((d) == end2)
 
 
 /* Test if D points to a character which is word-constituent.  We have
 
 
 /* Test if D points to a character which is word-constituent.  We have
@@ -3468,7 +3468,7 @@ re_match (bufp, string, size, pos, regs)
    the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
    and SIZE2, respectively).  We start matching at POS, and stop
    matching at STOP.
    the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
    and SIZE2, respectively).  We start matching at POS, and stop
    matching at STOP.
-   
+
    If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
    store offsets for the substring each group matched in REGS.  See the
    documentation for exactly how many groups we fill.
    If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
    store offsets for the substring each group matched in REGS.  See the
    documentation for exactly how many groups we fill.
@@ -3518,7 +3518,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
   /* Where we are in the data, and the end of the current string.  */
   const char *d, *dend;
 
   /* Where we are in the data, and the end of the current string.  */
   const char *d, *dend;
-  
+
   /* Where we are in the pattern, and the end of the pattern.  */
   unsigned char *p = bufp->buffer;
   register unsigned char *pend = p + bufp->used;
   /* Where we are in the pattern, and the end of the pattern.  */
   unsigned char *p = bufp->buffer;
   register unsigned char *pend = p + bufp->used;
@@ -3557,7 +3557,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
      return, for use in backreferences.  The number here includes
      an element for register zero.  */
   unsigned num_regs = bufp->re_nsub + 1;
      return, for use in backreferences.  The number here includes
      an element for register zero.  */
   unsigned num_regs = bufp->re_nsub + 1;
-  
+
   /* The currently active registers.  */
   unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
   unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
   /* The currently active registers.  */
   unsigned lowest_active_reg = NO_LOWEST_ACTIVE_REG;
   unsigned highest_active_reg = NO_HIGHEST_ACTIVE_REG;
@@ -3589,18 +3589,18 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
      subexpression.  These two fields get reset each time through any
      loop their register is in.  */
 #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global.  */
      subexpression.  These two fields get reset each time through any
      loop their register is in.  */
 #ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global.  */
-  register_info_type *reg_info; 
+  register_info_type *reg_info;
 #endif
 
   /* The following record the register info as found in the above
 #endif
 
   /* The following record the register info as found in the above
-     variables when we find a match better than any we've seen before. 
+     variables when we find a match better than any we've seen before.
      This happens as we backtrack through the failure points, which in
      turn happens only if we have not yet matched the entire string. */
   unsigned best_regs_set = false;
 #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global.  */
   const char **best_regstart, **best_regend;
 #endif
      This happens as we backtrack through the failure points, which in
      turn happens only if we have not yet matched the entire string. */
   unsigned best_regs_set = false;
 #ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global.  */
   const char **best_regstart, **best_regend;
 #endif
-  
+
   /* Logically, this is `best_regend[0]'.  But we don't want to have to
      allocate space for that if we're not allocating space for anything
      else (see below).  Also, we never need info about register 0 for
   /* Logically, this is `best_regend[0]'.  But we don't want to have to
      allocate space for that if we're not allocating space for anything
      else (see below).  Also, we never need info about register 0 for
@@ -3622,13 +3622,13 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
 #ifdef DEBUG
   /* Counts the total number of registers pushed.  */
 
 #ifdef DEBUG
   /* Counts the total number of registers pushed.  */
-  unsigned num_regs_pushed = 0;        
+  unsigned num_regs_pushed = 0;
 #endif
 
   DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
 #endif
 
   DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
-  
+
   INIT_FAIL_STACK ();
   INIT_FAIL_STACK ();
-  
+
 #ifdef MATCH_MAY_ALLOCATE
   /* Do not bother to initialize all the register variables if there are
      no groups in the pattern, as it takes a fair amount of time.  If
 #ifdef MATCH_MAY_ALLOCATE
   /* Do not bother to initialize all the register variables if there are
      no groups in the pattern, as it takes a fair amount of time.  If
@@ -3647,8 +3647,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
       reg_dummy = REGEX_TALLOC (num_regs, const char *);
       reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
 
       reg_dummy = REGEX_TALLOC (num_regs, const char *);
       reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
 
-      if (!(regstart && regend && old_regstart && old_regend && reg_info 
-            && best_regstart && best_regend && reg_dummy && reg_info_dummy)) 
+      if (!(regstart && regend && old_regstart && old_regend && reg_info
+            && best_regstart && best_regend && reg_dummy && reg_info_dummy))
         {
           FREE_VARIABLES ();
           return -2;
         {
           FREE_VARIABLES ();
           return -2;
@@ -3670,21 +3670,21 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
       FREE_VARIABLES ();
       return -1;
     }
       FREE_VARIABLES ();
       return -1;
     }
-    
+
   /* Initialize subexpression text positions to -1 to mark ones that no
      start_memory/stop_memory has been seen for. Also initialize the
      register information struct.  */
   for (mcnt = 1; mcnt < num_regs; mcnt++)
     {
   /* Initialize subexpression text positions to -1 to mark ones that no
      start_memory/stop_memory has been seen for. Also initialize the
      register information struct.  */
   for (mcnt = 1; mcnt < num_regs; mcnt++)
     {
-      regstart[mcnt] = regend[mcnt] 
+      regstart[mcnt] = regend[mcnt]
         = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
         = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
-        
+
       REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
       IS_ACTIVE (reg_info[mcnt]) = 0;
       MATCHED_SOMETHING (reg_info[mcnt]) = 0;
       EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
     }
       REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
       IS_ACTIVE (reg_info[mcnt]) = 0;
       MATCHED_SOMETHING (reg_info[mcnt]) = 0;
       EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
     }
-  
+
   /* We move `string1' into `string2' if the latter's empty -- but not if
      `string1' is null.  */
   if (size2 == 0 && string1 != NULL)
   /* We move `string1' into `string2' if the latter's empty -- but not if
      `string1' is null.  */
   if (size2 == 0 && string1 != NULL)
@@ -3709,7 +3709,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
       end_match_2 = string2 + stop - size1;
     }
 
       end_match_2 = string2 + stop - size1;
     }
 
-  /* `p' scans through the pattern as `d' scans through the data. 
+  /* `p' scans through the pattern as `d' scans through the data.
      `dend' is the end of the input string that `d' points within.  `d'
      is advanced into the following input string whenever necessary, but
      this happens before fetching; therefore, at the beginning of the
      `dend' is the end of the input string that `d' points within.  `d'
      is advanced into the following input string whenever necessary, but
      this happens before fetching; therefore, at the beginning of the
@@ -3731,7 +3731,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
   DEBUG_PRINT1 ("The string to match is: `");
   DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
   DEBUG_PRINT1 ("'\n");
   DEBUG_PRINT1 ("The string to match is: `");
   DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
   DEBUG_PRINT1 ("'\n");
-  
+
   /* This loops over pattern commands.  It exits by returning from the
      function if the match is complete, or it drops through if the match
      fails at this starting point in the input data.  */
   /* This loops over pattern commands.  It exits by returning from the
      function if the match is complete, or it drops through if the match
      fails at this starting point in the input data.  */
@@ -3742,14 +3742,14 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
       if (p == pend)
        { /* End of pattern means we might have succeeded.  */
           DEBUG_PRINT1 ("end of pattern ... ");
       if (p == pend)
        { /* End of pattern means we might have succeeded.  */
           DEBUG_PRINT1 ("end of pattern ... ");
-          
+
          /* If we haven't matched the entire string, and we want the
              longest match, try backtracking.  */
           if (d != end_match_2)
            {
              /* 1 if this match ends in the same string (string1 or string2)
                 as the best previous match.  */
          /* If we haven't matched the entire string, and we want the
              longest match, try backtracking.  */
           if (d != end_match_2)
            {
              /* 1 if this match ends in the same string (string1 or string2)
                 as the best previous match.  */
-             boolean same_str_p = (FIRST_STRING_P (match_end) 
+             boolean same_str_p = (FIRST_STRING_P (match_end)
                                    == MATCHING_IN_FIRST_STRING);
              /* 1 if this match is the best seen so far.  */
              boolean best_match_p;
                                    == MATCHING_IN_FIRST_STRING);
              /* 1 if this match is the best seen so far.  */
              boolean best_match_p;
@@ -3762,7 +3762,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                best_match_p = !MATCHING_IN_FIRST_STRING;
 
               DEBUG_PRINT1 ("backtracking.\n");
                best_match_p = !MATCHING_IN_FIRST_STRING;
 
               DEBUG_PRINT1 ("backtracking.\n");
-              
+
               if (!FAIL_STACK_EMPTY ())
                 { /* More failure points to try.  */
 
               if (!FAIL_STACK_EMPTY ())
                 { /* More failure points to try.  */
 
@@ -3771,16 +3771,16 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                     {
                       best_regs_set = true;
                       match_end = d;
                     {
                       best_regs_set = true;
                       match_end = d;
-                      
+
                       DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
                       DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
-                      
+
                       for (mcnt = 1; mcnt < num_regs; mcnt++)
                         {
                           best_regstart[mcnt] = regstart[mcnt];
                           best_regend[mcnt] = regend[mcnt];
                         }
                     }
                       for (mcnt = 1; mcnt < num_regs; mcnt++)
                         {
                           best_regstart[mcnt] = regstart[mcnt];
                           best_regend[mcnt] = regend[mcnt];
                         }
                     }
-                  goto fail;          
+                  goto fail;
                 }
 
               /* If no failure points, don't restore garbage.  And if
                 }
 
               /* If no failure points, don't restore garbage.  And if
@@ -3795,7 +3795,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                      strings `x-' and `y-z-', if the two strings are
                      not consecutive in memory.  */
                   DEBUG_PRINT1 ("Restoring best registers.\n");
                      strings `x-' and `y-z-', if the two strings are
                      not consecutive in memory.  */
                   DEBUG_PRINT1 ("Restoring best registers.\n");
-                  
+
                   d = match_end;
                   dend = ((d >= string1 && d <= end1)
                           ? end_match_1 : end_match_2);
                   d = match_end;
                   dend = ((d >= string1 && d <= end1)
                           ? end_match_1 : end_match_2);
@@ -3862,7 +3862,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                                  ? ((regoff_t) (d - string1))
                                  : ((regoff_t) (d - string2 + size1)));
                 }
                                  ? ((regoff_t) (d - string1))
                                  : ((regoff_t) (d - string2 + size1)));
                 }
-              
+
               /* Go through the first `min (num_regs, regs->num_regs)'
                  registers, since that is all we initialized.  */
              for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
               /* Go through the first `min (num_regs, regs->num_regs)'
                  registers, since that is all we initialized.  */
              for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
@@ -3877,7 +3877,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                        = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]);
                     }
                }
                        = (regoff_t) POINTER_TO_OFFSET (regend[mcnt]);
                     }
                }
-              
+
               /* If the regs structure we return has more elements than
                  were in the pattern, set the extra elements to -1.  If
                  we (re)allocated the registers, this is the case,
               /* If the regs structure we return has more elements than
                  were in the pattern, set the extra elements to -1.  If
                  we (re)allocated the registers, this is the case,
@@ -3892,8 +3892,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                         nfailure_points_pushed - nfailure_points_popped);
           DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
 
                         nfailure_points_pushed - nfailure_points_popped);
           DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
 
-          mcnt = d - pos - (MATCHING_IN_FIRST_STRING 
-                           ? string1 
+          mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+                           ? string1
                            : string2 - size1);
 
           DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
                            : string2 - size1);
 
           DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
@@ -3983,7 +3983,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
            p += 1 + *p;
 
            if (!not) goto fail;
            p += 1 + *p;
 
            if (!not) goto fail;
-            
+
            SET_REGS_MATCHED ();
             d++;
            break;
            SET_REGS_MATCHED ();
             d++;
            break;
@@ -4000,9 +4000,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
           /* Find out if this group can match the empty string.  */
          p1 = p;               /* To send to group_match_null_string_p.  */
 
           /* Find out if this group can match the empty string.  */
          p1 = p;               /* To send to group_match_null_string_p.  */
-          
+
           if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
           if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
-            REG_MATCH_NULL_STRING_P (reg_info[*p]) 
+            REG_MATCH_NULL_STRING_P (reg_info[*p])
               = group_match_null_string_p (&p1, pend, reg_info);
 
           /* Save the position in the string where we were the last time
               = group_match_null_string_p (&p1, pend, reg_info);
 
           /* Save the position in the string where we were the last time
@@ -4013,7 +4013,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
           old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
                              ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
                              : regstart[*p];
           old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
                              ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
                              : regstart[*p];
-         DEBUG_PRINT2 ("  old_regstart: %d\n", 
+         DEBUG_PRINT2 ("  old_regstart: %d\n",
                         POINTER_TO_OFFSET (old_regstart[*p]));
 
           regstart[*p] = d;
                         POINTER_TO_OFFSET (old_regstart[*p]));
 
           regstart[*p] = d;
@@ -4024,10 +4024,10 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
          /* Clear this whenever we change the register activity status.  */
          set_regs_matched_done = 0;
 
          /* Clear this whenever we change the register activity status.  */
          set_regs_matched_done = 0;
-          
+
           /* This is the new highest active register.  */
           highest_active_reg = *p;
           /* This is the new highest active register.  */
           highest_active_reg = *p;
-          
+
           /* If nothing was active before, this is the new lowest active
              register.  */
           if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
           /* If nothing was active before, this is the new lowest active
              register.  */
           if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
@@ -4045,7 +4045,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
            number, and the number of inner groups.  */
        case stop_memory:
          DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
            number, and the number of inner groups.  */
        case stop_memory:
          DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
-             
+
           /* We need to save the string position the last time we were at
              this close-group operator in case the group is operated
              upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
           /* We need to save the string position the last time we were at
              this close-group operator in case the group is operated
              upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
@@ -4054,7 +4054,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
           old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
                            ? REG_UNSET (regend[*p]) ? d : regend[*p]
                           : regend[*p];
           old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
                            ? REG_UNSET (regend[*p]) ? d : regend[*p]
                           : regend[*p];
-         DEBUG_PRINT2 ("      old_regend: %d\n", 
+         DEBUG_PRINT2 ("      old_regend: %d\n",
                         POINTER_TO_OFFSET (old_regend[*p]));
 
           regend[*p] = d;
                         POINTER_TO_OFFSET (old_regend[*p]));
 
           regend[*p] = d;
@@ -4081,7 +4081,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
               unsigned char r = *p - 1;
               while (r > 0 && !IS_ACTIVE (reg_info[r]))
                 r--;
               unsigned char r = *p - 1;
               while (r > 0 && !IS_ACTIVE (reg_info[r]))
                 r--;
-              
+
               /* If we end up at register zero, that means that we saved
                  the registers as the result of an `on_failure_jump', not
                  a `start_memory', and we jumped to past the innermost
               /* If we end up at register zero, that means that we saved
                  the registers as the result of an `on_failure_jump', not
                  a `start_memory', and we jumped to past the innermost
@@ -4097,7 +4097,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
               else
                 highest_active_reg = r;
             }
               else
                 highest_active_reg = r;
             }
-          
+
           /* If just failed to match something this time around with a
              group that's operated on by a repetition operator, try to
              force exit from the ``loop'', and restore the register
           /* If just failed to match something this time around with a
              group that's operated on by a repetition operator, try to
              force exit from the ``loop'', and restore the register
@@ -4105,10 +4105,10 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
              last match.  */
           if ((!MATCHED_SOMETHING (reg_info[*p])
                || just_past_start_mem == p - 1)
              last match.  */
           if ((!MATCHED_SOMETHING (reg_info[*p])
                || just_past_start_mem == p - 1)
-             && (p + 2) < pend)              
+             && (p + 2) < pend)
             {
               boolean is_a_jump_n = false;
             {
               boolean is_a_jump_n = false;
-              
+
               p1 = p + 2;
               mcnt = 0;
               switch ((re_opcode_t) *p1++)
               p1 = p + 2;
               mcnt = 0;
               switch ((re_opcode_t) *p1++)
@@ -4123,12 +4123,12 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                    if (is_a_jump_n)
                      p1 += 2;
                     break;
                    if (is_a_jump_n)
                      p1 += 2;
                     break;
-                  
+
                   default:
                     /* do nothing */ ;
                 }
              p1 += mcnt;
                   default:
                     /* do nothing */ ;
                 }
              p1 += mcnt;
-        
+
               /* If the next operation is a jump backwards in the pattern
                 to an on_failure_jump right before the start_memory
                  corresponding to this stop_memory, exit from the loop
               /* If the next operation is a jump backwards in the pattern
                 to an on_failure_jump right before the start_memory
                  corresponding to this stop_memory, exit from the loop
@@ -4142,17 +4142,17 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                      failed match, e.g., with `(a*)*b' against `ab' for
                      regstart[1], and, e.g., with `((a*)*(b*)*)*'
                      against `aba' for regend[3].
                      failed match, e.g., with `(a*)*b' against `ab' for
                      regstart[1], and, e.g., with `((a*)*(b*)*)*'
                      against `aba' for regend[3].
-                     
+
                      Also restore the registers for inner groups for,
                      e.g., `((a*)(b*))*' against `aba' (register 3 would
                      otherwise get trashed).  */
                      Also restore the registers for inner groups for,
                      e.g., `((a*)(b*))*' against `aba' (register 3 would
                      otherwise get trashed).  */
-                     
+
                   if (EVER_MATCHED_SOMETHING (reg_info[*p]))
                    {
                   if (EVER_MATCHED_SOMETHING (reg_info[*p]))
                    {
-                     unsigned r; 
-        
+                     unsigned r;
+
                       EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
                       EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
-                      
+
                      /* Restore this and inner groups' (if any) registers.  */
                       for (r = *p; r < *p + *(p + 1); r++)
                         {
                      /* Restore this and inner groups' (if any) registers.  */
                       for (r = *p; r < *p + *(p + 1); r++)
                         {
@@ -4161,7 +4161,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                           /* xx why this test?  */
                           if (old_regend[r] >= regstart[r])
                             regend[r] = old_regend[r];
                           /* xx why this test?  */
                           if (old_regend[r] >= regstart[r])
                             regend[r] = old_regend[r];
-                        }     
+                        }
                     }
                  p1++;
                   EXTRACT_NUMBER_AND_INCR (mcnt, p1);
                     }
                  p1++;
                   EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -4170,7 +4170,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                   goto fail;
                 }
             }
                   goto fail;
                 }
             }
-          
+
           /* Move past the register number and the inner group count.  */
           p += 2;
           break;
           /* Move past the register number and the inner group count.  */
           p += 2;
           break;
@@ -4187,16 +4187,16 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
            /* Can't back reference a group which we've never matched.  */
             if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
               goto fail;
            /* Can't back reference a group which we've never matched.  */
             if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
               goto fail;
-              
+
             /* Where in input to try to start matching.  */
             d2 = regstart[regno];
             /* Where in input to try to start matching.  */
             d2 = regstart[regno];
-            
+
             /* Where to stop matching; if both the place to start and
                the place to stop matching are in the same string, then
                set to the place to stop, otherwise, for now have to use
                the end of the first string.  */
 
             /* Where to stop matching; if both the place to start and
                the place to stop matching are in the same string, then
                set to the place to stop, otherwise, for now have to use
                the end of the first string.  */
 
-            dend2 = ((FIRST_STRING_P (regstart[regno]) 
+            dend2 = ((FIRST_STRING_P (regstart[regno])
                      == FIRST_STRING_P (regend[regno]))
                     ? regend[regno] : end_match_1);
            for (;;)
                      == FIRST_STRING_P (regend[regno]))
                     ? regend[regno] : end_match_1);
            for (;;)
@@ -4220,16 +4220,16 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
                /* How many characters left in this segment to match.  */
                mcnt = dend - d;
 
                /* How many characters left in this segment to match.  */
                mcnt = dend - d;
-                
+
                /* Want how many consecutive characters we can match in
                    one shot, so, if necessary, adjust the count.  */
                 if (mcnt > dend2 - d2)
                  mcnt = dend2 - d2;
                /* Want how many consecutive characters we can match in
                    one shot, so, if necessary, adjust the count.  */
                 if (mcnt > dend2 - d2)
                  mcnt = dend2 - d2;
-                  
+
                /* Compare that many; failure if mismatch, else move
                    past them.  */
                /* Compare that many; failure if mismatch, else move
                    past them.  */
-               if (translate 
-                    ? bcmp_translate (d, d2, mcnt, translate) 
+               if (translate
+                    ? bcmp_translate (d, d2, mcnt, translate)
                     : bcmp (d, d2, mcnt))
                  goto fail;
                d += mcnt, d2 += mcnt;
                     : bcmp (d, d2, mcnt))
                  goto fail;
                d += mcnt, d2 += mcnt;
@@ -4246,7 +4246,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
            `newline_anchor' is set, after newlines.  */
        case begline:
           DEBUG_PRINT1 ("EXECUTING begline.\n");
            `newline_anchor' is set, after newlines.  */
        case begline:
           DEBUG_PRINT1 ("EXECUTING begline.\n");
-          
+
           if (AT_STRINGS_BEG (d))
             {
               if (!bufp->not_bol) break;
           if (AT_STRINGS_BEG (d))
             {
               if (!bufp->not_bol) break;
@@ -4267,7 +4267,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
             {
               if (!bufp->not_eol) break;
             }
             {
               if (!bufp->not_eol) break;
             }
-          
+
           /* We have to ``prefetch'' the next character.  */
           else if ((d == end1 ? *string2 : *d) == '\n'
                    && bufp->newline_anchor)
           /* We have to ``prefetch'' the next character.  */
           else if ((d == end1 ? *string2 : *d) == '\n'
                    && bufp->newline_anchor)
@@ -4301,7 +4301,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
            then the . fails against the \n.  But the next thing we want
            to do is match the \n against the \n; if we restored the
            string value, we would be back at the foo.
            then the . fails against the \n.  But the next thing we want
            to do is match the \n against the \n; if we restored the
            string value, we would be back at the foo.
-           
+
            Because this is used only in specific cases, we don't need to
            check all the things that `on_failure_jump' does, to make
            sure the right things get saved on the stack.  Hence we don't
            Because this is used only in specific cases, we don't need to
            check all the things that `on_failure_jump' does, to make
            sure the right things get saved on the stack.  Hence we don't
@@ -4311,7 +4311,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
            case; that seems worse than this.  */
         case on_failure_keep_string_jump:
           DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
            case; that seems worse than this.  */
         case on_failure_keep_string_jump:
           DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
-          
+
           EXTRACT_NUMBER_AND_INCR (mcnt, p);
           DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
 
           EXTRACT_NUMBER_AND_INCR (mcnt, p);
           DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
 
@@ -4320,7 +4320,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
 
        /* Uses of on_failure_jump:
 
 
        /* Uses of on_failure_jump:
-        
+
            Each alternative starts with an on_failure_jump that points
            to the beginning of the next alternative.  Each alternative
            except the last ends with a jump that in effect jumps past
            Each alternative starts with an on_failure_jump that points
            to the beginning of the next alternative.  Each alternative
            except the last ends with a jump that in effect jumps past
@@ -4386,7 +4386,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                would have to backtrack because of (as in, e.g., `a*a')
                then we can change to pop_failure_jump, because we'll
                never have to backtrack.
                would have to backtrack because of (as in, e.g., `a*a')
                then we can change to pop_failure_jump, because we'll
                never have to backtrack.
-               
+
                This is not true in the case of alternatives: in
                `(a|ab)*' we do need to backtrack to the `ab' alternative
                (e.g., if the string was `ab').  But instead of trying to
                This is not true in the case of alternatives: in
                `(a|ab)*' we do need to backtrack to the `ab' alternative
                (e.g., if the string was `ab').  But instead of trying to
@@ -4412,7 +4412,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
            p1 = p + mcnt;
            /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
 
            p1 = p + mcnt;
            /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
-              to the `maybe_finalize_jump' of this case.  Examine what 
+              to the `maybe_finalize_jump' of this case.  Examine what
               follows.  */
 
             /* If we're at the end of the pattern, we can change.  */
               follows.  */
 
             /* If we're at the end of the pattern, we can change.  */
@@ -4438,12 +4438,12 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                     DEBUG_PRINT3 ("  %c != %c => pop_failure_jump.\n",
                                   c, p1[5]);
                   }
                     DEBUG_PRINT3 ("  %c != %c => pop_failure_jump.\n",
                                   c, p1[5]);
                   }
-                  
+
                else if ((re_opcode_t) p1[3] == charset
                         || (re_opcode_t) p1[3] == charset_not)
                  {
                    int not = (re_opcode_t) p1[3] == charset_not;
                else if ((re_opcode_t) p1[3] == charset
                         || (re_opcode_t) p1[3] == charset_not)
                  {
                    int not = (re_opcode_t) p1[3] == charset_not;
-                    
+
                    if (c < (unsigned char) (p1[4] * BYTEWIDTH)
                        && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
                      not = !not;
                    if (c < (unsigned char) (p1[4] * BYTEWIDTH)
                        && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
                      not = !not;
@@ -4473,7 +4473,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                     DEBUG_PRINT3 ("  %c != %c => pop_failure_jump.\n",
                                   c, p1[5]);
                   }
                     DEBUG_PRINT3 ("  %c != %c => pop_failure_jump.\n",
                                   c, p1[5]);
                   }
-                  
+
                else if ((re_opcode_t) p1[3] == charset_not)
                  {
                    int idx;
                else if ((re_opcode_t) p1[3] == charset_not)
                  {
                    int idx;
@@ -4544,7 +4544,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
           }
           /* Note fall through.  */
 
           }
           /* Note fall through.  */
 
-          
+
         /* Unconditionally jump (without popping any failure points).  */
         case jump:
        unconditional_jump:
         /* Unconditionally jump (without popping any failure points).  */
         case jump:
        unconditional_jump:
@@ -4554,7 +4554,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
           DEBUG_PRINT2 ("(to 0x%x).\n", p);
          break;
 
           DEBUG_PRINT2 ("(to 0x%x).\n", p);
          break;
 
-       
+
         /* We need this opcode so we can detect where alternatives end
            in `group_match_null_string_p' et al.  */
         case jump_past_alt:
         /* We need this opcode so we can detect where alternatives end
            in `group_match_null_string_p' et al.  */
         case jump_past_alt:
@@ -4589,7 +4589,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
         /* Have to succeed matching what follows at least n times.
            After that, handle like `on_failure_jump'.  */
 
         /* Have to succeed matching what follows at least n times.
            After that, handle like `on_failure_jump'.  */
-        case succeed_n: 
+        case succeed_n:
           EXTRACT_NUMBER (mcnt, p + 2);
           DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
 
           EXTRACT_NUMBER (mcnt, p + 2);
           DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
 
@@ -4610,8 +4610,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
               goto on_failure;
             }
           break;
               goto on_failure;
             }
           break;
-        
-        case jump_n: 
+
+        case jump_n:
           EXTRACT_NUMBER (mcnt, p + 2);
           DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
 
           EXTRACT_NUMBER (mcnt, p + 2);
           DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
 
@@ -4620,13 +4620,13 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
             {
                mcnt--;
                STORE_NUMBER (p + 2, mcnt);
             {
                mcnt--;
                STORE_NUMBER (p + 2, mcnt);
-              goto unconditional_jump;      
+              goto unconditional_jump;
             }
           /* If don't have to jump any more, skip over the rest of command.  */
             }
           /* If don't have to jump any more, skip over the rest of command.  */
-         else      
-           p += 4;                  
+         else
+           p += 4;
           break;
           break;
-        
+
        case set_number_at:
          {
             DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
        case set_number_at:
          {
             DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
@@ -4670,13 +4670,13 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
          if (PTR_CHAR_POS ((unsigned char *) d) >= point)
            goto fail;
          break;
          if (PTR_CHAR_POS ((unsigned char *) d) >= point)
            goto fail;
          break;
-  
+
        case at_dot:
           DEBUG_PRINT1 ("EXECUTING at_dot.\n");
          if (PTR_CHAR_POS ((unsigned char *) d) != point)
            goto fail;
          break;
        case at_dot:
           DEBUG_PRINT1 ("EXECUTING at_dot.\n");
          if (PTR_CHAR_POS ((unsigned char *) d) != point)
            goto fail;
          break;
-  
+
        case after_dot:
           DEBUG_PRINT1 ("EXECUTING after_dot.\n");
           if (PTR_CHAR_POS ((unsigned char *) d) <= point)
        case after_dot:
           DEBUG_PRINT1 ("EXECUTING after_dot.\n");
           if (PTR_CHAR_POS ((unsigned char *) d) <= point)
@@ -4733,7 +4733,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
          SET_REGS_MATCHED ();
           d++;
          break;
          SET_REGS_MATCHED ();
           d++;
          break;
-         
+
        case notwordchar:
           DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
          PREFETCH ();
        case notwordchar:
           DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
          PREFETCH ();
@@ -4743,7 +4743,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
           d++;
          break;
 #endif /* not emacs */
           d++;
          break;
 #endif /* not emacs */
-          
+
         default:
           abort ();
        }
         default:
           abort ();
        }
@@ -4768,7 +4768,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
           if (p < pend)
             {
               boolean is_a_jump_n = false;
           if (p < pend)
             {
               boolean is_a_jump_n = false;
-              
+
               /* If failed to a backwards jump that's part of a repetition
                  loop, need to pop this failure point and use the next one.  */
               switch ((re_opcode_t) *p)
               /* If failed to a backwards jump that's part of a repetition
                  loop, need to pop this failure point and use the next one.  */
               switch ((re_opcode_t) *p)
@@ -4780,7 +4780,7 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
                 case jump:
                   p1 = p + 1;
                   EXTRACT_NUMBER_AND_INCR (mcnt, p1);
                 case jump:
                   p1 = p + 1;
                   EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-                  p1 += mcnt;  
+                  p1 += mcnt;
 
                   if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
                       || (!is_a_jump_n
 
                   if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
                       || (!is_a_jump_n
@@ -4811,10 +4811,10 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
 
 
 /* We are passed P pointing to a register number after a start_memory.
 
 
 /* We are passed P pointing to a register number after a start_memory.
-   
+
    Return true if the pattern up to the corresponding stop_memory can
    match the empty string, and false otherwise.
    Return true if the pattern up to the corresponding stop_memory can
    match the empty string, and false otherwise.
-   
+
    If we find the matching stop_memory, sets P to point to one past its number.
    Otherwise, sets P to an undefined byte less than or equal to END.
 
    If we find the matching stop_memory, sets P to point to one past its number.
    Otherwise, sets P to an undefined byte less than or equal to END.
 
@@ -4828,20 +4828,20 @@ group_match_null_string_p (p, end, reg_info)
   int mcnt;
   /* Point to after the args to the start_memory.  */
   unsigned char *p1 = *p + 2;
   int mcnt;
   /* Point to after the args to the start_memory.  */
   unsigned char *p1 = *p + 2;
-  
+
   while (p1 < end)
     {
       /* Skip over opcodes that can match nothing, and return true or
         false, as appropriate, when we get to one that can't, or to the
          matching stop_memory.  */
   while (p1 < end)
     {
       /* Skip over opcodes that can match nothing, and return true or
         false, as appropriate, when we get to one that can't, or to the
          matching stop_memory.  */
-      
+
       switch ((re_opcode_t) *p1)
         {
         /* Could be either a loop or a series of alternatives.  */
         case on_failure_jump:
           p1++;
           EXTRACT_NUMBER_AND_INCR (mcnt, p1);
       switch ((re_opcode_t) *p1)
         {
         /* Could be either a loop or a series of alternatives.  */
         case on_failure_jump:
           p1++;
           EXTRACT_NUMBER_AND_INCR (mcnt, p1);
-          
+
           /* If the next operation is not a jump backwards in the
             pattern.  */
 
           /* If the next operation is not a jump backwards in the
             pattern.  */
 
@@ -4855,7 +4855,7 @@ group_match_null_string_p (p, end, reg_info)
 
                  /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
                  /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
 
                  /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
                  /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
-                 /exactn/1/c                                           
+                 /exactn/1/c
 
                  So, we have to first go through the first (n-1)
                  alternatives and then deal with the last one separately.  */
 
                  So, we have to first go through the first (n-1)
                  alternatives and then deal with the last one separately.  */
@@ -4871,19 +4871,19 @@ group_match_null_string_p (p, end, reg_info)
                      is, including the ending `jump_past_alt' and
                      its number.  */
 
                      is, including the ending `jump_past_alt' and
                      its number.  */
 
-                  if (!alt_match_null_string_p (p1, p1 + mcnt - 3, 
+                  if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
                                                      reg_info))
                     return false;
 
                   /* Move to right after this alternative, including the
                     jump_past_alt.  */
                                                      reg_info))
                     return false;
 
                   /* Move to right after this alternative, including the
                     jump_past_alt.  */
-                  p1 += mcnt;  
+                  p1 += mcnt;
 
                   /* Break if it's the beginning of an n-th alternative
                      that doesn't begin with an on_failure_jump.  */
                   if ((re_opcode_t) *p1 != on_failure_jump)
                     break;
 
                   /* Break if it's the beginning of an n-th alternative
                      that doesn't begin with an on_failure_jump.  */
                   if ((re_opcode_t) *p1 != on_failure_jump)
                     break;
-               
+
                  /* Still have to check that it's not an n-th
                     alternative that starts with an on_failure_jump.  */
                  p1++;
                  /* Still have to check that it's not an n-th
                     alternative that starts with an on_failure_jump.  */
                  p1++;
@@ -4908,14 +4908,14 @@ group_match_null_string_p (p, end, reg_info)
             } /* if mcnt > 0 */
           break;
 
             } /* if mcnt > 0 */
           break;
 
-          
+
         case stop_memory:
          assert (p1[1] == **p);
           *p = p1 + 2;
           return true;
 
         case stop_memory:
          assert (p1[1] == **p);
           *p = p1 + 2;
           return true;
 
-        
-        default: 
+
+        default:
           if (!common_op_match_null_string_p (&p1, end, reg_info))
             return false;
         }
           if (!common_op_match_null_string_p (&p1, end, reg_info))
             return false;
         }
@@ -4928,7 +4928,7 @@ group_match_null_string_p (p, end, reg_info)
 /* Similar to group_match_null_string_p, but doesn't deal with alternatives:
    It expects P to be the first byte of a single alternative and END one
    byte past the last. The alternative can contain groups.  */
 /* Similar to group_match_null_string_p, but doesn't deal with alternatives:
    It expects P to be the first byte of a single alternative and END one
    byte past the last. The alternative can contain groups.  */
-   
+
 static boolean
 alt_match_null_string_p (p, end, reg_info)
     unsigned char *p, *end;
 static boolean
 alt_match_null_string_p (p, end, reg_info)
     unsigned char *p, *end;
@@ -4936,12 +4936,12 @@ alt_match_null_string_p (p, end, reg_info)
 {
   int mcnt;
   unsigned char *p1 = p;
 {
   int mcnt;
   unsigned char *p1 = p;
-  
+
   while (p1 < end)
     {
   while (p1 < end)
     {
-      /* Skip over opcodes that can match nothing, and break when we get 
+      /* Skip over opcodes that can match nothing, and break when we get
          to one that can't.  */
          to one that can't.  */
-      
+
       switch ((re_opcode_t) *p1)
         {
        /* It's a loop.  */
       switch ((re_opcode_t) *p1)
         {
        /* It's a loop.  */
@@ -4950,8 +4950,8 @@ alt_match_null_string_p (p, end, reg_info)
           EXTRACT_NUMBER_AND_INCR (mcnt, p1);
           p1 += mcnt;
           break;
           EXTRACT_NUMBER_AND_INCR (mcnt, p1);
           p1 += mcnt;
           break;
-          
-       default: 
+
+       default:
           if (!common_op_match_null_string_p (&p1, end, reg_info))
             return false;
         }
           if (!common_op_match_null_string_p (&p1, end, reg_info))
             return false;
         }
@@ -4962,8 +4962,8 @@ alt_match_null_string_p (p, end, reg_info)
 
 
 /* Deals with the ops common to group_match_null_string_p and
 
 
 /* Deals with the ops common to group_match_null_string_p and
-   alt_match_null_string_p.  
-   
+   alt_match_null_string_p.
+
    Sets P to one after the op and its arguments, if any.  */
 
 static boolean
    Sets P to one after the op and its arguments, if any.  */
 
 static boolean
@@ -4998,7 +4998,7 @@ common_op_match_null_string_p (p, end, reg_info)
       reg_no = *p1;
       assert (reg_no > 0 && reg_no <= MAX_REGNUM);
       ret = group_match_null_string_p (&p1, end, reg_info);
       reg_no = *p1;
       assert (reg_no > 0 && reg_no <= MAX_REGNUM);
       ret = group_match_null_string_p (&p1, end, reg_info);
-      
+
       /* Have to set this here in case we're checking a group which
          contains a group and a back reference to it.  */
 
       /* Have to set this here in case we're checking a group which
          contains a group and a back reference to it.  */
 
@@ -5008,7 +5008,7 @@ common_op_match_null_string_p (p, end, reg_info)
       if (!ret)
         return false;
       break;
       if (!ret)
         return false;
       break;
-          
+
     /* If this is an optimized succeed_n for zero times, make the jump.  */
     case jump:
       EXTRACT_NUMBER_AND_INCR (mcnt, p1);
     /* If this is an optimized succeed_n for zero times, make the jump.  */
     case jump:
       EXTRACT_NUMBER_AND_INCR (mcnt, p1);
@@ -5020,7 +5020,7 @@ common_op_match_null_string_p (p, end, reg_info)
 
     case succeed_n:
       /* Get to the number of times to succeed.  */
 
     case succeed_n:
       /* Get to the number of times to succeed.  */
-      p1 += 2;         
+      p1 += 2;
       EXTRACT_NUMBER_AND_INCR (mcnt, p1);
 
       if (mcnt == 0)
       EXTRACT_NUMBER_AND_INCR (mcnt, p1);
 
       if (mcnt == 0)
@@ -5033,7 +5033,7 @@ common_op_match_null_string_p (p, end, reg_info)
         return false;
       break;
 
         return false;
       break;
 
-    case duplicate: 
+    case duplicate:
       if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
         return false;
       break;
       if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
         return false;
       break;
@@ -5053,7 +5053,7 @@ common_op_match_null_string_p (p, end, reg_info)
 
 /* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
    bytes; nonzero otherwise.  */
 
 /* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
    bytes; nonzero otherwise.  */
-   
+
 static int
 bcmp_translate (s1, s2, len, translate)
      unsigned char *s1, *s2;
 static int
 bcmp_translate (s1, s2, len, translate)
      unsigned char *s1, *s2;
@@ -5074,10 +5074,10 @@ bcmp_translate (s1, s2, len, translate)
 /* re_compile_pattern is the GNU regular expression compiler: it
    compiles PATTERN (of length SIZE) and puts the result in BUFP.
    Returns 0 if the pattern was valid, otherwise an error string.
 /* re_compile_pattern is the GNU regular expression compiler: it
    compiles PATTERN (of length SIZE) and puts the result in BUFP.
    Returns 0 if the pattern was valid, otherwise an error string.
-   
+
    Assumes the `allocated' (and perhaps `buffer') and `translate' fields
    are set in BUFP on entry.
    Assumes the `allocated' (and perhaps `buffer') and `translate' fields
    are set in BUFP on entry.
-   
+
    We call regex_compile to do the actual compilation.  */
 
 const char *
    We call regex_compile to do the actual compilation.  */
 
 const char *
@@ -5087,25 +5087,25 @@ re_compile_pattern (pattern, length, bufp)
      struct re_pattern_buffer *bufp;
 {
   reg_errcode_t ret;
      struct re_pattern_buffer *bufp;
 {
   reg_errcode_t ret;
-  
+
   /* GNU code is written to assume at least RE_NREGS registers will be set
      (and at least one extra will be -1).  */
   bufp->regs_allocated = REGS_UNALLOCATED;
   /* GNU code is written to assume at least RE_NREGS registers will be set
      (and at least one extra will be -1).  */
   bufp->regs_allocated = REGS_UNALLOCATED;
-  
+
   /* And GNU code determines whether or not to get register information
      by passing null for the REGS argument to re_match, etc., not by
      setting no_sub.  */
   bufp->no_sub = 0;
   /* And GNU code determines whether or not to get register information
      by passing null for the REGS argument to re_match, etc., not by
      setting no_sub.  */
   bufp->no_sub = 0;
-  
+
   /* Match anchors at newline.  */
   bufp->newline_anchor = 1;
   /* Match anchors at newline.  */
   bufp->newline_anchor = 1;
-  
+
   ret = regex_compile (pattern, length, re_syntax_options, bufp);
 
   if (!ret)
     return NULL;
   return gettext (re_error_msgid[(int) ret]);
   ret = regex_compile (pattern, length, re_syntax_options, bufp);
 
   if (!ret)
     return NULL;
   return gettext (re_error_msgid[(int) ret]);
-}     
+}
 \f
 /* Entry points compatible with 4.2 BSD regex library.  We don't define
    them unless specifically requested.  */
 \f
 /* Entry points compatible with 4.2 BSD regex library.  We don't define
    them unless specifically requested.  */
@@ -5120,7 +5120,7 @@ re_comp (s)
     const char *s;
 {
   reg_errcode_t ret;
     const char *s;
 {
   reg_errcode_t ret;
-  
+
   if (!s)
     {
       if (!re_comp_buf.buffer)
   if (!s)
     {
       if (!re_comp_buf.buffer)
@@ -5147,7 +5147,7 @@ re_comp (s)
   re_comp_buf.newline_anchor = 1;
 
   ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
   re_comp_buf.newline_anchor = 1;
 
   ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
-  
+
   if (!ret)
     return NULL;
 
   if (!ret)
     return NULL;
 
@@ -5207,7 +5207,7 @@ re_exec (s)
 int
 regcomp (preg, pattern, cflags)
     regex_t *preg;
 int
 regcomp (preg, pattern, cflags)
     regex_t *preg;
-    const char *pattern; 
+    const char *pattern;
     int cflags;
 {
   reg_errcode_t ret;
     int cflags;
 {
   reg_errcode_t ret;
@@ -5219,17 +5219,17 @@ regcomp (preg, pattern, cflags)
   preg->buffer = 0;
   preg->allocated = 0;
   preg->used = 0;
   preg->buffer = 0;
   preg->allocated = 0;
   preg->used = 0;
-  
+
   /* Don't bother to use a fastmap when searching.  This simplifies the
      REG_NEWLINE case: if we used a fastmap, we'd have to put all the
      characters after newlines into the fastmap.  This way, we just try
      every character.  */
   preg->fastmap = 0;
   /* Don't bother to use a fastmap when searching.  This simplifies the
      REG_NEWLINE case: if we used a fastmap, we'd have to put all the
      characters after newlines into the fastmap.  This way, we just try
      every character.  */
   preg->fastmap = 0;
-  
+
   if (cflags & REG_ICASE)
     {
       unsigned i;
   if (cflags & REG_ICASE)
     {
       unsigned i;
-      
+
       preg->translate = (char *) malloc (CHAR_SET_SIZE);
       if (preg->translate == NULL)
         return (int) REG_ESPACE;
       preg->translate = (char *) malloc (CHAR_SET_SIZE);
       if (preg->translate == NULL)
         return (int) REG_ESPACE;
@@ -5254,38 +5254,38 @@ regcomp (preg, pattern, cflags)
 
   preg->no_sub = !!(cflags & REG_NOSUB);
 
 
   preg->no_sub = !!(cflags & REG_NOSUB);
 
-  /* POSIX says a null character in the pattern terminates it, so we 
+  /* POSIX says a null character in the pattern terminates it, so we
      can use strlen here in compiling the pattern.  */
   ret = regex_compile (pattern, strlen (pattern), syntax, preg);
      can use strlen here in compiling the pattern.  */
   ret = regex_compile (pattern, strlen (pattern), syntax, preg);
-  
+
   /* POSIX doesn't distinguish between an unmatched open-group and an
      unmatched close-group: both are REG_EPAREN.  */
   if (ret == REG_ERPAREN) ret = REG_EPAREN;
   /* POSIX doesn't distinguish between an unmatched open-group and an
      unmatched close-group: both are REG_EPAREN.  */
   if (ret == REG_ERPAREN) ret = REG_EPAREN;
-  
+
   return (int) ret;
 }
 
 
 /* regexec searches for a given pattern, specified by PREG, in the
    string STRING.
   return (int) ret;
 }
 
 
 /* regexec searches for a given pattern, specified by PREG, in the
    string STRING.
-   
+
    If NMATCH is zero or REG_NOSUB was set in the cflags argument to
    `regcomp', we ignore PMATCH.  Otherwise, we assume PMATCH has at
    least NMATCH elements, and we set them to the offsets of the
    corresponding matched substrings.
    If NMATCH is zero or REG_NOSUB was set in the cflags argument to
    `regcomp', we ignore PMATCH.  Otherwise, we assume PMATCH has at
    least NMATCH elements, and we set them to the offsets of the
    corresponding matched substrings.
-   
+
    EFLAGS specifies `execution flags' which affect matching: if
    REG_NOTBOL is set, then ^ does not match at the beginning of the
    string; if REG_NOTEOL is set, then $ does not match at the end.
    EFLAGS specifies `execution flags' which affect matching: if
    REG_NOTBOL is set, then ^ does not match at the beginning of the
    string; if REG_NOTEOL is set, then $ does not match at the end.
-   
+
    We return 0 if we find a match and REG_NOMATCH if not.  */
 
 int
 regexec (preg, string, nmatch, pmatch, eflags)
     const regex_t *preg;
    We return 0 if we find a match and REG_NOMATCH if not.  */
 
 int
 regexec (preg, string, nmatch, pmatch, eflags)
     const regex_t *preg;
-    const char *string; 
-    size_t nmatch; 
-    regmatch_t pmatch[]; 
+    const char *string;
+    size_t nmatch;
+    regmatch_t pmatch[];
     int eflags;
 {
   int ret;
     int eflags;
 {
   int ret;
@@ -5295,15 +5295,15 @@ regexec (preg, string, nmatch, pmatch, eflags)
   boolean want_reg_info = !preg->no_sub && nmatch > 0;
 
   private_preg = *preg;
   boolean want_reg_info = !preg->no_sub && nmatch > 0;
 
   private_preg = *preg;
-  
+
   private_preg.not_bol = !!(eflags & REG_NOTBOL);
   private_preg.not_eol = !!(eflags & REG_NOTEOL);
   private_preg.not_bol = !!(eflags & REG_NOTBOL);
   private_preg.not_eol = !!(eflags & REG_NOTEOL);
-  
+
   /* The user has told us exactly how many registers to return
      information about, via `nmatch'.  We have to pass that on to the
      matching routines.  */
   private_preg.regs_allocated = REGS_FIXED;
   /* The user has told us exactly how many registers to return
      information about, via `nmatch'.  We have to pass that on to the
      matching routines.  */
   private_preg.regs_allocated = REGS_FIXED;
-  
+
   if (want_reg_info)
     {
       regs.num_regs = nmatch;
   if (want_reg_info)
     {
       regs.num_regs = nmatch;
@@ -5317,7 +5317,7 @@ regexec (preg, string, nmatch, pmatch, eflags)
   ret = re_search (&private_preg, string, len,
                    /* start: */ 0, /* range: */ len,
                    want_reg_info ? &regs : (struct re_registers *) 0);
   ret = re_search (&private_preg, string, len,
                    /* start: */ 0, /* range: */ len,
                    want_reg_info ? &regs : (struct re_registers *) 0);
-  
+
   /* Copy the register information to the POSIX structure.  */
   if (want_reg_info)
     {
   /* Copy the register information to the POSIX structure.  */
   if (want_reg_info)
     {
@@ -5357,7 +5357,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
 
   if (errcode < 0
       || errcode >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0])))
 
   if (errcode < 0
       || errcode >= (sizeof (re_error_msgid) / sizeof (re_error_msgid[0])))
-    /* Only error codes returned by the rest of the code should be passed 
+    /* Only error codes returned by the rest of the code should be passed
        to this routine.  If we are given anything else, or if other regex
        code generates an invalid error code, then the program has a bug.
        Dump core so we can fix it.  */
        to this routine.  If we are given anything else, or if other regex
        code generates an invalid error code, then the program has a bug.
        Dump core so we can fix it.  */
@@ -5366,7 +5366,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
   msg = gettext (re_error_msgid[errcode]);
 
   msg_size = strlen (msg) + 1; /* Includes the null.  */
   msg = gettext (re_error_msgid[errcode]);
 
   msg_size = strlen (msg) + 1; /* Includes the null.  */
-  
+
   if (errbuf_size != 0)
     {
       if (msg_size > errbuf_size)
   if (errbuf_size != 0)
     {
       if (msg_size > errbuf_size)
@@ -5391,7 +5391,7 @@ regfree (preg)
   if (preg->buffer != NULL)
     free (preg->buffer);
   preg->buffer = NULL;
   if (preg->buffer != NULL)
     free (preg->buffer);
   preg->buffer = NULL;
-  
+
   preg->allocated = 0;
   preg->used = 0;
 
   preg->allocated = 0;
   preg->used = 0;
 
index 31eaf84..bec21ec 100644 (file)
@@ -42,7 +42,7 @@ typedef unsigned reg_syntax_t;
 #define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
 
 /* If this bit is not set, then + and ? are operators, and \+ and \? are
 #define RE_BACKSLASH_ESCAPE_IN_LISTS (1)
 
 /* If this bit is not set, then + and ? are operators, and \+ and \? are
-     literals. 
+     literals.
    If set, then \+ and \? are operators and + and ? are literals.  */
 #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
 
    If set, then \+ and \? are operators and + and ? are literals.  */
 #define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
 
@@ -58,7 +58,7 @@ typedef unsigned reg_syntax_t;
         ^  is an anchor if it is at the beginning of a regular
            expression or after an open-group or an alternation operator;
         $  is an anchor if it is at the end of a regular expression, or
         ^  is an anchor if it is at the beginning of a regular
            expression or after an open-group or an alternation operator;
         $  is an anchor if it is at the end of a regular expression, or
-           before a close-group or an alternation operator.  
+           before a close-group or an alternation operator.
 
    This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
    POSIX draft 11.2 says that * etc. in leading positions is undefined.
 
    This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
    POSIX draft 11.2 says that * etc. in leading positions is undefined.
@@ -69,7 +69,7 @@ typedef unsigned reg_syntax_t;
 /* If this bit is set, then special characters are always special
      regardless of where they are in the pattern.
    If this bit is not set, then special characters are special only in
 /* If this bit is set, then special characters are always special
      regardless of where they are in the pattern.
    If this bit is not set, then special characters are special only in
-     some contexts; otherwise they are ordinary.  Specifically, 
+     some contexts; otherwise they are ordinary.  Specifically,
      * + ? and intervals are only special when not after the beginning,
      open-group, or alternation operator.  */
 #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
      * + ? and intervals are only special when not after the beginning,
      open-group, or alternation operator.  */
 #define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
@@ -91,7 +91,7 @@ typedef unsigned reg_syntax_t;
 #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
 
 /* If this bit is set, either \{...\} or {...} defines an
 #define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
 
 /* If this bit is set, either \{...\} or {...} defines an
-     interval, depending on RE_NO_BK_BRACES. 
+     interval, depending on RE_NO_BK_BRACES.
    If not set, \{, \}, {, and } are literals.  */
 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
 
    If not set, \{, \}, {, and } are literals.  */
 #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
 
@@ -116,7 +116,7 @@ typedef unsigned reg_syntax_t;
    If not set, then \<digit> is a back-reference.  */
 #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
 
    If not set, then \<digit> is a back-reference.  */
 #define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
 
-/* If this bit is set, then | is an alternation operator, and \| is literal. 
+/* If this bit is set, then | is an alternation operator, and \| is literal.
    If not set, then \| is an alternation operator, and | is literal.  */
 #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
 
    If not set, then \| is an alternation operator, and | is literal.  */
 #define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
 
@@ -142,7 +142,7 @@ extern reg_syntax_t re_syntax_options;
 \f
 /* Define combinations of the above bits for the standard possibilities.
    (The [[[ comments delimit what gets put into the Texinfo file, so
 \f
 /* Define combinations of the above bits for the standard possibilities.
    (The [[[ comments delimit what gets put into the Texinfo file, so
-   don't delete them!)  */ 
+   don't delete them!)  */
 /* [[[begin syntaxes]]] */
 #define RE_SYNTAX_EMACS 0
 
 /* [[[begin syntaxes]]] */
 #define RE_SYNTAX_EMACS 0
 
@@ -209,7 +209,7 @@ extern reg_syntax_t re_syntax_options;
 #ifdef RE_DUP_MAX
 #undef RE_DUP_MAX
 #endif
 #ifdef RE_DUP_MAX
 #undef RE_DUP_MAX
 #endif
-#define RE_DUP_MAX ((1 << 15) - 1) 
+#define RE_DUP_MAX ((1 << 15) - 1)
 
 
 /* POSIX `cflags' bits (i.e., information for `regcomp').  */
 
 
 /* POSIX `cflags' bits (i.e., information for `regcomp').  */
@@ -221,7 +221,7 @@ extern reg_syntax_t re_syntax_options;
 /* If this bit is set, then ignore case when matching.
    If not set, then case is significant.  */
 #define REG_ICASE (REG_EXTENDED << 1)
 /* If this bit is set, then ignore case when matching.
    If not set, then case is significant.  */
 #define REG_ICASE (REG_EXTENDED << 1)
+
 /* If this bit is set, then anchors do not match at newline
      characters in the string.
    If not set, then anchors do match at newlines.  */
 /* If this bit is set, then anchors do not match at newline
      characters in the string.
    If not set, then anchors do match at newlines.  */
@@ -260,7 +260,7 @@ typedef enum
   REG_EESCAPE,         /* Trailing backslash.  */
   REG_ESUBREG,         /* Invalid back reference.  */
   REG_EBRACK,          /* Unmatched left bracket.  */
   REG_EESCAPE,         /* Trailing backslash.  */
   REG_ESUBREG,         /* Invalid back reference.  */
   REG_EBRACK,          /* Unmatched left bracket.  */
-  REG_EPAREN,          /* Parenthesis imbalance.  */ 
+  REG_EPAREN,          /* Parenthesis imbalance.  */
   REG_EBRACE,          /* Unmatched \{.  */
   REG_BADBR,           /* Invalid contents of \{\}.  */
   REG_ERANGE,          /* Invalid range end.  */
   REG_EBRACE,          /* Unmatched \{.  */
   REG_BADBR,           /* Invalid contents of \{\}.  */
   REG_ERANGE,          /* Invalid range end.  */
@@ -291,7 +291,7 @@ struct re_pattern_buffer
   unsigned long allocated;
 
        /* Number of bytes actually used in `buffer'.  */
   unsigned long allocated;
 
        /* Number of bytes actually used in `buffer'.  */
-  unsigned long used;  
+  unsigned long used;
 
         /* Syntax setting with which the pattern was compiled.  */
   reg_syntax_t syntax;
 
         /* Syntax setting with which the pattern was compiled.  */
   reg_syntax_t syntax;
@@ -335,7 +335,7 @@ struct re_pattern_buffer
   unsigned no_sub : 1;
 
         /* If set, a beginning-of-line anchor doesn't match at the
   unsigned no_sub : 1;
 
         /* If set, a beginning-of-line anchor doesn't match at the
-           beginning of the string.  */ 
+           beginning of the string.  */
   unsigned not_bol : 1;
 
         /* Similarly for an end-of-line anchor.  */
   unsigned not_bol : 1;
 
         /* Similarly for an end-of-line anchor.  */
@@ -442,7 +442,7 @@ extern int re_match
 
 
 /* Relates to `re_match' as `re_search_2' relates to `re_search'.  */
 
 
 /* Relates to `re_match' as `re_search_2' relates to `re_search'.  */
-extern int re_match_2 
+extern int re_match_2
   _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
              int length1, const char *string2, int length2,
              int start, struct re_registers *regs, int stop));
   _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
              int length1, const char *string2, int length2,
              int start, struct re_registers *regs, int stop));
index 8994964..d570ef3 100644 (file)
@@ -13,7 +13,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
 #include <config.h>
  */
 
 #include <config.h>
index 0fbb407..9048256 100644 (file)
@@ -1,11 +1,11 @@
 /* Panel managing.
    Copyright (C) 1994, 1995 Miguel de Icaza.
 /* Panel managing.
    Copyright (C) 1994, 1995 Miguel de Icaza.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -99,7 +99,7 @@ int panel_event (Gpm_Event *event, WPanel *panel);
 #endif
 
 #ifndef PORT_HAS_PANEL_RESET_SORT_LABELS
 #endif
 
 #ifndef PORT_HAS_PANEL_RESET_SORT_LABELS
-#   define x_reset_sort_labels(x) 
+#   define x_reset_sort_labels(x)
 #endif
 
 /* This macro extracts the number of available lines in a panel */
 #endif
 
 /* This macro extracts the number of available lines in a panel */
@@ -147,7 +147,7 @@ void
 delete_format (format_e *format)
 {
     format_e *next;
 delete_format (format_e *format)
 {
     format_e *next;
-    
+
     while (format){
         next = format->next;
         free (format);
     while (format){
         next = format->next;
         free (format);
@@ -160,9 +160,9 @@ void
 add_permission_string (char *dest, int width, file_entry *fe, int attr, int color, int is_octal)
 {
     int i, r, l;
 add_permission_string (char *dest, int width, file_entry *fe, int attr, int color, int is_octal)
 {
     int i, r, l;
-    
+
     l = get_user_rights (&fe->buf);
     l = get_user_rights (&fe->buf);
-    
+
     if (is_octal){
        /* Place of the access bit in octal mode */
         l = width + l - 3;
     if (is_octal){
        /* Place of the access bit in octal mode */
         l = width + l - 3;
@@ -172,7 +172,7 @@ add_permission_string (char *dest, int width, file_entry *fe, int attr, int colo
         l = l * 3 + 1;
        r = l + 3;
     }
         l = l * 3 + 1;
        r = l + 3;
     }
-    
+
     for(i = 0; i < width; i++){
        if (i >= l && i < r){
             if (attr == SELECTED || attr == MARKED_SELECTED)
     for(i = 0; i < width; i++){
        if (i >= l && i < r){
             if (attr == SELECTED || attr == MARKED_SELECTED)
@@ -181,7 +181,7 @@ add_permission_string (char *dest, int width, file_entry *fe, int attr, int colo
                 attrset (MARKED_COLOR);
         } else
             attrset (color);
                 attrset (MARKED_COLOR);
         } else
             attrset (color);
-       
+
        addch (dest[i]);
     }
 }
        addch (dest[i]);
     }
 }
@@ -294,11 +294,11 @@ string_file_size (file_entry *fe, int len)
 
 #ifdef HAVE_ST_RDEV
     if (S_ISBLK (fe->buf.st_mode) || S_ISCHR (fe->buf.st_mode))
 
 #ifdef HAVE_ST_RDEV
     if (S_ISBLK (fe->buf.st_mode) || S_ISCHR (fe->buf.st_mode))
-        sprintf (buffer, "%3d,%3d", (int) (fe->buf.st_rdev >> 8), 
+        sprintf (buffer, "%3d,%3d", (int) (fe->buf.st_rdev >> 8),
             (int) (fe->buf.st_rdev & 0xff));
     else
             (int) (fe->buf.st_rdev & 0xff));
     else
-#endif 
-    {   
+#endif
+    {
         sprintf (buffer, "%lu", (unsigned long) fe->buf.st_size);
         if (len && (i = strlen (buffer)) > len) {
             if (i - 2 > len) {
         sprintf (buffer, "%lu", (unsigned long) fe->buf.st_size);
         if (len && (i = strlen (buffer)) > len) {
             if (i - 2 > len) {
@@ -471,7 +471,7 @@ int
 file_compute_color (int attr, file_entry *fe)
 {
     int color;
 file_compute_color (int attr, file_entry *fe)
 {
     int color;
-    
+
     switch (attr){
     case SELECTED:
        color = SELECTED_COLOR;
     switch (attr){
     case SELECTED:
        color = SELECTED_COLOR;
@@ -502,10 +502,10 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
     char     *cdest = dest;
     format_e *format, *home;
     file_entry *fe;
     char     *cdest = dest;
     format_e *format, *home;
     file_entry *fe;
-    
+
     length     = 0;
     empty_line = (file_index >= panel->count);
     length     = 0;
     empty_line = (file_index >= panel->count);
-    home       = (isstatus) ? panel->status_format : panel->format;   
+    home       = (isstatus) ? panel->status_format : panel->format;
     fe         = &panel->dir.list [file_index];
 
     if (!empty_line)
     fe         = &panel->dir.list [file_index];
 
     if (!empty_line)
@@ -515,7 +515,7 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
     for (format = home; format; format = format->next){
        if (format->string_fn){
            int len;
     for (format = home; format; format = format->next){
        if (format->string_fn){
            int len;
-           
+
            if (empty_line)
                txt = " ";
            else
            if (empty_line)
                txt = " ";
            else
@@ -536,9 +536,9 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
             /* What shall we do? Will we color each line according to
             * the file type? Any suggestions to mc@timur.kazan.su
             */
             /* What shall we do? Will we color each line according to
             * the file type? Any suggestions to mc@timur.kazan.su
             */
-           
+
             attrset (color);
             attrset (color);
+
             if (permission_mode && !strcmp(format->id, "perm"))
                 add_permission_string (old_pos, format->field_len, fe, attr, color, 0);
             else if (permission_mode && !strcmp(format->id, "mode"))
             if (permission_mode && !strcmp(format->id, "perm"))
                 add_permission_string (old_pos, format->field_len, fe, attr, color, 0);
             else if (permission_mode && !strcmp(format->id, "mode"))
@@ -560,7 +560,7 @@ format_file (char *dest, WPanel *panel, int file_index, int width, int attr, int
            length++;
        }
     }
            length++;
        }
     }
-    
+
     if (length < width){
        int still = width - length;
        while (still--)
     if (length < width){
        int still = width - length;
        while (still--)
@@ -583,14 +583,14 @@ repaint_file (WPanel *panel, int file_index, int mv, int attr, int isstatus)
 
     offset = 0;
     if (!isstatus && panel->split){
 
     offset = 0;
     if (!isstatus && panel->split){
-       
+
        second_column = (file_index - panel->top_file) / llines (panel);
        width = (panel->widget.cols - 2)/2 - 1;
        second_column = (file_index - panel->top_file) / llines (panel);
        width = (panel->widget.cols - 2)/2 - 1;
-       
+
        if (second_column){
            offset = 1 + width;
            width = (panel->widget.cols-2) - (panel->widget.cols-2)/2 - 1;
        if (second_column){
            offset = 1 + width;
            width = (panel->widget.cols-2) - (panel->widget.cols-2)/2 - 1;
-       } 
+       }
     } else
         width = (panel->widget.cols - 2);
 
     } else
         width = (panel->widget.cols - 2);
 
@@ -603,9 +603,9 @@ repaint_file (WPanel *panel, int file_index, int mv, int attr, int isstatus)
        } else
            widget_move (&panel->widget, file_index - panel->top_file + 2, 1);
     }
        } else
            widget_move (&panel->widget, file_index - panel->top_file + 2, 1);
     }
-    
+
     format_file (buffer, panel, file_index, width, attr, isstatus);
     format_file (buffer, panel, file_index, width, attr, isstatus);
-    
+
     if (!isstatus && panel->split){
        if (second_column)
            addch (' ');
     if (!isstatus && panel->split){
        if (second_column)
            addch (' ');
@@ -623,9 +623,9 @@ display_mini_info (WPanel *panel)
 {
     if (!show_mini_info)
        return;
 {
     if (!show_mini_info)
        return;
-    
+
     widget_move (&panel->widget, llines (panel)+3, 1);
     widget_move (&panel->widget, llines (panel)+3, 1);
-    
+
     if (panel->searching){
        attrset (INPUT_COLOR);
        printw ("/%-*s", panel->widget.cols-3, panel->search_buffer);
     if (panel->searching){
        attrset (INPUT_COLOR);
        printw ("/%-*s", panel->widget.cols-3, panel->search_buffer);
@@ -637,7 +637,7 @@ display_mini_info (WPanel *panel)
     if (panel->marked){
        char buffer [100];
        char *p;
     if (panel->marked){
        char buffer [100];
        char *p;
-       
+
        attrset (MARKED_COLOR);
        printw  ("%*s", panel->widget.cols-2, " ");
        widget_move (&panel->widget, llines (panel)+3, 1);
        attrset (MARKED_COLOR);
        printw  ("%*s", panel->widget.cols-2, " ");
        widget_move (&panel->widget, llines (panel)+3, 1);
@@ -655,7 +655,7 @@ display_mini_info (WPanel *panel)
 
     /* Status resolves links and show them */
     set_colors (panel);
 
     /* Status resolves links and show them */
     set_colors (panel);
-#ifndef OS2_NT    
+#ifndef OS2_NT
     if (S_ISLNK (panel->dir.list [panel->selected].buf.st_mode)){
        char *link, link_target [MC_MAXPATHLEN];
        int  len;
     if (S_ISLNK (panel->dir.list [panel->selected].buf.st_mode)){
        char *link, link_target [MC_MAXPATHLEN];
        int  len;
@@ -667,7 +667,7 @@ display_mini_info (WPanel *panel)
            link_target[len] = 0;
            printw ("-> %-*s", panel->widget.cols - 5,
                     name_trunc (link_target, panel->widget.cols - 5));
            link_target[len] = 0;
            printw ("-> %-*s", panel->widget.cols - 5,
                     name_trunc (link_target, panel->widget.cols - 5));
-       } else 
+       } else
            addstr (_("<readlink failed>"));
        return;
     }
            addstr (_("<readlink failed>"));
        return;
     }
@@ -687,7 +687,7 @@ paint_dir (WPanel *panel)
     int items;                 /* Number of items */
 
     items = llines (panel) * (panel->split ? 2 : 1);
     int items;                 /* Number of items */
 
     items = llines (panel) * (panel->split ? 2 : 1);
-    
+
     for (i = 0; i < items; i++){
        if (i+panel->top_file >= panel->count)
            color = 0;
     for (i = 0; i < items; i++){
        if (i+panel->top_file >= panel->count)
            color = 0;
@@ -695,7 +695,7 @@ paint_dir (WPanel *panel)
            color = 2 * (panel->dir.list [i+panel->top_file].f.marked);
            color += (panel->selected==i+panel->top_file && panel->active);
        }
            color = 2 * (panel->dir.list [i+panel->top_file].f.marked);
            color += (panel->selected==i+panel->top_file && panel->active);
        }
-       repaint_file (panel, i+panel->top_file, 1, color, 0);   
+       repaint_file (panel, i+panel->top_file, 1, color, 0);
     }
     standend ();
     panel->dirty = 0;
     }
     standend ();
     panel->dirty = 0;
@@ -710,7 +710,7 @@ mini_info_separator (WPanel *panel)
 {
     if (!show_mini_info)
        return;
 {
     if (!show_mini_info)
        return;
-    
+
     standend ();
     widget_move (&panel->widget, llines (panel)+2, 1);
 #ifdef HAVE_SLANG
     standend ();
     widget_move (&panel->widget, llines (panel)+2, 1);
 #ifdef HAVE_SLANG
@@ -719,7 +719,7 @@ mini_info_separator (WPanel *panel)
 #else
     hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
          panel->widget.cols-2);
 #else
     hline ((slow_terminal ? '-' : ACS_HLINE) | NORMAL_COLOR,
          panel->widget.cols-2);
-#endif 
+#endif
 }
 
 void
 }
 
 void
@@ -732,13 +732,13 @@ show_dir (WPanel *panel)
                    panel->widget.y,    panel->widget.x,
                    panel->widget.lines, panel->widget.cols);
 
                    panel->widget.y,    panel->widget.x,
                    panel->widget.lines, panel->widget.cols);
 
-#ifdef HAVE_SLANG                  
+#ifdef HAVE_SLANG
     if (show_mini_info) {
 #ifdef linux_unicode
        if (SLtt_Unicode) {
     if (show_mini_info) {
 #ifdef linux_unicode
        if (SLtt_Unicode) {
-            SLsmg_draw_unicode (panel->widget.y + llines (panel) + 2, 
+            SLsmg_draw_unicode (panel->widget.y + llines (panel) + 2,
                 panel->widget.x, SLUNI_DSLTEE_CHAR);
                 panel->widget.x, SLUNI_DSLTEE_CHAR);
-            SLsmg_draw_unicode (panel->widget.y + llines (panel) + 2, 
+            SLsmg_draw_unicode (panel->widget.y + llines (panel) + 2,
                 panel->widget.x + panel->widget.cols - 1, SLUNI_DSRTEE_CHAR);
        } else
 #endif /* linux_unicode */
                 panel->widget.x + panel->widget.cols - 1, SLUNI_DSRTEE_CHAR);
        } else
 #endif /* linux_unicode */
@@ -750,7 +750,7 @@ show_dir (WPanel *panel)
         }
     }
 #endif /* have_slang */
         }
     }
 #endif /* have_slang */
-    
+
     if (panel->active)
        attrset (REVERSE_COLOR);
 
     if (panel->active)
        attrset (REVERSE_COLOR);
 
@@ -764,7 +764,7 @@ show_dir (WPanel *panel)
     addstr (">");
     widget_move (&panel->widget, 0, panel->widget.cols-3);
     addstr ("v");
     addstr (">");
     widget_move (&panel->widget, 0, panel->widget.cols-3);
     addstr ("v");
-    
+
     if (panel->active)
        standend ();
 }
     if (panel->active)
        standend ();
 }
@@ -776,7 +776,7 @@ static void
 adjust_top_file (WPanel *panel)
 {
     int old_top = panel->top_file;
 adjust_top_file (WPanel *panel)
 {
     int old_top = panel->top_file;
-    
+
     if (panel->selected - old_top > llines (panel))
        panel->top_file = panel->selected;
     if (old_top - panel->count > llines (panel))
     if (panel->selected - old_top > llines (panel))
        panel->top_file = panel->selected;
     if (old_top - panel->count > llines (panel))
@@ -819,7 +819,7 @@ Xtry_to_select (WPanel *panel, char *name)
 {
     int i;
     char *subdir;
 {
     int i;
     char *subdir;
-    
+
     if (!name){
        panel->selected = 0;
        panel->top_file = 0;
     if (!name){
        panel->selected = 0;
        panel->top_file = 0;
@@ -836,7 +836,7 @@ Xtry_to_select (WPanel *panel, char *name)
     }
     if (subdir < name)
        subdir = name;
     }
     if (subdir < name)
        subdir = name;
-    
+
     /* Search that subdirectory, if found select it */
     for (i = 0; i < panel->count; i++){
        if (strcmp (subdir, panel->dir.list [i].fname))
     /* Search that subdirectory, if found select it */
     for (i = 0; i < panel->count; i++){
        if (strcmp (subdir, panel->dir.list [i].fname))
@@ -868,7 +868,7 @@ void
 panel_update_cols (Widget *widget, int frame_size)
 {
     int cols, origin;
 panel_update_cols (Widget *widget, int frame_size)
 {
     int cols, origin;
-    
+
     if (horizontal_split){
        widget->cols = COLS;
        return;
     if (horizontal_split){
        widget->cols = COLS;
        return;
@@ -886,7 +886,7 @@ panel_update_cols (Widget *widget, int frame_size)
            origin = first_panel_size;
        }
     }
            origin = first_panel_size;
        }
     }
-    
+
     widget->cols = cols;
     widget->x = origin;
 }
     widget->cols = cols;
     widget->x = origin;
 }
@@ -896,7 +896,7 @@ static char *
 panel_save_name (WPanel *panel)
 {
     extern int saving_setup;
 panel_save_name (WPanel *panel)
 {
     extern int saving_setup;
-    
+
     /* If the program is shuting down */
     if ((midnight_shutdown && auto_save_setup) || saving_setup)
        return copy_strings (panel->panel_name, 0);
     /* If the program is shuting down */
     if ((midnight_shutdown && auto_save_setup) || saving_setup)
        return copy_strings (panel->panel_name, 0);
@@ -914,7 +914,7 @@ panel_destroy (WPanel *p)
     panel_save_setup (p, name);
     x_panel_destroy (p);
     clean_dir (&p->dir, p->count);
     panel_save_setup (p, name);
     x_panel_destroy (p);
     clean_dir (&p->dir, p->count);
-    
+
 /* save and clean history */
     if (p->dir_history){
        Hist *current, *old;
 /* save and clean history */
     if (p->dir_history){
        Hist *current, *old;
@@ -933,7 +933,7 @@ panel_destroy (WPanel *p)
 
     delete_format (p->format);
     delete_format (p->status_format);
 
     delete_format (p->format);
     delete_format (p->status_format);
-    
+
     free (p->user_format);
     for (i = 0; i < LIST_TYPES; i++)
        free (p->user_status_format [i]);
     free (p->user_format);
     for (i = 0; i < LIST_TYPES; i++)
        free (p->user_status_format [i]);
@@ -968,7 +968,7 @@ panel_new (char *panel_name)
 
     panel = xmalloc (sizeof (WPanel), "panel_new");
     memset (panel, 0, sizeof (WPanel));
 
     panel = xmalloc (sizeof (WPanel), "panel_new");
     memset (panel, 0, sizeof (WPanel));
-    
+
     /* No know sizes of the panel at startup */
     init_widget (&panel->widget, 0, 0, 0, 0, (callback_fn)
                 panel_callback, (destroy_fn) panel_destroy,
     /* No know sizes of the panel at startup */
     init_widget (&panel->widget, 0, 0, 0, 0, (callback_fn)
                 panel_callback, (destroy_fn) panel_destroy,
@@ -976,7 +976,7 @@ panel_new (char *panel_name)
 
     /* We do not want the cursor */
     widget_want_cursor (panel->widget, 0);
 
     /* We do not want the cursor */
     widget_want_cursor (panel->widget, 0);
-    
+
     mc_get_current_wd (panel->cwd, sizeof (panel->cwd)-2);
     strcpy (panel->lwd, ".");
 
     mc_get_current_wd (panel->cwd, sizeof (panel->cwd)-2);
     strcpy (panel->lwd, ".");
 
@@ -1000,15 +1000,15 @@ panel_new (char *panel_name)
     panel->is_panelized     = 0;
     panel->has_dir_sizes    = 0;
     panel->format          = 0;
     panel->is_panelized     = 0;
     panel->has_dir_sizes    = 0;
     panel->format          = 0;
-    panel->status_format    = 0;    
+    panel->status_format    = 0;
     panel->format_modified  = 1;
     panel->format_modified  = 1;
-    
+
     panel->panel_name = strdup (panel_name);
     panel->user_format = strdup (DEFAULT_USER_FORMAT);
     panel->panel_name = strdup (panel_name);
     panel->user_format = strdup (DEFAULT_USER_FORMAT);
-    
+
     for(i = 0; i < LIST_TYPES; i++)
        panel->user_status_format [i] = strdup (DEFAULT_USER_FORMAT);
     for(i = 0; i < LIST_TYPES; i++)
        panel->user_status_format [i] = strdup (DEFAULT_USER_FORMAT);
-    
+
     panel->search_buffer [0] = 0;
     panel->frame_size = frame_half;
     section = copy_strings ("Temporal:", panel->panel_name, 0);
     panel->search_buffer [0] = 0;
     panel->frame_size = frame_half;
     section = copy_strings ("Temporal:", panel->panel_name, 0);
@@ -1032,7 +1032,7 @@ panel_new (char *panel_name)
        }
        set_panel_formats (panel);
     }
        }
        set_panel_formats (panel);
     }
-    
+
     /* Load the default format */
     panel->count = do_load_dir (&panel->dir, panel->sort_type,
                                panel->reverse, panel->case_sensitive, panel->filter);
     /* Load the default format */
     panel->count = do_load_dir (&panel->dir, panel->sort_type,
                                panel->reverse, panel->case_sensitive, panel->filter);
@@ -1067,7 +1067,7 @@ panel_reload (WPanel *panel)
         bzero (&(panel->dir_stat), sizeof (panel->dir_stat));
        show_dir (panel);
     }
         bzero (&(panel->dir_stat), sizeof (panel->dir_stat));
        show_dir (panel);
     }
-    
+
     panel->count = do_reload_dir (&panel->dir, panel->sort_type, panel->count,
                                  panel->reverse, panel->case_sensitive, panel->filter);
     panel->marked = 0;
     panel->count = do_reload_dir (&panel->dir, panel->sort_type, panel->count,
                                  panel->reverse, panel->case_sensitive, panel->filter);
     panel->marked = 0;
@@ -1092,11 +1092,11 @@ paint_frame (WPanel *panel)
     int  header_len;
     int  spaces, extra;
     int  side, width;
     int  header_len;
     int  spaces, extra;
     int  side, width;
-    
+
     char *txt, buffer[30]; /*Hope that this is enough ;-) */
     if (!panel->split)
        adjust_top_file (panel);
     char *txt, buffer[30]; /*Hope that this is enough ;-) */
     if (!panel->split)
        adjust_top_file (panel);
-    
+
     widget_erase (&panel->widget);
     show_dir (panel);
 
     widget_erase (&panel->widget);
     show_dir (panel);
 
@@ -1104,7 +1104,7 @@ paint_frame (WPanel *panel)
 
     for (side = 0; side <= panel->split; side++){
        format_e *format;
 
     for (side = 0; side <= panel->split; side++){
        format_e *format;
-       
+
        if (side){
            attrset (NORMAL_COLOR);
            one_vline ();
        if (side){
            attrset (NORMAL_COLOR);
            one_vline ();
@@ -1113,11 +1113,11 @@ paint_frame (WPanel *panel)
            width = panel->widget.cols/2 - 3;
        else
            width = panel->widget.cols - 2;
            width = panel->widget.cols/2 - 3;
        else
            width = panel->widget.cols - 2;
-       
+
        for (format = panel->format; format; format = format->next){
             if (format->string_fn){
                 txt = format->title;
        for (format = panel->format; format; format = format->next){
             if (format->string_fn){
                 txt = format->title;
-               
+
                header_len = strlen (txt);
                if (header_len > format->field_len){
                    strcpy (buffer, txt);
                header_len = strlen (txt);
                if (header_len > format->field_len){
                    strcpy (buffer, txt);
@@ -1125,7 +1125,7 @@ paint_frame (WPanel *panel)
                    txt [format->field_len] = 0;
                    header_len = strlen (txt);
                }
                    txt [format->field_len] = 0;
                    header_len = strlen (txt);
                }
-               
+
                 attrset (MARKED_COLOR);
                 spaces = (format->field_len - header_len) / 2;
                 extra  = (format->field_len - header_len) % 2;
                 attrset (MARKED_COLOR);
                 spaces = (format->field_len - header_len) / 2;
                 extra  = (format->field_len - header_len) % 2;
@@ -1139,7 +1139,7 @@ paint_frame (WPanel *panel)
                continue;
            }
        }
                continue;
            }
        }
-       
+
        if (width > 0)
            printw ("%*s", width, "");
     }
        if (width > 0)
            printw ("%*s", width, "");
     }
@@ -1164,10 +1164,10 @@ parse_panel_size (WPanel *panel, char *format, int isstatus)
         panel->frame_size = frame;
         panel->split = 0;
     }
         panel->frame_size = frame;
         panel->split = 0;
     }
-    
+
     /* Now, the optional column specifier */
     format = skip_separators (format);
     /* Now, the optional column specifier */
     format = skip_separators (format);
-    
+
     if (*format == '1' || *format == '2'){
        if (!isstatus)
            panel->split = *format == '2';
     if (*format == '1' || *format == '2'){
        if (!isstatus)
            panel->split = *format == '2';
@@ -1176,7 +1176,7 @@ parse_panel_size (WPanel *panel, char *format, int isstatus)
 
     if (!isstatus)
         panel_update_cols (&(panel->widget), panel->frame_size);
 
     if (!isstatus)
         panel_update_cols (&(panel->widget), panel->frame_size);
-    
+
     return skip_separators (format);
 }
 
     return skip_separators (format);
 }
 
@@ -1192,7 +1192,7 @@ parse_panel_size (WPanel *panel, char *format, int isstatus)
    opt_size         := : size [opt_expand]
    size             := [0-9]+
    opt_expand       := +
    opt_size         := : size [opt_expand]
    size             := [0-9]+
    opt_expand       := +
-   
+
 */
 
 format_e *
 */
 
 format_e *
@@ -1206,7 +1206,7 @@ parse_display_format (WPanel *panel, char *format, char **error, int isstatus, i
     int  i;
 
     *error = 0;
     int  i;
 
     *error = 0;
-    
+
     /*
      * This makes sure that the panel and mini status full/half mode
      * setting is equal
     /*
      * This makes sure that the panel and mini status full/half mode
      * setting is equal
@@ -1217,15 +1217,15 @@ parse_display_format (WPanel *panel, char *format, char **error, int isstatus, i
        int found = 0;
 
         darr = xmalloc (sizeof (format_e), "parse_display_format");
        int found = 0;
 
         darr = xmalloc (sizeof (format_e), "parse_display_format");
-       
+
         /* I'm so ugly, don't look at me :-) */
         if (!home)
             home = old = darr;
         /* I'm so ugly, don't look at me :-) */
         if (!home)
             home = old = darr;
-       
+
         old->next = darr;
         darr->next = 0;
         old = darr;
         old->next = darr;
         darr->next = 0;
         old = darr;
-       
+
        format = skip_separators (format);
 
        if (*format == '<' || *format == '>'){
        format = skip_separators (format);
 
        if (*format == '<' || *format == '>'){
@@ -1234,7 +1234,7 @@ parse_display_format (WPanel *panel, char *format, char **error, int isstatus, i
            format = skip_separators (format+1);
        } else
            set_justify = 0;
            format = skip_separators (format+1);
        } else
            set_justify = 0;
-       
+
        for (i = 0; i < ELEMENTS(formats); i++){
            int klen = strlen (formats [i].id);
 
        for (i = 0; i < ELEMENTS(formats); i++){
            int klen = strlen (formats [i].id);
 
@@ -1255,7 +1255,7 @@ parse_display_format (WPanel *panel, char *format, char **error, int isstatus, i
                    darr->title = "";
             darr->id                  = formats [i].id;
            darr->expand              = formats [i].expands;
                    darr->title = "";
             darr->id                  = formats [i].id;
            darr->expand              = formats [i].expands;
-           
+
            if (set_justify)
                darr->just_mode = justify;
            else
            if (set_justify)
                darr->just_mode = justify;
            else
@@ -1291,7 +1291,7 @@ parse_display_format (WPanel *panel, char *format, char **error, int isstatus, i
        }
        if (!found){
            char old_char;
        }
        if (!found){
            char old_char;
-           
+
            int pos = min (8, strlen (format));
            delete_format (home);
            old_char = format [pos];
            int pos = min (8, strlen (format));
            delete_format (home);
            old_char = format [pos];
@@ -1302,7 +1302,7 @@ parse_display_format (WPanel *panel, char *format, char **error, int isstatus, i
        }
        total_cols += darr->requested_field_len;
     }
        }
        total_cols += darr->requested_field_len;
     }
-    
+
     *res_total_cols = total_cols;
     if (home)
        home->items = items;
     *res_total_cols = total_cols;
     if (home)
        home->items = items;
@@ -1319,36 +1319,36 @@ use_display_format (WPanel *panel, char *format, char **error, int isstatus)
     char *expand_list [MAX_EXPAND];    /* Expand at most 4 fields. */
     int  i;
     format_e *darr, *home;
     char *expand_list [MAX_EXPAND];    /* Expand at most 4 fields. */
     int  i;
     format_e *darr, *home;
-    
+
     if (!format)
        format = DEFAULT_USER_FORMAT;
     if (!format)
        format = DEFAULT_USER_FORMAT;
-    
+
     home = parse_display_format (panel, format, error, isstatus, &total_cols);
 
     if (*error)
        return 0;
     home = parse_display_format (panel, format, error, isstatus, &total_cols);
 
     if (*error)
        return 0;
-           
+
     /* Status needn't to be split */
     usable_columns = ((panel->widget.cols-2)/((isstatus)
                                              ? 1
                                              : (panel->split+1))) - (!isstatus && panel->split);
     /* Status needn't to be split */
     usable_columns = ((panel->widget.cols-2)/((isstatus)
                                              ? 1
                                              : (panel->split+1))) - (!isstatus && panel->split);
-    
+
     /* Clean expand list */
     for (i = 0; i < MAX_EXPAND; i++)
         expand_list [i] = '\0';
     /* Clean expand list */
     for (i = 0; i < MAX_EXPAND; i++)
         expand_list [i] = '\0';
-    
-    
+
+
     /* Look for the expandable fields and set field_len based on the requested field len */
     for (darr = home; darr && expand_top < MAX_EXPAND; darr = darr->next){
        darr->field_len = darr->requested_field_len;
        if (darr->expand)
            expand_list [expand_top++] = darr->id;
     }
     /* Look for the expandable fields and set field_len based on the requested field len */
     for (darr = home; darr && expand_top < MAX_EXPAND; darr = darr->next){
        darr->field_len = darr->requested_field_len;
        if (darr->expand)
            expand_list [expand_top++] = darr->id;
     }
-    
+
     /* If we used more columns than the available columns, adjust that */
     if (total_cols > usable_columns){
        int pdif, dif = total_cols - usable_columns;
     /* If we used more columns than the available columns, adjust that */
     if (total_cols > usable_columns){
        int pdif, dif = total_cols - usable_columns;
-       
+
         while (dif){
            pdif = dif;
            for (darr = home; darr; darr = darr->next){
         while (dif){
            pdif = dif;
            for (darr = home; darr; darr = darr->next){
@@ -1360,7 +1360,7 @@ use_display_format (WPanel *panel, char *format, char **error, int isstatus)
 
            /* avoid endless loop if num fields > 40 */
            if (pdif == dif)
 
            /* avoid endless loop if num fields > 40 */
            if (pdif == dif)
-               break; 
+               break;
        }
        total_cols  = usable_columns; /* give up, the rest should be truncated */
     }
        }
        total_cols  = usable_columns; /* give up, the rest should be truncated */
     }
@@ -1386,11 +1386,11 @@ int
 set_panel_formats (WPanel *p)
 {
     format_e *form;
 set_panel_formats (WPanel *p)
 {
     format_e *form;
-    char *err;    
+    char *err;
     int retcode = 0;
     int retcode = 0;
-    
+
     form = use_display_format (p, panel_format (p), &err, 0);
     form = use_display_format (p, panel_format (p), &err, 0);
-       
+
     if (err){
         free (err);
         retcode = 1;
     if (err){
         free (err);
         retcode = 1;
@@ -1398,14 +1398,14 @@ set_panel_formats (WPanel *p)
     else {
         if (p->format)
            delete_format (p->format);
     else {
         if (p->format)
            delete_format (p->format);
-               
+
        p->format = form;
     }
        p->format = form;
     }
-    
+
     if (show_mini_info){
     if (show_mini_info){
-    
+
        form = use_display_format (p, mini_status_format (p), &err, 1);
        form = use_display_format (p, mini_status_format (p), &err, 1);
-       
+
        if (err){
            free (err);
            retcode += 2;
        if (err){
            free (err);
            retcode += 2;
@@ -1413,14 +1413,14 @@ set_panel_formats (WPanel *p)
        else {
            if (p->status_format)
                delete_format (p->status_format);
        else {
            if (p->status_format)
                delete_format (p->status_format);
-               
+
            p->status_format = form;
        }
     }
            p->status_format = form;
        }
     }
-    
+
     panel_format_modified (p);
     panel_update_cols (&(p->widget), p->frame_size);
     panel_format_modified (p);
     panel_update_cols (&(p->widget), p->frame_size);
-    
+
     return retcode;
 }
 
     return retcode;
 }
 
@@ -1492,7 +1492,7 @@ select_item (WPanel *panel)
 {
     int repaint = 0;
     int items = ITEMS (panel);
 {
     int repaint = 0;
     int items = ITEMS (panel);
-    
+
     /* Although currently all over the code we set the selection and
        top file to decent values before calling select_item, I could
        forget it someday, so it's better to do the actual fitting here */
     /* Although currently all over the code we set the selection and
        top file to decent values before calling select_item, I could
        forget it someday, so it's better to do the actual fitting here */
@@ -1501,7 +1501,7 @@ select_item (WPanel *panel)
     int old_top;
     old_top = panel->top_file;
 #endif
     int old_top;
     old_top = panel->top_file;
 #endif
-    
+
     if (panel->top_file < 0){
        repaint = 1;
        panel->top_file = 0;
     if (panel->top_file < 0){
        repaint = 1;
        panel->top_file = 0;
@@ -1517,14 +1517,14 @@ select_item (WPanel *panel)
        repaint = 1;
        panel->top_file = panel->count-1;
     }
        repaint = 1;
        panel->top_file = panel->count-1;
     }
-    
+
     if ((panel->count - panel->top_file) < items){
        repaint = 1;
        panel->top_file = panel->count - items;
        if (panel->top_file < 0)
            panel->top_file = 0;
     }
     if ((panel->count - panel->top_file) < items){
        repaint = 1;
        panel->top_file = panel->count - items;
        if (panel->top_file < 0)
            panel->top_file = 0;
     }
-    
+
     if (panel->selected < panel->top_file){
        repaint = 1;
        panel->top_file = panel->selected;
     if (panel->selected < panel->top_file){
        repaint = 1;
        panel->top_file = panel->selected;
@@ -1535,7 +1535,7 @@ select_item (WPanel *panel)
        panel->top_file = panel->selected - items + 1;
     }
 
        panel->top_file = panel->selected - items + 1;
     }
 
-#ifndef HAVE_X    
+#ifndef HAVE_X
     if (repaint)
        paint_panel (panel);
     else
     if (repaint)
        paint_panel (panel);
     else
@@ -1586,7 +1586,7 @@ do_move_down (WPanel *panel)
 {
     if (panel->selected+1 == panel->count)
        return;
 {
     if (panel->selected+1 == panel->count)
        return;
-    
+
     unselect_item (panel);
     panel->selected++;
 
     unselect_item (panel);
     panel->selected++;
 
@@ -1627,7 +1627,7 @@ static int
 move_rel (WPanel *panel, int rel)
 {
     unselect_item (panel);
 move_rel (WPanel *panel, int rel)
 {
     unselect_item (panel);
-    
+
     if (rel < 0){
        if (panel->selected + rel < 0)
            panel->selected = 0;
     if (rel < 0){
        if (panel->selected + rel < 0)
            panel->selected = 0;
@@ -1685,12 +1685,12 @@ move_selection (WPanel *panel, int lines)
        panel->top_file += lines;
        adjust = 1;
     }
        panel->top_file += lines;
        adjust = 1;
     }
-    
+
     if (panel->selected - panel->top_file < 0){
        panel->top_file += lines;
        adjust = 1;
     }
     if (panel->selected - panel->top_file < 0){
        panel->top_file += lines;
        adjust = 1;
     }
-    
+
     if (adjust){
        if (panel->top_file > panel->selected)
            panel->top_file = panel->selected;
     if (adjust){
        if (panel->top_file > panel->selected)
            panel->top_file = panel->selected;
@@ -1708,11 +1708,11 @@ move_left (WPanel *panel, int c_code)
     if (panel->list_type == list_icons){
        do_move_up (panel);
        return 1;
     if (panel->list_type == list_icons){
        do_move_up (panel);
        return 1;
-    } else {    
+    } else {
        if (panel->split){
            move_selection (panel, -llines (panel));
            return 1;
        if (panel->split){
            move_selection (panel, -llines (panel));
            return 1;
-       } else 
+       } else
            return maybe_cd (c_code, 0);
     }
 }
            return maybe_cd (c_code, 0);
     }
 }
@@ -1845,7 +1845,7 @@ move_home (WPanel *panel)
     if (panel->selected == 0)
        return;
     unselect_item (panel);
     if (panel->selected == 0)
        return;
     unselect_item (panel);
-    
+
     if (torben_fj_mode){
        int middle_pos = panel->top_file + (ITEMS (panel)/2);
 
     if (torben_fj_mode){
        int middle_pos = panel->top_file + (ITEMS (panel)/2);
 
@@ -1858,7 +1858,7 @@ move_home (WPanel *panel)
            return;
        }
     }
            return;
        }
     }
-    
+
     panel->top_file = 0;
     panel->selected = 0;
 
     panel->top_file = 0;
     panel->selected = 0;
 
@@ -1886,7 +1886,7 @@ move_end (WPanel *panel)
            return;
        }
     }
            return;
        }
     }
-    
+
     panel->selected = panel->count-1;
 #ifndef HAVE_X
     paint_dir (panel);
     panel->selected = panel->count-1;
 #ifndef HAVE_X
     paint_dir (panel);
@@ -1911,9 +1911,9 @@ do_file_mark (WPanel *panel, int idx, int mark)
                if (panel->has_dir_sizes)
                    panel->total += panel->dir.list [idx].buf.st_size;
                 panel->dirs_marked++;
                if (panel->has_dir_sizes)
                    panel->total += panel->dir.list [idx].buf.st_size;
                 panel->dirs_marked++;
-           } else 
+           } else
                panel->total += panel->dir.list [idx].buf.st_size;
                panel->total += panel->dir.list [idx].buf.st_size;
-#ifndef HAVE_XVIEW            
+#ifndef HAVE_XVIEW
             set_colors (panel);
 #endif
         } else {
             set_colors (panel);
 #endif
         } else {
@@ -1936,7 +1936,7 @@ do_file_mark_range (WPanel *panel, int r1, int r2)
        int i, mark;
 
        mark = !panel->dir.list [start].f.marked;
        int i, mark;
 
        mark = !panel->dir.list [start].f.marked;
-       
+
        for (i = start; i < end; i++)
            do_file_mark (panel, i, mark);
 }
        for (i = start; i < end; i++)
            do_file_mark (panel, i, mark);
 }
@@ -1946,9 +1946,9 @@ do_mark_file (WPanel *panel, int do_move)
 {
     int idx = panel->selected;
     do_file_mark (panel, idx, selection (panel)->f.marked ? 0 : 1);
 {
     int idx = panel->selected;
     do_file_mark (panel, idx, selection (panel)->f.marked ? 0 : 1);
-#ifndef HAVE_XVIEW     
+#ifndef HAVE_XVIEW
     repaint_file (panel, idx, 1, 2*panel->dir.list [idx].f.marked+1, 0);
     repaint_file (panel, idx, 1, 2*panel->dir.list [idx].f.marked+1, 0);
-#endif        
+#endif
 
     if (mark_moves_down && do_move)
        move_down (panel);
 
     if (mark_moves_down && do_move)
        move_down (panel);
@@ -1998,7 +1998,7 @@ do_search (WPanel *panel, int c_code)
     }
     if (!found)
        panel->search_buffer [--l] = 0;
     }
     if (!found)
        panel->search_buffer [--l] = 0;
-#ifndef HAVE_X    
+#ifndef HAVE_X
     paint_panel (panel);
 #endif
 }
     paint_panel (panel);
 #endif
 }
@@ -2027,12 +2027,12 @@ do_enter (WPanel *panel)
        || link_isdir (selection (panel))){
        do_cd (selection (panel)->fname, cd_exact);
        return;
        || link_isdir (selection (panel))){
        do_cd (selection (panel)->fname, cd_exact);
        return;
-    } else { 
+    } else {
        if (is_exe (selection (panel)->buf.st_mode) &&
            if_link_is_exe (selection (panel))) {
        if (is_exe (selection (panel)->buf.st_mode) &&
            if_link_is_exe (selection (panel))) {
-#ifdef USE_VFS     
-           if (vfs_current_is_local ()) 
-#endif     
+#ifdef USE_VFS
+           if (vfs_current_is_local ())
+#endif
            {
                char *tmp = name_quote (selection (panel)->fname, 0);
                char *cmd = copy_strings (".", PATH_SEP_STR, tmp, 0);
            {
                char *tmp = name_quote (selection (panel)->fname, 0);
                char *cmd = copy_strings (".", PATH_SEP_STR, tmp, 0);
@@ -2042,8 +2042,8 @@ do_enter (WPanel *panel)
                    execute (cmd);
                free (tmp);
                free (cmd);
                    execute (cmd);
                free (tmp);
                free (cmd);
-           } 
-#ifdef USE_VFS             
+           }
+#ifdef USE_VFS
            else if (vfs_current_is_extfs ()) {
                char *tmp = vfs_get_current_dir();
                char *tmp2;
            else if (vfs_current_is_extfs ()) {
                char *tmp = vfs_get_current_dir();
                char *tmp2;
@@ -2052,7 +2052,7 @@ do_enter (WPanel *panel)
                extfs_run(tmp2);
                free (tmp2);
            }
                extfs_run(tmp2);
                free (tmp2);
            }
-#endif /* USE_VFS */       
+#endif /* USE_VFS */
            return;
        } else {
            regex_command (selection (panel)->fname, "Open", NULL, 0);
            return;
        } else {
            regex_command (selection (panel)->fname, "Open", NULL, 0);
@@ -2078,7 +2078,7 @@ chdir_other_panel (WPanel *panel)
     change_panel ();
 
     move_down (panel);
     change_panel ();
 
     move_down (panel);
-    
+
     free (new_dir);
 }
 
     free (new_dir);
 }
 
@@ -2094,7 +2094,7 @@ chdir_to_readlink (WPanel *panel)
        char buffer [MC_MAXPATHLEN], *p;
        int i;
        struct stat mybuf;
        char buffer [MC_MAXPATHLEN], *p;
        int i;
        struct stat mybuf;
-       
+
        i = readlink (selection (panel)->fname, buffer, MC_MAXPATHLEN);
        if (i < 0)
            return;
        i = readlink (selection (panel)->fname, buffer, MC_MAXPATHLEN);
        if (i < 0)
            return;
@@ -2119,9 +2119,9 @@ chdir_to_readlink (WPanel *panel)
        change_panel ();
        do_cd (new_dir, cd_exact);
        change_panel ();
        change_panel ();
        do_cd (new_dir, cd_exact);
        change_panel ();
-       
+
        move_down (panel);
        move_down (panel);
-           
+
        free (new_dir);
     }
 }
        free (new_dir);
     }
 }
@@ -2152,7 +2152,7 @@ static key_map panel_keymap [] = {
     { ALT(KEY_F(12)), drive_cmd_b },
     { ALT('d'),   drive_chg },
 #endif
     { ALT(KEY_F(12)), drive_cmd_b },
     { ALT('d'),   drive_chg },
 #endif
-    
+
     /* Emacs-like bindings */
     { XCTRL('v'), next_page },         /* C-v like emacs */
     { ALT('v'),   prev_page },         /* M-v like emacs */
     /* Emacs-like bindings */
     { XCTRL('v'), next_page },         /* C-v like emacs */
     { ALT('v'),   prev_page },         /* M-v like emacs */
@@ -2175,7 +2175,7 @@ static key_map panel_keymap [] = {
     { KEY_KP_SUBTRACT, unselect_cmd_panel },
     { ALT('*'),          reverse_selection_cmd_panel },
     { KEY_KP_MULTIPLY, reverse_selection_cmd_panel },
     { KEY_KP_SUBTRACT, unselect_cmd_panel },
     { ALT('*'),          reverse_selection_cmd_panel },
     { KEY_KP_MULTIPLY, reverse_selection_cmd_panel },
-    
+
 
 #ifdef HAVE_GNOME
     { '+',        select_cmd_panel },
 
 #ifdef HAVE_GNOME
     { '+',        select_cmd_panel },
@@ -2189,10 +2189,10 @@ static key_map panel_keymap [] = {
     { KEY_F(7),   mkdir_panel_cmd },
     { KEY_F(8),   delete_cmd },
 #endif
     { KEY_F(7),   mkdir_panel_cmd },
     { KEY_F(8),   delete_cmd },
 #endif
-    
+
     { 0, 0 }
 };
     { 0, 0 }
 };
-    
+
 static inline int
 panel_key (WPanel *panel, int key)
 {
 static inline int
 panel_key (WPanel *panel, int key)
 {
@@ -2257,14 +2257,14 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
        define_label (h, (Widget *)panel, 7, _("Mkdir"), mkdir_panel_cmd);
        define_label (h, (Widget *)panel, 8, _("Delete"), delete_cmd);
        x_create_panel (h, h->wdata, panel);
        define_label (h, (Widget *)panel, 7, _("Mkdir"), mkdir_panel_cmd);
        define_label (h, (Widget *)panel, 8, _("Delete"), delete_cmd);
        x_create_panel (h, h->wdata, panel);
-#endif 
+#endif
        return 1;
        return 1;
-       
+
     case WIDGET_DRAW:
 #ifndef HAVE_XVIEW
        paint_panel (panel);
 #else
     case WIDGET_DRAW:
 #ifndef HAVE_XVIEW
        paint_panel (panel);
 #else
-       show_dir (panel);       
+       show_dir (panel);
 #endif
        break;
 
 #endif
        break;
 
@@ -2278,10 +2278,10 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
                     panel->cwd, unix_error_string (errno));
        } else
            subshell_chdir (panel->cwd);
                     panel->cwd, unix_error_string (errno));
        } else
            subshell_chdir (panel->cwd);
-           
+
        show_dir (panel);
        focus_select_item (panel);
        show_dir (panel);
        focus_select_item (panel);
-#ifndef HAVE_X 
+#ifndef HAVE_X
        define_label (h, (Widget *)panel, 1, _("Help"), help_cmd);
        define_label (h, (Widget *)panel, 2, _("Menu"), user_menu_cmd);
        define_label (h, (Widget *)panel, 3, _("View"), view_panel_cmd);
        define_label (h, (Widget *)panel, 1, _("Help"), help_cmd);
        define_label (h, (Widget *)panel, 2, _("Menu"), user_menu_cmd);
        define_label (h, (Widget *)panel, 3, _("View"), view_panel_cmd);
@@ -2295,14 +2295,14 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
        /* Chain behaviour */
        default_proc (h, WIDGET_FOCUS, par);
        return 1;
        /* Chain behaviour */
        default_proc (h, WIDGET_FOCUS, par);
        return 1;
-       
+
     case WIDGET_UNFOCUS:
        /* Janne: look at this for the multiple panel options */
        if (panel->searching){
            panel->searching = 0;
            display_mini_info (panel);
        }
     case WIDGET_UNFOCUS:
        /* Janne: look at this for the multiple panel options */
        if (panel->searching){
            panel->searching = 0;
            display_mini_info (panel);
        }
-#ifdef HAVE_X  
+#ifdef HAVE_X
        show_dir (panel);
        unfocus_unselect_item (panel);
        panel->active = 0;
        show_dir (panel);
        unfocus_unselect_item (panel);
        panel->active = 0;
@@ -2312,7 +2312,7 @@ panel_callback (Dlg_head *h, WPanel *panel, int msg, int par)
        unselect_item (panel);
 #endif
        return 1;
        unselect_item (panel);
 #endif
        return 1;
-       
+
     case WIDGET_KEY:
        return panel_key (panel, par);
        break;
     case WIDGET_KEY:
        return panel_key (panel, par);
        break;
@@ -2385,7 +2385,7 @@ int
 panel_event (Gpm_Event *event, WPanel *panel)
 {
     const int lines = panel->count;
 panel_event (Gpm_Event *event, WPanel *panel)
 {
     const int lines = panel->count;
-    
+
     int my_index;
     extern void change_panel (void);
 
     int my_index;
     extern void change_panel (void);
 
@@ -2413,7 +2413,7 @@ panel_event (Gpm_Event *event, WPanel *panel)
 
        if (my_index >= panel->count)
            my_index = panel->count - 1;
 
        if (my_index >= panel->count)
            my_index = panel->count - 1;
-       
+
        if (my_index != panel->selected){
            unselect_item (panel);
            panel->selected = my_index;
        if (my_index != panel->selected){
            unselect_item (panel);
            panel->selected = my_index;
@@ -2422,7 +2422,7 @@ panel_event (Gpm_Event *event, WPanel *panel)
 
        /* This one is new */
        mark_if_marking (panel, event);
 
        /* This one is new */
        mark_if_marking (panel, event);
-       
+
     } else if ((event->type & (GPM_UP|GPM_DOUBLE)) == (GPM_UP|GPM_DOUBLE)){
             if (event->y > 0 && event->y <= lines)
                do_enter (panel);
     } else if ((event->type & (GPM_UP|GPM_DOUBLE)) == (GPM_UP|GPM_DOUBLE)){
             if (event->y > 0 && event->y <= lines)
                do_enter (panel);
@@ -2436,7 +2436,7 @@ int
 panel_event (Gpm_Event *event, WPanel *panel)
 {
     const int lines = llines (panel);
 panel_event (Gpm_Event *event, WPanel *panel)
 {
     const int lines = llines (panel);
-    
+
     int my_index;
     extern void change_panel (void);
 
     int my_index;
     extern void change_panel (void);
 
@@ -2487,7 +2487,7 @@ panel_event (Gpm_Event *event, WPanel *panel)
 
        if (my_index >= panel->count)
            my_index = panel->count - 1;
 
        if (my_index >= panel->count)
            my_index = panel->count - 1;
-       
+
        if (my_index != panel->selected){
            unselect_item (panel);
            panel->selected = my_index;
        if (my_index != panel->selected){
            unselect_item (panel);
            panel->selected = my_index;
@@ -2496,7 +2496,7 @@ panel_event (Gpm_Event *event, WPanel *panel)
 
        /* This one is new */
        mark_if_marking (panel, event);
 
        /* This one is new */
        mark_if_marking (panel, event);
-       
+
     } else if ((event->type & (GPM_UP|GPM_DOUBLE)) == (GPM_UP|GPM_DOUBLE)){
             if (event->y > 0 && event->y <= lines)
                do_enter (panel);
     } else if ((event->type & (GPM_UP|GPM_DOUBLE)) == (GPM_UP|GPM_DOUBLE)){
             if (event->y > 0 && event->y <= lines)
                do_enter (panel);
index 0840e6b..99af533 100644 (file)
@@ -1,11 +1,11 @@
 /* Setup loading/saving.
    Copyright (C) 1994 Miguel de Icaza
 /* Setup loading/saving.
    Copyright (C) 1994 Miguel de Icaza
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -66,7 +66,7 @@ extern int ftpfs_use_passive_connections;
 extern int ftpfs_use_unix_list_options;
 #endif
 
 extern int ftpfs_use_unix_list_options;
 #endif
 
-/* "$Id: setup.c,v 1.1 2001/12/30 09:55:21 sedwards Exp $" */
+/* "$Id$" */
 
 #ifdef USE_VFS
 extern int vfs_timeout;
 
 #ifdef USE_VFS
 extern int vfs_timeout;
@@ -131,7 +131,7 @@ static struct {
     { "tree",      view_tree },
     { 0, 0 }
 };
     { "tree",      view_tree },
     { 0, 0 }
 };
-    
+
 static struct {
     char *opt_name;
     int *opt_addr;
 static struct {
     char *opt_name;
     int *opt_addr;
@@ -216,7 +216,7 @@ static struct {
        (follow links, stable symlinks) -Norbert */
     { "tree_navigation_flag", &tree_navigation_flag },
 #endif
        (follow links, stable symlinks) -Norbert */
     { "tree_navigation_flag", &tree_navigation_flag },
 #endif
-#ifdef USE_VFS    
+#ifdef USE_VFS
     { "tar_gzipped_memlimit", &tar_gzipped_memlimit },
     { "vfs_timeout", &vfs_timeout },
     { "vfs_use_targz_memlimit", &vfs_use_limit },
     { "tar_gzipped_memlimit", &tar_gzipped_memlimit },
     { "vfs_timeout", &vfs_timeout },
     { "vfs_use_targz_memlimit", &vfs_use_limit },
@@ -260,7 +260,7 @@ void panel_save_setup (WPanel *panel, char *section)
 {
     char buffer [40];
     int  i;
 {
     char buffer [40];
     int  i;
-    
+
     sprintf (buffer, "%d", panel->reverse);
     save_string (section, "reverse", buffer, profile_name);
     sprintf (buffer, "%d", panel->case_sensitive);
     sprintf (buffer, "%d", panel->reverse);
     save_string (section, "reverse", buffer, profile_name);
     sprintf (buffer, "%d", panel->case_sensitive);
@@ -277,16 +277,16 @@ void panel_save_setup (WPanel *panel, char *section)
            save_string (section, PORT_LIST_MODE_NAME, list_types [i].key, profile_name);
            break;
        }
            save_string (section, PORT_LIST_MODE_NAME, list_types [i].key, profile_name);
            break;
        }
-    
+
     save_string (section, "user_format",
                               panel->user_format, profile_name);
     save_string (section, "user_format",
                               panel->user_format, profile_name);
-                              
+
     for (i = 0; i < LIST_TYPES; i++){
        sprintf (buffer, "user_status%d", i);
     for (i = 0; i < LIST_TYPES; i++){
        sprintf (buffer, "user_status%d", i);
-       save_string (section, buffer, 
+       save_string (section, buffer,
            panel->user_status_format [i], profile_name);
     }
            panel->user_status_format [i], profile_name);
     }
-                              
+
     sprintf (buffer, "%d", panel->user_mini_status);
     save_string (section, "user_mini_status", buffer,
                               profile_name);
     sprintf (buffer, "%d", panel->user_mini_status);
     save_string (section, "user_mini_status", buffer,
                               profile_name);
@@ -326,7 +326,7 @@ void save_configure (void)
 static void panel_save_type (char *section, int type)
 {
     int i;
 static void panel_save_type (char *section, int type)
 {
     int i;
-    
+
     for (i = 0; panel_types [i].opt_name; i++)
        if (panel_types [i].opt_type == type){
            save_string (section, "display", panel_types [i].opt_name,
     for (i = 0; panel_types [i].opt_name; i++)
        if (panel_types [i].opt_type == type){
            save_string (section, "display", panel_types [i].opt_name,
@@ -374,7 +374,7 @@ void save_setup (void)
     save_panelize ();
     save_panel_types ();
 /*     directory_history_save (); */
     save_panelize ();
     save_panel_types ();
 /*     directory_history_save (); */
-    
+
 #ifdef USE_VFS
 #ifdef USE_NETCODE
     WritePrivateProfileString ("Misc", "ftpfs_password",
 #ifdef USE_VFS
 #ifdef USE_NETCODE
     WritePrivateProfileString ("Misc", "ftpfs_password",
@@ -392,10 +392,10 @@ void panel_load_setup (WPanel *panel, char *section)
 {
     int i;
     char buffer [40];
 {
     int i;
     char buffer [40];
-    
+
     panel->reverse = load_int (section, "reverse", 0);
     panel->case_sensitive = load_int (section, "case_sensitive", OS_SORT_CASE_SENSITIVE_DEFAULT);
     panel->reverse = load_int (section, "reverse", 0);
     panel->case_sensitive = load_int (section, "case_sensitive", OS_SORT_CASE_SENSITIVE_DEFAULT);
-    
+
     /* Load sort order */
     load_string (section, "sort_order", "name", buffer, sizeof (buffer));
     panel->sort_type = (sortfn *) sort_name;
     /* Load sort order */
     load_string (section, "sort_order", "name", buffer, sizeof (buffer));
     panel->sort_type = (sortfn *) sort_name;
@@ -433,7 +433,7 @@ void panel_load_setup (WPanel *panel, char *section)
            strdup (get_profile_string (section, buffer,
                        DEFAULT_USER_FORMAT, profile_name));
     }
            strdup (get_profile_string (section, buffer,
                        DEFAULT_USER_FORMAT, profile_name));
     }
-    
+
     panel->user_mini_status =
        load_int (section, "user_mini_status", 0);
 
     panel->user_mini_status =
        load_int (section, "user_mini_status", 0);
 
@@ -442,7 +442,7 @@ void panel_load_setup (WPanel *panel, char *section)
 static void load_layout (char *profile_name)
 {
     int i;
 static void load_layout (char *profile_name)
 {
     int i;
-    
+
     for (i = 0; layout [i].opt_name; i++)
        *layout [i].opt_addr =
            load_int ("Layout", layout [i].opt_name,
     for (i = 0; layout [i].opt_name; i++)
        *layout [i].opt_addr =
            load_int ("Layout", layout [i].opt_name,
@@ -453,9 +453,9 @@ static int load_mode (char *section)
 {
     char buffer [20];
     int  i;
 {
     char buffer [20];
     int  i;
-    
+
     int mode = view_listing;
     int mode = view_listing;
-    
+
     /* Load the display mode */
     load_string (section, "display", "listing", buffer, sizeof (buffer));
 
     /* Load the display mode */
     load_string (section, "display", "listing", buffer, sizeof (buffer));
 
@@ -472,7 +472,7 @@ char *do_load_string (char *s, char *ss, char *def)
 {
     char *buffer = xmalloc (128, "dls");
     char *p;
 {
     char *buffer = xmalloc (128, "dls");
     char *p;
-    
+
     load_string (s, ss, def, buffer, 128);
 
     p = strdup (buffer);
     load_string (s, ss, def, buffer, 128);
 
     p = strdup (buffer);
@@ -500,7 +500,7 @@ void load_setup (void)
        profile = buffer;
     }
     free (inifile);
        profile = buffer;
     }
     free (inifile);
-    
+
     profile_name = profile;
 
     /* Load integer boolean options */
     profile_name = profile;
 
     /* Load integer boolean options */
@@ -518,7 +518,7 @@ void load_setup (void)
     /* At least one of the panels is a listing panel */
     if (startup_left_mode != view_listing && startup_right_mode!=view_listing)
        startup_left_mode = view_listing;
     /* At least one of the panels is a listing panel */
     if (startup_left_mode != view_listing && startup_right_mode!=view_listing)
        startup_left_mode = view_listing;
-    
+
     if (!other_dir){
        buffer = (char*) malloc (MC_MAXPATHLEN);
        load_string ("Dirs", "other_dir", ".", buffer,
     if (!other_dir){
        buffer = (char*) malloc (MC_MAXPATHLEN);
        load_string ("Dirs", "other_dir", ".", buffer,
@@ -533,12 +533,12 @@ void load_setup (void)
 #endif
     boot_current_is_left =
        GetPrivateProfileInt ("Dirs", "current_is_left", 1, profile);
 #endif
     boot_current_is_left =
        GetPrivateProfileInt ("Dirs", "current_is_left", 1, profile);
-    
+
     load_string ("Misc", "find_ignore_dirs", "", setup_color_string,
                 sizeof (setup_color_string));
     if (setup_color_string [0])
        find_ignore_dirs = copy_strings (":", setup_color_string, ":", 0);
     load_string ("Misc", "find_ignore_dirs", "", setup_color_string,
                 sizeof (setup_color_string));
     if (setup_color_string [0])
        find_ignore_dirs = copy_strings (":", setup_color_string, ":", 0);
-    
+
     /* The default color and the terminal dependent color */
     load_string ("Colors", "base_color", "", setup_color_string,
                             sizeof (setup_color_string));
     /* The default color and the terminal dependent color */
     load_string ("Colors", "base_color", "", setup_color_string,
                             sizeof (setup_color_string));
@@ -598,7 +598,7 @@ void load_keys_from_section (char *terminal, char *profile_name)
        free (section_name);
        return;
     }
        free (section_name);
        return;
     }
-    
+
     while (profile_keys){
        profile_keys = profile_iterator_next (profile_keys, &key, &value);
        key_code = lookup_key (key);
     while (profile_keys){
        profile_keys = profile_iterator_next (profile_keys, &key, &value);
        key_code = lookup_key (key);
index e61a7f4..1a9d9d3 100644 (file)
@@ -1,16 +1,16 @@
 /* Slang interface to the Midnight Commander
    This emulates some features of ncurses on top of slang
 /* Slang interface to the Midnight Commander
    This emulates some features of ncurses on top of slang
-   
+
    Copyright (C) 1995, 1996 The Free Software Foundation.
 
    Author Miguel de Icaza
           Norbert Warmuth
    Copyright (C) 1995, 1996 The Free Software Foundation.
 
    Author Miguel de Icaza
           Norbert Warmuth
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -86,14 +86,14 @@ static unsigned int SLang_getkey2 (void)
 {
    unsigned int imax;
    unsigned int ch;
 {
    unsigned int imax;
    unsigned int ch;
-   
+
    if (SLang_Input_Buffer_Len)
      {
        ch = (unsigned int) *SLang_Input_Buffer;
        SLang_Input_Buffer_Len--;
        imax = SLang_Input_Buffer_Len;
    if (SLang_Input_Buffer_Len)
      {
        ch = (unsigned int) *SLang_Input_Buffer;
        SLang_Input_Buffer_Len--;
        imax = SLang_Input_Buffer_Len;
-   
-       memcpy ((char *) SLang_Input_Buffer, 
+
+       memcpy ((char *) SLang_Input_Buffer,
                (char *) (SLang_Input_Buffer + 1), imax);
        return(ch);
      }
                (char *) (SLang_Input_Buffer + 1), imax);
        return(ch);
      }
@@ -109,16 +109,16 @@ static int SLang_input_pending2 (int tsecs)
    int n;
    unsigned char c;
    if (SLang_Input_Buffer_Len) return (int) SLang_Input_Buffer_Len;
    int n;
    unsigned char c;
    if (SLang_Input_Buffer_Len) return (int) SLang_Input_Buffer_Len;
-#if SLANG_VERSION >= 10000  
+#if SLANG_VERSION >= 10000
    n = _SLsys_input_pending (tsecs);
 #else
    n = SLsys_input_pending (tsecs);
 #endif
    if (n <= 0) return 0;
    n = _SLsys_input_pending (tsecs);
 #else
    n = SLsys_input_pending (tsecs);
 #endif
    if (n <= 0) return 0;
-   
+
    c = (unsigned char) SLang_getkey2 ();
    SLang_ungetkey_string (&c, 1);
    c = (unsigned char) SLang_getkey2 ();
    SLang_ungetkey_string (&c, 1);
-   
+
    return n;
 }
 /* }}} */
    return n;
 }
 /* }}} */
@@ -142,7 +142,7 @@ void
 enable_interrupt_key(void)
 {
     struct sigaction act;
 enable_interrupt_key(void)
 {
     struct sigaction act;
-    
+
     act.sa_handler = slang_intr;
     sigemptyset (&act.sa_mask);
     act.sa_flags = 0;
     act.sa_handler = slang_intr;
     sigemptyset (&act.sa_mask);
     act.sa_flags = 0;
@@ -154,7 +154,7 @@ void
 disable_interrupt_key(void)
 {
     struct sigaction act;
 disable_interrupt_key(void)
 {
     struct sigaction act;
-    
+
     act.sa_handler = SIG_IGN;
     act.sa_flags = 0;
     sigemptyset (&act.sa_mask);
     act.sa_handler = SIG_IGN;
     act.sa_flags = 0;
     sigemptyset (&act.sa_mask);
@@ -179,12 +179,12 @@ slang_init (void)
     extern int SLtt_Has_Alt_Charset;
     extern int force_ugly_line_drawing;
     struct sigaction act, oact;
     extern int SLtt_Has_Alt_Charset;
     extern int force_ugly_line_drawing;
     struct sigaction act, oact;
-    
+
     SLtt_get_terminfo ();
     tcgetattr (fileno (stdin), &boot_mode);
     /* 255 = ignore abort char; XCTRL('g') for abort char = ^g */
     SLtt_get_terminfo ();
     tcgetattr (fileno (stdin), &boot_mode);
     /* 255 = ignore abort char; XCTRL('g') for abort char = ^g */
-    SLang_init_tty (XCTRL('c'), 1, 0); 
-    
+    SLang_init_tty (XCTRL('c'), 1, 0);
+
     /* If SLang uses fileno(stderr) for terminal input MC will hang
        if we call SLang_getkey between calls to open_error_pipe and
        close_error_pipe, e.g. when we do a growing view of an gzipped
     /* If SLang uses fileno(stderr) for terminal input MC will hang
        if we call SLang_getkey between calls to open_error_pipe and
        close_error_pipe, e.g. when we do a growing view of an gzipped
@@ -238,7 +238,7 @@ void
 slang_shutdown ()
 {
     char *op_cap;
 slang_shutdown ()
 {
     char *op_cap;
-    
+
     slang_shell_mode ();
     do_exit_ca_mode ();
     SLang_reset_tty ();
     slang_shell_mode ();
     do_exit_ca_mode ();
     SLang_reset_tty ();
@@ -255,19 +255,19 @@ slang_shutdown ()
 
 /* HP Terminals have capabilities (pfkey, pfloc, pfx) to program function keys.
    elm 2.4pl15 invoked with the -K option utilizes these softkeys and the
 
 /* HP Terminals have capabilities (pfkey, pfloc, pfx) to program function keys.
    elm 2.4pl15 invoked with the -K option utilizes these softkeys and the
-   consequence is that function keys don't work in MC sometimes. 
-   Unfortunately I don't now the one and only escape sequence to turn off 
-   softkeys (elm uses three different capabilities to turn on softkeys and two 
-   capabilities to turn them off). 
-   Among other things elm uses the pair we already use in slang_keypad. That's 
+   consequence is that function keys don't work in MC sometimes.
+   Unfortunately I don't now the one and only escape sequence to turn off
+   softkeys (elm uses three different capabilities to turn on softkeys and two
+   capabilities to turn them off).
+   Among other things elm uses the pair we already use in slang_keypad. That's
    the reason why I call slang_reset_softkeys from slang_keypad. In lack of
    something better the softkeys are programmed to their defaults from the
    termcap/terminfo database.
    the reason why I call slang_reset_softkeys from slang_keypad. In lack of
    something better the softkeys are programmed to their defaults from the
    termcap/terminfo database.
-   The escape sequence to program the softkeys is taken from elm and it is 
-   hardcoded because neither slang nor ncurses 4.1 know how to 'printf' this 
+   The escape sequence to program the softkeys is taken from elm and it is
+   hardcoded because neither slang nor ncurses 4.1 know how to 'printf' this
    sequence. -- Norbert
    sequence. -- Norbert
- */   
-   
+ */
+
 void
 slang_reset_softkeys (void)
 {
 void
 slang_reset_softkeys (void)
 {
@@ -275,7 +275,7 @@ slang_reset_softkeys (void)
     char *send;
     char *display = "                ";
     char tmp[100];
     char *send;
     char *display = "                ";
     char tmp[100];
-    
+
     for ( key = 1; key < 9; key++ ) {
        sprintf ( tmp, "k%d", key);
        send = (char *) SLtt_tgetstr (tmp);
     for ( key = 1; key < 9; key++ ) {
        sprintf ( tmp, "k%d", key);
        send = (char *) SLtt_tgetstr (tmp);
@@ -293,7 +293,7 @@ slang_keypad (int set)
 {
     char *keypad_string;
     extern int reset_hp_softkeys;
 {
     char *keypad_string;
     extern int reset_hp_softkeys;
-    
+
     keypad_string = (char *) SLtt_tgetstr (set ? "ks" : "ke");
     if (keypad_string)
        SLtt_write_string (keypad_string);
     keypad_string = (char *) SLtt_tgetstr (set ? "ks" : "ke");
     if (keypad_string)
        SLtt_write_string (keypad_string);
@@ -314,7 +314,7 @@ hline (int ch, int len)
 
     last_x = SLsmg_get_column ();
     last_y = SLsmg_get_row ();
 
     last_x = SLsmg_get_column ();
     last_y = SLsmg_get_row ();
-    
+
     if (ch == 0)
        ch = ACS_HLINE;
 
     if (ch == 0)
        ch = ACS_HLINE;
 
@@ -459,7 +459,7 @@ int has_colors ()
         }
       }
     }
         }
       }
     }
-    
+
     /* Setup emulated colors */
     if (SLtt_Use_Ansi_Colors){
         if (use_colors){
     /* Setup emulated colors */
     if (SLtt_Use_Ansi_Colors){
         if (use_colors){
@@ -469,7 +469,7 @@ int has_colors ()
            init_pair (A_REVERSE, "black", "lightgray");
            init_pair (A_BOLD, "white", "black");
            init_pair (A_BOLD_REVERSE, "white", "lightgray");
            init_pair (A_REVERSE, "black", "lightgray");
            init_pair (A_BOLD, "white", "black");
            init_pair (A_BOLD_REVERSE, "white", "lightgray");
-       } 
+       }
     } else {
        SLtt_set_mono (A_BOLD,    NULL, SLTT_BOLD_MASK);
        SLtt_set_mono (A_REVERSE, NULL, SLTT_REV_MASK);
     } else {
        SLtt_set_mono (A_BOLD,    NULL, SLTT_BOLD_MASK);
        SLtt_set_mono (A_REVERSE, NULL, SLTT_REV_MASK);
@@ -485,7 +485,7 @@ attrset (int color)
        SLsmg_set_color (color);
        return;
     }
        SLsmg_set_color (color);
        return;
     }
-    
+
     if (color & A_BOLD){
        if (color == A_BOLD)
            SLsmg_set_color (A_BOLD);
     if (color & A_BOLD){
        if (color == A_BOLD)
            SLsmg_set_color (A_BOLD);
@@ -527,7 +527,7 @@ struct {
     { KEY_F(17), "F7" },
     { KEY_F(18), "F8" },
     { KEY_F(19), "F9" },
     { KEY_F(17), "F7" },
     { KEY_F(18), "F8" },
     { KEY_F(19), "F9" },
-    { KEY_F(20), "FA" },       
+    { KEY_F(20), "FA" },
     { KEY_IC,    "kI" },
     { KEY_NPAGE, "kN" },
     { KEY_PPAGE, "kP" },
     { KEY_IC,    "kI" },
     { KEY_NPAGE, "kN" },
     { KEY_PPAGE, "kP" },
@@ -541,7 +541,7 @@ struct {
     { KEY_END,  "@7" },
     { 0, 0}
 };
     { KEY_END,  "@7" },
     { 0, 0}
 };
-       
+
 void
 do_define_key (int code, char *strcap)
 {
 void
 do_define_key (int code, char *strcap)
 {
index d6762d3..b1e7a61 100644 (file)
@@ -24,7 +24,7 @@
 
 /* {{{ Declarations */
 
 
 /* {{{ Declarations */
 
-#include <stdio.h>      
+#include <stdio.h>
 #include <stdlib.h>    /* For errno, putenv, etc.            */
 #include <errno.h>     /* For errno on SunOS systems         */
 #include <termios.h>   /* tcgetattr(), struct termios, etc.  */
 #include <stdlib.h>    /* For errno, putenv, etc.            */
 #include <errno.h>     /* For errno on SunOS systems         */
 #include <termios.h>   /* tcgetattr(), struct termios, etc.  */
@@ -213,7 +213,7 @@ void init_subshell (void)
     /* Braindead tcsh can't redirect output to a file descriptor? */
     char tcsh_fifo[sizeof "/tmp/mc.pipe.1234567890"];
 
     /* Braindead tcsh can't redirect output to a file descriptor? */
     char tcsh_fifo[sizeof "/tmp/mc.pipe.1234567890"];
 
-    
+
 #ifdef SYNC_PTY_SIDES
        /* Used to wait for a SIGUSR1 signal from the subprocess */
        sigset_t sigusr1_mask, old_mask;
 #ifdef SYNC_PTY_SIDES
        /* Used to wait for a SIGUSR1 signal from the subprocess */
        sigset_t sigusr1_mask, old_mask;
@@ -316,7 +316,7 @@ void init_subshell (void)
     subshell_alive = TRUE;
     subshell_stopped = FALSE;
     subshell_pid = fork ();
     subshell_alive = TRUE;
     subshell_stopped = FALSE;
     subshell_pid = fork ();
-    
+
     if (subshell_pid == -1)
     {
        perror (__FILE__": couldn't spawn the subshell process");
     if (subshell_pid == -1)
     {
        perror (__FILE__": couldn't spawn the subshell process");
@@ -330,7 +330,7 @@ void init_subshell (void)
     if (subshell_pid == 0)  /* We are in the child process */
     {
        char *init_file = NULL;
     if (subshell_pid == 0)  /* We are in the child process */
     {
        char *init_file = NULL;
-       
+
        setsid ();  /* Get a fresh terminal session */
 
        /* {{{ Open the slave side of the pty: again */
        setsid ();  /* Get a fresh terminal session */
 
        /* {{{ Open the slave side of the pty: again */
@@ -478,7 +478,7 @@ void init_subshell (void)
 
     init_sigchld ();
 
 
     init_sigchld ();
 
-    /* We could have received the SIGCHLD signal for the subshell 
+    /* We could have received the SIGCHLD signal for the subshell
      * before installing the init_sigchld */
     pid = waitpid (subshell_pid, &status, WUNTRACED | WNOHANG);
     if (pid == subshell_pid){
      * before installing the init_sigchld */
     pid = waitpid (subshell_pid, &status, WUNTRACED | WNOHANG);
     if (pid == subshell_pid){
@@ -535,7 +535,7 @@ int invoke_subshell (const char *command, int how, char **new_dir)
     /* {{{ Fiddle with terminal modes */
 
     static struct termios raw_mode = {0};
     /* {{{ Fiddle with terminal modes */
 
     static struct termios raw_mode = {0};
-    
+
     /* MC calls reset_shell_mode() in pre_exec() to set the real tty to its */
     /* original settings.  However, here we need to make this tty very raw, */
     /* so that all keyboard signals, XON/XOFF, etc. will get through to the */
     /* MC calls reset_shell_mode() in pre_exec() to set the real tty to its */
     /* original settings.  However, here we need to make this tty very raw, */
     /* so that all keyboard signals, XON/XOFF, etc. will get through to the */
@@ -558,11 +558,11 @@ int invoke_subshell (const char *command, int how, char **new_dir)
     tcsetattr (STDOUT_FILENO, TCSANOW, &raw_mode);
 
     /* }}} */
     tcsetattr (STDOUT_FILENO, TCSANOW, &raw_mode);
 
     /* }}} */
-    
+
     /* Make the subshell change to MC's working directory */
     if (new_dir)
        do_subshell_chdir (cpanel->cwd, TRUE, 1);
     /* Make the subshell change to MC's working directory */
     if (new_dir)
        do_subshell_chdir (cpanel->cwd, TRUE, 1);
-    
+
     if (command == NULL)  /* The user has done "C-o" from MC */
     {
        if (subshell_state == INACTIVE)
     if (command == NULL)  /* The user has done "C-o" from MC */
     {
        if (subshell_state == INACTIVE)
@@ -653,7 +653,7 @@ int read_subshell_prompt (int how)
                clear_now = TRUE;
                if (!pty_buffer [i])
                    continue;
                clear_now = TRUE;
                if (!pty_buffer [i])
                    continue;
-               
+
                subshell_prompt[prompt_pos++] = pty_buffer[i];
                if (prompt_pos == prompt_size)
                    subshell_prompt = (char *) realloc (subshell_prompt,
                subshell_prompt[prompt_pos++] = pty_buffer[i];
                if (prompt_pos == prompt_size)
                    subshell_prompt = (char *) realloc (subshell_prompt,
@@ -695,7 +695,7 @@ void resize_subshell (void)
 int exit_subshell (void)
 {
     int quit = TRUE;
 int exit_subshell (void)
 {
     int quit = TRUE;
-    
+
     if (subshell_state != INACTIVE && subshell_alive)
        quit = !query_dialog (_(" Warning "), _(" The shell is still active. Quit anyway? "),
                              0, 2, _("&Yes"), _("&No"));
     if (subshell_state != INACTIVE && subshell_alive)
        quit = !query_dialog (_(" Warning "), _(" The shell is still active. Quit anyway? "),
                              0, 2, _("&Yes"), _("&No"));
@@ -739,7 +739,7 @@ int exit_subshell (void)
        if (unlink (pty_buffer) == -1)
            perror (__FILE__": couldn't remove named pipe /tmp/mc.pipe.NNN");
     }
        if (unlink (pty_buffer) == -1)
            perror (__FILE__": couldn't remove named pipe /tmp/mc.pipe.NNN");
     }
-    
+
     return quit;
 }
 
     return quit;
 }
 
@@ -750,7 +750,7 @@ int exit_subshell (void)
 void do_subshell_chdir (char *directory, int do_update, int reset_prompt)
 {
     char *temp;
 void do_subshell_chdir (char *directory, int do_update, int reset_prompt)
 {
     char *temp;
-    
+
     if (!(subshell_state == INACTIVE && strcmp (subshell_cwd, cpanel->cwd))){
        /* We have to repaint the subshell prompt if we read it from
         * the main program.  Please note that in the code after this
     if (!(subshell_state == INACTIVE && strcmp (subshell_cwd, cpanel->cwd))){
        /* We have to repaint the subshell prompt if we read it from
         * the main program.  Please note that in the code after this
@@ -760,22 +760,22 @@ void do_subshell_chdir (char *directory, int do_update, int reset_prompt)
            do_update_prompt ();
        return;
     }
            do_update_prompt ();
        return;
     }
-    
+
     /* The initial space keeps this out of the command history (in bash
        because we set "HISTCONTROL=ignorespace") */
     write (subshell_pty, " cd ", 4);
     if (*directory) {
        temp = name_quote (directory, 0);
     /* The initial space keeps this out of the command history (in bash
        because we set "HISTCONTROL=ignorespace") */
     write (subshell_pty, " cd ", 4);
     if (*directory) {
        temp = name_quote (directory, 0);
-       write (subshell_pty, temp, strlen (temp));    
+       write (subshell_pty, temp, strlen (temp));
         free (temp);
     } else {
        write (subshell_pty, "/", 1);
     }
     write (subshell_pty, "\n", 1);
         free (temp);
     } else {
        write (subshell_pty, "/", 1);
     }
     write (subshell_pty, "\n", 1);
-    
+
     subshell_state = RUNNING_COMMAND;
     feed_subshell (QUIETLY, FALSE);
     subshell_state = RUNNING_COMMAND;
     feed_subshell (QUIETLY, FALSE);
-    
+
     if (subshell_alive && strcmp (subshell_cwd, cpanel->cwd) && strcmp (cpanel->cwd, "."))
        fprintf (stderr, _("Warning: Couldn't change to %s.\n"), cpanel->cwd);
 
     if (subshell_alive && strcmp (subshell_cwd, cpanel->cwd) && strcmp (cpanel->cwd, "."))
        fprintf (stderr, _("Warning: Couldn't change to %s.\n"), cpanel->cwd);
 
@@ -840,7 +840,7 @@ void sigchld_handler (int sig)
 #ifndef HAVE_X
 #ifndef SCO_FLAVOR
     pid = waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG);
 #ifndef HAVE_X
 #ifndef SCO_FLAVOR
     pid = waitpid (cons_saver_pid, &status, WUNTRACED | WNOHANG);
-    
+
     if (pid == cons_saver_pid) {
        /* {{{ Someone has stopped or killed cons.saver; restart it */
 
     if (pid == cons_saver_pid) {
        /* {{{ Someone has stopped or killed cons.saver; restart it */
 
@@ -874,7 +874,7 @@ static int feed_subshell (int how, int fail_on_error)
     fd_set read_set;   /* For `select' */
     int bytes;         /* For the return value from `read' */
     int i;             /* Loop counter */
     fd_set read_set;   /* For `select' */
     int bytes;         /* For the return value from `read' */
     int i;             /* Loop counter */
-    
+
     struct timeval wtime; /* Maximum time we wait for the subshell */
     struct timeval *wptr;
     /* }}} */
     struct timeval wtime; /* Maximum time we wait for the subshell */
     struct timeval *wptr;
     /* }}} */
@@ -882,7 +882,7 @@ static int feed_subshell (int how, int fail_on_error)
     /* we wait up to 10 seconds if fail_on_error */
     wtime.tv_sec = 10;
     wtime.tv_usec = 0;
     /* we wait up to 10 seconds if fail_on_error */
     wtime.tv_sec = 10;
     wtime.tv_usec = 0;
-    
+
     for (wptr = fail_on_error ? &wtime : NULL;;)
     {
        if (!subshell_alive)
     for (wptr = fail_on_error ? &wtime : NULL;;)
     {
        if (!subshell_alive)
@@ -909,7 +909,7 @@ static int feed_subshell (int how, int fail_on_error)
 
        /* From now on: block forever on the select call */
        wptr = NULL;
 
        /* From now on: block forever on the select call */
        wptr = NULL;
-       
+
        if (FD_ISSET (subshell_pty, &read_set))
            /* {{{ Read from the subshell, write to stdout */
 
        if (FD_ISSET (subshell_pty, &read_set))
            /* {{{ Read from the subshell, write to stdout */
 
@@ -1054,7 +1054,7 @@ static int pty_open_slave (const char *pty_name)
 {
     int pty_slave;
     struct group *group_info = getgrnam ("terminal");
 {
     int pty_slave;
     struct group *group_info = getgrnam ("terminal");
-    
+
     if (group_info != NULL)
     {
        /* The following two calls will only succeed if we are root */
     if (group_info != NULL)
     {
        /* The following two calls will only succeed if we are root */
@@ -1112,7 +1112,7 @@ static int pty_open_slave (const char *pty_name)
            close (pty_slave);
            return -1;
        }
            close (pty_slave);
            return -1;
        }
-       
+
     if (!ioctl (pty_slave, I_FIND, "ldterm"))
         if (ioctl (pty_slave, I_PUSH, "ldterm") == -1)
        {
     if (!ioctl (pty_slave, I_FIND, "ldterm"))
         if (ioctl (pty_slave, I_PUSH, "ldterm") == -1)
        {
index 377b730..c4fd7b0 100644 (file)
@@ -1,11 +1,11 @@
 /* Term name pollution avoiding.
    Copyright (C) 1994 Miguel de Icaza
 /* Term name pollution avoiding.
    Copyright (C) 1994 Miguel de Icaza
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
index 4d34826..31a0668 100644 (file)
@@ -57,7 +57,7 @@ edition_post_exec (void)
     /* FIXME: Missing on slang endwin? */
     reset_prog_mode ();
     flushinp ();
     /* FIXME: Missing on slang endwin? */
     reset_prog_mode ();
     flushinp ();
-    
+
     keypad (stdscr, TRUE);
     mc_raw_mode ();
     channels_up ();
     keypad (stdscr, TRUE);
     mc_raw_mode ();
     channels_up ();
@@ -80,13 +80,13 @@ edition_pre_exec (void)
     channels_down ();
     if (use_mouse_p)
        shut_mouse ();
     channels_down ();
     if (use_mouse_p)
        shut_mouse ();
-    
+
     reset_shell_mode ();
     keypad (stdscr, FALSE);
     endwin ();
     reset_shell_mode ();
     keypad (stdscr, FALSE);
     endwin ();
-    
+
     numeric_keypad_mode ();
     numeric_keypad_mode ();
-    
+
     /* on xterms: maybe endwin did not leave the terminal on the shell
      * screen page: do it now.
      *
     /* on xterms: maybe endwin did not leave the terminal on the shell
      * screen page: do it now.
      *
index 91a185d..6eec44e 100644 (file)
@@ -4,12 +4,12 @@
    Written: 1994, 1996 Janne Kukonlehto
             1997 Norbert Warmuth
             1996 Miguel de Icaza
    Written: 1994, 1996 Janne Kukonlehto
             1997 Norbert Warmuth
             1996 Miguel de Icaza
-           
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -78,7 +78,7 @@ int xtree_mode = 0;
 static int tree_callback (Dlg_head *h, WTree *tree, int msg, int par);
 #define tcallback (callback_fn) tree_callback
 
 static int tree_callback (Dlg_head *h, WTree *tree, int msg, int par);
 #define tcallback (callback_fn) tree_callback
 
-/* "$Id: tree.c,v 1.1 2001/12/30 09:55:21 sedwards Exp $" */
+/* "$Id$" */
 
 /* Returns number of common characters */
 static inline int str_common (char *s1, char *s2)
 
 /* Returns number of common characters */
 static inline int str_common (char *s1, char *s2)
@@ -125,14 +125,14 @@ static tree_entry *forw_ptr (tree_entry *ptr, int *count)
         /etc.old/X11
         /etc.old/rc.d
         /usr
         /etc.old/X11
         /etc.old/rc.d
         /usr
-       
-   i.e. the required collating sequence when comparing two directory names is 
+
+   i.e. the required collating sequence when comparing two directory names is
         '\0' < PATH_SEP < all-other-characters-in-encoding-order
         '\0' < PATH_SEP < all-other-characters-in-encoding-order
-   
+
     Since strcmp doesn't fulfil this requirement we use pathcmp when
     Since strcmp doesn't fulfil this requirement we use pathcmp when
-    inserting directory names into the list. The meaning of the return value 
-    of pathcmp and strcmp are the same (an integer less than, equal to, or 
-    greater than zero if p1 is found to be less than, to match, or be greater 
+    inserting directory names into the list. The meaning of the return value
+    of pathcmp and strcmp are the same (an integer less than, equal to, or
+    greater than zero if p1 is found to be less than, to match, or be greater
     than p2.
  */
 int
     than p2.
  */
 int
@@ -141,7 +141,7 @@ pathcmp (const char *p1, const char *p2)
     for ( ;*p1 == *p2; p1++, p2++)
         if (*p1 == '\0' )
            return 0;
     for ( ;*p1 == *p2; p1++, p2++)
         if (*p1 == '\0' )
            return 0;
-           
+
     if (*p1 == '\0')
         return -1;
     if (*p2 == '\0')
     if (*p1 == '\0')
         return -1;
     if (*p2 == '\0')
@@ -193,7 +193,7 @@ tree_entry *tree_add_entry (WTree *tree, char *name)
 
     if (!tree)
        return 0;
 
     if (!tree)
        return 0;
-    
+
     if (tree->tree_last && tree->tree_last->next)
        abort ();
 #if 0
     if (tree->tree_last && tree->tree_last->next)
        abort ();
 #if 0
@@ -216,7 +216,7 @@ tree_entry *tree_add_entry (WTree *tree, char *name)
        old = current;
        current = current->next;
     }
        old = current;
        current = current->next;
     }
-    
+
     if (flag == 0)
        return current; /* Already in the list */
 
     if (flag == 0)
        return current; /* Already in the list */
 
@@ -390,7 +390,7 @@ void tree_remove_entry (WTree *tree, char *name)
     if (name [0] == PATH_SEP && name [1] == 0)
        return;
     /* Miguel Ugly hack end */
     if (name [0] == PATH_SEP && name [1] == 0)
        return;
     /* Miguel Ugly hack end */
-    
+
     base = whereis (tree, name);
     if (!base)
        return; /* Doesn't exist */
     base = whereis (tree, name);
     if (!base)
        return; /* Doesn't exist */
@@ -439,7 +439,7 @@ void start_tree_check (WTree *tree)
        tree = (WTree *) find_widget_type (current_dlg, tcallback);
     if (!tree)
        return;
        tree = (WTree *) find_widget_type (current_dlg, tcallback);
     if (!tree)
        return;
-    
+
     /* Search for the start of subdirectories */
     mc_get_current_wd (tree->check_name, MC_MAXPATHLEN);
     tree->check_start = NULL;
     /* Search for the start of subdirectories */
     mc_get_current_wd (tree->check_name, MC_MAXPATHLEN);
     tree->check_start = NULL;
@@ -483,7 +483,7 @@ void do_tree_check (WTree *tree, const char *subname)
     current = tree->check_start;
     while (current && (flag = pathcmp (current->name, name)) < 0)
        current = current->next;
     current = tree->check_start;
     while (current && (flag = pathcmp (current->name, name)) < 0)
        current = current->next;
-    
+
     if (flag != 0)
        /* Doesn't exist -> add it */
        current = tree_add_entry (tree, name);
     if (flag != 0)
        /* Doesn't exist -> add it */
        current = tree_add_entry (tree, name);
@@ -528,7 +528,7 @@ void end_tree_check (WTree *tree)
        tree = (WTree *) find_widget_type (current_dlg, tcallback);
     if (!tree)
        return;
        tree = (WTree *) find_widget_type (current_dlg, tcallback);
     if (!tree)
        return;
-    
+
     /* Check delete marks and delete if found */
     len = strlen (tree->check_name);
 
     /* Check delete marks and delete if found */
     len = strlen (tree->check_name);
 
@@ -561,7 +561,7 @@ void load_tree (WTree *tree)
        file = fopen (filename, "r");
        free (filename);
     }
        file = fopen (filename, "r");
        free (filename);
     }
-    
+
     if (file){
        /* File open -> read contents */
        oldname [0] = 0;
     if (file){
        /* File open -> read contents */
        oldname [0] = 0;
@@ -572,9 +572,9 @@ void load_tree (WTree *tree)
            }
 #ifdef OS2_NT
             /* .ado: Drives for NT and OS/2 */
            }
 #ifdef OS2_NT
             /* .ado: Drives for NT and OS/2 */
-            if ((len > 2)         && 
-                 isalpha(name[0]) && 
-                 (name[1] == ':') && 
+            if ((len > 2)         &&
+                 isalpha(name[0]) &&
+                 (name[1] == ':') &&
                  (name[2] == '\\')) {
                        tree_add_entry (tree, name);
                        strcpy (oldname, name);
                  (name[2] == '\\')) {
                        tree_add_entry (tree, name);
                        strcpy (oldname, name);
@@ -657,17 +657,17 @@ static void tree_show_mini_info (WTree *tree, int tree_lines, int tree_cols)
        line = tree_lines+2;
     } else
        line = tree_lines+1;
        line = tree_lines+2;
     } else
        line = tree_lines+1;
-    
+
     widget_move (&tree->widget, line, 1);
     hline (' ', tree_cols);
     widget_move (&tree->widget, line, 1);
     widget_move (&tree->widget, line, 1);
     hline (' ', tree_cols);
     widget_move (&tree->widget, line, 1);
-    
+
     if (tree->searching){
        /* Show search string */
        attrset (TREE_NORMALC);
        attrset (FOCUSC);
        addch (PATH_SEP);
     if (tree->searching){
        /* Show search string */
        attrset (TREE_NORMALC);
        attrset (FOCUSC);
        addch (PATH_SEP);
-       
+
        addstr (name_trunc (tree->search_buffer, tree_cols-2));
        addch (' ');
        attrset (FOCUSC);
        addstr (name_trunc (tree->search_buffer, tree_cols-2));
        addch (' ');
        attrset (FOCUSC);
@@ -712,7 +712,7 @@ void show_tree (WTree *tree)
        tree->topdiff = 0;
     }
     current = tree->selected_ptr;
        tree->topdiff = 0;
     }
     current = tree->selected_ptr;
-    
+
     /* Calculate the directory which is to be shown on the topmost line */
     if (tree_navigation_flag){
        i = 0;
     /* Calculate the directory which is to be shown on the topmost line */
     if (tree_navigation_flag){
        i = 0;
@@ -747,7 +747,7 @@ void show_tree (WTree *tree)
 
        if (!current)
            continue;
 
        if (!current)
            continue;
-       
+
        tree->tree_shown [i] = current;
        if (current->sublevel == topsublevel){
 
        tree->tree_shown [i] = current;
        if (current->sublevel == topsublevel){
 
@@ -782,7 +782,7 @@ void show_tree (WTree *tree)
                addch (ACS_LTEE);
            addch (ACS_HLINE);
            noacs ();
                addch (ACS_LTEE);
            addch (ACS_HLINE);
            noacs ();
-           
+
            if (tree->active && current == tree->selected_ptr)
                /* Selected directory -> change color */
                if (!use_colors && !tree->is_panel)
            if (tree->active && current == tree->selected_ptr)
                /* Selected directory -> change color */
                if (!use_colors && !tree->is_panel)
@@ -796,7 +796,7 @@ void show_tree (WTree *tree)
                                tree_cols - 2 - 4 - 3 * j));
        }
        addch (' ');
                                tree_cols - 2 - 4 - 3 * j));
        }
        addch (' ');
-       
+
        /* Return to normal color */
        attrset (TREE_NORMALC);
 
        /* Return to normal color */
        attrset (TREE_NORMALC);
 
@@ -838,7 +838,7 @@ void tree_move_backward (WTree *tree, int i)
 {
     tree_entry *current;
     int j = 0;
 {
     tree_entry *current;
     int j = 0;
-    
+
     if (tree_navigation_flag){
        current = tree->selected_ptr;
        while (j < i && current->prev
     if (tree_navigation_flag){
        current = tree->selected_ptr;
        while (j < i && current->prev
@@ -909,7 +909,7 @@ int tree_move_to_parent (WTree *tree)
 {
     tree_entry *current;
     tree_entry *old;
 {
     tree_entry *current;
     tree_entry *old;
-    
+
     if (!tree->selected_ptr)
        return 0;
     old = tree->selected_ptr;
     if (!tree->selected_ptr)
        return 0;
     old = tree->selected_ptr;
@@ -976,7 +976,7 @@ static int event_callback (Gpm_Event *event, WTree *tree)
 
     if (tree->is_panel)
        event->y--;
 
     if (tree->is_panel)
        event->y--;
-    
+
     event->y--;
 
     if (!tree->active)
     event->y--;
 
     if (!tree->active)
@@ -1043,7 +1043,7 @@ static void tree_do_search (WTree *tree, int key)
 
     if (!search_tree (tree, tree->search_buffer))
        tree->search_buffer [--l] = 0;
 
     if (!search_tree (tree, tree->search_buffer))
        tree->search_buffer [--l] = 0;
-    
+
     show_tree (tree);
     maybe_chdir (tree);
 }
     show_tree (tree);
     maybe_chdir (tree);
 }
@@ -1058,7 +1058,7 @@ void tree_rescan_cmd (WTree *tree)
     if (!tree->selected_ptr || !mc_get_current_wd (old_dir, MC_MAXPATHLEN) ||
        mc_chdir (tree->selected_ptr->name))
        return;
     if (!tree->selected_ptr || !mc_get_current_wd (old_dir, MC_MAXPATHLEN) ||
        mc_chdir (tree->selected_ptr->name))
        return;
-    
+
     start_tree_check (tree);
     dirp = opendir (".");
     if (dirp){
     start_tree_check (tree);
     dirp = opendir (".");
     if (dirp){
@@ -1264,7 +1264,7 @@ static void move_end (WTree *tree)
 static int move_left (WTree *tree)
 {
     int v;
 static int move_left (WTree *tree)
 {
     int v;
-    
+
     if (tree_navigation_flag){
        v = tree_move_to_parent (tree);
        show_tree (tree);
     if (tree_navigation_flag){
        v = tree_move_to_parent (tree);
        show_tree (tree);
@@ -1323,15 +1323,15 @@ static void start_search (WTree *tree)
     int i;
 
     if (tree->searching){
     int i;
 
     if (tree->searching){
-    
+
        if (tree->selected_ptr == tree->tree_last)
            tree_move_to_top(tree);
        else {
        if (tree->selected_ptr == tree->tree_last)
            tree_move_to_top(tree);
        else {
-       /* set navigation mode temporarily to 'Static' because in 
+       /* set navigation mode temporarily to 'Static' because in
         * dynamic navigation mode tree_move_forward will not move
         * to a lower sublevel if necessary (sequent searches must
         * start with the directory followed the last found directory)
         * dynamic navigation mode tree_move_forward will not move
         * to a lower sublevel if necessary (sequent searches must
         * start with the directory followed the last found directory)
-         */     
+         */
            i = tree_navigation_flag;
            tree_navigation_flag = 0;
            tree_move_forward (tree, 1);
            i = tree_navigation_flag;
            tree_navigation_flag = 0;
            tree_move_forward (tree, 1);
@@ -1427,7 +1427,7 @@ static void tree_frame (Dlg_head *h, WTree *tree)
     if (tree->is_panel)
        draw_double_box (h, tree->widget.y, tree->widget.x, tree->widget.lines,
                         tree->widget.cols);
     if (tree->is_panel)
        draw_double_box (h, tree->widget.y, tree->widget.x, tree->widget.lines,
                         tree->widget.cols);
-    
+
     if (show_mini_info && tree->is_panel){
        widget_move (tree, tlines (tree) + 1, 1);
        hline (ACS_HLINE, tree->widget.cols - 2);
     if (show_mini_info && tree->is_panel){
        widget_move (tree, tlines (tree) + 1, 1);
        hline (ACS_HLINE, tree->widget.cols - 2);
@@ -1449,29 +1449,29 @@ static int tree_callback (Dlg_head *h, WTree *tree, int msg, int par)
     case WIDGET_FOCUS:
        tree->active = 1;
        define_label (h, (Widget *)tree, 1, _("Help"), (voidfn) tree_help_cmd);
     case WIDGET_FOCUS:
        tree->active = 1;
        define_label (h, (Widget *)tree, 1, _("Help"), (voidfn) tree_help_cmd);
-       define_label_data (h, (Widget *)tree, 
+       define_label_data (h, (Widget *)tree,
            2, _("Rescan"), (buttonbarfn)tree_rescan_cmd, tree);
            2, _("Rescan"), (buttonbarfn)tree_rescan_cmd, tree);
-       define_label_data (h, (Widget *)tree, 
+       define_label_data (h, (Widget *)tree,
            3, _("Forget"), (buttonbarfn)tree_forget_cmd, tree);
            3, _("Forget"), (buttonbarfn)tree_forget_cmd, tree);
-       define_label_data (h, (Widget *)tree, 
+       define_label_data (h, (Widget *)tree,
            5, _("Copy"),   (buttonbarfn) tree_copy_cmd, tree);
            5, _("Copy"),   (buttonbarfn) tree_copy_cmd, tree);
-       define_label_data (h, (Widget *)tree, 
+       define_label_data (h, (Widget *)tree,
            6, _("RenMov"), (buttonbarfn) tree_move_cmd, tree);
 #if 0
        /* FIXME: mkdir is currently defunct */
            6, _("RenMov"), (buttonbarfn) tree_move_cmd, tree);
 #if 0
        /* FIXME: mkdir is currently defunct */
-       define_label_data (h, (Widget *)tree, 
+       define_label_data (h, (Widget *)tree,
            7, _("Mkdir"),  (buttonbarfn) tree_mkdir_cmd, tree);
 #else
         define_label (h, (Widget *)tree, 7, "", 0);
 #endif
            7, _("Mkdir"),  (buttonbarfn) tree_mkdir_cmd, tree);
 #else
         define_label (h, (Widget *)tree, 7, "", 0);
 #endif
-       define_label_data (h, (Widget *)tree, 
+       define_label_data (h, (Widget *)tree,
            8, _("Rmdir"),  (buttonbarfn) tree_rmdir_cmd, tree);
        set_navig_label (h);
        redraw_labels (h, (Widget *)tree);
 
            8, _("Rmdir"),  (buttonbarfn) tree_rmdir_cmd, tree);
        set_navig_label (h);
        redraw_labels (h, (Widget *)tree);
 
-       
+
        /* FIXME: Should find a better way of only displaying the
        /* FIXME: Should find a better way of only displaying the
-          currently selected item */ 
+          currently selected item */
        show_tree (tree);
        return 1;
 
        show_tree (tree);
        return 1;
 
@@ -1500,7 +1500,7 @@ WTree *tree_new (int is_panel, int y, int x, int lines, int cols)
     tree->searching = 0;
     tree->done = 0;
     tree->active = 0;
     tree->searching = 0;
     tree->done = 0;
     tree->active = 0;
-    
+
     /* We do not want to keep the cursor */
     widget_want_cursor (tree->widget, 0);
     load_tree (tree);
     /* We do not want to keep the cursor */
     widget_want_cursor (tree->widget, 0);
     load_tree (tree);
@@ -1521,7 +1521,7 @@ static int my_mkdir_rec (char *s, mode_t mode)
 {
     char *p, *q;
     int result;
 {
     char *p, *q;
     int result;
-    
+
     if (!mc_mkdir (s, mode))
         return 0;
 
     if (!mc_mkdir (s, mode))
         return 0;
 
@@ -1535,7 +1535,7 @@ static int my_mkdir_rec (char *s, mode_t mode)
     free (p);
     if (!(result = my_mkdir_rec (q, mode))) {
        result = mc_mkdir (s, mode);
     free (p);
     if (!(result = my_mkdir_rec (q, mode))) {
        result = mc_mkdir (s, mode);
-    } 
+    }
     free (q);
     return result;
 }
     free (q);
     return result;
 }
@@ -1543,9 +1543,9 @@ static int my_mkdir_rec (char *s, mode_t mode)
 int my_mkdir (char *s, mode_t mode)
 {
     int result;
 int my_mkdir (char *s, mode_t mode)
 {
     int result;
-#if FIXME    
+#if FIXME
     WTree *tree = 0;
     WTree *tree = 0;
-#endif    
+#endif
 
     result = mc_mkdir (s, mode);
 #ifdef OS2_NT
 
     result = mc_mkdir (s, mode);
 #ifdef OS2_NT
@@ -1555,7 +1555,7 @@ int my_mkdir (char *s, mode_t mode)
 #endif
     if (result) {
         char *p = vfs_canon (s);
 #endif
     if (result) {
         char *p = vfs_canon (s);
-        
+
         result = my_mkdir_rec (p, mode);
         free (p);
     }
         result = my_mkdir_rec (p, mode);
         free (p);
     }
@@ -1574,9 +1574,9 @@ int my_mkdir (char *s, mode_t mode)
 int my_rmdir (char *s)
 {
     int result;
 int my_rmdir (char *s)
 {
     int result;
-#if FIXME    
+#if FIXME
     WTree *tree = 0;
     WTree *tree = 0;
-#endif    
+#endif
 
     /* FIXME: Should receive a Wtree! */
     result = mc_rmdir (s);
 
     /* FIXME: Should receive a Wtree! */
     result = mc_rmdir (s);
index c5e2460..30aba60 100644 (file)
@@ -88,7 +88,7 @@ void mc_refresh (void);
 #   define ACS_MAP(x) '*'
 
 #   define NO_COLOR_SUPPORT
 #   define ACS_MAP(x) '*'
 
 #   define NO_COLOR_SUPPORT
-#   define untouchwin(win) 
+#   define untouchwin(win)
 #   define xgetch x_getch
 #   define wtouchln(win,b,c,d) touchwin(win)
 #   define derwin(win,x,y,z,w) win
 #   define xgetch x_getch
 #   define wtouchln(win,b,c,d) touchwin(win)
 #   define derwin(win,x,y,z,w) win
index e1df3a4..f924c86 100644 (file)
@@ -1,11 +1,11 @@
 /* User Menu implementation
    Copyright (C) 1994 Miguel de Icaza, Janne Kukonlehto
 /* User Menu implementation
    Copyright (C) 1994 Miguel de Icaza, Janne Kukonlehto
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -46,7 +46,7 @@
 
 #include "view.h" /* for default_* externs */
 
 
 #include "view.h" /* for default_* externs */
 
-/* "$Id: user.c,v 1.1 2001/12/30 09:55:20 sedwards Exp $" */
+/* "$Id$" */
 
 #define MAX_ENTRIES 40
 #define MAX_ENTRY_LEN 60
 
 #define MAX_ENTRIES 40
 #define MAX_ENTRY_LEN 60
@@ -73,7 +73,7 @@ extern char *search_string (char *, char *);
        ascii, hex, nroff, unformated and
 
    If the format letter is in uppercase, it refers to the other panel.
        ascii, hex, nroff, unformated and
 
    If the format letter is in uppercase, it refers to the other panel.
-   
+
    With a number followed the % character you can turn quoting on (default)
    and off. For example:
        %f    quote expanded macro
    With a number followed the % character you can turn quoting on (default)
    and off. For example:
        %f    quote expanded macro
@@ -103,7 +103,7 @@ int check_format_view (char *p)
                } else if (!strncmp (q, "unformated", 10)){
                    default_nroff_flag = 0;
                    q += 9;
                } else if (!strncmp (q, "unformated", 10)){
                    default_nroff_flag = 0;
                    q += 9;
-               } 
+               }
            }
            if (*q == '}')
                q++;
            }
            if (*q == '}')
                q++;
@@ -130,7 +130,7 @@ int check_format_var (char *p, char **v)
     char *var_name;
     char *value;
     char *dots;
     char *var_name;
     char *value;
     char *dots;
-    
+
     *v = 0;
     dots = 0;
     if (!strncmp (p, "var{", 4)){
     *v = 0;
     dots = 0;
     if (!strncmp (p, "var{", 4)){
@@ -149,7 +149,7 @@ int check_format_var (char *p, char **v)
                     :       " The %%var macros does not have a variable " );
            return 0;
        }
                     :       " The %%var macros does not have a variable " );
            return 0;
        }
-       
+
        /* Copy the variable name */
        var_name = xmalloc (dots - p, "check_format_var");
        strncpy (var_name, p+4, dots-2 - (p+3));
        /* Copy the variable name */
        var_name = xmalloc (dots - p, "check_format_var");
        strncpy (var_name, p+4, dots-2 - (p+3));
@@ -188,7 +188,7 @@ char *expand_format (char c, int quote)
 {
     WPanel *panel;
     char *(*quote_func)(const char *, int);
 {
     WPanel *panel;
     char *(*quote_func)(const char *, int);
-    
+
     if (quote)
        quote_func = name_quote;
     else
     if (quote)
        quote_func = name_quote;
     else
@@ -196,7 +196,7 @@ char *expand_format (char c, int quote)
 
     if (c == '%')
        return strdup ("%");
 
     if (c == '%')
        return strdup ("%");
-    
+
     if (islower (c))
        panel = cpanel;
     else {
     if (islower (c))
        panel = cpanel;
     else {
@@ -209,9 +209,9 @@ char *expand_format (char c, int quote)
        panel = cpanel;
 
     c = tolower (c);
        panel = cpanel;
 
     c = tolower (c);
-    
+
     switch (c){
     switch (c){
-    case 'f': 
+    case 'f':
     case 'p': return (*quote_func) (panel->dir.list [panel->selected].fname, 0);
     case 'b':
        return strip_ext((*quote_func) (panel->dir.list [panel->selected].fname, 0));
     case 'p': return (*quote_func) (panel->dir.list [panel->selected].fname, 0);
     case 'b':
        return strip_ext((*quote_func) (panel->dir.list [panel->selected].fname, 0));
@@ -227,7 +227,7 @@ char *expand_format (char c, int quote)
     {
        int length = 2, i;
        char *block, *tmp;
     {
        int length = 2, i;
        char *block, *tmp;
-       
+
        for (i = 0; i < panel->count; i++)
            if (panel->dir.list [i].f.marked)
                length += strlen (panel->dir.list [i].fname) + 1;
        for (i = 0; i < panel->count; i++)
            if (panel->dir.list [i].f.marked)
                length += strlen (panel->dir.list [i].fname) + 1;
@@ -476,7 +476,7 @@ static char *test_line (char *p, int *result)
        } /* switch */
        /* Add one debug statement */
        debug_out (&operator, NULL, *result);
        } /* switch */
        /* Add one debug statement */
        debug_out (&operator, NULL, *result);
-       
+
     } /* while (*p != '\n') */
     /* Report debug message */
     debug_out (NULL, NULL, 1);
     } /* while (*p != '\n') */
     /* Report debug message */
     debug_out (NULL, NULL, 1);
@@ -516,7 +516,7 @@ void execute_menu_command (char *s)
        return;
     }
     commands++;
        return;
     }
     commands++;
-    
+
     for (col = 0; *commands; commands++){
        if (col == 0 && (*commands != ' ' && *commands != '\t'))
            break;
     for (col = 0; *commands; commands++){
        if (col == 0 && (*commands != ' ' && *commands != '\t'))
            break;
@@ -558,7 +558,7 @@ void execute_menu_command (char *s)
            if (isdigit (*commands)) {
                do_quote = atoi (commands);
                for ( ; isdigit (*commands); commands++)
            if (isdigit (*commands)) {
                do_quote = atoi (commands);
                for ( ; isdigit (*commands); commands++)
-                   ;       
+                   ;
            }
            if (*commands == '{')
                parameter_found = 1;
            }
            if (*commands == '{')
                parameter_found = 1;
@@ -581,11 +581,11 @@ void execute_menu_command (char *s)
     unlink (file_name);
 }
 
     unlink (file_name);
 }
 
-/* 
+/*
 **     Check owner of the menu file. Using menu file is allowed, if
 **     owner of the menu is root or the actual user. In either case
 **     file should not be group and word-writable.
 **     Check owner of the menu file. Using menu file is allowed, if
 **     owner of the menu is root or the actual user. In either case
 **     file should not be group and word-writable.
-**     
+**
 **     Q. Should we apply this routine to system and home menu (and .ext files)?
 */
 static int
 **     Q. Should we apply this routine to system and home menu (and .ext files)?
 */
 static int
@@ -620,13 +620,13 @@ void user_menu_cmd (void)
     int  col, i, accept_entry = 1;
     int  selected, old_patterns;
     Listbox *listbox;
     int  col, i, accept_entry = 1;
     int  selected, old_patterns;
     Listbox *listbox;
-    
+
     if (!vfs_current_is_local ()){
        message (1, _(" Oops... "),
                 _(" I can't run programs while logged on a non local directory "));
        return;
     }
     if (!vfs_current_is_local ()){
        message (1, _(" Oops... "),
                 _(" I can't run programs while logged on a non local directory "));
        return;
     }
-    
+
     menu = strdup (MC_LOCAL_MENU);
     if (!exist_file (menu) || !menu_file_own (menu)){
        free (menu);
     menu = strdup (MC_LOCAL_MENU);
     if (!exist_file (menu) || !menu_file_own (menu)){
        free (menu);
@@ -644,7 +644,7 @@ void user_menu_cmd (void)
        return;
     }
     free (menu);
        return;
     }
     free (menu);
-    
+
     max_cols = 0;
     for (i = 0; i < MAX_ENTRIES; i++)
        entries [i] = 0;
     max_cols = 0;
     for (i = 0; i < MAX_ENTRIES; i++)
        entries [i] = 0;
@@ -662,7 +662,7 @@ void user_menu_cmd (void)
                if (*(p+1) == '='){
                    /* Combined adding and default */
                    char *q = p++;
                if (*(p+1) == '='){
                    /* Combined adding and default */
                    char *q = p++;
-                   
+
                    p = test_line (q, &accept_entry);
                    if (selected == 0 && accept_entry)
                        selected = menu_lines;
                    p = test_line (q, &accept_entry);
                    if (selected == 0 && accept_entry)
                        selected = menu_lines;
@@ -712,7 +712,7 @@ void user_menu_cmd (void)
     /* Create listbox */
     listbox = create_listbox_window (max_cols+2, menu_lines, _(" User menu "),
                                     "[Menu File Edit]");
     /* Create listbox */
     listbox = create_listbox_window (max_cols+2, menu_lines, _(" User menu "),
                                     "[Menu File Edit]");
-    
+
     /* insert all the items found */
     for (i = 0; i < menu_lines; i++)
        LISTBOX_APPEND_TEXT (listbox, entries [i][0],
     /* insert all the items found */
     for (i = 0; i < menu_lines; i++)
        LISTBOX_APPEND_TEXT (listbox, entries [i][0],
@@ -722,7 +722,7 @@ void user_menu_cmd (void)
 
     /* Select the default entry */
     listbox_select_by_number (listbox->list, selected);
 
     /* Select the default entry */
     listbox_select_by_number (listbox->list, selected);
-    
+
     selected = run_listbox (listbox);
     if (selected >= 0)
        execute_menu_command (entries [selected]);
     selected = run_listbox (listbox);
     if (selected >= 0)
        execute_menu_command (entries [selected]);
index d50d716..19ef420 100644 (file)
@@ -11,7 +11,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -88,7 +88,7 @@ int message (int error, char *header, char *text, ...);
 #include "user.h"              /* expand_format */
 #include "../vfs/vfs.h"
 
 #include "user.h"              /* expand_format */
 #include "../vfs/vfs.h"
 
-/* "$Id: util.c,v 1.2 2003/06/27 21:10:35 gvg Exp $" */
+/* "$Id$" */
 
 char app_text [] = "Midnight-Commander";
 
 
 char app_text [] = "Midnight-Commander";
 
@@ -142,7 +142,7 @@ int msglen (char *text, int *lines)
 {
     int max = 0;
     int line_len = 0;
 {
     int max = 0;
     int line_len = 0;
-    
+
     for (*lines = 1;*text; text++){
        if (*text == '\n'){
            line_len = 0;
     for (*lines = 1;*text; text++){
        if (*text == '\n'){
            line_len = 0;
@@ -159,7 +159,7 @@ int msglen (char *text, int *lines)
 char *trim (char *s, char *d, int len)
 {
     int source_len = strlen (s);
 char *trim (char *s, char *d, int len)
 {
     int source_len = strlen (s);
-    
+
     if (source_len > len){
        strcpy (d, s+(source_len-len));
        d [0] = '.';
     if (source_len > len){
        strcpy (d, s+(source_len-len));
        d [0] = '.';
@@ -174,7 +174,7 @@ char *
 name_quote (const char *s, int quote_percent)
 {
     char *ret, *d;
 name_quote (const char *s, int quote_percent)
 {
     char *ret, *d;
-    
+
     d = ret = xmalloc (strlen (s)*2 + 2 + 1, "quote_name");
     if (*s == '-') {
         *d++ = '.';
     d = ret = xmalloc (strlen (s)*2 + 2 + 1, "quote_name");
     if (*s == '-') {
         *d++ = '.';
@@ -231,7 +231,7 @@ char *name_trunc (char *txt, int trunc_len)
 
     if (!txt)
        txt = PATH_SEP_STR;
 
     if (!txt)
        txt = PATH_SEP_STR;
-    
+
     if (trunc_len > sizeof (x)-1){
        fprintf (stderr, _("name_trunc: too big"));
        trunc_len = sizeof (x)-1;
     if (trunc_len > sizeof (x)-1){
        fprintf (stderr, _("name_trunc: too big"));
        trunc_len = sizeof (x)-1;
@@ -260,7 +260,7 @@ char *size_trunc (long int size)
     static char x [30];
     long int divisor = 1;
     char *xtra = "";
     static char x [30];
     long int divisor = 1;
     char *xtra = "";
-    
+
     if (size > 999999999L){
        divisor = 1024;
        xtra = "kb";
     if (size > 999999999L){
        divisor = 1024;
        xtra = "kb";
@@ -341,7 +341,7 @@ static char *
 strip_password (char *path)
 {
     char *at, *inner_colon, *dir;
 strip_password (char *path)
 {
     char *at, *inner_colon, *dir;
-    
+
     if ((dir = strchr (path, PATH_SEP)) != NULL)
        *dir = '\0';
     /* search for any possible user */
     if ((dir = strchr (path, PATH_SEP)) != NULL)
        *dir = '\0';
     /* search for any possible user */
@@ -368,8 +368,8 @@ char *strip_home_and_password(char *dir)
        newdir [0] = '~';
        strcpy (&newdir [1], &dir [strlen (home_dir)]);
        return newdir;
        newdir [0] = '~';
        strcpy (&newdir [1], &dir [strlen (home_dir)]);
        return newdir;
-    } 
-#ifdef USE_NETCODE    
+    }
+#ifdef USE_NETCODE
     else if (!strncmp (dir, "ftp://", 6)) {
        strip_password (strcpy (newdir, dir) + 6);
         if ((p = strchr (newdir + 6, PATH_SEP)) != NULL) {
     else if (!strncmp (dir, "ftp://", 6)) {
        strip_password (strcpy (newdir, dir) + 6);
         if ((p = strchr (newdir + 6, PATH_SEP)) != NULL) {
@@ -385,10 +385,10 @@ char *strip_home_and_password(char *dir)
     } else if (!strncmp (dir, "mc:", 3)) {
         char  *pth;
        strcpy (newdir, dir);
     } else if (!strncmp (dir, "mc:", 3)) {
         char  *pth;
        strcpy (newdir, dir);
-       if (newdir[3] == '/' && newdir[4] == '/') { 
+       if (newdir[3] == '/' && newdir[4] == '/') {
            pth = newdir + 5;
            strip_password ( newdir + 5);
            pth = newdir + 5;
            strip_password ( newdir + 5);
-       } else { 
+       } else {
            pth = newdir + 3;
            strip_password (newdir + 3);
        }
            pth = newdir + 3;
            strip_password (newdir + 3);
        }
@@ -396,17 +396,17 @@ char *strip_home_and_password(char *dir)
             *p = 0;
            q = mcfs_gethome (newdir);
             *p = PATH_SEP;
             *p = 0;
            q = mcfs_gethome (newdir);
             *p = PATH_SEP;
-            if (q != NULL ) { 
+            if (q != NULL ) {
                if (strcmp (q, PATH_SEP_STR) && !strncmp (p, q, strlen (q) - 1)) {
                    strcpy (p, "/~");
                    strcat (newdir, p + strlen (q) - 1);
                }
                 free (q);
                if (strcmp (q, PATH_SEP_STR) && !strncmp (p, q, strlen (q) - 1)) {
                    strcpy (p, "/~");
                    strcat (newdir, p + strlen (q) - 1);
                }
                 free (q);
-            }      
+            }
         }
        return (newdir);
     }
         }
        return (newdir);
     }
-#endif    
+#endif
     return dir;
 }
 
     return dir;
 }
 
@@ -455,12 +455,12 @@ char *convert_pattern (char *pattern, int match_type, int do_group)
                *d++ = '.';
                *d   = '*';
                break;
                *d++ = '.';
                *d   = '*';
                break;
-               
+
            case '?':
                d = maybe_start_group (d, do_group, &was_wildcard);
                *d = '.';
                break;
            case '?':
                d = maybe_start_group (d, do_group, &was_wildcard);
                *d = '.';
                break;
-               
+
            case '.':
                d = maybe_end_group (d, do_group, &was_wildcard);
                *d++ = '\\';
            case '.':
                d = maybe_end_group (d, do_group, &was_wildcard);
                *d++ = '\\';
@@ -512,7 +512,7 @@ char *extension (char *filename)
 
     if (!strlen (filename))
        return "";
 
     if (!strlen (filename))
        return "";
-    
+
     d = filename + strlen (filename) - 1;
     for (;d >= filename; d--){
        if (*d == '.')
     d = filename + strlen (filename) - 1;
     for (;d >= filename; d--){
        if (*d == '.')
@@ -526,13 +526,13 @@ char *split_extension (char *x, int pad)
 {
     return x;
 
 {
     return x;
 
-    /* Buggy code 
+    /* Buggy code
     if (!align_extensions)
        return x;
 
     if (strlen (x) >= pad)
        return x;
     if (!align_extensions)
        return x;
 
     if (strlen (x) >= pad)
        return x;
-    
+
     if ((ext = extension (x)) == x || *ext == 0)
        return x;
 
     if ((ext = extension (x)) == x || *ext == 0)
        return x;
 
@@ -544,7 +544,7 @@ char *split_extension (char *x, int pad)
     l = strlen (ext);
     for (i = 0; i < l; i++)
        xbuf [pad-i] = *(ext+l-i-1);
     l = strlen (ext);
     for (i = 0; i < l; i++)
        xbuf [pad-i] = *(ext+l-i-1);
-    for (i = xbuf + (ext - x); i < 
+    for (i = xbuf + (ext - x); i <
     return xbuf; */
 }
 
     return xbuf; */
 }
 
@@ -585,7 +585,7 @@ char *load_file (char *filename)
     struct stat s;
     char *data;
     long read_size,i;
     struct stat s;
     char *data;
     long read_size,i;
-    
+
     if (stat (filename, &s) != 0){
        return 0;
     }
     if (stat (filename, &s) != 0){
        return 0;
     }
@@ -652,7 +652,7 @@ char *extract_line (char *s, char *top)
 {
     static char tmp_line [500];
     char *t = tmp_line;
 {
     static char tmp_line [500];
     char *t = tmp_line;
-    
+
     while (*s && *s != '\n' && (t - tmp_line) < sizeof (tmp_line)-1 && s < top)
        *t++ = *s++;
     *t = 0;
     while (*s && *s != '\n' && (t - tmp_line) < sizeof (tmp_line)-1 && s < top)
        *t++ = *s++;
     *t = 0;
@@ -749,7 +749,7 @@ char *unix_error_string (int error_num)
 {
     static char buffer [256];
     char *error_msg;
 {
     static char buffer [256];
     char *error_msg;
-       
+
 #ifdef HAVE_STRERROR
     error_msg = strerror (error_num);
 #else
 #ifdef HAVE_STRERROR
     error_msg = strerror (error_num);
 #else
@@ -772,7 +772,7 @@ char *copy_strings (const char *first,...)
 
     if (!first)
        return 0;
 
     if (!first)
        return 0;
-    
+
     len = strlen (first);
     va_start (ap, first);
 
     len = strlen (first);
     va_start (ap, first);
 
@@ -791,7 +791,7 @@ char *copy_strings (const char *first,...)
 
     return result;
 }
 
     return result;
 }
-       
+
 long blocks2kilos (int blocks, int bsize)
 {
     if (bsize > 1024){
 long blocks2kilos (int blocks, int bsize)
 {
     if (bsize > 1024){
@@ -844,7 +844,7 @@ char *strip_ctrl_codes (char *s)
 
     if (!s)
        return 0;
 
     if (!s)
        return 0;
-    
+
     for (i = 0, j = 0; s [i+j]; ++i)
        if (s [i+j] != ESC_CHAR){
            if (j)
     for (i = 0, j = 0; s [i+j]; ++i)
        if (s [i+j] != ESC_CHAR){
            if (j)
@@ -913,15 +913,15 @@ long get_small_endian_long (int fd)
 long int is_gunzipable (int fd, int *type)
 {
     unsigned char magic [4];
 long int is_gunzipable (int fd, int *type)
 {
     unsigned char magic [4];
-       
+
     *type = ISGUNZIPABLE_GUNZIP;
     *type = ISGUNZIPABLE_GUNZIP;
-       
+
     /* Read the magic signature */
     CHECK (mc_read (fd, &magic [0], 1));
     CHECK (mc_read (fd, &magic [1], 1));
     CHECK (mc_read (fd, &magic [2], 1));
     CHECK (mc_read (fd, &magic [3], 1));
     /* Read the magic signature */
     CHECK (mc_read (fd, &magic [0], 1));
     CHECK (mc_read (fd, &magic [1], 1));
     CHECK (mc_read (fd, &magic [2], 1));
     CHECK (mc_read (fd, &magic [3], 1));
-       
+
     /* GZIP_MAGIC and OLD_GZIP_MAGIC */
     if (magic [0] == 037 && (magic [1] == 0213 || magic [1] == 0236)){
        /* Read the uncompressed size of the file */
     /* GZIP_MAGIC and OLD_GZIP_MAGIC */
     if (magic [0] == 037 && (magic [1] == 0213 || magic [1] == 0236)){
        /* Read the uncompressed size of the file */
@@ -935,7 +935,7 @@ long int is_gunzipable (int fd, int *type)
        mc_lseek (fd, 8, SEEK_SET);
        CHECK (mc_read (fd, &magic [0], 1));
        CHECK (mc_read (fd, &magic [1], 1));
        mc_lseek (fd, 8, SEEK_SET);
        CHECK (mc_read (fd, &magic [0], 1));
        CHECK (mc_read (fd, &magic [1], 1));
-       
+
        /* Gzip can handle only deflated (8) or stored (0) files */
        if ((magic [0] != 8 && magic [0] != 0) || magic [1] != 0)
             return 0;
        /* Gzip can handle only deflated (8) or stored (0) files */
        if ((magic [0] != 8 && magic [0] != 0) || magic [1] != 0)
             return 0;
@@ -960,7 +960,7 @@ long int is_gunzipable (int fd, int *type)
                 case '0':
                     *type = ISGUNZIPABLE_BZIP;
                     return 5*mc_lseek (fd, 0, SEEK_END);
                 case '0':
                     *type = ISGUNZIPABLE_BZIP;
                     return 5*mc_lseek (fd, 0, SEEK_END);
-                case 'h': 
+                case 'h':
                    *type = ISGUNZIPABLE_BZIP2;
                    return 5*mc_lseek (fd, 0, SEEK_END);
             }
                    *type = ISGUNZIPABLE_BZIP2;
                    return 5*mc_lseek (fd, 0, SEEK_END);
             }
@@ -974,10 +974,10 @@ decompress_command (int type)
        switch (type){
        case ISGUNZIPABLE_GUNZIP:
                return "gzip -cdf";
        switch (type){
        case ISGUNZIPABLE_GUNZIP:
                return "gzip -cdf";
-               
+
        case ISGUNZIPABLE_BZIP:
                return "bzip -d";
        case ISGUNZIPABLE_BZIP:
                return "bzip -d";
-               
+
        case ISGUNZIPABLE_BZIP2:
                return "bzip2 -dc";
        }
        case ISGUNZIPABLE_BZIP2:
                return "bzip2 -dc";
        }
@@ -1000,7 +1000,7 @@ decompress_command_and_arg (int type, char **cmd, char **flags)
                *flags = "-d";
                return;
 
                *flags = "-d";
                return;
 
-               
+
        case ISGUNZIPABLE_BZIP2:
                *cmd   = "bzip2";
                *flags = "-dc";
        case ISGUNZIPABLE_BZIP2:
                *cmd   = "bzip2";
                *flags = "-dc";
@@ -1008,7 +1008,7 @@ decompress_command_and_arg (int type, char **cmd, char **flags)
        }
        *cmd   = 0;
        *flags = 0;
        }
        *cmd   = 0;
        *flags = 0;
-       
+
        /* Should never reach this place */
        fprintf (stderr, "Fatal: decompress_command called with an unknown argument\n");
 }
        /* Should never reach this place */
        fprintf (stderr, "Fatal: decompress_command called with an unknown argument\n");
 }
@@ -1021,7 +1021,7 @@ void add_hook (Hook **hook_list, void (*hook_fn)(void *), void *data)
     new_hook->hook_fn = hook_fn;
     new_hook->next    = *hook_list;
     new_hook->hook_data = data;
     new_hook->hook_fn = hook_fn;
     new_hook->next    = *hook_list;
     new_hook->hook_data = data;
-      
+
     *hook_list = new_hook;
 }
 
     *hook_list = new_hook;
 }
 
@@ -1033,18 +1033,18 @@ void execute_hooks (Hook *hook_list)
     /* We copy the hook list first so tahat we let the hook
      * function call delete_hook
      */
     /* We copy the hook list first so tahat we let the hook
      * function call delete_hook
      */
-    
+
     while (hook_list){
        add_hook (&new_hook, hook_list->hook_fn, hook_list->hook_data);
        hook_list = hook_list->next;
     }
     p = new_hook;
     while (hook_list){
        add_hook (&new_hook, hook_list->hook_fn, hook_list->hook_data);
        hook_list = hook_list->next;
     }
     p = new_hook;
-    
+
     while (new_hook){
        (*new_hook->hook_fn)(new_hook->hook_data);
        new_hook = new_hook->next;
     }
     while (new_hook){
        (*new_hook->hook_fn)(new_hook->hook_data);
        new_hook = new_hook->next;
     }
-    
+
     for (hook_list = p; hook_list;){
        p = hook_list;
        hook_list = hook_list->next;
     for (hook_list = p; hook_list;){
        p = hook_list;
        hook_list = hook_list->next;
@@ -1057,7 +1057,7 @@ void delete_hook (Hook **hook_list, void (*hook_fn)(void *))
     Hook *current, *new_list, *next;
 
     new_list = 0;
     Hook *current, *new_list, *next;
 
     new_list = 0;
-    
+
     for (current = *hook_list; current; current = next){
        next = current->next;
        if (current->hook_fn == hook_fn)
     for (current = *hook_list; current; current = next){
        next = current->next;
        if (current->hook_fn == hook_fn)
@@ -1071,7 +1071,7 @@ void delete_hook (Hook **hook_list, void (*hook_fn)(void *))
 int hook_present (Hook *hook_list, void (*hook_fn)(void *))
 {
     Hook *p;
 int hook_present (Hook *hook_list, void (*hook_fn)(void *))
 {
     Hook *p;
-    
+
     for (p = hook_list; p; p = p->next)
        if (p->hook_fn == hook_fn)
            return 1;
     for (p = hook_list; p; p = p->next)
        if (p->hook_fn == hook_fn)
            return 1;
@@ -1081,7 +1081,7 @@ int hook_present (Hook *hook_list, void (*hook_fn)(void *))
 void wipe_password (char *passwd)
 {
     char *p = passwd;
 void wipe_password (char *passwd)
 {
     char *p = passwd;
-    
+
     for (;*p ; p++)
         *p = 0;
     free (passwd);
     for (;*p ; p++)
         *p = 0;
     free (passwd);
@@ -1128,10 +1128,10 @@ char *reverse_string (char *string)
     int len = strlen (string);
     int i;
     const int steps = len/2;
     int len = strlen (string);
     int i;
     const int steps = len/2;
-    
+
     for (i = 0; i < steps; i++){
        char c = string [i];
     for (i = 0; i < steps; i++){
        char c = string [i];
-    
+
        string [i] = string [len-i-1];
        string [len-i-1] = c;
     }
        string [i] = string [len-i-1];
        string [len-i-1] = c;
     }
@@ -1143,11 +1143,11 @@ char *resolve_symlinks (char *path)
     char *buf, *buf2, *p, *q, *r, c;
     int len;
     struct stat mybuf;
     char *buf, *buf2, *p, *q, *r, c;
     int len;
     struct stat mybuf;
-    
+
     if (*path != PATH_SEP)
         return NULL;
     r = buf = xmalloc (MC_MAXPATHLEN, "resolve symlinks");
     if (*path != PATH_SEP)
         return NULL;
     r = buf = xmalloc (MC_MAXPATHLEN, "resolve symlinks");
-    buf2 = xmalloc (MC_MAXPATHLEN, "resolve symlinks"); 
+    buf2 = xmalloc (MC_MAXPATHLEN, "resolve symlinks");
     *r++ = PATH_SEP;
     *r = 0;
     p = path;
     *r++ = PATH_SEP;
     *r = 0;
     p = path;
@@ -1203,11 +1203,11 @@ char *resolve_symlinks (char *path)
 
 /* Finds out a relative path from first to second, i.e. goes as many ..
  * as needed up in first and then goes down using second */
 
 /* Finds out a relative path from first to second, i.e. goes as many ..
  * as needed up in first and then goes down using second */
-char *diff_two_paths (char *first, char *second) 
+char *diff_two_paths (char *first, char *second)
 {
     char *p, *q, *r, *s, *buf = 0;
     int i, j, prevlen = -1, currlen;
 {
     char *p, *q, *r, *s, *buf = 0;
     int i, j, prevlen = -1, currlen;
-    
+
     first = resolve_symlinks (first);
     if (first == NULL)
         return NULL;
     first = resolve_symlinks (first);
     if (first == NULL)
         return NULL;
@@ -1266,15 +1266,15 @@ int my_ftruncate (int fd, long size)
 #ifdef OS2_NT
     if(_chsize(fd, size))
        return -1;
 #ifdef OS2_NT
     if(_chsize(fd, size))
        return -1;
-    else 
+    else
        return 0;
 #else
     struct flock lk;
        return 0;
 #else
     struct flock lk;
-    
+
     lk.l_whence = 0;
     lk.l_start = size;
     lk.l_len = 0;
     lk.l_whence = 0;
     lk.l_start = size;
     lk.l_len = 0;
-    
+
     return fcntl (fd, F_FREESP, &lk);
 #endif
 }
     return fcntl (fd, F_FREESP, &lk);
 #endif
 }
@@ -1283,7 +1283,7 @@ int truncate (const char *path, long size)
 {
     int fd;
     int res;
 {
     int fd;
     int res;
-    
+
     fd = open (path, O_RDWR, 0);
     if (fd < 0)
        return fd;
     fd = open (path, O_RDWR, 0);
     if (fd < 0)
        return fd;
index 91eb799..b2dc9e0 100644 (file)
@@ -11,7 +11,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -112,7 +112,7 @@ void init_groups (void)
 
     if (pwd == 0)
        return;
 
     if (pwd == 0)
        return;
-    
+
     setgrent ();
     while ((grp = getgrent ()))
        for (i = 0; grp->gr_mem[i]; i++)
     setgrent ();
     while ((grp = getgrent ()))
        for (i = 0; grp->gr_mem[i]; i++)
@@ -204,10 +204,10 @@ char *get_owner (int uid)
     static char ibuf [8];
     char   *name;
     static int uid_last;
     static char ibuf [8];
     char   *name;
     static int uid_last;
-    
+
     if ((name = i_cache_match (uid, uid_cache, UID_CACHE_SIZE)) != NULL)
        return name;
     if ((name = i_cache_match (uid, uid_cache, UID_CACHE_SIZE)) != NULL)
        return name;
-    
+
     pwd = getpwuid (uid);
     if (pwd){
        i_cache_add (uid, uid_cache, UID_CACHE_SIZE, pwd->pw_name, &uid_last);
     pwd = getpwuid (uid);
     if (pwd){
        i_cache_add (uid, uid_cache, UID_CACHE_SIZE, pwd->pw_name, &uid_last);
@@ -225,10 +225,10 @@ char *get_group (int gid)
     static char gbuf [8];
     char *name;
     static int  gid_last;
     static char gbuf [8];
     char *name;
     static int  gid_last;
-    
+
     if ((name = i_cache_match (gid, gid_cache, GID_CACHE_SIZE)) != NULL)
        return name;
     if ((name = i_cache_match (gid, gid_cache, GID_CACHE_SIZE)) != NULL)
        return name;
-    
+
     grp = getgrgid (gid);
     if (grp){
        i_cache_add (gid, gid_cache, GID_CACHE_SIZE, grp->gr_name, &gid_last);
     grp = getgrgid (gid);
     if (grp){
        i_cache_add (gid, gid_cache, GID_CACHE_SIZE, grp->gr_name, &gid_last);
@@ -258,12 +258,12 @@ int my_system (int flags, const char *shell, const char *command)
     pid_t pid;
     int status = 0;
     int as_shell_command = flags & EXECUTE_AS_SHELL;
     pid_t pid;
     int status = 0;
     int as_shell_command = flags & EXECUTE_AS_SHELL;
-    
+
     ignore.sa_handler = SIG_IGN;
     sigemptyset (&ignore.sa_mask);
     ignore.sa_flags = 0;
     ignore.sa_handler = SIG_IGN;
     sigemptyset (&ignore.sa_mask);
     ignore.sa_flags = 0;
-    
-    sigaction (SIGINT, &ignore, &save_intr);    
+
+    sigaction (SIGINT, &ignore, &save_intr);
     sigaction (SIGQUIT, &ignore, &save_quit);
 
     /* Restore the original SIGTSTP handler, we don't want ncurses' */
     sigaction (SIGQUIT, &ignore, &save_quit);
 
     /* Restore the original SIGTSTP handler, we don't want ncurses' */
@@ -281,7 +281,7 @@ int my_system (int flags, const char *shell, const char *command)
 #if 0
        prepare_environment ();
 #endif
 #if 0
        prepare_environment ();
 #endif
-       
+
        if (as_shell_command)
            execl (shell, shell, "-c", command, (char *) 0);
        else
        if (as_shell_command)
            execl (shell, shell, "-c", command, (char *) 0);
        else
@@ -299,7 +299,7 @@ int my_system (int flags, const char *shell, const char *command)
     sigaction (SIGQUIT, &save_quit, NULL);
     sigaction (SIGTSTP, &save_stop, NULL);
 
     sigaction (SIGQUIT, &save_quit, NULL);
     sigaction (SIGTSTP, &save_stop, NULL);
 
-#ifdef SCO_FLAVOR 
+#ifdef SCO_FLAVOR
        waitpid(-1, NULL, WNOHANG);
 #endif /* SCO_FLAVOR */
 
        waitpid(-1, NULL, WNOHANG);
 #endif /* SCO_FLAVOR */
 
@@ -314,14 +314,14 @@ char *tilde_expand (char *directory)
     char *p;
     char *name;
     int  len;
     char *p;
     char *name;
     int  len;
-    
+
     if (*directory != '~')
        return strdup (directory);
 
     directory++;
     if (*directory != '~')
        return strdup (directory);
 
     directory++;
-    
+
     p = strchr (directory, PATH_SEP);
     p = strchr (directory, PATH_SEP);
-    
+
     /* d = "~" or d = "~/" */
     if (!(*directory) || (*directory == PATH_SEP)){
        passwd = getpwuid (geteuid ());
     /* d = "~" or d = "~/" */
     if (!(*directory) || (*directory == PATH_SEP)){
        passwd = getpwuid (geteuid ());
@@ -462,12 +462,12 @@ int mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
 
 #define closepipes() close(pipe0[0]);close(pipe0[1]);close(pipe1[0]);close(pipe1[1])
 #define is_a_pipe_fd(f) ((pipe0[0] == f) || (pipe0[1] == f) || (pipe1[0] == f) || (pipe1[1] == f))
 
 #define closepipes() close(pipe0[0]);close(pipe0[1]);close(pipe1[0]);close(pipe1[1])
 #define is_a_pipe_fd(f) ((pipe0[0] == f) || (pipe0[1] == f) || (pipe1[0] == f) || (pipe1[1] == f))
-    
+
     pipe (pipe0); pipe (pipe1);
     ignore.sa_handler = SIG_IGN;
     sigemptyset (&ignore.sa_mask);
     ignore.sa_flags = 0;
     pipe (pipe0); pipe (pipe1);
     ignore.sa_handler = SIG_IGN;
     sigemptyset (&ignore.sa_mask);
     ignore.sa_flags = 0;
-        
+
     sigaction (SIGINT, &ignore, &save_intr);
     sigaction (SIGQUIT, &ignore, &save_quit);
     sigaction (SIGTSTP, &startup_handler, &save_stop);
     sigaction (SIGINT, &ignore, &save_intr);
     sigaction (SIGQUIT, &ignore, &save_quit);
     sigaction (SIGTSTP, &startup_handler, &save_stop);
@@ -492,7 +492,7 @@ int mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
                     int nulldevice;
 
                     port_shutdown_extra_fds ();
                     int nulldevice;
 
                     port_shutdown_extra_fds ();
-           
+
                     nulldevice = open ("/dev/null", O_WRONLY);
                     close (0);
                     dup (pipe0 [0]);
                     nulldevice = open ("/dev/null", O_WRONLY);
                     close (0);
                     dup (pipe0 [0]);
@@ -522,7 +522,7 @@ int mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
                        close (pipe1 [0]);
                        close (pipe1 [1]);
                        while ((i = mc_read (inhandle, buffer,
                        close (pipe1 [0]);
                        close (pipe1 [1]);
                        while ((i = mc_read (inhandle, buffer,
-                                             (inlen == -1 || inlen > 8192) 
+                                             (inlen == -1 || inlen > 8192)
                                              ? 8192 : inlen)) > 0) {
                            write (pipe0 [1], buffer, i);
                            if (inlen != -1) {
                                              ? 8192 : inlen)) > 0) {
                            write (pipe0 [1], buffer, i);
                            if (inlen != -1) {
@@ -554,7 +554,7 @@ int mc_doublepopen (int inhandle, int inlen, pid_t *the_pid, char *command, ...)
 int mc_doublepclose (int pipe, pid_t pid)
 {
     int status = 0;
 int mc_doublepclose (int pipe, pid_t pid)
 {
     int status = 0;
-    
+
     close (pipe);
     waitpid (pid, &status, 0);
 #ifdef SCO_FLAVOR
     close (pipe);
     waitpid (pid, &status, 0);
 #ifdef SCO_FLAVOR
@@ -564,7 +564,7 @@ int mc_doublepclose (int pipe, pid_t pid)
     sigaction (SIGQUIT, &save_quit, NULL);
     sigaction (SIGTSTP, &save_stop, NULL);
 
     sigaction (SIGQUIT, &save_quit, NULL);
     sigaction (SIGTSTP, &save_stop, NULL);
 
-    return status;     
+    return status;
 }
 
 /* Canonicalize path, and return a new path. Do everything in situ.
 }
 
 /* Canonicalize path, and return a new path. Do everything in situ.
@@ -654,7 +654,7 @@ char *canonicalize_pathname (char *path)
                continue;
            }
 
                continue;
            }
 
-           /* Handle `../' or trailing `..' by itself. 
+           /* Handle `../' or trailing `..' by itself.
               Remove the previous ?/ part with the exception of
               ../, which we should leave intact. */
            if (path[i + 1] == '.' && (path[i + 2] == PATH_SEP || !path[i + 2])) {
               Remove the previous ?/ part with the exception of
               ../, which we should leave intact. */
            if (path[i + 1] == '.' && (path[i + 2] == PATH_SEP || !path[i + 2])) {
@@ -680,7 +680,7 @@ int gettimeofday( struct timeval * tv, struct timezone * tz)
 {
     struct timeb tb;
     struct tm * l;
 {
     struct timeb tb;
     struct tm * l;
-    
+
     ftime( &tb );
     if (errno == EFAULT)
        return -1;
     ftime( &tb );
     if (errno == EFAULT)
        return -1;
@@ -710,7 +710,7 @@ putenv (const char *string)
     const char *const name_end = strchr (string, '=');
     register size_t size;
     register char **ep;
     const char *const name_end = strchr (string, '=');
     register size_t size;
     register char **ep;
-    
+
     if (name_end == NULL){
        /* Remove the variable from the environment.  */
        size = strlen (string);
     if (name_end == NULL){
        /* Remove the variable from the environment.  */
        size = strlen (string);
@@ -724,7 +724,7 @@ putenv (const char *string)
                return 0;
            }
     }
                return 0;
            }
     }
-    
+
     size = 0;
     for (ep = __environ; *ep != NULL; ++ep)
        if (!strncmp (*ep, string, name_end - string) &&
     size = 0;
     for (ep = __environ; *ep != NULL; ++ep)
        if (!strncmp (*ep, string, name_end - string) &&
@@ -732,7 +732,7 @@ putenv (const char *string)
            break;
        else
            ++size;
            break;
        else
            ++size;
-    
+
     if (*ep == NULL){
        static char **last_environ = NULL;
        char **new_environ = (char **) malloc ((size + 2) * sizeof (char *));
     if (*ep == NULL){
        static char **last_environ = NULL;
        char **new_environ = (char **) malloc ((size + 2) * sizeof (char *));
@@ -749,7 +749,7 @@ putenv (const char *string)
     }
     else
        *ep = (char *) string;
     }
     else
        *ep = (char *) string;
-    
+
     return 0;
 }
 #endif /* !HAVE_PUTENV */
     return 0;
 }
 #endif /* !HAVE_PUTENV */
@@ -892,11 +892,11 @@ int s_pipe(int fd[2])
       #endif
       return -1;
    }
       #endif
       return -1;
    }
-   
+
    /*
     * Now link these two stream together with an I_FDINSERT ioctl.
     */
    /*
     * Now link these two stream together with an I_FDINSERT ioctl.
     */
-   
+
    ins.ctlbuf.buf     = (char *) &pointer;   /* no control information, just the pointer */
    ins.ctlbuf.maxlen  = sizeof pointer;
    ins.ctlbuf.len     = sizeof pointer;
    ins.ctlbuf.buf     = (char *) &pointer;   /* no control information, just the pointer */
    ins.ctlbuf.maxlen  = sizeof pointer;
    ins.ctlbuf.len     = sizeof pointer;
index 5d96cc6..4e6379d 100644 (file)
@@ -12,7 +12,7 @@
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -93,7 +93,7 @@
 #endif
 
 /* Maxlimit for skipping updates */
 #endif
 
 /* Maxlimit for skipping updates */
-int max_dirt_limit = 
+int max_dirt_limit =
 #ifdef OS2_NT
 0;
 #else
 #ifdef OS2_NT
 0;
 #else
@@ -124,7 +124,7 @@ int altered_magic_flag = 0;
 int altered_nroff_flag = 0;
 /* }}} */
 
 int altered_nroff_flag = 0;
 /* }}} */
 
-/* "$Id: view.c,v 1.1 2001/12/30 09:55:20 sedwards Exp $" */
+/* "$Id$" */
 
 static char hex_char[] = "0123456789ABCDEF";
 
 
 static char hex_char[] = "0123456789ABCDEF";
 
@@ -144,24 +144,24 @@ void
 free_file (WView *view)
 {
     int i;
 free_file (WView *view)
 {
     int i;
-    
+
 #ifdef HAVE_MMAP
 
     if (view->mmapping){
        mc_munmap (view->data, view->s.st_size);
        close_view_file (view);
 #ifdef HAVE_MMAP
 
     if (view->mmapping){
        mc_munmap (view->data, view->s.st_size);
        close_view_file (view);
-    } else 
+    } else
 #endif /* HAVE_MMAP */
     {
        if (view->reading_pipe){
            /* Check error messages */
            if (!view->have_frame)
                check_error_pipe ();
 #endif /* HAVE_MMAP */
     {
        if (view->reading_pipe){
            /* Check error messages */
            if (!view->have_frame)
                check_error_pipe ();
-           
+
            /* Close pipe */
            pclose (view->stdfile);
            view->stdfile = NULL;
            /* Close pipe */
            pclose (view->stdfile);
            view->stdfile = NULL;
-           
+
            /* Ignore errors because we don't want to hear about broken pipe */
            close_error_pipe (-1, NULL);
        } else
            /* Ignore errors because we don't want to hear about broken pipe */
            close_error_pipe (-1, NULL);
        } else
@@ -225,7 +225,7 @@ get_byte (WView *view, int byte_index)
     int offset = byte_index % VIEW_PAGE_SIZE;
     int i, n;
     block_ptr_t *tmp;
     int offset = byte_index % VIEW_PAGE_SIZE;
     int i, n;
     block_ptr_t *tmp;
-    
+
     if (view->growing_buffer){
        if (page > view->blocks){
            tmp = xmalloc (sizeof (block_ptr_t) * page, "get_byte");
     if (view->growing_buffer){
        if (page > view->blocks){
            tmp = xmalloc (sizeof (block_ptr_t) * page, "get_byte");
@@ -233,7 +233,7 @@ get_byte (WView *view, int byte_index)
                bcopy (view->block_ptr, tmp, sizeof (block_ptr_t) *
                       view->blocks);
                free (view->block_ptr);
                bcopy (view->block_ptr, tmp, sizeof (block_ptr_t) *
                       view->blocks);
                free (view->block_ptr);
-           } 
+           }
            view->block_ptr = tmp;
            for (i = view->blocks; i < page; i++){
                char *p = malloc (VIEW_PAGE_SIZE);
            view->block_ptr = tmp;
            for (i = view->blocks; i < page; i++){
                char *p = malloc (VIEW_PAGE_SIZE);
@@ -300,10 +300,10 @@ put_editkey (WView *view, unsigned char key)
 
     if (!view->hexedit_mode || view->growing_buffer != 0)
         return;
 
     if (!view->hexedit_mode || view->growing_buffer != 0)
         return;
+
     /* Has there been a change at this position ? */
     node = view->change_list;
     /* Has there been a change at this position ? */
     node = view->change_list;
-    while (node) { 
+    while (node) {
         if (node->offset != view->edit_cursor)
             node = node->next;
         else
         if (node->offset != view->edit_cursor)
             node = node->next;
         else
@@ -342,7 +342,7 @@ put_editkey (WView *view, unsigned char key)
 
         if (node) {
 #ifndef HAVE_MMAP
 
         if (node) {
 #ifndef HAVE_MMAP
-                       /* 
+                       /*
                        **      alex@bcs.zaporizhzhe.ua: here we are using file copy
                        **      completely loaded into memory, so we can replace bytes
                        **      in view->data array to allow changes to be reflected
                        **      alex@bcs.zaporizhzhe.ua: here we are using file copy
                        **      completely loaded into memory, so we can replace bytes
                        **      in view->data array to allow changes to be reflected
@@ -381,7 +381,7 @@ save_edit_changes (WView *view)
 {
     struct hexedit_change_node *node = view->change_list;
     int fp;
 {
     struct hexedit_change_node *node = view->change_list;
     int fp;
-    
+
     fp = open (view->filename, O_WRONLY);
     if (fp >= 0) {
         while (node) {
     fp = open (view->filename, O_WRONLY);
     if (fp >= 0) {
         while (node) {
@@ -399,17 +399,17 @@ view_ok_to_quit (WView *view)
 {
     int r;
     char *text;
 {
     int r;
     char *text;
-    
+
     if (!view->change_list)
        return 1;
     if (!view->change_list)
        return 1;
-    
+
     query_set_sel (1);
     text = copy_strings (_("File: \n\n    "), view->filename,
                         _("\n\nhas been modified, do you want to save the changes?\n"), NULL);
     query_set_sel (1);
     text = copy_strings (_("File: \n\n    "), view->filename,
                         _("\n\nhas been modified, do you want to save the changes?\n"), NULL);
-           
+
     r = query_dialog (_(" Save changes "), text, 2, 3, _("&Yes"), _("&No"), _("&Cancel"));
     free (text);
     r = query_dialog (_(" Save changes "), text, 2, 3, _("&Yes"), _("&No"), _("&Cancel"));
     free (text);
-    
+
     switch (r) {
     case 0:
        save_edit_changes (view);
     switch (r) {
     case 0:
        save_edit_changes (view);
@@ -438,7 +438,7 @@ set_view_init_error (WView *view, char *msg)
 
 /* return values: 0 for success, else points to error message */
 static char *
 
 /* return values: 0 for success, else points to error message */
 static char *
-init_growing_view (WView *view, char *name, char *filename) 
+init_growing_view (WView *view, char *name, char *filename)
 {
     view->growing_buffer = 1;
 
 {
     view->growing_buffer = 1;
 
@@ -505,7 +505,7 @@ static char *load_view_file (WView *view, char *filename)
        close_view_file (view);
        return init_growing_view (view, 0, filename);
     }
        close_view_file (view);
        return init_growing_view (view, 0, filename);
     }
-    
+
     /* First, try to open a compressed file */
     if (view->viewer_magic_flag && (is_gunzipable (view->file, &type)) != 0){
        close_view_file (view);
     /* First, try to open a compressed file */
     if (view->viewer_magic_flag && (is_gunzipable (view->file, &type)) != 0){
        close_view_file (view);
@@ -535,7 +535,7 @@ static char *load_view_file (WView *view, char *filename)
        return copy_strings (" Can't mmap file \n ",
                             unix_error_string (errno), " ", 0);*/
        return init_growing_view (view, 0, filename);
        return copy_strings (" Can't mmap file \n ",
                             unix_error_string (errno), " ", 0);*/
        return init_growing_view (view, 0, filename);
-                            
+
     }
 
     view->first = 0;
     }
 
     view->first = 0;
@@ -543,7 +543,7 @@ static char *load_view_file (WView *view, char *filename)
     view->mmapping = 1;
     return 0;
 #else /* ! HAVE_MMAP */
     view->mmapping = 1;
     return 0;
 #else /* ! HAVE_MMAP */
-       /* 
+       /*
        **      For those OS that dont provide mmap call. Try to load all the file
        **      into memory (alex@bcs.zaporizhzhe.ua)
        */
        **      For those OS that dont provide mmap call. Try to load all the file
        **      into memory (alex@bcs.zaporizhzhe.ua)
        */
@@ -592,7 +592,7 @@ do_view_init (WView *view, char *_command, char *_file, int start_line)
     view->marker = 0;
     for (i = 0; i < 10; i++)
        view->marks [i] = 0;
     view->marker = 0;
     for (i = 0; i < 10; i++)
        view->marks [i] = 0;
-    
+
 
     if (!view->have_frame){
        view->start_col = 0;
 
     if (!view->have_frame){
        view->start_col = 0;
@@ -627,7 +627,7 @@ do_view_init (WView *view, char *_command, char *_file, int start_line)
        view->s.st_size = view->bytes_read = strlen (view->data);
     }
     view->last_byte = view->first + view->s.st_size;
        view->s.st_size = view->bytes_read = strlen (view->data);
     }
     view->last_byte = view->first + view->s.st_size;
-    
+
     if (start_line > 1 && !error){
         int saved_wrap_mode = view->wrap_mode;
 
     if (start_line > 1 && !error){
         int saved_wrap_mode = view->wrap_mode;
 
@@ -657,7 +657,7 @@ view_init (WView *view, char *_command, char *_file, int start_line)
        cols = view->widget.cols - 2;
     else
        cols = view->widget.cols;
        cols = view->widget.cols - 2;
     else
        cols = view->widget.cols;
-    
+
     view->bottom_first = -1;
     view->bytes_per_line = 2 * (cols - 7) / 9;
     view->bytes_per_line &= 0xfffc;
     view->bottom_first = -1;
     view->bytes_per_line = 2 * (cols - 7) / 9;
     view->bytes_per_line &= 0xfffc;
@@ -688,7 +688,7 @@ view_percent (WView *view, int p, int w)
        (view->last_byte == view->last ? 100 :
         (p)*100 / view->s.st_size);
 #endif
        (view->last_byte == view->last ? 100 :
         (p)*100 / view->s.st_size);
 #endif
-    
+
     widget_move (view, view->have_frame, w - 5);
     printw ("%3d%% ", percent);
 }
     widget_move (view, view->have_frame, w - 5);
     printw ("%3d%% ", percent);
 }
@@ -739,7 +739,7 @@ view_display_clean (WView *view, int height, int width)
     /* FIXME: Should I use widget_erase only and repaint the box? */
     if (view->have_frame){
        int i;
     /* FIXME: Should I use widget_erase only and repaint the box? */
     if (view->have_frame){
        int i;
-       
+
        draw_double_box (view->widget.parent, view->widget.y, view->widget.x,
                         view->widget.lines, view->widget.cols);
        for (i = 1; i < height; i++){
        draw_double_box (view->widget.parent, view->widget.y, view->widget.x,
                         view->widget.lines, view->widget.cols);
        for (i = 1; i < height; i++){
@@ -792,7 +792,7 @@ display (WView *view)
     int c;
     int boldflag = 0;
     struct hexedit_change_node *curr = view->change_list;
     int c;
     int boldflag = 0;
     struct hexedit_change_node *curr = view->change_list;
+
     height = view->widget.lines - frame_shift;
     width = view->widget.cols - frame_shift;
     from = view->start_display;
     height = view->widget.lines - frame_shift;
     width = view->widget.cols - frame_shift;
     from = view->start_display;
@@ -805,20 +805,20 @@ display (WView *view)
     if ((!view->hex_mode) && (ruler)){
        char r_buff[4];
        int cl;
     if ((!view->hex_mode) && (ruler)){
        char r_buff[4];
        int cl;
-       
+
        view_set_color (view, BOLD_COLOR);
        for (c = frame_shift; c < width; c++) {
        view_set_color (view, BOLD_COLOR);
        for (c = frame_shift; c < width; c++) {
-           cl = c-view->start_col;  
+           cl = c-view->start_col;
            if (ruler == 1)
                view_gotoyx (view, row, c);
            else
                view_gotoyx (view, row+height-2, c);
            r_buff[0] = '-';
            if ((cl % 10) == 0)
            if (ruler == 1)
                view_gotoyx (view, row, c);
            else
                view_gotoyx (view, row+height-2, c);
            r_buff[0] = '-';
            if ((cl % 10) == 0)
-               r_buff[0] = '|'; 
+               r_buff[0] = '|';
            else
                if ((cl % 5) == 0)
            else
                if ((cl % 5) == 0)
-                   r_buff[0] = '*'; 
+                   r_buff[0] = '*';
            view_add_character (view, r_buff[0]);
            if ((cl != 0) && (cl % 10) == 0){
                sprintf(r_buff, "%03d", cl);
            view_add_character (view, r_buff[0]);
            if ((cl != 0) && (cl % 10) == 0){
                sprintf(r_buff, "%03d", cl);
@@ -827,15 +827,15 @@ display (WView *view)
                else
                    widget_move (view, row + height - 3, c - 1);
                 view_add_string (view, r_buff);
                else
                    widget_move (view, row + height - 3, c - 1);
                 view_add_string (view, r_buff);
-           }   
-       }    
+           }
+       }
        view_set_color (view, DEF_COLOR);
        view_set_color (view, DEF_COLOR);
-       if (ruler == 1) 
+       if (ruler == 1)
            row += 2;
        else
            row += 2;
        else
-           height -= 2;    
+           height -= 2;
     }
     }
-    
+
     /* Find the first displayable changed byte */
     while (curr) {
         if (curr->offset < from)
     /* Find the first displayable changed byte */
     while (curr) {
         if (curr->offset < from)
@@ -846,19 +846,19 @@ display (WView *view)
     if (view->hex_mode){
         char hex_buff[10];   /* A temporary buffer for sprintf and mvwaddstr */
         int bytes;          /* Number of bytes already printed on the line */
     if (view->hex_mode){
         char hex_buff[10];   /* A temporary buffer for sprintf and mvwaddstr */
         int bytes;          /* Number of bytes already printed on the line */
-       
+
        /* Start of text column */
         int text_start = width - view->bytes_per_line - 1 + frame_shift;
        /* Start of text column */
         int text_start = width - view->bytes_per_line - 1 + frame_shift;
-       
+
         for (;row < height && from < view->last_byte; row++){
             /* Print the hex offset */
             sprintf (hex_buff, "%05X", (int) (from - view->first));
            widget_move (view, row, frame_shift);
             view_add_string (view, hex_buff);
         for (;row < height && from < view->last_byte; row++){
             /* Print the hex offset */
             sprintf (hex_buff, "%05X", (int) (from - view->first));
            widget_move (view, row, frame_shift);
             view_add_string (view, hex_buff);
-           
+
             /* Hex dump starts from column seven */
             col = 7;
             /* Hex dump starts from column seven */
             col = 7;
-           
+
             /* Each hex number is two digits */
             hex_buff[2] = 0;
             for (bytes = 0; bytes < view->bytes_per_line
             /* Each hex number is two digits */
             hex_buff[2] = 0;
             for (bytes = 0; bytes < view->bytes_per_line
@@ -871,7 +871,7 @@ display (WView *view)
                     view_set_color (view, 7);
                 } else
                 c = (unsigned char) get_byte (view, from);
                     view_set_color (view, 7);
                 } else
                 c = (unsigned char) get_byte (view, from);
-               
+
                if (view->found_len && from >= view->search_start
                    && from < view->search_start + view->found_len){
                    boldflag = 1;
                if (view->found_len && from >= view->search_start
                    && from < view->search_start + view->found_len){
                    boldflag = 1;
@@ -901,26 +901,26 @@ display (WView *view)
                     if (boldflag == 1 &&
                             from == view->search_start + view->found_len - 1)
                         view_set_color (view, DEF_COLOR);
                     if (boldflag == 1 &&
                             from == view->search_start + view->found_len - 1)
                         view_set_color (view, DEF_COLOR);
-                   
+
                     /* Hex numbers are printed in the groups of four */
                     /* Groups are separated by a vline */
                     /* Hex numbers are printed in the groups of four */
                     /* Groups are separated by a vline */
-                   
+
                     view_add_character (view, ' ');
                     one_vline ();
                    view_gotoyx (view, row, col + 1);
                     col += 2;
                     view_add_character (view, ' ');
                     one_vline ();
                    view_gotoyx (view, row, col + 1);
                     col += 2;
-                    
+
                     if (boldflag && from==view->search_start+view->found_len-1)
                        view_set_color (view, BOLD_COLOR);
                     if (boldflag && from==view->search_start+view->found_len-1)
                        view_set_color (view, BOLD_COLOR);
-                   
+
                 }
                 }
-                if (boldflag && from < view->search_start + view->found_len - 1 
+                if (boldflag && from < view->search_start + view->found_len - 1
                     && bytes != view->bytes_per_line - 1)
                     view_add_character (view, ' ');
                     && bytes != view->bytes_per_line - 1)
                     view_add_character (view, ' ');
-               
+
                 /* Print the corresponding ascii character */
                view_gotoyx (view, row, text_start + bytes);
                 /* Print the corresponding ascii character */
                view_gotoyx (view, row, text_start + bytes);
-               
+
                 if (!is_printable (c))
                     c = '.';
                 switch (boldflag) {
                 if (!is_printable (c))
                     c = '.';
                 switch (boldflag) {
@@ -942,7 +942,7 @@ display (WView *view)
                    }
                }
                view_add_character (view, c);
                    }
                }
                view_add_character (view, c);
-               
+
                 if (boldflag){
                     boldflag = 0;
                     view_set_color (view, DEF_COLOR);
                 if (boldflag){
                     boldflag = 0;
                     view_set_color (view, DEF_COLOR);
@@ -1004,7 +1004,7 @@ display (WView *view)
                    c = '.';
 
                view_add_character (view, c);
                    c = '.';
 
                view_add_character (view, c);
-                   } 
+                   }
            col++;
            if (boldflag){
                boldflag = 0;
            col++;
            if (boldflag){
                boldflag = 0;
@@ -1033,7 +1033,7 @@ view_place_cursor (WView *view)
        shift = view->nib_shift;
     else
        shift = 0;
        shift = view->nib_shift;
     else
        shift = 0;
-    
+
     widget_move (&view->widget, view->cursor_row, view->cursor_col + shift);
 }
 
     widget_move (&view->widget, view->cursor_row, view->cursor_col + shift);
 }
 
@@ -1115,12 +1115,12 @@ move_forward2 (WView *view, long current, int lines, long upto)
            q++;
         for (line = col = 0, p = current; p < q; p++){
            int c;
            q++;
         for (line = col = 0, p = current; p < q; p++){
            int c;
-           
+
            if (lines != -1 && line >= lines)
                return p;
 
            c = get_byte (view, p);
            if (lines != -1 && line >= lines)
                return p;
 
            c = get_byte (view, p);
-           
+
            if (view->wrap_mode){
                if (c == '\r')
                    continue; /* This characters is never displayed */
            if (view->wrap_mode){
                if (c == '\r')
                    continue; /* This characters is never displayed */
@@ -1139,12 +1139,12 @@ move_forward2 (WView *view, long current, int lines, long upto)
                       I suspect I got that fix from Jakub, same applies
                       for d. */
                    int d = get_byte (view, p+2);
                       I suspect I got that fix from Jakub, same applies
                       for d. */
                    int d = get_byte (view, p+2);
-                   
-                   if (p + 2 >= view->last_byte || !is_printable (c) || 
-                       !view->viewer_nroff_flag || get_byte (view, p + 1) != '\b' || 
+
+                   if (p + 2 >= view->last_byte || !is_printable (c) ||
+                       !view->viewer_nroff_flag || get_byte (view, p + 1) != '\b' ||
                        !is_printable (d)){
                        col = 0;
                        !is_printable (d)){
                        col = 0;
-                       
+
                        if (c == '\n' || get_byte (view, p+1) != '\n')
                            line++;
                    }
                        if (c == '\n' || get_byte (view, p+1) != '\n')
                            line++;
                    }
@@ -1174,7 +1174,7 @@ move_backward2 (WView *view, long current, int lines)
 
     if (!view->hex_mode && current == view->first)
         return current;
 
     if (!view->hex_mode && current == view->first)
         return current;
-    
+
     if (view->hex_mode){
        p = current - lines * view->bytes_per_line;
         p = (p < view->first) ? view->first : p;
     if (view->hex_mode){
        p = current - lines * view->bytes_per_line;
         p = (p < view->first) ? view->first : p;
@@ -1235,7 +1235,7 @@ get_bottom_first (WView *view, int do_not_cache, int really)
 
     if (!have_fast_cpu && !really)
        return INT_MAX;
 
     if (!have_fast_cpu && !really)
        return INT_MAX;
-    
+
     if (!do_not_cache && view->bottom_first != -1)
        return view->bottom_first;
 
     if (!do_not_cache && view->bottom_first != -1)
        return view->bottom_first;
 
@@ -1251,12 +1251,12 @@ get_bottom_first (WView *view, int do_not_cache, int really)
     }
 
     bottom_first = move_backward2 (view, view->last_byte, vheight - 1);
     }
 
     bottom_first = move_backward2 (view, view->last_byte, vheight - 1);
-    
+
     if (view->hex_mode)
        bottom_first = (bottom_first + view->bytes_per_line - 1)
            / view->bytes_per_line * view->bytes_per_line;
     view->bottom_first = bottom_first;
     if (view->hex_mode)
        bottom_first = (bottom_first + view->bytes_per_line - 1)
            / view->bytes_per_line * view->bytes_per_line;
     view->bottom_first = bottom_first;
-    
+
     return view->bottom_first;
 }
 
     return view->bottom_first;
 }
 
@@ -1280,7 +1280,7 @@ move_to_top (WView *view)
     view->found_len = 0;
     view->last = view->first + ((LINES-2) * view->bytes_per_line);
     view->nib_shift = 0;
     view->found_len = 0;
     view->last = view->first + ((LINES-2) * view->bytes_per_line);
     view->nib_shift = 0;
-    view->edit_cursor = view->start_display; 
+    view->edit_cursor = view->start_display;
     view->dirty++;
 }
 
     view->dirty++;
 }
 
@@ -1308,7 +1308,7 @@ move_right (WView *view)
             view->nib_shift = 1 - view->nib_shift;
             if (view->nib_shift == 1)
                 return;
             view->nib_shift = 1 - view->nib_shift;
             if (view->nib_shift == 1)
                 return;
-        } 
+        }
         view->edit_cursor = (++view->edit_cursor <  view->last_byte) ?
             view->edit_cursor : view->last_byte - 1;
         if (view->edit_cursor >= view->last) {
         view->edit_cursor = (++view->edit_cursor <  view->last_byte) ?
             view->edit_cursor : view->last_byte - 1;
         if (view->edit_cursor >= view->last) {
@@ -1331,7 +1331,7 @@ move_left (WView *view)
             view->nib_shift = 1 - view->nib_shift;
             if (view->nib_shift == 0)
                 return;
             view->nib_shift = 1 - view->nib_shift;
             if (view->nib_shift == 0)
                 return;
-        } 
+        }
         view->edit_cursor = (--view->edit_cursor < view->first) ?
             view->first : view->edit_cursor;
         if (view->edit_cursor < view->start_display) {
         view->edit_cursor = (--view->edit_cursor < view->first) ?
             view->first : view->edit_cursor;
         if (view->edit_cursor < view->start_display) {
@@ -1354,7 +1354,7 @@ icase_search_p (WView *view, char *text, char *data, int nothing)
     int p = 0, lng;
     char *q;
 
     int p = 0, lng;
     char *q;
 
-    p = (q = _icase_search (text, data, &lng)) != 0; 
+    p = (q = _icase_search (text, data, &lng)) != 0;
     if (p) {
        view->found_len = lng;
        view->search_start = q - data - view->found_len;
     if (p) {
        view->found_len = lng;
        view->search_start = q - data - view->found_len;
@@ -1392,7 +1392,7 @@ get_line_at (WView *view, long *p)
 
     direction = view->direction;
     buffer_size = usable_size = 0;
 
     direction = view->direction;
     buffer_size = usable_size = 0;
-    
+
     i = ch = 0;
     for (;pos >= 0 && (ch = get_byte (view, pos))!= -1; pos += direction, i++){
 
     i = ch = 0;
     for (;pos >= 0 && (ch = get_byte (view, pos))!= -1; pos += direction, i++){
 
@@ -1418,7 +1418,7 @@ get_line_at (WView *view, long *p)
        i--;
        buffer [0] = ' ';
        buffer [i+1] = 0;
        i--;
        buffer [0] = ' ';
        buffer [i+1] = 0;
-       
+
        /* If we are searching backwards, reverse the string */
        if (view->direction < 0)
            reverse_string (buffer);
        /* If we are searching backwards, reverse the string */
        if (view->direction < 0)
            reverse_string (buffer);
@@ -1469,7 +1469,7 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
     long t;
     /* Clear interrupt status */
     got_interrupt ();
     long t;
     /* Clear interrupt status */
     got_interrupt ();
-    
+
     if (verbose){
        d = message (D_INSERT, _(" Search "), _("Searching %s"), text);
        mc_refresh ();
     if (verbose){
        d = message (D_INSERT, _(" Search "), _("Searching %s"), text);
        mc_refresh ();
@@ -1515,7 +1515,7 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
        enable_interrupt_key ();
        if (!s)
            break;
        enable_interrupt_key ();
        if (!s)
            break;
-       
+
        search_status = (*search) (view, text, s + 1, match_normal);
        if (search_status < 0)
            break;
        search_status = (*search) (view, text, s + 1, match_normal);
        if (search_status < 0)
            break;
@@ -1524,9 +1524,9 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
            continue;
 
        /* We found the string */
            continue;
 
        /* We found the string */
-       
+
        if (!isatbeg && !view->search_start){
        if (!isatbeg && !view->search_start){
-           
+
            /* We do not want to match a
             * ^ regexp when not at the real
             * beginning of some line
            /* We do not want to match a
             * ^ regexp when not at the real
             * beginning of some line
@@ -1550,7 +1550,7 @@ search (WView *view, char *text, int (*search)(WView *, char *, char *, int))
            else
                view->start_display = t;
        }
            else
                view->start_display = t;
        }
-       
+
        free (s);
        break;
     }
        free (s);
        break;
     }
@@ -1582,7 +1582,7 @@ block_search (WView *view, char *buffer, int len)
 
     search_update_steps (view);
     update_activate = 0;
 
     search_update_steps (view);
     update_activate = 0;
-    
+
     for (; e < view->last_byte; e++){
        if (e >= update_activate){
            update_activate += update_steps;
     for (; e < view->last_byte; e++){
        if (e >= update_activate){
            update_activate += update_steps;
@@ -1594,7 +1594,7 @@ block_search (WView *view, char *buffer, int len)
                break;
        }
        b = get_byte (view, e);
                break;
        }
        b = get_byte (view, e);
-       
+
        if (*d == b){
            d++;
        } else {
        if (*d == b){
            d++;
        } else {
@@ -1630,7 +1630,7 @@ hex_search (WView *view, char *text)
     long pos;                  /* Where did we found the string */
     char *p;                   /* Temporary */
     int  state = normal;       /* Initial state of the micro-scanner */
     long pos;                  /* Where did we found the string */
     char *p;                   /* Temporary */
     int  state = normal;       /* Initial state of the micro-scanner */
-    
+
     /* First convert the string to a stream of bytes */
     for (i = block_len = 0; text [i] && block_len < sizeof (buffer); i++){
        switch (state){
     /* First convert the string to a stream of bytes */
     for (i = block_len = 0; text [i] && block_len < sizeof (buffer); i++){
        switch (state){
@@ -1687,13 +1687,13 @@ hex_search (WView *view, char *text)
        view->found_len = 0;
        return;
     }
        view->found_len = 0;
        return;
     }
-    
+
     view->search_start = pos + 1;
     view->found_len = block_len;
     /* Set the edit cursor to the search position, left nibble */
     view->edit_cursor = view->search_start;
     view->nib_shift = 0;
     view->search_start = pos + 1;
     view->found_len = block_len;
     /* Set the edit cursor to the search position, left nibble */
     view->edit_cursor = view->search_start;
     view->nib_shift = 0;
-    
+
     /* Adjust the file offset */
     view->start_display = (pos & (~(view->bytes_per_line-1)));
     if (view->start_display > get_bottom_first (view, 0, 0))
     /* Adjust the file offset */
     view->start_display = (pos & (~(view->bytes_per_line-1)));
     if (view->start_display > get_bottom_first (view, 0, 0))
@@ -1738,7 +1738,7 @@ static int regexp_view_search (WView *view, char *pattern, char *string, int mat
 static void do_regexp_search (void *xview, char *regexp)
 {
     WView *view = (WView *) xview;
 static void do_regexp_search (void *xview, char *regexp)
 {
     WView *view = (WView *) xview;
-    
+
     view->search_exp = regexp;
     search (view, regexp, regexp_view_search);
     /* Had a refresh here */
     view->search_exp = regexp;
     search (view, regexp, regexp_view_search);
     /* Had a refresh here */
@@ -1749,11 +1749,11 @@ static void do_regexp_search (void *xview, char *regexp)
 static void do_normal_search (void *xview, char *text)
 {
     WView *view = (WView *) xview;
 static void do_normal_search (void *xview, char *text)
 {
     WView *view = (WView *) xview;
-    
+
     view->search_exp = text;
     if (view->hex_mode)
        hex_search (view, text);
     view->search_exp = text;
     if (view->hex_mode)
        hex_search (view, text);
-    else 
+    else
        search (view, text, icase_search_p);
     /* Had a refresh here */
     view->dirty++;
        search (view, text, icase_search_p);
     /* Had a refresh here */
     view->dirty++;
@@ -1791,7 +1791,7 @@ void toggle_wrap_mode (WView *view)
         view->dirty++;
         view_update (view);
                return;
         view->dirty++;
         view_update (view);
                return;
-    } 
+    }
     view->wrap_mode = 1 - view->wrap_mode;
     get_bottom_first (view, 1, 1);
     if (view->wrap_mode)
     view->wrap_mode = 1 - view->wrap_mode;
     get_bottom_first (view, 1, 1);
     if (view->wrap_mode)
@@ -1880,7 +1880,7 @@ regexp_search (WView *view, int direction)
         save_edit_changes(view);
        return;
     }
         save_edit_changes(view);
        return;
     }
-    
+
     regexp = old ? old : regexp;
     regexp = input_dialog (_(" Search "), _(" Enter regexp:"), regexp);
     if ((!regexp) || (!*regexp)){
     regexp = old ? old : regexp;
     regexp = input_dialog (_(" Search "), _(" Enter regexp:"), regexp);
     if ((!regexp) || (!*regexp)){
@@ -1983,9 +1983,9 @@ void
 view_labels (WView *view)
 {
     Dlg_head *h = view->widget.parent;
 view_labels (WView *view)
 {
     Dlg_head *h = view->widget.parent;
-    
+
     define_label (h, (Widget *) view, 1, _("Help"), help_cmd);
     define_label (h, (Widget *) view, 1, _("Help"), help_cmd);
-    
+
     my_define (h, 10, _("Quit"), view_quit_cmd, view);
     my_define (h, 4, view->hex_mode ? _("Ascii"): _("Hex"), toggle_hex_mode, view);
     my_define (h, 5, _("Line"), goto_line, view);
     my_define (h, 10, _("Quit"), view_quit_cmd, view);
     my_define (h, 4, view->hex_mode ? _("Ascii"): _("Hex"), toggle_hex_mode, view);
     my_define (h, 5, _("Line"), goto_line, view);
@@ -1996,10 +1996,10 @@ view_labels (WView *view)
                      view->growing_buffer ? "" : _("Edit") :
                      view->wrap_mode ? _("UnWrap") : _("Wrap"),
                      toggle_wrap_mode, view);
                      view->growing_buffer ? "" : _("Edit") :
                      view->wrap_mode ? _("UnWrap") : _("Wrap"),
                      toggle_wrap_mode, view);
-   
+
     my_define (h, 7, view->hex_mode ? _("HxSrch") : _("Search"),
               normal_search_cmd, view);
     my_define (h, 7, view->hex_mode ? _("HxSrch") : _("Search"),
               normal_search_cmd, view);
-    
+
     my_define (h, 8, view->viewer_magic_flag ? _("Raw") : _("Parse"),
               change_viewer, view);
 
     my_define (h, 8, view->viewer_magic_flag ? _("Raw") : _("Parse"),
               change_viewer, view);
 
@@ -2008,7 +2008,7 @@ view_labels (WView *view)
                   change_nroff, view);
        my_define (h, 3, _("Quit"), view_quit_cmd, view);
     }
                   change_nroff, view);
        my_define (h, 3, _("Quit"), view_quit_cmd, view);
     }
-    
+
     redraw_labels (h, (Widget *) view);
 }
 
     redraw_labels (h, (Widget *) view);
 }
 
@@ -2029,9 +2029,9 @@ void
 set_monitor (WView *view, int set_on)
 {
     int old = view->monitor;
 set_monitor (WView *view, int set_on)
 {
     int old = view->monitor;
-    
+
     view->monitor = set_on;
     view->monitor = set_on;
-    
+
     if (view->monitor){
        move_to_bottom (view);
        view->bottom_first = -1;
     if (view->monitor){
        move_to_bottom (view);
        view->bottom_first = -1;
@@ -2060,7 +2060,7 @@ view_handle_key (WView *view, int c)
     int prev_monitor = view->monitor;
 
     set_monitor (view, off);
     int prev_monitor = view->monitor;
 
     set_monitor (view, off);
-    
+
     if (view->hex_mode) {
         switch (c) {
         case 0x09:             /* Tab key */
     if (view->hex_mode) {
         switch (c) {
         case 0x09:             /* Tab key */
@@ -2072,7 +2072,7 @@ view_handle_key (WView *view, int c)
             view->edit_cursor -= view->edit_cursor % view->bytes_per_line;
             view->dirty++;
             return 1;
             view->edit_cursor -= view->edit_cursor % view->bytes_per_line;
             view->dirty++;
             return 1;
-    
+
         case XCTRL('b'):        /* Character back */
             move_left(view);
             return 1;
         case XCTRL('b'):        /* Character back */
             move_left(view);
             return 1;
@@ -2082,23 +2082,23 @@ view_handle_key (WView *view, int c)
             view->edit_cursor += view->bytes_per_line - 1;
             view->dirty++;
             return 1;
             view->edit_cursor += view->bytes_per_line - 1;
             view->dirty++;
             return 1;
-    
+
         case XCTRL('f'):        /* Character forward */
             move_right(view);
             return 1;
         }
         case XCTRL('f'):        /* Character forward */
             move_right(view);
             return 1;
         }
-    
+
        /* Trap 0-9,A-F,a-f for left side data entry (hex editing) */
         if (view->view_side == view_side_left){
        /* Trap 0-9,A-F,a-f for left side data entry (hex editing) */
         if (view->view_side == view_side_left){
-            if ((c >= '0' && c <= '9') || 
+            if ((c >= '0' && c <= '9') ||
                 (c >= 'A' && c <= 'F') ||
                 (c >= 'a' && c <= 'f')){
                 (c >= 'A' && c <= 'F') ||
                 (c >= 'a' && c <= 'f')){
-        
+
                 put_editkey (view, c);
                 return 1;
             }
         }
                 put_editkey (view, c);
                 return 1;
             }
         }
-       
+
        /* Trap all printable characters for right side data entry */
        /* Also enter the value of the Enter key */
        if (view->view_side == view_side_right){
        /* Trap all printable characters for right side data entry */
        /* Also enter the value of the Enter key */
        if (view->view_side == view_side_right){
@@ -2108,10 +2108,10 @@ view_handle_key (WView *view, int c)
            }
        }
     }
            }
        }
     }
-    
+
     if (check_left_right_keys (view, c))
        return 1;
     if (check_left_right_keys (view, c))
        return 1;
-    
+
     if (check_movement_keys (c, 1, vheight, view, (movefn) view_move_backward, (movefn) view_move_forward,
                             (movefn) move_to_top, (movefn) move_to_bottom)){
        return 1;
     if (check_movement_keys (c, 1, vheight, view, (movefn) view_move_backward, (movefn) view_move_forward,
                             (movefn) move_to_top, (movefn) move_to_bottom)){
        return 1;
@@ -2121,7 +2121,7 @@ view_handle_key (WView *view, int c)
     case '?':
        regexp_search (view, -1);
        return 1;
     case '?':
        regexp_search (view, -1);
        return 1;
-       
+
     case '/':
        regexp_search (view, 1);
        return 1;
     case '/':
        regexp_search (view, 1);
        return 1;
@@ -2157,30 +2157,30 @@ view_handle_key (WView *view, int c)
     case 'h':
         move_left (view);
         return 1;
     case 'h':
         move_left (view);
         return 1;
-        
+
     case 'j':
     case '\n':
     case 'e':
        view_move_forward (view, 1);
        return 1;
     case 'j':
     case '\n':
     case 'e':
        view_move_forward (view, 1);
        return 1;
-       
+
     case 'd':
         view_move_forward (view, vheight / 2);
         return 1;
     case 'd':
         view_move_forward (view, vheight / 2);
         return 1;
-        
+
     case 'u':
         view_move_backward (view, vheight / 2);
         return 1;
     case 'u':
         view_move_backward (view, vheight / 2);
         return 1;
-       
+
     case 'k':
     case 'y':
         view_move_backward (view, 1);
         return 1;
     case 'k':
     case 'y':
         view_move_backward (view, 1);
         return 1;
-        
+
     case 'l':
         move_right (view);
         return 1;
     case 'l':
         move_right (view);
         return 1;
-        
+
     case ' ':
     case 'f':
         view_move_forward (view, vheight - 1);
     case ' ':
     case 'f':
         view_move_forward (view, vheight - 1);
@@ -2189,19 +2189,19 @@ view_handle_key (WView *view, int c)
     case '!':
        exec_shell ();
        return 1;
     case '!':
        exec_shell ();
        return 1;
-       
+
     case 'F':
        set_monitor (view, on);
        return 1;
     case 'F':
        set_monitor (view, on);
        return 1;
-       
+
     case 'b':
        view_move_backward (view, vheight - 1);
        return 1;
     case 'b':
        view_move_backward (view, vheight - 1);
        return 1;
-        
+
     case KEY_IC:
         view_move_backward (view, 2);
         return 1;
     case KEY_IC:
         view_move_backward (view, 2);
         return 1;
-        
+
     case KEY_DC:
         view_move_forward (view, 2);
         return 1;
     case KEY_DC:
         view_move_forward (view, 2);
         return 1;
@@ -2214,7 +2214,7 @@ view_handle_key (WView *view, int c)
        view->start_display = view->marks [view->marker];
        view->dirty++;
        return 1;
        view->start_display = view->marks [view->marker];
        view->dirty++;
        return 1;
-       
+
        /*  Use to indicate parent that we want to see the next/previous file */
        /* Only works on full screen mode */
     case XCTRL('f'):
        /*  Use to indicate parent that we want to see the next/previous file */
        /* Only works on full screen mode */
     case XCTRL('f'):
@@ -2236,7 +2236,7 @@ view_handle_key (WView *view, int c)
 
     /* Restore the monitor status */
     set_monitor (view, prev_monitor);
 
     /* Restore the monitor status */
     set_monitor (view, prev_monitor);
-    
+
     /* Key not used */
     return 0;
 }
     /* Key not used */
     return 0;
 }
@@ -2272,7 +2272,7 @@ view_event (WView *view, Gpm_Event *event, int *result)
                view_move_forward (view, vheight / 2 - 1);
            else
                view_move_forward (view, 1);
                view_move_forward (view, vheight / 2 - 1);
            else
                view_move_forward (view, 1);
-           *result = MOU_REPEAT; 
+           *result = MOU_REPEAT;
            return 1;
        }
     }
            return 1;
        }
     }
@@ -2284,7 +2284,7 @@ int
 real_view_event (Gpm_Event *event, void *x)
 {
     int result;
 real_view_event (Gpm_Event *event, void *x)
 {
     int result;
-    
+
     if (view_event ((WView *) x, event, &result))
        view_update ((WView *) x);
     return result;
     if (view_event ((WView *) x, event, &result))
        view_update ((WView *) x);
     return result;
@@ -2318,7 +2318,7 @@ view (char *_command, char *_file, int *move_dir_p, int start_line)
 
     error = view_init (wview, _command, _file, start_line);
     if (!error){
 
     error = view_init (wview, _command, _file, start_line);
     if (!error){
-       x_view (wview); 
+       x_view (wview);
     }
     *move_dir_p = 0;
     return !error;
     }
     *move_dir_p = 0;
     return !error;
@@ -2351,7 +2351,7 @@ view (char *_command, char *_file, int *move_dir_p, int start_line)
     WView *wview;
     WButtonBar *bar;
     Dlg_head *our_dlg;
     WView *wview;
     WButtonBar *bar;
     Dlg_head *our_dlg;
-    
+
     /* Create dialog and widgets, put them on the dialog */
     our_dlg = create_dlg (0, 0, LINES, COLS, midnight_colors,
                           view_mode_callback, "[Internal File Viewer]",
     /* Create dialog and widgets, put them on the dialog */
     our_dlg = create_dlg (0, 0, LINES, COLS, midnight_colors,
                           view_mode_callback, "[Internal File Viewer]",
@@ -2382,7 +2382,7 @@ view (char *_command, char *_file, int *move_dir_p, int start_line)
            *move_dir_p = wview->move_dir;
     }
     destroy_dlg (our_dlg);
            *move_dir_p = wview->move_dir;
     }
     destroy_dlg (our_dlg);
-    
+
     return !error;
 }
 #endif
     return !error;
 }
 #endif
@@ -2403,7 +2403,7 @@ view_hook (void *v)
     }
 
     delete_hook (&idle_hook, view_hook);
     }
 
     delete_hook (&idle_hook, view_hook);
-    
+
     if (get_current_type () == view_listing)
        panel = cpanel;
     else if (get_other_type () == view_listing)
     if (get_current_type () == view_listing)
        panel = cpanel;
     else if (get_other_type () == view_listing)
@@ -2420,7 +2420,7 @@ view_hook (void *v)
         if (!S_ISREG (panel->dir.list [panel->selected].buf.st_mode))
            return;
     }
         if (!S_ISREG (panel->dir.list [panel->selected].buf.st_mode))
            return;
     }
-    
+
     view_init (view, 0, panel->dir.list [panel->selected].fname, 0);
     display (view);
     view_status (view);
     view_init (view, 0, panel->dir.list [panel->selected].fname, 0);
     display (view);
     view_status (view);
@@ -2431,7 +2431,7 @@ view_callback (Dlg_head *h, WView *v, int msg, int par)
 {
     WView *view = (WView *) v;
     int i;
 {
     WView *view = (WView *) v;
     int i;
-    
+
     switch (msg){
     case WIDGET_INIT:
        x_create_viewer (view);
     switch (msg){
     case WIDGET_INIT:
        x_create_viewer (view);
@@ -2440,7 +2440,7 @@ view_callback (Dlg_head *h, WView *v, int msg, int par)
        else
            view_labels (view);
        break;
        else
            view_labels (view);
        break;
-       
+
     case WIDGET_DRAW:
        display (view);
        view_status (view);
     case WIDGET_DRAW:
        display (view);
        view_status (view);
@@ -2468,12 +2468,12 @@ view_callback (Dlg_head *h, WView *v, int msg, int par)
        view_status (view);
        sleep (1);
        return 1;
        view_status (view);
        sleep (1);
        return 1;
-       
+
     case WIDGET_FOCUS:
        x_focus_view (view);
        view_labels (view);
        return 1;
     case WIDGET_FOCUS:
        x_focus_view (view);
        view_labels (view);
        return 1;
-       
+
     }
     return default_proc (h, msg, par);
 }
     }
     return default_proc (h, msg, par);
 }
@@ -2482,7 +2482,7 @@ WView *
 view_new (int y, int x, int cols, int lines, int is_panel)
 {
     WView *view = xmalloc (sizeof (WView), "view_new");
 view_new (int y, int x, int cols, int lines, int is_panel)
 {
     WView *view = xmalloc (sizeof (WView), "view_new");
-    
+
     init_widget (&view->widget, y, x, lines, cols,
                 (callback_fn) view_callback,
                 (destroy_fn) view_destroy,
     init_widget (&view->widget, y, x, lines, cols,
                 (callback_fn) view_callback,
                 (destroy_fn) view_destroy,
@@ -2503,7 +2503,7 @@ view_new (int y, int x, int cols, int lines, int is_panel)
     view->last_byte = -1;
     view->monitor = 0;
     view->wrap_mode = global_wrap_mode;
     view->last_byte = -1;
     view->monitor = 0;
     view->wrap_mode = global_wrap_mode;
-    
+
     x_init_view (view);
 
     widget_want_cursor (view->widget, 0);
     x_init_view (view);
 
     widget_want_cursor (view->widget, 0);
index 6430044..edc0a67 100644 (file)
@@ -21,7 +21,7 @@ typedef struct {
     char *localcopy;
     int view_active;
     int have_frame;
     char *localcopy;
     int view_active;
     int have_frame;
-    
+
     unsigned char *data;       /* Memory area for the file to be viewed */
 
     /* File information */
     unsigned char *data;       /* Memory area for the file to be viewed */
 
     /* File information */
@@ -40,30 +40,30 @@ typedef struct {
     long start_display;                /* First char displayed */
     int  start_col;            /* First displayed column, negative */
     int  edit_cursor;           /* HexEdit cursor position in file */
     long start_display;                /* First char displayed */
     int  start_col;            /* First displayed column, negative */
     int  edit_cursor;           /* HexEdit cursor position in file */
-    char hexedit_mode;          /* Hexidecimal editing mode flag */ 
+    char hexedit_mode;          /* Hexidecimal editing mode flag */
     char nib_shift;             /* A flag for inserting nibbles into bytes */
     enum ViewSide view_side;   /* A flag for the active editing panel */
     int  file_dirty;            /* Number of changes */
     char nib_shift;             /* A flag for inserting nibbles into bytes */
     enum ViewSide view_side;   /* A flag for the active editing panel */
     int  file_dirty;            /* Number of changes */
-    int  start_save;            /* Line start shift between Ascii and Hex */ 
+    int  start_save;            /* Line start shift between Ascii and Hex */
     int  cursor_col;           /* Cursor column */
     int  cursor_row;           /* Cursor row */
     struct hexedit_change_node *change_list;   /* Linked list of changes */
 
     int dirty;                 /* Number of skipped updates */
     int wrap_mode;             /* wrap_mode */
     int  cursor_col;           /* Cursor column */
     int  cursor_row;           /* Cursor row */
     struct hexedit_change_node *change_list;   /* Linked list of changes */
 
     int dirty;                 /* Number of skipped updates */
     int wrap_mode;             /* wrap_mode */
-       
+
     /* Mode variables */
     int hex_mode;              /* Hexadecimal mode flag */
     int bytes_per_line;                /* Number of bytes per line in hex mode */
     int viewer_magic_flag;     /* Selected viewer */
     int viewer_nroff_flag;     /* Do we do nroff style highlighting? */
     /* Mode variables */
     int hex_mode;              /* Hexadecimal mode flag */
     int bytes_per_line;                /* Number of bytes per line in hex mode */
     int viewer_magic_flag;     /* Selected viewer */
     int viewer_nroff_flag;     /* Do we do nroff style highlighting? */
-    
+
     /* Growing buffers information */
     int growing_buffer;                /* Use the growing buffers? */
     block_ptr_t *block_ptr;    /* Pointer to the block pointers */
     int          blocks;       /* The number of blocks in *block_ptr */
 
     /* Growing buffers information */
     int growing_buffer;                /* Use the growing buffers? */
     block_ptr_t *block_ptr;    /* Pointer to the block pointers */
     int          blocks;       /* The number of blocks in *block_ptr */
 
-    
+
     /* Search variables */
     int search_start;          /* First character to start searching from */
     int found_len;             /* Length of found string or 0 if none was found */
     /* Search variables */
     int search_start;          /* First character to start searching from */
     int found_len;             /* Length of found string or 0 if none was found */
@@ -77,7 +77,7 @@ typedef struct {
     /* Markers */
     int marker;                        /* mark to use */
     int marks [10];            /* 10 marks: 0..9 */
     /* Markers */
     int marker;                        /* mark to use */
     int marks [10];            /* 10 marks: 0..9 */
-    
+
 #ifdef HAVE_TK
     /* Tk version, line cache */
     int  current_line;         /* The current screen line cached */
 #ifdef HAVE_TK
     /* Tk version, line cache */
     int  current_line;         /* The current screen line cached */
@@ -88,7 +88,7 @@ typedef struct {
     int  last_col;             /* last column used */
     int  status_shown;         /* Have we show the file information? */
 #endif
     int  last_col;             /* last column used */
     int  status_shown;         /* Have we show the file information? */
 #endif
-       
+
 #ifdef HAVE_GNOME
     int  current_x, current_y; /* Current x,y position */
     int  color;                        /* Current color */
 #ifdef HAVE_GNOME
     int  current_x, current_y; /* Current x,y position */
     int  color;                        /* Current color */
@@ -99,8 +99,8 @@ typedef struct {
     void *gtk_percent;         /* percent */
     void *sadj;                        /* scrollbar adjustment */
 #endif
     void *gtk_percent;         /* percent */
     void *sadj;                        /* scrollbar adjustment */
 #endif
-       
-    int  move_dir;             /* return value from widget:  
+
+    int  move_dir;             /* return value from widget:
                                 * 0 do nothing
                                 * -1 view previous file
                                 * 1 view next file
                                 * 0 do nothing
                                 * -1 view previous file
                                 * 1 view next file
index 4741c9a..2e19b5d 100644 (file)
@@ -1,7 +1,7 @@
 /* Widgets for the Midnight Commander
 
    Copyright (C) 1994, 1995, 1996 the Free Software Foundation
 /* Widgets for the Midnight Commander
 
    Copyright (C) 1994, 1995, 1996 the Free Software Foundation
-   
+
    Authors: 1994, 1995 Radek Doulik
             1994, 1995 Miguel de Icaza
             1995 Jakub Jelinek
    Authors: 1994, 1995 Radek Doulik
             1994, 1995 Miguel de Icaza
             1995 Jakub Jelinek
@@ -23,7 +23,7 @@
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
  */
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
  */
-/* "$Id: widget.c,v 1.1 2001/12/30 09:55:20 sedwards Exp $" */
+/* "$Id$" */
 
 #include <config.h>
 #include <string.h>
 
 #include <config.h>
 #include <string.h>
@@ -80,7 +80,7 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
     char *txt, buf[256];
     int stop = 0;
     int off = 0;
     char *txt, buf[256];
     int stop = 0;
     int off = 0;
-    
+
     switch (Msg){
     case WIDGET_INIT:
        return x_create_button (h, h->wdata, b);
     switch (Msg){
     case WIDGET_INIT:
        return x_create_button (h, h->wdata, b);
@@ -91,7 +91,7 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
            return 1;
        } else
            return 0;
            return 1;
        } else
            return 0;
-       
+
     case WIDGET_KEY:
        if (Par != ' ' && Par != '\n')
            break;
     case WIDGET_KEY:
        if (Par != ' ' && Par != '\n')
            break;
@@ -109,13 +109,13 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
     case WIDGET_CURSOR:
     {
        char *s = b->action == B_ENTER ? ".button" : "";
     case WIDGET_CURSOR:
     {
        char *s = b->action == B_ENTER ? ".button" : "";
-       
+
        tk_evalf ("focus %s%s", (char *)(b->widget.wdata)+1, s);
        /* Do not call default_proc: we did the tk focus command */
        return 1;
     }
 #else
        tk_evalf ("focus %s%s", (char *)(b->widget.wdata)+1, s);
        /* Do not call default_proc: we did the tk focus command */
        return 1;
     }
 #else
-       
+
     case WIDGET_CURSOR:
        switch (b->flags) {
            case DEFPUSH_BUTTON:
     case WIDGET_CURSOR:
        switch (b->flags) {
            case DEFPUSH_BUTTON:
@@ -138,9 +138,9 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
     case WIDGET_UNFOCUS:
     case WIDGET_FOCUS:
     case WIDGET_DRAW:
     case WIDGET_UNFOCUS:
     case WIDGET_FOCUS:
     case WIDGET_DRAW:
-       if (Msg==WIDGET_UNFOCUS) 
+       if (Msg==WIDGET_UNFOCUS)
            b->selected = 0;
            b->selected = 0;
-       else if (Msg==WIDGET_FOCUS) 
+       else if (Msg==WIDGET_FOCUS)
            b->selected = 1;
 
        switch (b->flags){
            b->selected = 1;
 
        switch (b->flags){
@@ -179,9 +179,9 @@ button_callback (Dlg_head *h, WButton *b, int Msg, int Par)
        else
            return 1;
        break;
        else
            return 1;
        break;
-#endif 
+#endif
 #endif /* !HAVE_XVIEW */
 #endif /* !HAVE_XVIEW */
-    }  
+    }
     return default_proc (h, Msg, Par);
 }
 
     return default_proc (h, Msg, Par);
 }
 
@@ -253,7 +253,7 @@ button_scan_hotkey(WButton* b)
 }
 
 WButton *
 }
 
 WButton *
-button_new (int y, int x, int action, int flags, char *text, 
+button_new (int y, int x, int action, int flags, char *text,
            int (*callback)(int, void *), void *callback_data, char *tkname)
 {
     WButton *b = xmalloc (sizeof (WButton), "new_button");
            int (*callback)(int, void *), void *callback_data, char *tkname)
 {
     WButton *b = xmalloc (sizeof (WButton), "new_button");
@@ -261,7 +261,7 @@ button_new (int y, int x, int action, int flags, char *text,
     init_widget (&b->widget, y, x, 1, button_len (text, flags),
                 (callback_fn) button_callback,
                 (destroy_fn) button_destroy, (mouse_h)button_event, tkname);
     init_widget (&b->widget, y, x, 1, button_len (text, flags),
                 (callback_fn) button_callback,
                 (destroy_fn) button_destroy, (mouse_h)button_event, tkname);
-    
+
     b->action = action;
     b->flags  = flags;
     b->selected = 0;
     b->action = action;
     b->flags  = flags;
     b->selected = 0;
@@ -298,22 +298,22 @@ static int
 radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
 {
     int i;
 radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
 {
     int i;
-    
+
     switch (Msg) {
     case WIDGET_INIT:
        return x_create_radio (h, h->wdata, r);
     switch (Msg) {
     case WIDGET_INIT:
        return x_create_radio (h, h->wdata, r);
-       
+
 #ifndef HAVE_XVIEW
     case WIDGET_HOTKEY:
        {
            int i, lp = tolower(Par);
            char *cp;
 #ifndef HAVE_XVIEW
     case WIDGET_HOTKEY:
        {
            int i, lp = tolower(Par);
            char *cp;
-           
+
            for (i = 0; i < r->count; i++){
                cp = strchr (r->texts [i], '&');
                if (cp != NULL && cp[1] != '\0'){
                    int c = tolower (cp [1]);
            for (i = 0; i < r->count; i++){
                cp = strchr (r->texts [i], '&');
                if (cp != NULL && cp[1] != '\0'){
                    int c = tolower (cp [1]);
-                   
+
                    if (c != lp)
                        continue;
                    r->pos = i;
                    if (c != lp)
                        continue;
                    r->pos = i;
@@ -323,7 +323,7 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
            }
        }
        return 0;
            }
        }
        return 0;
-       
+
     case WIDGET_KEY:
        switch (Par){
        case ' ':
     case WIDGET_KEY:
        switch (Par){
        case ' ':
@@ -341,7 +341,7 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
                return 1;
            }
            return 0;
                return 1;
            }
            return 0;
-           
+
        case KEY_DOWN:
        case KEY_RIGHT:
            if (r->count - 1 > r->pos) {
        case KEY_DOWN:
        case KEY_RIGHT:
            if (r->count - 1 > r->pos) {
@@ -359,14 +359,14 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
            return 1;
 #endif
 #endif
            return 1;
 #endif
 #endif
-       
+
 #ifndef HAVE_X
     case WIDGET_CURSOR:
        (*h->callback) (h, h->current->dlg_id, DLG_ACTION);
        radio_callback (h, r, WIDGET_FOCUS, ' ');
        widget_move (&r->widget, r->pos, 1);
        break;
 #ifndef HAVE_X
     case WIDGET_CURSOR:
        (*h->callback) (h, h->current->dlg_id, DLG_ACTION);
        radio_callback (h, r, WIDGET_FOCUS, ' ');
        widget_move (&r->widget, r->pos, 1);
        break;
-           
+
     case WIDGET_UNFOCUS:
     case WIDGET_FOCUS:
     case WIDGET_DRAW:
     case WIDGET_UNFOCUS:
     case WIDGET_FOCUS:
     case WIDGET_DRAW:
@@ -380,7 +380,7 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
                {
                        if (*cp == '&')
                        {
                {
                        if (*cp == '&')
                        {
-                               attrset ((i==r->pos && Msg==WIDGET_FOCUS) 
+                               attrset ((i==r->pos && Msg==WIDGET_FOCUS)
                                        ? HOT_FOCUSC : HOT_NORMALC);
                                addch(*++cp);
                                attrset ((i==r->pos && Msg==WIDGET_FOCUS) ? FOCUSC : NORMALC);
                                        ? HOT_FOCUSC : HOT_NORMALC);
                                addch(*++cp);
                                attrset ((i==r->pos && Msg==WIDGET_FOCUS) ? FOCUSC : NORMALC);
@@ -391,7 +391,7 @@ radio_callback (Dlg_head *h, WRadio *r, int Msg, int Par)
        }
        return 1;
        break;
        }
        return 1;
        break;
-#endif 
+#endif
     }
     return default_proc (h, Msg, Par);
 }
     }
     return default_proc (h, Msg, Par);
 }
@@ -412,7 +412,7 @@ radio_event (Gpm_Event *event, WRadio *r)
 #ifndef HAVE_X
     if (event->type & (GPM_DOWN|GPM_UP)){
        Dlg_head *h = r->widget.parent;
 #ifndef HAVE_X
     if (event->type & (GPM_DOWN|GPM_UP)){
        Dlg_head *h = r->widget.parent;
-       
+
        r->pos = event->y - 1;
        dlg_select_widget (h, r);
        if (event->type & GPM_UP){
        r->pos = event->y - 1;
        dlg_select_widget (h, r);
        if (event->type & GPM_UP){
@@ -449,7 +449,7 @@ radio_new (int y, int x, int count, char **texts, int use_hotkey, char *tkname)
     r->texts = texts;
     r->upper_letter_is_hotkey = use_hotkey;
     widget_want_hotkey (r->widget, 1);
     r->texts = texts;
     r->upper_letter_is_hotkey = use_hotkey;
     widget_want_hotkey (r->widget, 1);
-    
+
     return r;
 }
 
     return r;
 }
 
@@ -483,13 +483,13 @@ check_callback (Dlg_head *h, WCheck *c, int Msg, int Par)
        check_callback (h, c, WIDGET_FOCUS, ' ');
        return 1;
 
        check_callback (h, c, WIDGET_FOCUS, ' ');
        return 1;
 
-#ifndef HAVE_X 
+#ifndef HAVE_X
     case WIDGET_CURSOR:
        widget_move (&c->widget, 0, 1);
        break;
     case WIDGET_CURSOR:
        widget_move (&c->widget, 0, 1);
        break;
-       
+
     case WIDGET_FOCUS:
     case WIDGET_FOCUS:
-    case WIDGET_UNFOCUS:       
+    case WIDGET_UNFOCUS:
     case WIDGET_DRAW:
        attrset ((Msg == WIDGET_FOCUS) ? FOCUSC : NORMALC);
        widget_move (&c->widget, 0, 0);
     case WIDGET_DRAW:
        attrset ((Msg == WIDGET_FOCUS) ? FOCUSC : NORMALC);
        widget_move (&c->widget, 0, 0);
@@ -513,7 +513,7 @@ check_event (Gpm_Event *event, WCheck *c)
 #ifndef HAVE_X
     if (event->type & (GPM_DOWN|GPM_UP)){
        Dlg_head *h = c->widget.parent;
 #ifndef HAVE_X
     if (event->type & (GPM_DOWN|GPM_UP)){
        Dlg_head *h = c->widget.parent;
-       
+
        dlg_select_widget (h, c);
        if (event->type & GPM_UP){
            check_callback (h, c, WIDGET_KEY, ' ');
        dlg_select_widget (h, c);
        if (event->type & GPM_UP){
            check_callback (h, c, WIDGET_KEY, ' ');
@@ -538,7 +538,7 @@ check_new (int y, int x, int state, char *text, char *tkname)
 {
     WCheck *c =  xmalloc (sizeof (WCheck), "check_new");
     char *s, *t;
 {
     WCheck *c =  xmalloc (sizeof (WCheck), "check_new");
     char *s, *t;
-    
+
     init_widget (&c->widget, y, x, 1, strlen (text),
                 (callback_fn)check_callback,
                 (destroy_fn)check_destroy, (mouse_h) check_event, tkname);
     init_widget (&c->widget, y, x, 1, strlen (text),
                 (callback_fn)check_callback,
                 (destroy_fn)check_destroy, (mouse_h) check_event, tkname);
@@ -573,7 +573,7 @@ label_callback (Dlg_head *h, WLabel *l, int Msg, int Par)
 {
     if (Msg == WIDGET_INIT)
        return x_create_label (h, h->wdata, l);
 {
     if (Msg == WIDGET_INIT)
        return x_create_label (h, h->wdata, l);
-    
+
     /* We don't want to get the focus */
     if (Msg == WIDGET_FOCUS)
        return 0;
     /* We don't want to get the focus */
     if (Msg == WIDGET_FOCUS)
        return 0;
@@ -587,7 +587,7 @@ label_callback (Dlg_head *h, WLabel *l, int Msg, int Par)
            attrset (NORMALC);
        for (;;){
            int xlen;
            attrset (NORMALC);
        for (;;){
            int xlen;
-               
+
            q = strchr (p, '\n');
            if (q){
                c = *q;
            q = strchr (p, '\n');
            if (q){
                c = *q;
@@ -606,7 +606,7 @@ label_callback (Dlg_head *h, WLabel *l, int Msg, int Par)
        }
        return 1;
     }
        }
        return 1;
     }
-#endif    
+#endif
     return default_proc (h, Msg, Par);
 }
 
     return default_proc (h, Msg, Par);
 }
 
@@ -614,7 +614,7 @@ void
 label_set_text (WLabel *label, char *text)
 {
     int newcols = label->widget.cols;
 label_set_text (WLabel *label, char *text)
 {
     int newcols = label->widget.cols;
-    
+
     if (label->text && text && !strcmp (label->text, text))
         return; /* Flickering is not nice */
 
     if (label->text && text && !strcmp (label->text, text))
         return; /* Flickering is not nice */
 
@@ -630,7 +630,7 @@ label_set_text (WLabel *label, char *text)
        }
     } else
        label->text = 0;
        }
     } else
        label->text = 0;
-    
+
     if (label->widget.parent)
 #ifdef HAVE_X
        x_label_set_text (label, text);
     if (label->widget.parent)
 #ifdef HAVE_X
        x_label_set_text (label, text);
@@ -675,7 +675,7 @@ gauge_callback (Dlg_head *h, WGauge *g, int Msg, int Par)
 
     if (Msg == WIDGET_INIT)
        return x_create_gauge (h, h->wdata, g);
 
     if (Msg == WIDGET_INIT)
        return x_create_gauge (h, h->wdata, g);
-    
+
     /* We don't want to get the focus */
     if (Msg == WIDGET_FOCUS)
        return 0;
     /* We don't want to get the focus */
     if (Msg == WIDGET_FOCUS)
        return 0;
@@ -689,7 +689,7 @@ gauge_callback (Dlg_head *h, WGauge *g, int Msg, int Par)
        else {
            long percentage, columns;
            long total = g->max, done = g->current;
        else {
            long percentage, columns;
            long total = g->max, done = g->current;
-           
+
            if (total <= 0 || done < 0) {
                done = 0;
                total = 100;
            if (total <= 0 || done < 0) {
                done = 0;
                total = 100;
@@ -710,7 +710,7 @@ gauge_callback (Dlg_head *h, WGauge *g, int Msg, int Par)
        }
        return 1;
     }
        }
        return 1;
     }
-#endif    
+#endif
     return default_proc (h, Msg, Par);
 }
 
     return default_proc (h, Msg, Par);
 }
 
@@ -722,12 +722,12 @@ gauge_set_value (WGauge *g, int max, int current)
     if (max == 0)
         max = 1; /* I do not like division by zero :) */
 #ifdef HAVE_X
     if (max == 0)
         max = 1; /* I do not like division by zero :) */
 #ifdef HAVE_X
-/* NOTE: x_gauge_set_value has to be called before we change actual 
+/* NOTE: x_gauge_set_value has to be called before we change actual
  *       max and current values in g, since it assumes g->max and
  *       g->current as the previous values and max and current
  *       as the new ones :) */
     x_gauge_set_value (g, max, current);
  *       max and current values in g, since it assumes g->max and
  *       g->current as the previous values and max and current
  *       as the new ones :) */
     x_gauge_set_value (g, max, current);
-#endif    
+#endif
     g->current = current;
     g->max = max;
 #ifndef HAVE_X
     g->current = current;
     g->max = max;
 #ifndef HAVE_X
@@ -745,7 +745,7 @@ gauge_show (WGauge *g, int shown)
     x_gauge_show (g);
 #else
     gauge_callback (g->widget.parent, g, WIDGET_DRAW, 0);
     x_gauge_show (g);
 #else
     gauge_callback (g->widget.parent, g, WIDGET_DRAW, 0);
-#endif    
+#endif
 }
 
 static void
 }
 
 static void
@@ -776,15 +776,15 @@ gauge_new (int y, int x, int shown, int max, int current, char *tkname)
 /* Input widget */
 
 /* {{{ history button */
 /* Input widget */
 
 /* {{{ history button */
+
 #define LARGE_HISTORY_BUTTON 1
 #define LARGE_HISTORY_BUTTON 1
+
 #ifdef LARGE_HISTORY_BUTTON
 #  define HISTORY_BUTTON_WIDTH 3
 #else
 #  define HISTORY_BUTTON_WIDTH 1
 #endif
 #ifdef LARGE_HISTORY_BUTTON
 #  define HISTORY_BUTTON_WIDTH 3
 #else
 #  define HISTORY_BUTTON_WIDTH 1
 #endif
+
 #define should_show_history_button(in) \
            (in->history && in->field_len > HISTORY_BUTTON_WIDTH * 2 + 1 && in->widget.parent)
 
 #define should_show_history_button(in) \
            (in->history && in->field_len > HISTORY_BUTTON_WIDTH * 2 + 1 && in->widget.parent)
 
@@ -814,7 +814,7 @@ static void draw_history_button (WInput * in)
     addch (c);
 #endif
 }
     addch (c);
 #endif
 }
+
 /* }}} history button */
 
 
 /* }}} history button */
 
 
@@ -848,7 +848,7 @@ update_input (WInput *in, int clear_first)
     /* Adjust the mark */
     if (in->mark > buf_len)
        in->mark = buf_len;
     /* Adjust the mark */
     if (in->mark > buf_len)
        in->mark = buf_len;
-    
+
 #ifdef HAVE_X
     if (clear_first && in->first)
            in->first = -1;
 #ifdef HAVE_X
     if (clear_first && in->first)
            in->first = -1;
@@ -859,12 +859,12 @@ update_input (WInput *in, int clear_first)
        draw_history_button (in);
 
     attrset (in->color);
        draw_history_button (in);
 
     attrset (in->color);
-    
+
     widget_move (&in->widget, 0, 0);
     for (i = 0; i < in->field_len - has_history; i++)
        addch (' ');
     widget_move (&in->widget, 0, 0);
     widget_move (&in->widget, 0, 0);
     for (i = 0; i < in->field_len - has_history; i++)
        addch (' ');
     widget_move (&in->widget, 0, 0);
-    
+
     for (i = 0, j = in->first_shown; i < in->field_len - has_history && in->buffer [j]; i++){
        c = in->buffer [j++];
        c = is_printable (c) ? c : '.';
     for (i = 0, j = in->first_shown; i < in->field_len - has_history && in->buffer [j]; i++){
        c = in->buffer [j++];
        c = is_printable (c) ? c : '.';
@@ -909,7 +909,7 @@ Hist *history_get (char *input_name)
     int i;
     Hist *old = 0, *new = 0;
     char *profile;
     int i;
     Hist *old = 0, *new = 0;
     char *profile;
-    
+
     if (!num_history_items_recorded)   /* this is how to disable */
        return 0;
     if (!input_name)
     if (!num_history_items_recorded)   /* this is how to disable */
        return 0;
     if (!input_name)
@@ -947,7 +947,7 @@ void history_put (char *input_name, Hist *h)
 
     if (!*input_name)
        return;
 
     if (!*input_name)
        return;
-    
+
     if (!h)
        return;
 
     if (!h)
        return;
 
@@ -959,7 +959,7 @@ void history_put (char *input_name, Hist *h)
        h = h->next;
 
     /* go back 60 places */
        h = h->next;
 
     /* go back 60 places */
-    for (i = 0; i < num_history_items_recorded - 1 && h->prev; i++)    
+    for (i = 0; i < num_history_items_recorded - 1 && h->prev; i++)
        h = h->prev;
     i = 0;
 
        h = h->prev;
     i = 0;
 
@@ -1150,7 +1150,7 @@ push_history (WInput *in, char *text)
 {
     Hist *new;
     char *p;
 {
     Hist *new;
     char *p;
-    
+
     for (p = text; *p == ' ' || *p == '\t'; p++);
     if (!*p)
         return 0;
     for (p = text; *p == ' ' || *p == '\t'; p++);
     if (!*p)
         return 0;
@@ -1192,7 +1192,7 @@ insert_char (WInput *in, int c_code)
 
     if (c_code == -1)
        return 0;
 
     if (c_code == -1)
        return 0;
-    
+
     in->need_push = 1;
     if (strlen (in->buffer)+1 == in->current_max_len){
        /* Expand the buffer */
     in->need_push = 1;
     if (strlen (in->buffer)+1 == in->current_max_len){
        /* Expand the buffer */
@@ -1288,12 +1288,12 @@ key_right (WInput *in)
 #define key_left  backward_char
 #define key_right forward_char
 #endif
 #define key_left  backward_char
 #define key_right forward_char
 #endif
-    
+
 static void
 backward_delete (WInput *in)
 {
     int i;
 static void
 backward_delete (WInput *in)
 {
     int i;
-    
+
     if (!in->point)
        return;
     for (i = in->point; in->buffer [i-1]; i++)
     if (!in->point)
        return;
     for (i = in->point; in->buffer [i-1]; i++)
@@ -1317,13 +1317,13 @@ copy_region (WInput *in, int x_first, int x_last)
 {
     int first = min (x_first, x_last);
     int last  = max (x_first, x_last);
 {
     int first = min (x_first, x_last);
     int last  = max (x_first, x_last);
-    
+
     if (last == first)
        return;
     if (last == first)
        return;
-    
+
     if (kill_buffer)
        free (kill_buffer);
     if (kill_buffer)
        free (kill_buffer);
-    
+
     kill_buffer = xmalloc (last-first + 1, "copy_region");
     strncpy (kill_buffer, in->buffer+first, last-first);
     kill_buffer [last-first] = 0;
     kill_buffer = xmalloc (last-first + 1, "copy_region");
     strncpy (kill_buffer, in->buffer+first, last-first);
     kill_buffer [last-first] = 0;
@@ -1394,7 +1394,7 @@ static void
 yank (WInput *in)
 {
     char *p;
 yank (WInput *in)
 {
     char *p;
-    
+
     if (!kill_buffer)
         return;
     for (p = kill_buffer; *p; p++)
     if (!kill_buffer)
         return;
     for (p = kill_buffer; *p; p++)
@@ -1454,7 +1454,7 @@ hist_next (WInput *in)
             return;
         }
     }
             return;
         }
     }
-    
+
     if (!in->history)
        return;
 
     if (!in->history)
        return;
 
@@ -1462,7 +1462,7 @@ hist_next (WInput *in)
         assign_text (in, "");
        return;
     }
         assign_text (in, "");
        return;
     }
-    
+
     in->history = in->history->next;
     assign_text (in, in->history->text);
     in->need_push = 0;
     in->history = in->history->next;
     assign_text (in, in->history->text);
     in->need_push = 0;
@@ -1485,8 +1485,8 @@ static struct {
     { KEY_RIGHT,          key_right },
     { XCTRL('f'),         forward_char },
     { ALT('f'),           forward_word },
     { KEY_RIGHT,          key_right },
     { XCTRL('f'),         forward_char },
     { ALT('f'),           forward_word },
-                         
-    /* Editing */         
+
+    /* Editing */
     { 0177,               backward_delete },
     { KEY_BACKSPACE,      backward_delete },
     { XCTRL('h'),         backward_delete },
     { 0177,               backward_delete },
     { KEY_BACKSPACE,      backward_delete },
     { XCTRL('h'),         backward_delete },
@@ -1496,22 +1496,22 @@ static struct {
     { ALT(KEY_BACKSPACE), back_kill_word },
     { ALT(XCTRL('h')),    back_kill_word },
     { ALT(127),           back_kill_word },
     { ALT(KEY_BACKSPACE), back_kill_word },
     { ALT(XCTRL('h')),    back_kill_word },
     { ALT(127),           back_kill_word },
-    
+
     /* Region manipulation */
     { 0,                 set_mark },
     { XCTRL('w'),        kill_region },
     { ALT('w'),          kill_save },
     { XCTRL('y'),        yank },
     { XCTRL('k'),        kill_line },
     /* Region manipulation */
     { 0,                 set_mark },
     { XCTRL('w'),        kill_region },
     { ALT('w'),          kill_save },
     { XCTRL('y'),        yank },
     { XCTRL('k'),        kill_line },
-                         
-    /* History */        
+
+    /* History */
     { ALT('p'),          hist_prev },
     { ALT('n'),          hist_next },
     { ALT('h'),          do_show_hist },
     { ALT('p'),          hist_prev },
     { ALT('n'),          hist_next },
     { ALT('h'),          do_show_hist },
-    
+
     /* Completion */
     { ALT('\t'),         complete },
     /* Completion */
     { ALT('\t'),         complete },
-    
+
     { 0,            0 }
 };
 
     { 0,            0 }
 };
 
@@ -1522,7 +1522,7 @@ int
 is_in_input_map (WInput *in, int c_code)
 {
     int i;
 is_in_input_map (WInput *in, int c_code)
 {
     int i;
-    
+
     for (i = 0; input_map [i].fn; i++)
        if (c_code == input_map [i].key_code)
            if (input_map [i].fn == complete)
     for (i = 0; input_map [i].fn; i++)
        if (c_code == input_map [i].key_code)
            if (input_map [i].fn == complete)
@@ -1556,7 +1556,7 @@ handle_char (WInput *in, int c_code)
 
     v = 0;
 
 
     v = 0;
 
-#ifdef HAVE_TK    
+#ifdef HAVE_TK
     in->inserted_one = 0;
 #endif
     if (quote){
     in->inserted_one = 0;
 #endif
     if (quote){
@@ -1628,7 +1628,7 @@ input_callback (Dlg_head *h, WInput *in, int Msg, int Par)
     case WIDGET_KEY:
        if (Par == XCTRL('q')){
            int v;
     case WIDGET_KEY:
        if (Par == XCTRL('q')){
            int v;
-           
+
            quote = 1;
            v = handle_char (in, mi_getch ());
            quote = 0;
            quote = 1;
            v = handle_char (in, mi_getch ());
            quote = 0;
@@ -1646,7 +1646,7 @@ input_callback (Dlg_head *h, WInput *in, int Msg, int Par)
        return handle_char (in, Par);
 
     case WIDGET_FOCUS:
        return handle_char (in, Par);
 
     case WIDGET_FOCUS:
-    case WIDGET_UNFOCUS:       
+    case WIDGET_UNFOCUS:
     case WIDGET_DRAW:
        update_input (in, 0);
        break;
     case WIDGET_DRAW:
        update_input (in, 0);
        break;
@@ -1656,19 +1656,19 @@ input_callback (Dlg_head *h, WInput *in, int Msg, int Par)
        widget_move (&in->widget, 0, in->point - in->first_shown);
        return 1;
 #endif
        widget_move (&in->widget, 0, in->point - in->first_shown);
        return 1;
 #endif
-       
+
     }
     return default_proc (h, Msg, Par);
 }
 
 /* Not declared static, since we check against this value in dlg.c */
 /* FIXME: Declare static again and provide an identification mechanism */
     }
     return default_proc (h, Msg, Par);
 }
 
 /* Not declared static, since we check against this value in dlg.c */
 /* FIXME: Declare static again and provide an identification mechanism */
-int 
-input_event (Gpm_Event *event, WInput *in) 
-{ 
+int
+input_event (Gpm_Event *event, WInput *in)
+{
 #ifndef HAVE_X
 #ifndef HAVE_X
-    if (event->type & (GPM_DOWN|GPM_DRAG)){ 
-       dlg_select_widget (in->widget.parent, in); 
+    if (event->type & (GPM_DOWN|GPM_DRAG)){
+       dlg_select_widget (in->widget.parent, in);
 
        if (event->x >= in->field_len - HISTORY_BUTTON_WIDTH + 1 && should_show_history_button (in)) {
            do_show_hist (in);
 
        if (event->x >= in->field_len - HISTORY_BUTTON_WIDTH + 1 && should_show_history_button (in)) {
            do_show_hist (in);
@@ -1681,11 +1681,11 @@ input_event (Gpm_Event *event, WInput *in)
                in->point = 0;
 
            update_input (in, 1);
                in->point = 0;
 
            update_input (in, 1);
-       } 
-    } 
+       }
+    }
 #endif
 #endif
-    return MOU_NORMAL; 
-} 
+    return MOU_NORMAL;
+}
 
 WInput *
 input_new (int y, int x, int color, int len, char *def_text, char *tkname)
 
 WInput *
 input_new (int y, int x, int color, int len, char *def_text, char *tkname)
@@ -1750,7 +1750,7 @@ listbox_drawscroll (WListbox *l)
     int line;
     int i, top;
     int max_line = l->height-1;
     int line;
     int i, top;
     int max_line = l->height-1;
-    
+
     /* Are we at the top? */
     widget_move (&l->widget, 0, l->width);
     if (l->list == l->top)
     /* Are we at the top? */
     widget_move (&l->widget, 0, l->width);
     if (l->list == l->top)
@@ -1771,7 +1771,7 @@ listbox_drawscroll (WListbox *l)
        line = 1+ ((l->pos * (l->height-2)) / l->count);
     else
        line = 0;
        line = 1+ ((l->pos * (l->height-2)) / l->count);
     else
        line = 0;
-    
+
     for (i = 1; i < max_line; i++){
        widget_move (&l->widget, i, l->width);
        if (i != line)
     for (i = 1; i < max_line; i++){
        widget_move (&l->widget, i, l->width);
        if (i != line)
@@ -1780,7 +1780,7 @@ listbox_drawscroll (WListbox *l)
            addch ('*');
     }
 }
            addch ('*');
     }
 }
-    
+
 static void
 listbox_draw (WListbox *l, Dlg_head *h, int focused)
 {
 static void
 listbox_draw (WListbox *l, Dlg_head *h, int focused)
 {
@@ -1788,7 +1788,7 @@ listbox_draw (WListbox *l, Dlg_head *h, int focused)
     int i;
     int sel_line;
     int normalc, selc;
     int i;
     int sel_line;
     int normalc, selc;
-    char *text; 
+    char *text;
 
     if (focused){
        normalc = NORMALC;
 
     if (focused){
        normalc = NORMALC;
@@ -1800,7 +1800,7 @@ listbox_draw (WListbox *l, Dlg_head *h, int focused)
     sel_line = -1;
 
     for (e = l->top, i = 0; (i < l->height); i++){
     sel_line = -1;
 
     for (e = l->top, i = 0; (i < l->height); i++){
-       
+
        /* Display the entry */
        if (e == l->current && sel_line == -1){
            sel_line = i;
        /* Display the entry */
        if (e == l->current && sel_line == -1){
            sel_line = i;
@@ -1842,12 +1842,12 @@ listbox_check_hotkey (WListbox *l, int key)
 {
     int i;
     WLEntry *e;
 {
     int i;
     WLEntry *e;
-    
+
     i = 0;
     e = l->list;
     if (!e)
        return 0;
     i = 0;
     e = l->list;
     if (!e)
        return 0;
-    
+
     while (1){
 
        /* If we didn't find anything, return */
     while (1){
 
        /* If we didn't find anything, return */
@@ -1856,7 +1856,7 @@ listbox_check_hotkey (WListbox *l, int key)
 
        if (e->hotkey == key)
            return e;
 
        if (e->hotkey == key)
            return e;
-       
+
        i++;
        e = e->next;
     }
        i++;
        e = e->next;
     }
@@ -1891,7 +1891,7 @@ listbox_remove_list (WListbox *l)
     }
 #endif
     p = l->list;
     }
 #endif
     p = l->list;
-    
+
     while (l->count--) {
        q = p->next;
        free (p->text);
     while (l->count--) {
        q = p->next;
        free (p->text);
@@ -1911,11 +1911,11 @@ void
 listbox_remove_current (WListbox *l, int force)
 {
     WLEntry *p;
 listbox_remove_current (WListbox *l, int force)
 {
     WLEntry *p;
-    
+
     /* Ok, note: this won't allow for emtpy lists */
     if (!force && (!l->count || l->count == 1))
        return;
     /* Ok, note: this won't allow for emtpy lists */
     if (!force && (!l->count || l->count == 1))
        return;
-    
+
 #ifdef HAVE_X
     if (l->widget.wdata != (widget_data) NULL) {
         x_listbox_delete_nth (l, l->pos);
 #ifdef HAVE_X
     if (l->widget.wdata != (widget_data) NULL) {
         x_listbox_delete_nth (l, l->pos);
@@ -1937,10 +1937,10 @@ listbox_remove_current (WListbox *l, int force)
        if (p->next == l->list) {
            l->current = p->prev;
            l->pos--;
        if (p->next == l->list) {
            l->current = p->prev;
            l->pos--;
-       }       
-       else 
+       }
+       else
            l->current = p->next;
            l->current = p->next;
-       
+
        if (p == l->list)
            l->list = l->top = p->next;
     } else {
        if (p == l->list)
            l->list = l->top = p->next;
     } else {
@@ -1959,15 +1959,15 @@ listbox_select_entry (WListbox *l, WLEntry *dest)
     WLEntry *e;
     int pos;
     int top_seen;
     WLEntry *e;
     int pos;
     int top_seen;
-    
+
     top_seen = 0;
     top_seen = 0;
-    
+
     /* Special case */
     for (pos = 0, e = l->list; pos < l->count; e = e->next, pos++){
 
        if (e == l->top)
            top_seen = 1;
     /* Special case */
     for (pos = 0, e = l->list; pos < l->count; e = e->next, pos++){
 
        if (e == l->top)
            top_seen = 1;
-       
+
        if (e == dest){
            l->current = e;
            if (top_seen){
        if (e == dest){
            l->current = e;
            if (top_seen){
@@ -2032,14 +2032,14 @@ listbox_key (WListbox *l, int key)
 
     if (!l->list)
        return 0;
 
     if (!l->list)
        return 0;
-    
+
     switch (key){
     case KEY_HOME:
     case KEY_A1:
        l->current = l->top = l->list;
        l->pos = 0;
        return 1;
     switch (key){
     case KEY_HOME:
     case KEY_A1:
        l->current = l->top = l->list;
        l->pos = 0;
        return 1;
-       
+
     case KEY_END:
     case KEY_C1:
        l->current = l->top = l->list->prev;
     case KEY_END:
     case KEY_C1:
        l->current = l->top = l->list->prev;
@@ -2047,12 +2047,12 @@ listbox_key (WListbox *l, int key)
            l->top = l->top->prev;
        l->pos = l->count - 1;
        return 1;
            l->top = l->top->prev;
        l->pos = l->count - 1;
        return 1;
-       
+
     case XCTRL('p'):
     case KEY_UP:
        listbox_back (l);
        return 1;
     case XCTRL('p'):
     case KEY_UP:
        listbox_back (l);
        return 1;
-       
+
     case XCTRL('n'):
     case KEY_DOWN:
        listbox_fwd (l);
     case XCTRL('n'):
     case KEY_DOWN:
        listbox_fwd (l);
@@ -2063,7 +2063,7 @@ listbox_key (WListbox *l, int key)
        for (i = 0; i < l->height-1; i++)
            j |= listbox_fwd (l);
        return j > 0;
        for (i = 0; i < l->height-1; i++)
            j |= listbox_fwd (l);
        return j > 0;
-       
+
     case KEY_PPAGE:
     case ALT('v'):
        for (i = 0; i < l->height-1; i++)
     case KEY_PPAGE:
     case ALT('v'):
        for (i = 0; i < l->height-1; i++)
@@ -2080,11 +2080,11 @@ listbox_callback (Dlg_head *h, WListbox *l, int msg, int par)
     WLEntry  *e;
     /* int selected_color; Never used */
     int ret_code;
     WLEntry  *e;
     /* int selected_color; Never used */
     int ret_code;
-    
+
     switch (msg){
     case WIDGET_INIT:
        return x_create_listbox (h, h->wdata, l);
     switch (msg){
     case WIDGET_INIT:
        return x_create_listbox (h, h->wdata, l);
-       
+
 #ifndef        HAVE_XVIEW
     case WIDGET_HOTKEY:
        if ((e = listbox_check_hotkey (l, par)) != NULL){
 #ifndef        HAVE_XVIEW
     case WIDGET_HOTKEY:
        if ((e = listbox_check_hotkey (l, par)) != NULL){
@@ -2103,7 +2103,7 @@ listbox_callback (Dlg_head *h, WListbox *l, int msg, int par)
            return 1;
        } else
            return 0;
            return 1;
        } else
            return 0;
-       
+
     case WIDGET_KEY:
        if ((ret_code = listbox_key (l, par)))
            listbox_draw (l, h, 1);
     case WIDGET_KEY:
        if ((ret_code = listbox_key (l, par)))
            listbox_draw (l, h, 1);
@@ -2113,13 +2113,13 @@ listbox_callback (Dlg_head *h, WListbox *l, int msg, int par)
     case WIDGET_CURSOR:
        widget_move (&l->widget, l->cursor_y, 0);
        return 1;
     case WIDGET_CURSOR:
        widget_move (&l->widget, l->cursor_y, 0);
        return 1;
-       
+
     case WIDGET_FOCUS:
     case WIDGET_UNFOCUS:
     case WIDGET_DRAW:
        listbox_draw (l, h, msg != WIDGET_UNFOCUS);
        return 1;
     case WIDGET_FOCUS:
     case WIDGET_UNFOCUS:
     case WIDGET_DRAW:
        listbox_draw (l, h, msg != WIDGET_UNFOCUS);
        return 1;
-#endif 
+#endif
 #endif /* !HAVE_XVIEW */
     }
     return default_proc (h, msg, par);
 #endif /* !HAVE_XVIEW */
     }
     return default_proc (h, msg, par);
@@ -2130,9 +2130,9 @@ listbox_event (Gpm_Event *event, WListbox *l)
 {
 #ifndef HAVE_X
     int i;
 {
 #ifndef HAVE_X
     int i;
-    
+
     Dlg_head *h = l->widget.parent;
     Dlg_head *h = l->widget.parent;
-    
+
     /* Single click */
     if (event->type & GPM_DOWN)
        dlg_select_widget (l->widget.parent, l);
     /* Single click */
     if (event->type & GPM_DOWN)
        dlg_select_widget (l->widget.parent, l);
@@ -2150,7 +2150,7 @@ listbox_event (Gpm_Event *event, WListbox *l)
        else
             listbox_select_entry (l, listbox_select_pos (l, l->top,
                                                         event->y - 1));
        else
             listbox_select_entry (l, listbox_select_pos (l, l->top,
                                                         event->y - 1));
-       
+
        /* We need to refresh ourselves since the dialog manager doesn't */
        /* know about this event */
        listbox_callback (h, l, WIDGET_DRAW, 0);
        /* We need to refresh ourselves since the dialog manager doesn't */
        /* know about this event */
        listbox_callback (h, l, WIDGET_DRAW, 0);
@@ -2164,9 +2164,9 @@ listbox_event (Gpm_Event *event, WListbox *l)
            return MOU_NORMAL;
        if (event->y < 1 || event->y > l->height)
            return MOU_NORMAL;
            return MOU_NORMAL;
        if (event->y < 1 || event->y > l->height)
            return MOU_NORMAL;
-       
+
        dlg_select_widget (l->widget.parent, l);
        dlg_select_widget (l->widget.parent, l);
-       listbox_select_entry (l, listbox_select_pos (l, l->top, event->y - 1)); 
+       listbox_select_entry (l, listbox_select_pos (l, l->top, event->y - 1));
 
        switch (l->action){
        case listbox_nothing:
 
        switch (l->action){
        case listbox_nothing:
@@ -2182,7 +2182,7 @@ listbox_event (Gpm_Event *event, WListbox *l)
                return MOU_ENDLOOP;
        }
     }
                return MOU_ENDLOOP;
        }
     }
-#endif    
+#endif
     return MOU_NORMAL;
 }
 
     return MOU_NORMAL;
 }
 
@@ -2207,7 +2207,7 @@ listbox_new (int y, int x, int width, int height,
 {
     WListbox *l = xmalloc (sizeof (WListbox), "listbox_new");
     extern int slow_terminal;
 {
     WListbox *l = xmalloc (sizeof (WListbox), "listbox_new");
     extern int slow_terminal;
-    
+
     init_widget (&l->widget, y, x, height, width,
                 (callback_fn)listbox_callback,
                 (destroy_fn) listbox_destroy, (mouse_h)listbox_event, tkname);
     init_widget (&l->widget, y, x, height, width,
                 (callback_fn)listbox_callback,
                 (destroy_fn) listbox_destroy, (mouse_h)listbox_event, tkname);
@@ -2224,7 +2224,7 @@ listbox_new (int y, int x, int width, int height,
     l->allow_duplicates = 1;
     l->scrollbar = slow_terminal ? 0 : 1;
     widget_want_hotkey (l->widget, 1);
     l->allow_duplicates = 1;
     l->scrollbar = slow_terminal ? 0 : 1;
     widget_want_hotkey (l->widget, 1);
-    
+
     return l;
 }
 
     return l;
 }
 
@@ -2276,14 +2276,14 @@ listbox_add_item (WListbox *l, enum append_pos pos, int hotkey, char *text,
     if (!l->allow_duplicates)
        if (listbox_search_text (l, text))
            return 0;
     if (!l->allow_duplicates)
        if (listbox_search_text (l, text))
            return 0;
-           
+
     entry = xmalloc (sizeof (WLEntry), "listbox_add_item");
     entry->text = strdup (text);
     entry->data = data;
     entry->hotkey = hotkey;
 
     listbox_append_item (l, entry, pos);
     entry = xmalloc (sizeof (WLEntry), "listbox_add_item");
     entry->text = strdup (text);
     entry->data = data;
     entry->hotkey = hotkey;
 
     listbox_append_item (l, entry, pos);
-    
+
     return entry->text;
 }
 
     return entry->text;
 }
 
@@ -2302,7 +2302,7 @@ listbox_search_text (WListbox *l, char *text)
     e = l->list;
     if (!e)
        return NULL;
     e = l->list;
     if (!e)
        return NULL;
-    
+
     do {
        if(!strcmp (e->text, text))
            return e;
     do {
        if(!strcmp (e->text, text))
            return e;
@@ -2330,7 +2330,7 @@ int
 buttonbar_callback (Dlg_head *h, WButtonBar *bb, int msg, int par)
 {
     int i;
 buttonbar_callback (Dlg_head *h, WButtonBar *bb, int msg, int par)
 {
     int i;
-    
+
     switch (msg){
     case WIDGET_INIT:
        return x_create_buttonbar (h, h->wdata, bb);
     switch (msg){
     case WIDGET_INIT:
        return x_create_buttonbar (h, h->wdata, bb);
@@ -2347,7 +2347,7 @@ buttonbar_callback (Dlg_head *h, WButtonBar *bb, int msg, int par)
            }
        }
        return 0;
            }
        }
        return 0;
-       
+
 #ifndef HAVE_X
     case WIDGET_DRAW:
        if (!bb->visible)
 #ifndef HAVE_X
     case WIDGET_DRAW:
        if (!bb->visible)
@@ -2409,7 +2409,7 @@ buttonbar_new (int visible)
     init_widget (&bb->widget, LINES-1, 0, 1, COLS,
                 (callback_fn) buttonbar_callback,
                 (destroy_fn) buttonbar_destroy, (mouse_h) buttonbar_event, NULL);
     init_widget (&bb->widget, LINES-1, 0, 1, COLS,
                 (callback_fn) buttonbar_callback,
                 (destroy_fn) buttonbar_destroy, (mouse_h) buttonbar_event, NULL);
-    
+
     bb->visible = visible;
     for (i = 0; i < 10; i++){
        bb->labels [i].text     = 0;
     bb->visible = visible;
     for (i = 0; i < 10; i++){
        bb->labels [i].text     = 0;
@@ -2450,7 +2450,7 @@ find_buttonbar (Dlg_head *h, Widget *paneletc)
                bb = 0;
                continue;
            }
                bb = 0;
                continue;
            }
-#endif     
+#endif
            break;
        }
     }
            break;
        }
     }
@@ -2464,7 +2464,7 @@ define_label_data (Dlg_head *h, Widget *paneletc, int idx, char *text,
     WButtonBar *bb = find_buttonbar (h, paneletc);
     if (!bb)
        return;
     WButtonBar *bb = find_buttonbar (h, paneletc);
     if (!bb)
        return;
-    
+
     set_label_text (bb, idx, text);
     bb->labels [idx-1].function = (void (*)(void *)) cback;
     bb->labels [idx-1].data = data;
     set_label_text (bb, idx, text);
     bb->labels [idx-1].function = (void (*)(void *)) cback;
     bb->labels [idx-1].data = data;
index d4db09d..d772acc 100644 (file)
@@ -41,7 +41,7 @@ typedef struct WCheck {
     Widget widget;
     unsigned int state;                /* check button state */
     char *text;                        /* text of check button */
     Widget widget;
     unsigned int state;                /* check button state */
     char *text;                        /* text of check button */
-    int hotkey;                 /* hot KEY */                    
+    int hotkey;                 /* hot KEY */
     int hotpos;                        /* offset hot KEY char in text */
 } WCheck;
 
     int hotpos;                        /* offset hot KEY char in text */
 } WCheck;
 
@@ -147,7 +147,7 @@ typedef struct {
 } WButtonBar;
 
 /* Constructors */
 } WButtonBar;
 
 /* Constructors */
-WButton *button_new   (int y, int x, int action, int flags, char *text, 
+WButton *button_new   (int y, int x, int action, int flags, char *text,
                        int (*callback)(int, void *), void *extra, char *tkname);
 WRadio  *radio_new    (int y, int x, int count, char **text, int use_hotkey, char *tkname);
 WCheck  *check_new    (int y, int x, int state,  char *text, char *tkname);
                        int (*callback)(int, void *), void *extra, char *tkname);
 WRadio  *radio_new    (int y, int x, int count, char **text, int use_hotkey, char *tkname);
 WCheck  *check_new    (int y, int x, int state,  char *text, char *tkname);
index 68f0615..5fb970f 100644 (file)
@@ -1,11 +1,11 @@
 /* Curses utilities
    Copyright (C) 1995 Miguel de Icaza, Janne Kukonlehto
 /* Curses utilities
    Copyright (C) 1995 Miguel de Icaza, Janne Kukonlehto
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -35,7 +35,7 @@
 #include "layout.h"
 #include "global.h"
 
 #include "layout.h"
 #include "global.h"
 
-/* "$Id: win.c,v 1.1 2001/12/30 09:55:20 sedwards Exp $" */
+/* "$Id$" */
 
 typedef void (*fnptr)(void);
 
 
 typedef void (*fnptr)(void);
 
@@ -67,7 +67,7 @@ void sprint_bytesize (char *buffer, int size, int scale)
 void print_bytesize (int size, int scale)
 {
     char buffer [10];
 void print_bytesize (int size, int scale)
 {
     char buffer [10];
-    
+
     sprint_bytesize (buffer, size, scale);
     printw (buffer);
 }
     sprint_bytesize (buffer, size, scale);
     printw (buffer);
 }
@@ -79,7 +79,7 @@ int check_fkeys (int c)
 
     if (!fkey_table_list)
        return 0;
 
     if (!fkey_table_list)
        return 0;
-    
+
     switch (c){
     case KEY_F(1):
        fkey = 1;
     switch (c){
     case KEY_F(1):
        fkey = 1;
@@ -132,22 +132,22 @@ int check_movement_keys (int c, int additional, int page_size, void *data,
     case XCTRL ('p'):
        (*backfn)(data, 1);
        return 1;
     case XCTRL ('p'):
        (*backfn)(data, 1);
        return 1;
-       
+
     case KEY_DOWN:
     case XCTRL ('n'):
        (*forfn)(data, 1);
        return 1;
     case KEY_DOWN:
     case XCTRL ('n'):
        (*forfn)(data, 1);
        return 1;
-       
+
     case KEY_PPAGE:
     case ALT('v'):
        (*backfn)(data, page_size-1);
        return 1;
     case KEY_PPAGE:
     case ALT('v'):
        (*backfn)(data, page_size-1);
        return 1;
-       
+
     case KEY_NPAGE:
     case XCTRL('v'):
        (*forfn)(data, page_size-1);
        return 1;
     case KEY_NPAGE:
     case XCTRL('v'):
        (*forfn)(data, page_size-1);
        return 1;
-       
+
     case KEY_HOME:
     case KEY_A1:
        (*topfn)(data, 0);
     case KEY_HOME:
     case KEY_A1:
        (*topfn)(data, 0);
@@ -159,7 +159,7 @@ int check_movement_keys (int c, int additional, int page_size, void *data,
     }
     if (additional)
         switch (c){
     }
     if (additional)
         switch (c){
-       case 'b':  
+       case 'b':
        case XCTRL('h'):
        case KEY_BACKSPACE:
        case 0177:
        case XCTRL('h'):
        case KEY_BACKSPACE:
        case 0177:
@@ -248,7 +248,7 @@ key_code_name_t key_name_conv_tab [] = {
     { KEY_KP_ADD,    "kpplus",     N_("+ on keypad") },
     { KEY_KP_SUBTRACT,"kpminus",   N_("- on keypad") },
     { KEY_KP_MULTIPLY,"kpasterix", N_("* on keypad") },
     { KEY_KP_ADD,    "kpplus",     N_("+ on keypad") },
     { KEY_KP_SUBTRACT,"kpminus",   N_("- on keypad") },
     { KEY_KP_MULTIPLY,"kpasterix", N_("* on keypad") },
-/* From here on, these won't be shown in Learn keys (no space) */    
+/* From here on, these won't be shown in Learn keys (no space) */
     { KEY_LEFT,             "kpleft",     N_("Left arrow keypad") },
     { KEY_RIGHT,     "kpright",    N_("Right arrow keypad") },
     { KEY_UP,       "kpup",       N_("Up arrow keypad") },
     { KEY_LEFT,             "kpleft",     N_("Left arrow keypad") },
     { KEY_RIGHT,     "kpright",    N_("Right arrow keypad") },
     { KEY_UP,       "kpup",       N_("Up arrow keypad") },
index 3069025..cbae6af 100644 (file)
@@ -4,7 +4,7 @@
 
 /* Widget based utility functions.
    Copyright (C) 1994, 1995 the Free Software Foundation
 
 /* Widget based utility functions.
    Copyright (C) 1994, 1995 the Free Software Foundation
-   
+
    Authors: 1994, 1995, 1996 Miguel de Icaza
             1994, 1995 Radek Doulik
            1995  Jakub Jelinek
    Authors: 1994, 1995, 1996 Miguel de Icaza
             1994, 1995 Radek Doulik
            1995  Jakub Jelinek
@@ -28,7 +28,7 @@
 
 /* }}} */
 
 
 /* }}} */
 
-/*  [] = "$Id: wtools.c,v 1.1 2001/12/30 09:55:20 sedwards Exp $" */
+/*  [] = "$Id$" */
 
 #include <config.h>
 #include <string.h>
 
 #include <config.h>
 #include <string.h>
@@ -122,7 +122,7 @@ Listbox *create_listbox_window (int cols, int lines, char *title, char *help)
        /* no &, but 4 spaces around button for brackets and such */
        if (cols < (len = strlen(cancel_string) + 3))
                cols = len;
        /* no &, but 4 spaces around button for brackets and such */
        if (cols < (len = strlen(cancel_string) + 3))
                cols = len;
-       
+
     cols = cols > COLS-6 ? COLS-6 : cols;
 
     /* I'm not sure if this -2 is safe, should test it */
     cols = cols > COLS-6 ? COLS-6 : cols;
 
     /* I'm not sure if this -2 is safe, should test it */
@@ -132,12 +132,12 @@ Listbox *create_listbox_window (int cols, int lines, char *title, char *help)
     /* Create components */
     listbox->dlg = create_dlg (ypos, xpos, lines+6, cols+4, dialog_colors,
                               listbox_callback, help, "listbox", DLG_CENTER|DLG_GRID);
     /* Create components */
     listbox->dlg = create_dlg (ypos, xpos, lines+6, cols+4, dialog_colors,
                               listbox_callback, help, "listbox", DLG_CENTER|DLG_GRID);
-    x_set_dialog_title (listbox->dlg, title);         
-    
+    x_set_dialog_title (listbox->dlg, title);
+
     listbox->list = listbox_new (2, 2, cols, lines, listbox_finish, 0, "li");
 
     add_widget (listbox->dlg,
     listbox->list = listbox_new (2, 2, cols, lines, listbox_finish, 0, "li");
 
     add_widget (listbox->dlg,
-               button_new (lines+3, (cols/2 + 2) - len/2, 
+               button_new (lines+3, (cols/2 + 2) - len/2,
                B_CANCEL, NORMAL_BUTTON, cancel_string, 0, 0, "c"));
     add_widget (listbox->dlg, listbox->list);
 #ifndef HAVE_X
                B_CANCEL, NORMAL_BUTTON, cancel_string, 0, 0, "c"));
     add_widget (listbox->dlg, listbox->list);
 #ifndef HAVE_X
@@ -150,7 +150,7 @@ Listbox *create_listbox_window (int cols, int lines, char *title, char *help)
 int run_listbox (Listbox *l)
 {
     int val;
 int run_listbox (Listbox *l)
 {
     int val;
-    
+
     run_dlg (l->dlg);
     if (l->dlg->ret_value == B_CANCEL)
        val = -1;
     run_dlg (l->dlg);
     if (l->dlg->ret_value == B_CANCEL)
        val = -1;
@@ -176,9 +176,9 @@ static int query_callback (struct Dlg_head *h, int Id, int Msg)
     struct text_struct *info;
 
     info = (struct text_struct *) h->data;
     struct text_struct *info;
 
     info = (struct text_struct *) h->data;
-    
+
     switch (Msg){
     switch (Msg){
-#ifndef HAVE_X    
+#ifndef HAVE_X
     case DLG_DRAW:
        /* designate window */
        attrset (NORMALC);
     case DLG_DRAW:
        /* designate window */
        attrset (NORMALC);
@@ -211,19 +211,19 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
     char *cur_name;
     static int query_colors [4];
     static struct text_struct pass;
     char *cur_name;
     static int query_colors [4];
     static struct text_struct pass;
-#ifdef HAVE_X    
+#ifdef HAVE_X
     static char *buttonnames [10];
 #endif
     static char *buttonnames [10];
 #endif
-    
+
     /* set dialog colors */
     query_colors [0] = (flags & D_ERROR) ? ERROR_COLOR :  Q_UNSELECTED_COLOR;
     query_colors [1] = (flags & D_ERROR) ? REVERSE_COLOR : Q_SELECTED_COLOR;
     query_colors [2] = (flags & D_ERROR) ? ERROR_COLOR : COLOR_HOT_NORMAL;
     query_colors [3] = (flags & D_ERROR) ? COLOR_HOT_NORMAL :  COLOR_HOT_FOCUS;
     /* set dialog colors */
     query_colors [0] = (flags & D_ERROR) ? ERROR_COLOR :  Q_UNSELECTED_COLOR;
     query_colors [1] = (flags & D_ERROR) ? REVERSE_COLOR : Q_SELECTED_COLOR;
     query_colors [2] = (flags & D_ERROR) ? ERROR_COLOR : COLOR_HOT_NORMAL;
     query_colors [3] = (flags & D_ERROR) ? COLOR_HOT_NORMAL :  COLOR_HOT_FOCUS;
-    
+
     if (header == MSG_ERROR)
            header = _(" Error ");
     if (header == MSG_ERROR)
            header = _(" Error ");
-    
+
     if (count > 0){
        va_start (ap, count);
        for (i = 0; i < count; i++)
     if (count > 0){
        va_start (ap, count);
        for (i = 0; i < count; i++)
@@ -250,10 +250,10 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
     x_set_dialog_title (query_dlg, header);
 
     /* The data we need to pass to the callback */
     x_set_dialog_title (query_dlg, header);
 
     /* The data we need to pass to the callback */
-    query_dlg->cols = cols; 
-    query_dlg->lines = lines; 
+    query_dlg->cols = cols;
+    query_dlg->lines = lines;
     query_dlg->data  = &pass;
     query_dlg->data  = &pass;
-       
+
     query_dlg->direction = DIR_BACKWARD;
 
     if (count > 0){
     query_dlg->direction = DIR_BACKWARD;
 
     if (count > 0){
@@ -269,9 +269,9 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
            add_widget (query_dlg, button_new
                        (lines-3, cols, B_USER+i, NORMAL_BUTTON, cur_name,
                         0, 0, NULL));
            add_widget (query_dlg, button_new
                        (lines-3, cols, B_USER+i, NORMAL_BUTTON, cur_name,
                         0, 0, NULL));
-#else                   
+#else
            buttonnames [i] = cur_name;
            buttonnames [i] = cur_name;
-#endif                      
+#endif
            cols += xpos;
            if (i == sel_pos)
                query_dlg->initfocus = query_dlg->current;
            cols += xpos;
            if (i == sel_pos)
                query_dlg->initfocus = query_dlg->current;
@@ -281,11 +281,11 @@ int query_dialog (char *header, char *text, int flags, int count, ...)
 #ifdef HAVE_XVIEW
        for (i = count - 1; i >= 0; i--)
            add_widgetl (query_dlg, button_new
 #ifdef HAVE_XVIEW
        for (i = count - 1; i >= 0; i--)
            add_widgetl (query_dlg, button_new
-                        (0, 0, B_USER+i, NORMAL_BUTTON, buttonnames [i], 0, 0, NULL), 
+                        (0, 0, B_USER+i, NORMAL_BUTTON, buttonnames [i], 0, 0, NULL),
                         i ? XV_WLAY_RIGHTOF : XV_WLAY_CENTERROW);
                         i ? XV_WLAY_RIGHTOF : XV_WLAY_CENTERROW);
-#endif 
+#endif
        add_widget (query_dlg, label_new (2, 3, text, NULL));
        add_widget (query_dlg, label_new (2, 3, text, NULL));
-       
+
        /* run dialog and make result */
        run_dlg (query_dlg);
        switch (query_dlg->ret_value){
        /* run dialog and make result */
        run_dlg (query_dlg);
        switch (query_dlg->ret_value){
@@ -343,7 +343,7 @@ Dlg_head *message (int error, char *header, char *text, ...)
     vsprintf (&buffer [1], text, args);
     strcat (buffer, "\n");
     va_end (args);
     vsprintf (&buffer [1], text, args);
     strcat (buffer, "\n");
     va_end (args);
-    
+
     query_dialog (header, buffer, error, 0);
 #ifndef HAVE_XVIEW
     d = last_query_dlg;
     query_dialog (header, buffer, error, 0);
 #ifndef HAVE_XVIEW
     d = last_query_dlg;
@@ -353,7 +353,7 @@ Dlg_head *message (int error, char *header, char *text, ...)
        tk_dispatch_all ();
        return d;
     }
        tk_dispatch_all ();
        return d;
     }
-#else  
+#else
     init_dlg (d);
     if (!(error & D_INSERT)){
        mi_getch ();
     init_dlg (d);
     if (!(error & D_INSERT)){
        mi_getch ();
@@ -362,7 +362,7 @@ Dlg_head *message (int error, char *header, char *text, ...)
     } else
        return d;
 #endif
     } else
        return d;
 #endif
-#endif 
+#endif
     return 0;
 }
 #endif
     return 0;
 }
 #endif
@@ -373,12 +373,12 @@ Dlg_head *message (int error, char *header, char *text, ...)
 static int  remove_callback (int i, void *data)
 {
     Chooser *c = (Chooser *) data;
 static int  remove_callback (int i, void *data)
 {
     Chooser *c = (Chooser *) data;
-    
+
     listbox_remove_current (c->listbox, 0);
 
     dlg_select_widget (c->dialog, c->listbox);
     dlg_select_nth_widget (c->dialog, 0);
     listbox_remove_current (c->listbox, 0);
 
     dlg_select_widget (c->dialog, c->listbox);
     dlg_select_nth_widget (c->dialog, 0);
-    
+
     /* Return: do not abort dialog */
     return 0;
 }
     /* Return: do not abort dialog */
     return 0;
 }
@@ -391,15 +391,15 @@ Chooser *new_chooser (int lines, int cols, char *help, int flags)
     c = (Chooser *) xmalloc (sizeof (Chooser), "new_chooser");
     c->dialog = create_dlg (0, 0, lines, cols, dialog_colors, common_dialog_callback,
                            help, "chooser", DLG_CENTER | DLG_GRID);
     c = (Chooser *) xmalloc (sizeof (Chooser), "new_chooser");
     c->dialog = create_dlg (0, 0, lines, cols, dialog_colors, common_dialog_callback,
                            help, "chooser", DLG_CENTER | DLG_GRID);
-    
+
     c->dialog->lines = lines;
     c->dialog->cols  = cols;
     c->dialog->lines = lines;
     c->dialog->cols  = cols;
-    
+
     button_lines = flags & CHOOSE_EDITABLE ? 3 : 0;
     button_lines = flags & CHOOSE_EDITABLE ? 3 : 0;
-    
+
     c->listbox = listbox_new (1, 1, cols-2, lines-button_lines,
                           listbox_finish, 0, "listbox");
     c->listbox = listbox_new (1, 1, cols-2, lines-button_lines,
                           listbox_finish, 0, "listbox");
-    
+
     if (button_lines){
        add_widget (c->dialog, button_new (lines-button_lines+1,
                                20, B_ENTER, DEFPUSH_BUTTON, _("&Remove"),
     if (button_lines){
        add_widget (c->dialog, button_new (lines-button_lines+1,
                                20, B_ENTER, DEFPUSH_BUTTON, _("&Remove"),
@@ -407,7 +407,7 @@ Chooser *new_chooser (int lines, int cols, char *help, int flags)
        add_widget (c->dialog, button_new (lines-button_lines+1,
                                    4, B_CANCEL, NORMAL_BUTTON, _("&Cancel"),
                                    0, 0, "button-cancel"));
        add_widget (c->dialog, button_new (lines-button_lines+1,
                                    4, B_CANCEL, NORMAL_BUTTON, _("&Cancel"),
                                    0, 0, "button-cancel"));
-    }              
+    }
     add_widget (c->dialog, c->listbox);
     return c;
 }
     add_widget (c->dialog, c->listbox);
     return c;
 }
@@ -430,17 +430,17 @@ void destroy_chooser (Chooser *c)
 static int quick_callback (struct Dlg_head *h, int id, int Msg)
 {
     switch (Msg){
 static int quick_callback (struct Dlg_head *h, int id, int Msg)
 {
     switch (Msg){
-#ifndef HAVE_X    
+#ifndef HAVE_X
     case DLG_DRAW:
        attrset (COLOR_NORMAL);
        dlg_erase (h);
        draw_box (h, 1, 1, h->lines-2, h->cols-2);
     case DLG_DRAW:
        attrset (COLOR_NORMAL);
        dlg_erase (h);
        draw_box (h, 1, 1, h->lines-2, h->cols-2);
-       
+
        attrset (COLOR_HOT_NORMAL);
        dlg_move (h, 1,((h->cols-strlen (h->data))/2));
        addstr (h->data);
        break;
        attrset (COLOR_HOT_NORMAL);
        dlg_move (h, 1,((h->cols-strlen (h->data))/2));
        addstr (h->data);
        break;
-#endif 
+#endif
     case DLG_KEY:
        if (id == '\n'){
            h->ret_value = B_ENTER;
     case DLG_KEY:
        if (id == '\n'){
            h->ret_value = B_ENTER;
@@ -472,17 +472,17 @@ int quick_dialog_skip (QuickDialog *qd, int nskip)
            qd->title = _(qd->title);
     } else
        do_int = 0;
            qd->title = _(qd->title);
     } else
        do_int = 0;
-    
+
     if (qd->xpos == -1)
         dd = create_dlg (0, 0, qd->ylen, qd->xlen, dialog_colors, quick_callback,
                         qd->help, qd->class, DLG_CENTER | DLG_TRYUP | DLG_GRID);
     else
     if (qd->xpos == -1)
         dd = create_dlg (0, 0, qd->ylen, qd->xlen, dialog_colors, quick_callback,
                         qd->help, qd->class, DLG_CENTER | DLG_TRYUP | DLG_GRID);
     else
-        dd = create_dlg (qd->ypos, qd->xpos, qd->ylen, qd->xlen, dialog_colors, 
+        dd = create_dlg (qd->ypos, qd->xpos, qd->ylen, qd->xlen, dialog_colors,
                          quick_callback,
                         qd->help, qd->class, DLG_GRID);
 
     x_set_dialog_title (dd, qd->title);
                          quick_callback,
                         qd->help, qd->class, DLG_GRID);
 
     x_set_dialog_title (dd, qd->title);
-    
+
     /* We pass this to the callback */
     dd->cols  = qd->xlen;
     dd->lines = qd->ylen;
     /* We pass this to the callback */
     dd->cols  = qd->xlen;
     dd->lines = qd->ylen;
@@ -495,7 +495,7 @@ int quick_dialog_skip (QuickDialog *qd, int nskip)
        xpos = (qd->xlen * qw->relative_x)/qw->x_divisions;
        ypos = (qd->ylen * qw->relative_y)/qw->y_divisions;
 #endif
        xpos = (qd->xlen * qw->relative_x)/qw->x_divisions;
        ypos = (qd->ylen * qw->relative_y)/qw->y_divisions;
 #endif
-       
+
        switch (qw->widget_type){
        case quick_checkbox:
            widget = check_new (ypos, xpos, *qw->result, I18N (qw->text), qw->tkname);
        switch (qw->widget_type){
        case quick_checkbox:
            widget = check_new (ypos, xpos, *qw->result, I18N (qw->text), qw->tkname);
@@ -506,7 +506,7 @@ int quick_dialog_skip (QuickDialog *qd, int nskip)
            r->pos = r->sel = qw->value;
            widget = r;
            break;
            r->pos = r->sel = qw->value;
            widget = r;
            break;
-           
+
        case quick_button:
            widget = button_new (ypos, xpos, qw->value, (qw->value==B_ENTER) ? DEFPUSH_BUTTON : NORMAL_BUTTON,
            I18N (qw->text), 0, 0, qw->tkname);
        case quick_button:
            widget = button_new (ypos, xpos, qw->value, (qw->value==B_ENTER) ? DEFPUSH_BUTTON : NORMAL_BUTTON,
            I18N (qw->text), 0, 0, qw->tkname);
@@ -526,7 +526,7 @@ int quick_dialog_skip (QuickDialog *qd, int nskip)
        case quick_label:
            widget = label_new (ypos, xpos, I18N(qw->text), qw->tkname);
            break;
        case quick_label:
            widget = label_new (ypos, xpos, I18N(qw->text), qw->tkname);
            break;
-           
+
        default:
            widget = 0;
            fprintf (stderr, "QuickWidget: unknown widget type\n");
        default:
            widget = 0;
            fprintf (stderr, "QuickWidget: unknown widget type\n");
@@ -552,7 +552,7 @@ int quick_dialog_skip (QuickDialog *qd, int nskip)
            case quick_radio:
                *qw->result = ((WRadio *) qw->the_widget)->sel;
                break;
            case quick_radio:
                *qw->result = ((WRadio *) qw->the_widget)->sel;
                break;
-               
+
            case quick_input:
                *qw->str_result = strdup (((WInput *) qw->the_widget)->buffer);
                break;
            case quick_input:
                *qw->str_result = strdup (((WInput *) qw->the_widget)->buffer);
                break;
@@ -561,7 +561,7 @@ int quick_dialog_skip (QuickDialog *qd, int nskip)
     }
     return_val = dd->ret_value;
     destroy_dlg (dd);
     }
     return_val = dd->ret_value;
     destroy_dlg (dd);
-    
+
     return return_val;
 }
 
     return return_val;
 }
 
@@ -585,13 +585,13 @@ char *real_input_dialog_help (char *header, char *text, char *help, char *def_te
     { quick_input,  4, 80, 0, 0, "", 58, 0, 0, 0, XV_WLAY_NEXTROW, 0 },
     { quick_label,  3, 80, 2, 0, "", 0, 0, 0, 0, XV_WLAY_NEXTROW, "label" },
     { 0 } };
     { quick_input,  4, 80, 0, 0, "", 58, 0, 0, 0, XV_WLAY_NEXTROW, 0 },
     { quick_label,  3, 80, 2, 0, "", 0, 0, 0, 0, XV_WLAY_NEXTROW, "label" },
     { 0 } };
-    
+
     int len;
     int i;
     int lines;
     char *my_str;
     char tk_name[64] = "inp|";
     int len;
     int i;
     int lines;
     char *my_str;
     char tk_name[64] = "inp|";
-    
+
 /* we need a unique name for tkname because widget.c:history_tool()
    needs a unique name for each dialog - using the header is ideal */
 
 /* we need a unique name for tkname because widget.c:history_tool()
    needs a unique name for each dialog - using the header is ideal */
 
@@ -614,16 +614,16 @@ char *real_input_dialog_help (char *header, char *text, char *help, char *def_te
     }
 
 #ifdef ENABLE_NLS
     }
 
 #ifdef ENABLE_NLS
-       /* 
+       /*
         * An attempt to place buttons symmetrically, based on actual i18n
         * length of the string. It looks nicer with i18n (IMO) - alex
         */
        quick_widgets [0].relative_x = len/2 + 4;
         * An attempt to place buttons symmetrically, based on actual i18n
         * length of the string. It looks nicer with i18n (IMO) - alex
         */
        quick_widgets [0].relative_x = len/2 + 4;
-       quick_widgets [1].relative_x = 
+       quick_widgets [1].relative_x =
                len/2 - (strlen (_(quick_widgets [1].text)) + 9);
        quick_widgets [0].x_divisions = quick_widgets [1].x_divisions = len;
 #endif /* ENABLE_NLS */
                len/2 - (strlen (_(quick_widgets [1].text)) + 9);
        quick_widgets [0].x_divisions = quick_widgets [1].x_divisions = len;
 #endif /* ENABLE_NLS */
-    
+
     Quick_input.xlen  = len;
     Quick_input.xpos  = -1;
     Quick_input.title = header;
     Quick_input.xlen  = len;
     Quick_input.xpos  = -1;
     Quick_input.title = header;
@@ -641,7 +641,7 @@ char *real_input_dialog_help (char *header, char *text, char *help, char *def_te
        quick_widgets [i].relative_y += 2 + lines;
 
     quick_widgets [INPUT_INDEX].str_result = &my_str;
        quick_widgets [i].relative_y += 2 + lines;
 
     quick_widgets [INPUT_INDEX].str_result = &my_str;
-    
+
     Quick_input.widgets = quick_widgets;
     if (quick_dialog (&Quick_input) != B_CANCEL){
        return *(quick_widgets [INPUT_INDEX].str_result);
     Quick_input.widgets = quick_widgets;
     if (quick_dialog (&Quick_input) != B_CANCEL){
        return *(quick_widgets [INPUT_INDEX].str_result);
@@ -668,12 +668,12 @@ int input_dialog_help_2 (char *header, char *text1, char *text2, char *help, cha
     { quick_input,  4, 80, 3, 0, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-lbl" },
     { quick_label,  3, 80, 2, 0, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "label-lbl" },
     { 0 } };
     { quick_input,  4, 80, 3, 0, "", 58, 0, 0, 0, XV_WLAY_BELOWCLOSE, "input-lbl" },
     { quick_label,  3, 80, 2, 0, "", 0, 0, 0, 0, XV_WLAY_DONTCARE, "label-lbl" },
     { 0 } };
-    
+
     int len;
     int i;
     int lines1, lines2;
     char *my_str1, *my_str2;
     int len;
     int i;
     int lines1, lines2;
     char *my_str1, *my_str2;
-    
+
     len = max (strlen (header), msglen (text1, &lines1));
     len = max (len, msglen (text2, &lines2)) + 4;
     len = max (len, 64);
     len = max (strlen (header), msglen (text1, &lines1));
     len = max (len, msglen (text2, &lines2)) + 4;
     len = max (len, 64);
@@ -698,7 +698,7 @@ int input_dialog_help_2 (char *header, char *text1, char *text2, char *help, cha
 
     quick_widgets [4].str_result = &my_str1;
     quick_widgets [2].str_result = &my_str2;
 
     quick_widgets [4].str_result = &my_str1;
     quick_widgets [2].str_result = &my_str2;
-    
+
     Quick_input.widgets = quick_widgets;
     if (quick_dialog (&Quick_input) != B_CANCEL){
         *r1 = *(quick_widgets [4].str_result);
     Quick_input.widgets = quick_widgets;
     if (quick_dialog (&Quick_input) != B_CANCEL){
         *r1 = *(quick_widgets [4].str_result);
@@ -724,7 +724,7 @@ char *input_expand_dialog (char *header, char *text, char *def_text)
        if (expanded){
            free (result);
            return expanded;
        if (expanded){
            free (result);
            return expanded;
-       } else 
+       } else
            return result;
     }
     return result;
            return result;
     }
     return result;
index 3afc551..16fa712 100644 (file)
@@ -22,7 +22,7 @@ int run_listbox (Listbox *l);
 
 /* Quick Widgets */
 enum {
 
 /* Quick Widgets */
 enum {
-    quick_end, quick_checkbox, 
+    quick_end, quick_checkbox,
     quick_button, quick_input,
     quick_label, quick_radio
 } /* quick_t */;
     quick_button, quick_input,
     quick_label, quick_radio
 } /* quick_t */;
@@ -48,7 +48,7 @@ typedef struct {
     char *tkname;              /* Name of the widget used for Tk only */
     void *the_widget;          /* For the quick quick dialog manager */
 } QuickWidget;
     char *tkname;              /* Name of the widget used for Tk only */
     void *the_widget;          /* For the quick quick dialog manager */
 } QuickWidget;
-    
+
 typedef struct {
     int  xlen, ylen;
     int  xpos, ypos; /* if -1, then center the dialog */
 typedef struct {
     int  xlen, ylen;
     int  xpos, ypos; /* if -1, then center the dialog */
index f0e0135..a7d2037 100644 (file)
@@ -1,11 +1,11 @@
 /* Glue code to run with bsd curses.
    Copyright (C) 1994 Miguel de Icaza
 /* Glue code to run with bsd curses.
    Copyright (C) 1994 Miguel de Icaza
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
index 43d2416..695970f 100644 (file)
@@ -1,16 +1,16 @@
 /* Routines expected by the Midnight Commander
 /* Routines expected by the Midnight Commander
-   
+
    Copyright (C) 1999 The Free Software Foundation.
 
    Author Miguel de Icaza
 
    FIXME: This expects the user to always use slang instead of ncurses.
    Copyright (C) 1999 The Free Software Foundation.
 
    Author Miguel de Icaza
 
    FIXME: This expects the user to always use slang instead of ncurses.
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -32,7 +32,7 @@ interrupts_enabled (void) { return 0; }
 
 void
 enable_interrupt_key(void) {}
 
 void
 enable_interrupt_key(void) {}
-   
+
 void
 disable_interrupt_key(void) {}
 
 void
 disable_interrupt_key(void) {}
 
index 172a99a..14024c4 100644 (file)
@@ -1,7 +1,7 @@
 /* Declarations for the extfs.
 
    Copyright (C) 1995 The Free Software Foundation
 /* Declarations for the extfs.
 
    Copyright (C) 1995 The Free Software Foundation
-   
+
    Written by: 1995 Jakub Jelinek
 
 This program is free software; you can redistribute it and/or modify
    Written by: 1995 Jakub Jelinek
 
 This program is free software; you can redistribute it and/or modify
index 0a5f341..ace0548 100644 (file)
@@ -25,11 +25,11 @@ struct utimbuf {
 #endif
 
     /* Our virtual file system layer */
 #endif
 
     /* Our virtual file system layer */
-    
+
     typedef void * vfsid;
 
     struct vfs_stamping;
     typedef void * vfsid;
 
     struct vfs_stamping;
-    
+
     typedef struct {
        void  *(*open)(char *fname, int flags, int mode);
        int   (*close)(void *vfs_info);
     typedef struct {
        void  *(*open)(char *fname, int flags, int mode);
        int   (*close)(void *vfs_info);
@@ -57,24 +57,24 @@ struct utimbuf {
        int  (*ferrno)(void);
        int  (*lseek)(void *vfs_info, off_t offset, int whence);
        int  (*mknod)(char *path, int mode, int dev);
        int  (*ferrno)(void);
        int  (*lseek)(void *vfs_info, off_t offset, int whence);
        int  (*mknod)(char *path, int mode, int dev);
-       
+
        vfsid (*getid)(char *path, struct vfs_stamping **parent);
        int  (*nothingisopen)(vfsid id);
        void (*free)(vfsid id);
        vfsid (*getid)(char *path, struct vfs_stamping **parent);
        int  (*nothingisopen)(vfsid id);
        void (*free)(vfsid id);
-       
+
        char *(*getlocalcopy)(char *filename);
        void (*ungetlocalcopy)(char *filename, char *local, int has_changed);
 
        int  (*mkdir)(char *path, mode_t mode);
        int  (*rmdir)(char *path);
        char *(*getlocalcopy)(char *filename);
        void (*ungetlocalcopy)(char *filename, char *local, int has_changed);
 
        int  (*mkdir)(char *path, mode_t mode);
        int  (*rmdir)(char *path);
-       
+
        int  (*ctl)(void *vfs_info, int ctlop, int arg);
        int  (*setctl)(char *path, int ctlop, char *arg);
        void (*forget_about)(char *path);
 #ifdef HAVE_MMAP
        caddr_t (*mmap)(caddr_t addr, size_t len, int prot, int flags, void *vfs_info, off_t offset);
        int (*munmap)(caddr_t addr, size_t len, void *vfs_info);
        int  (*ctl)(void *vfs_info, int ctlop, int arg);
        int  (*setctl)(char *path, int ctlop, char *arg);
        void (*forget_about)(char *path);
 #ifdef HAVE_MMAP
        caddr_t (*mmap)(caddr_t addr, size_t len, int prot, int flags, void *vfs_info, off_t offset);
        int (*munmap)(caddr_t addr, size_t len, void *vfs_info);
-#endif 
+#endif
     } vfs;
 
     /* Other file systems */
     } vfs;
 
     /* Other file systems */
@@ -83,7 +83,7 @@ struct utimbuf {
 
     extern vfs ftpfs_vfs_ops;
     extern vfs mcfs_vfs_ops;
 
     extern vfs ftpfs_vfs_ops;
     extern vfs mcfs_vfs_ops;
-    
+
     extern vfs extfs_vfs_ops;
 
     extern vfs undelfs_vfs_ops;
     extern vfs extfs_vfs_ops;
 
     extern vfs undelfs_vfs_ops;
@@ -112,7 +112,7 @@ struct utimbuf {
     int vfs_file_is_local (char *name);
     int vfs_file_is_ftp (char *filename);
     char *vfs_get_current_dir (void);
     int vfs_file_is_local (char *name);
     int vfs_file_is_ftp (char *filename);
     char *vfs_get_current_dir (void);
-    
+
     void vfs_stamp (vfs *, vfsid);
     void vfs_rmstamp (vfs *, vfsid, int);
     void vfs_addstamp (vfs *, vfsid, struct vfs_stamping *);
     void vfs_stamp (vfs *, vfsid);
     void vfs_rmstamp (vfs *, vfsid, int);
     void vfs_addstamp (vfs *, vfsid, struct vfs_stamping *);
@@ -136,16 +136,16 @@ struct utimbuf {
     void ftpfs_flushdir(void);
 #else
 #   define ftpfs_flushdir()
     void ftpfs_flushdir(void);
 #else
 #   define ftpfs_flushdir()
-#   define ftpfs_hint_reread(x) 
+#   define ftpfs_hint_reread(x)
 #endif
     /* They fill the file system names */
     void mcfs_fill_names (void (*)(char *));
     void ftpfs_fill_names (void (*)(char *));
     void tarfs_fill_names (void (*)(char *));
 #endif
     /* They fill the file system names */
     void mcfs_fill_names (void (*)(char *));
     void ftpfs_fill_names (void (*)(char *));
     void tarfs_fill_names (void (*)(char *));
-    
+
     char *ftpfs_gethome (char *);
     char *mcfs_gethome (char *);
     char *ftpfs_gethome (char *);
     char *mcfs_gethome (char *);
-    
+
     char *ftpfs_getupdir (char *);
     char *mcfs_getupdir (char *);
 
     char *ftpfs_getupdir (char *);
     char *mcfs_getupdir (char *);
 
@@ -249,14 +249,14 @@ struct utimbuf {
 #   define vfs_free_resources()
 #   define vfs_timeout_handler()
 #   define vfs_timeouts() 0
 #   define vfs_free_resources()
 #   define vfs_timeout_handler()
 #   define vfs_timeouts() 0
-#   define vfs_force_expire () 
+#   define vfs_force_expire ()
 
     typedef int vfs;
 
     typedef int vfs;
-    
+
 #   define mc_getlocalcopy(x) NULL
 #   define mc_ungetlocalcopy(x,y,z)
 
 #   define mc_getlocalcopy(x) NULL
 #   define mc_ungetlocalcopy(x,y,z)
 
-#   define ftpfs_hint_reread(x) 
+#   define ftpfs_hint_reread(x)
 #   define ftpfs_flushdir()
 
 #ifdef _OS_NT
 #   define ftpfs_flushdir()
 
 #ifdef _OS_NT
index dfa1833..436baa0 100644 (file)
@@ -17,7 +17,7 @@
  * strtok 4=[402] length=3
  * strtok 5=[573] length=3
  * strtok 6=[1000] length=4
  * strtok 4=[402] length=3
  * strtok 5=[573] length=3
  * strtok 6=[1000] length=4
- * 
+ *
  * (Strtok:)
  * Strtok 1=[] length=0
  * Strtok 2=[] length=0
  * (Strtok:)
  * Strtok 1=[] length=0
  * Strtok 2=[] length=0
@@ -50,7 +50,7 @@ Strtok(char *buf, const char *delims)
                }
                if (strchr(delims, (int) *end) != NULL) {
                        *end++ = '\0';
                }
                if (strchr(delims, (int) *end) != NULL) {
                        *end++ = '\0';
-                       p = end; 
+                       p = end;
                        break;
                }
        }
                        break;
                }
        }
@@ -104,7 +104,7 @@ Strntok(char *dstTokenStart, size_t tokenSize, char *buf, const char *delims)
                }
                if (strchr(delims, (int) *end) != NULL) {
                        ++end;
                }
                if (strchr(delims, (int) *end) != NULL) {
                        ++end;
-                       p = end; 
+                       p = end;
                        break;
                }
                if (dst < lim)                  /* Don't overrun token size. */
                        break;
                }
                if (dst < lim)                  /* Don't overrun token size. */
index aefe313..6c00ae2 100644 (file)
 
 /* Define if scanning a "long long" with "%qd" works. */
 #undef SCANF_LONG_LONG_QD
 
 /* Define if scanning a "long long" with "%qd" works. */
 #undef SCANF_LONG_LONG_QD
-  
+
 /* Define to the type of arg1 for select(). */
 #undef SELECT_TYPE_ARG1
 
 /* Define to the type of arg1 for select(). */
 #undef SELECT_TYPE_ARG1
 
index 13804ac..1430736 100644 (file)
@@ -22,7 +22,7 @@ FTPChdir(const FTPCIPtr cip, const char *const cdCwd)
                cip->errNo = kErrInvalidDirParam;
        } else {
                if (cdCwd[0] == '\0')   /* But allow FTPChdir(cip, ".") to go through. */
                cip->errNo = kErrInvalidDirParam;
        } else {
                if (cdCwd[0] == '\0')   /* But allow FTPChdir(cip, ".") to go through. */
-                       result = 2;     
+                       result = 2;
                else if (strcmp(cdCwd, "..") == 0)
                        result = FTPCmd(cip, "CDUP");
                else
                else if (strcmp(cdCwd, "..") == 0)
                        result = FTPCmd(cip, "CDUP");
                else
@@ -69,7 +69,7 @@ FTPChmod(const FTPCIPtr cip, const char *const pattern, const char *const mode,
                        cip->errNo = kErrBadLineList;
                        break;
                }
                        cip->errNo = kErrBadLineList;
                        break;
                }
-               onceResult = FTPCmd(cip, "SITE CHMOD %s %s", mode, file);       
+               onceResult = FTPCmd(cip, "SITE CHMOD %s %s", mode, file);
                if (onceResult < 0) {
                        batchResult = onceResult;
                        break;
                if (onceResult < 0) {
                        batchResult = onceResult;
                        break;
@@ -228,7 +228,7 @@ FTPDelete(const FTPCIPtr cip, const char *const pattern, const int recurse, cons
                                batchResult = kErrDELEFailed;
                                cip->errNo = kErrDELEFailed;
                        } else {
                                batchResult = kErrDELEFailed;
                                cip->errNo = kErrDELEFailed;
                        } else {
-                               onceResult = FTPCmd(cip, "RMD %s", file);       
+                               onceResult = FTPCmd(cip, "RMD %s", file);
                                if (onceResult < 0) {
                                        batchResult = onceResult;
                                        break;
                                if (onceResult < 0) {
                                        batchResult = onceResult;
                                        break;
@@ -336,7 +336,7 @@ FTPChdirAndGetCWD(const FTPCIPtr cip, const char *const cdCwd, char *const newCw
                        Error(cip, kDontPerror, "Malloc failed.\n");
                } else {
                        if (strcmp(cdCwd, "..") == 0)
                        Error(cip, kDontPerror, "Malloc failed.\n");
                } else {
                        if (strcmp(cdCwd, "..") == 0)
-                               result = RCmd(cip, rp, "CDUP");         
+                               result = RCmd(cip, rp, "CDUP");
                        else
                                result = RCmd(cip, rp, "CWD %s", cdCwd);
                        if (result == 2) {
                        else
                                result = RCmd(cip, rp, "CWD %s", cdCwd);
                        if (result == 2) {
@@ -408,13 +408,13 @@ FTPChdir3(FTPCIPtr cip, const char *const cdCwd, char *const newCwd, const size_
        }
 
        /* else: (flags | kChdirOneSubdirAtATime) == true */
        }
 
        /* else: (flags | kChdirOneSubdirAtATime) == true */
-       
+
        cp = cip->buf;
        cp[cip->bufSize - 1] = '\0';
        (void) Strncpy(cip->buf, cdCwd, cip->bufSize);
        if (cp[cip->bufSize - 1] != '\0')
                return (kErrBadParameter);
        cp = cip->buf;
        cp[cip->bufSize - 1] = '\0';
        (void) Strncpy(cip->buf, cdCwd, cip->bufSize);
        if (cp[cip->bufSize - 1] != '\0')
                return (kErrBadParameter);
-       
+
        mkd = (flags & kChdirAndMkdir);
        pwd = (flags & kChdirAndGetCWD);
 
        mkd = (flags & kChdirAndMkdir);
        pwd = (flags & kChdirAndGetCWD);
 
@@ -713,7 +713,7 @@ FTPRename(const FTPCIPtr cip, const char *const oldname, const char *const newna
        if ((newname == NULL) || (oldname[0] == '\0'))
                return (kErrBadParameter);
 
        if ((newname == NULL) || (oldname[0] == '\0'))
                return (kErrBadParameter);
 
-       
+
        result = FTPCmd(cip, "RNFR %s", oldname);
        if (result < 0)
                return (result);
        result = FTPCmd(cip, "RNFR %s", oldname);
        if (result < 0)
                return (result);
@@ -721,7 +721,7 @@ FTPRename(const FTPCIPtr cip, const char *const oldname, const char *const newna
                cip->errNo = kErrRenameFailed;
                return (cip->errNo);
        }
                cip->errNo = kErrRenameFailed;
                return (cip->errNo);
        }
-       
+
        result = FTPCmd(cip, "RNTO %s", newname);
        if (result < 0)
                return (result);
        result = FTPCmd(cip, "RNTO %s", newname);
        if (result < 0)
                return (result);
@@ -807,7 +807,7 @@ FTPRmdir(const FTPCIPtr cip, const char *const pattern, const int recurse, const
                        cip->errNo = kErrBadLineList;
                        break;
                }
                        cip->errNo = kErrBadLineList;
                        break;
                }
-               onceResult = FTPCmd(cip, "RMD %s", file);       
+               onceResult = FTPCmd(cip, "RMD %s", file);
                if (onceResult < 0) {
                        batchResult = onceResult;
                        break;
                if (onceResult < 0) {
                        batchResult = onceResult;
                        break;
@@ -1362,7 +1362,7 @@ FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, co
                        cip->errNo = kErrNoSuchFileOrDirectory;
                        return (kErrNoSuchFileOrDirectory);
                }
                        cip->errNo = kErrNoSuchFileOrDirectory;
                        return (kErrNoSuchFileOrDirectory);
                }
-               /* else keep going */   
+               /* else keep going */
        }
 
        if (trySIZE != 0) {
        }
 
        if (trySIZE != 0) {
@@ -1375,7 +1375,7 @@ FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, co
                 * if (result == kErrSIZEFailed)
                 *      return (kErrNoSuchFileOrDirectory);
                 */
                 * if (result == kErrSIZEFailed)
                 *      return (kErrNoSuchFileOrDirectory);
                 */
-               /* else keep going */   
+               /* else keep going */
        }
 
 
        }
 
 
@@ -1387,7 +1387,7 @@ FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, co
                        cip->errNo = kErrNoSuchFileOrDirectory;
                        return (kErrNoSuchFileOrDirectory);
                }
                        cip->errNo = kErrNoSuchFileOrDirectory;
                        return (kErrNoSuchFileOrDirectory);
                }
-               /* else keep going */   
+               /* else keep going */
        }
 
        if (trySTAT != 0) {
        }
 
        if (trySTAT != 0) {
@@ -1398,7 +1398,7 @@ FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, co
                        cip->errNo = kErrNoSuchFileOrDirectory;
                        return (kErrNoSuchFileOrDirectory);
                }
                        cip->errNo = kErrNoSuchFileOrDirectory;
                        return (kErrNoSuchFileOrDirectory);
                }
-               /* else keep going */   
+               /* else keep going */
        }
 
        if (tryNLST != 0) {
        }
 
        if (tryNLST != 0) {
@@ -1409,7 +1409,7 @@ FTPFileExists2(const FTPCIPtr cip, const char *const file, const int tryMDTM, co
                        cip->errNo = kErrNoSuchFileOrDirectory;
                        return (kErrNoSuchFileOrDirectory);
                }
                        cip->errNo = kErrNoSuchFileOrDirectory;
                        return (kErrNoSuchFileOrDirectory);
                }
-               /* else keep going */   
+               /* else keep going */
        }
 
        cip->errNo = kErrCantTellIfFileExists;
        }
 
        cip->errNo = kErrCantTellIfFileExists;
@@ -1678,7 +1678,7 @@ FTPUtime(const FTPCIPtr cip, const char *const file, time_t actime, time_t modti
                        cip->errNo = kErrMallocFailed;
                        Error(cip, kDontPerror, "Malloc failed.\n");
                } else {
                        cip->errNo = kErrMallocFailed;
                        Error(cip, kDontPerror, "Malloc failed.\n");
                } else {
-                       result = RCmd(cip, rp, "SITE UTIME %s %s %s %s UTC", file, astr, mstr, cstr);   
+                       result = RCmd(cip, rp, "SITE UTIME %s %s %s %s UTC", file, astr, mstr, cstr);
                        if (result < 0) {
                                DoneWithResponse(cip, rp);
                                return (result);
                        if (result < 0) {
                                DoneWithResponse(cip, rp);
                                return (result);
index 2d40a9d..e5b6ee5 100644 (file)
@@ -7,7 +7,7 @@
 
 #define _libncftp_errno_c_ 1
 #include "syshdrs.h"
 
 #define _libncftp_errno_c_ 1
 #include "syshdrs.h"
-       
+
 static const char *gErrList[kErrLast - kErrFirst + 2] = {
        "gethostname() failed",                                         /* -100 */
        "hostname does not include domain name",                        /* -101 */
 static const char *gErrList[kErrLast - kErrFirst + 2] = {
        "gethostname() failed",                                         /* -100 */
        "hostname does not include domain name",                        /* -101 */
@@ -105,7 +105,7 @@ static const char *gErrList[kErrLast - kErrFirst + 2] = {
        "timed out while waiting for server response",                  /* -193 */
        "data transfer timed out",                                      /* -194 */
        "canceled by user",                                             /* -195 */
        "timed out while waiting for server response",                  /* -193 */
        "data transfer timed out",                                      /* -194 */
        "canceled by user",                                             /* -195 */
-       NULL,                                                           
+       NULL,
 };
 
 int gLibNcFTP_Uses_Me_To_Quiet_Variable_Unused_Warnings = 0;
 };
 
 int gLibNcFTP_Uses_Me_To_Quiet_Variable_Unused_Warnings = 0;
@@ -136,24 +136,24 @@ FTPPerror(const FTPCIPtr cip, const int err, const int eerr, const char *const s
        if (err != kNoErr) {
                if (err == eerr) {
                        if ((s2 == NULL) || (s2[0] == '\0')) {
        if (err != kNoErr) {
                if (err == eerr) {
                        if ((s2 == NULL) || (s2[0] == '\0')) {
-                               if ((s1 == NULL) || (s1[0] == '\0')) { 
+                               if ((s1 == NULL) || (s1[0] == '\0')) {
                                        (void) fprintf(stderr, "server said: %s\n", cip->lastFTPCmdResultStr);
                                } else {
                                        (void) fprintf(stderr, "%s: server said: %s\n", s1, cip->lastFTPCmdResultStr);
                                }
                                        (void) fprintf(stderr, "server said: %s\n", cip->lastFTPCmdResultStr);
                                } else {
                                        (void) fprintf(stderr, "%s: server said: %s\n", s1, cip->lastFTPCmdResultStr);
                                }
-                       } else if ((s1 == NULL) || (s1[0] == '\0')) { 
+                       } else if ((s1 == NULL) || (s1[0] == '\0')) {
                                (void) fprintf(stderr, "%s: server said: %s\n", s2, cip->lastFTPCmdResultStr);
                        } else {
                                (void) fprintf(stderr, "%s %s: server said: %s\n", s1, s2, cip->lastFTPCmdResultStr);
                        }
                } else {
                        if ((s2 == NULL) || (s2[0] == '\0')) {
                                (void) fprintf(stderr, "%s: server said: %s\n", s2, cip->lastFTPCmdResultStr);
                        } else {
                                (void) fprintf(stderr, "%s %s: server said: %s\n", s1, s2, cip->lastFTPCmdResultStr);
                        }
                } else {
                        if ((s2 == NULL) || (s2[0] == '\0')) {
-                               if ((s1 == NULL) || (s1[0] == '\0')) { 
+                               if ((s1 == NULL) || (s1[0] == '\0')) {
                                        (void) fprintf(stderr, "%s.\n", FTPStrError(cip->errNo));
                                } else {
                                        (void) fprintf(stderr, "%s: %s.\n", s1, FTPStrError(cip->errNo));
                                }
                                        (void) fprintf(stderr, "%s.\n", FTPStrError(cip->errNo));
                                } else {
                                        (void) fprintf(stderr, "%s: %s.\n", s1, FTPStrError(cip->errNo));
                                }
-                       } else if ((s1 == NULL) || (s1[0] == '\0')) { 
+                       } else if ((s1 == NULL) || (s1[0] == '\0')) {
                                (void) fprintf(stderr, "%s: %s.\n", s2, FTPStrError(cip->errNo));
                        } else {
                                (void) fprintf(stderr, "%s %s: %s.\n", s1, s2, FTPStrError(cip->errNo));
                                (void) fprintf(stderr, "%s: %s.\n", s2, FTPStrError(cip->errNo));
                        } else {
                                (void) fprintf(stderr, "%s %s: %s.\n", s1, s2, FTPStrError(cip->errNo));
index ca1e484..43f4156 100644 (file)
@@ -54,7 +54,7 @@ GetHostEntry(char *host, struct in_addr *ip_address)
 {
        struct in_addr ip;
        struct hostent *hp;
 {
        struct in_addr ip;
        struct hostent *hp;
-       
+
        /* See if the host was given in the dotted IP format, like "36.44.0.2."
         * If it was, inet_addr will convert that to a 32-bit binary value;
         * it not, inet_addr will return (-1L).
        /* See if the host was given in the dotted IP format, like "36.44.0.2."
         * If it was, inet_addr will convert that to a 32-bit binary value;
         * it not, inet_addr will return (-1L).
@@ -106,7 +106,7 @@ GetOurHostName(char *host, size_t siz)
                 */
                return (2);             /* Success */
        }
                 */
                return (2);             /* Success */
        }
-       
+
        hp = gethostbyname(host);
        if (hp != NULL) {
                /* Maybe the host entry has the full name. */
        hp = gethostbyname(host);
        if (hp != NULL) {
                /* Maybe the host entry has the full name. */
@@ -145,7 +145,7 @@ GetOurHostName(char *host, size_t siz)
                }
        }
 #      endif   /* HAVE_RES_INIT && HAVE__RES_DEFDNAME */
                }
        }
 #      endif   /* HAVE_RES_INIT && HAVE__RES_DEFDNAME */
-       
+
        if (domain[0] == '\0') {
                FILE *fp;
                char line[256];
        if (domain[0] == '\0') {
                FILE *fp;
                char line[256];
@@ -410,7 +410,7 @@ OpenControlConnection(const FTPCIPtr cip, char *host, unsigned int port)
                cip->servCtlAddr.sin_family = hp->h_addrtype;
                /* We'll fill in the rest of the structure below. */
        }
                cip->servCtlAddr.sin_family = hp->h_addrtype;
                /* We'll fill in the rest of the structure below. */
        }
-       
+
        /* After obtaining a socket, try to connect it to a remote
         * address.  If we didn't get a host entry, we will only have
         * one thing to try (ip_address);  if we do have one, we can try
        /* After obtaining a socket, try to connect it to a remote
         * address.  If we didn't get a host entry, we will only have
         * one thing to try (ip_address);  if we do have one, we can try
@@ -585,7 +585,7 @@ OpenControlConnection(const FTPCIPtr cip, char *host, unsigned int port)
 #endif /* NO_SIGNALS */
                }
        }
 #endif /* NO_SIGNALS */
                }
        }
-       
+
        if (err < 0) {
                /* Could not connect.  Close up shop and go home. */
 
        if (err < 0) {
                /* Could not connect.  Close up shop and go home. */
 
@@ -728,7 +728,7 @@ OpenControlConnection(const FTPCIPtr cip, char *host, unsigned int port)
        else
                (void) STRNCPY(cip->actualHost, (char *) hp->h_name);
 
        else
                (void) STRNCPY(cip->actualHost, (char *) hp->h_name);
 
-       /* Read the startup message from the server. */ 
+       /* Read the startup message from the server. */
        rp = InitResponse();
        if (rp == NULL) {
                Error(cip, kDontPerror, "Malloc failed.\n");
        rp = InitResponse();
        if (rp == NULL) {
                Error(cip, kDontPerror, "Malloc failed.\n");
@@ -748,7 +748,7 @@ OpenControlConnection(const FTPCIPtr cip, char *host, unsigned int port)
                secondLine = NULL;
                if (rp->msg.first->next != NULL)
                        secondLine = rp->msg.first->next->line;
                secondLine = NULL;
                if (rp->msg.first->next != NULL)
                        secondLine = rp->msg.first->next->line;
-               
+
                if (strstr(firstLine, "Version wu-") != NULL) {
                        cip->serverType = kServerTypeWuFTPd;
                        srvr = "wu-ftpd";
                if (strstr(firstLine, "Version wu-") != NULL) {
                        cip->serverType = kServerTypeWuFTPd;
                        srvr = "wu-ftpd";
@@ -811,12 +811,12 @@ OpenControlConnection(const FTPCIPtr cip, char *host, unsigned int port)
        cip->connected = 1;
        DoneWithResponse(cip, rp);
        return (kNoErr);
        cip->connected = 1;
        DoneWithResponse(cip, rp);
        return (kNoErr);
-       
+
 fatal:
        if (sockfd > 0)
                (void) closesocket(sockfd);
        if (sock2fd > 0)
 fatal:
        if (sockfd > 0)
                (void) closesocket(sockfd);
        if (sock2fd > 0)
-               (void) closesocket(sock2fd);            
+               (void) closesocket(sock2fd);
        CloseFile(&cip->cin);
        CloseFile(&cip->cout);
        cip->ctrlSocketR = kClosedFileDescriptor;
        CloseFile(&cip->cin);
        CloseFile(&cip->cout);
        cip->ctrlSocketR = kClosedFileDescriptor;
@@ -1090,7 +1090,7 @@ tryPort:
                cip->ourDataAddr.sin_port = 0;
                if (Rbind(dataSocket, (struct sockaddr *) &cip->ourDataAddr,
                        (int) sizeof (cip->ourDataAddr),
                cip->ourDataAddr.sin_port = 0;
                if (Rbind(dataSocket, (struct sockaddr *) &cip->ourDataAddr,
                        (int) sizeof (cip->ourDataAddr),
-                       cip->servCtlAddr.sin_addr.s_addr) < 0) 
+                       cip->servCtlAddr.sin_addr.s_addr) < 0)
 #else
                if (BindToEphemeralPortNumber(dataSocket, &cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0)
 #endif
 #else
                if (BindToEphemeralPortNumber(dataSocket, &cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0)
 #endif
@@ -1100,27 +1100,27 @@ tryPort:
                        cip->errNo = kErrBindDataSocket;
                        goto bad;
                }
                        cip->errNo = kErrBindDataSocket;
                        goto bad;
                }
-       
+
                /* Need to do this so we can figure out which port the system
                 * gave to us.
                 */
                if ((result = GetSocketAddress(cip, dataSocket, &cip->ourDataAddr)) < 0)
                        goto bad;
                /* Need to do this so we can figure out which port the system
                 * gave to us.
                 */
                if ((result = GetSocketAddress(cip, dataSocket, &cip->ourDataAddr)) < 0)
                        goto bad;
-       
+
                if (listen(dataSocket, 1) < 0) {
                        Error(cip, kDoPerror, "listen failed");
                        result = kErrListenDataSocket;
                        cip->errNo = kErrListenDataSocket;
                        goto bad;
                }
                if (listen(dataSocket, 1) < 0) {
                        Error(cip, kDoPerror, "listen failed");
                        result = kErrListenDataSocket;
                        cip->errNo = kErrListenDataSocket;
                        goto bad;
                }
-       
+
                if ((result = SendPort(cip, &cip->ourDataAddr)) < 0)
                        goto bad;
                if ((result = SendPort(cip, &cip->ourDataAddr)) < 0)
                        goto bad;
-       
+
                cip->dataPortMode = kSendPortMode;
        } else {
                /* Passive mode.  Let the other side decide where to send. */
                cip->dataPortMode = kSendPortMode;
        } else {
                /* Passive mode.  Let the other side decide where to send. */
-               
+
                cip->servDataAddr = cip->servCtlAddr;
                cip->servDataAddr.sin_family = AF_INET;
                cip->ourDataAddr = cip->ourCtlAddr;
                cip->servDataAddr = cip->servCtlAddr;
                cip->servDataAddr.sin_family = AF_INET;
                cip->ourDataAddr = cip->ourCtlAddr;
@@ -1129,7 +1129,7 @@ tryPort:
                if (Passive(cip, &cip->servDataAddr, &weirdPort) < 0) {
                        Error(cip, kDontPerror, "Passive mode refused.\n");
                        cip->hasPASV = kCommandNotAvailable;
                if (Passive(cip, &cip->servDataAddr, &weirdPort) < 0) {
                        Error(cip, kDontPerror, "Passive mode refused.\n");
                        cip->hasPASV = kCommandNotAvailable;
-                       
+
                        /* We can try using regular PORT commands, which are required
                         * by all FTP protocol compliant programs, if you said so.
                         *
                        /* We can try using regular PORT commands, which are required
                         * by all FTP protocol compliant programs, if you said so.
                         *
@@ -1148,7 +1148,7 @@ tryPort:
                cip->ourDataAddr.sin_port = 0;
                if (Rbind(dataSocket, (struct sockaddr *) &cip->ourDataAddr,
                        (int) sizeof (cip->ourDataAddr),
                cip->ourDataAddr.sin_port = 0;
                if (Rbind(dataSocket, (struct sockaddr *) &cip->ourDataAddr,
                        (int) sizeof (cip->ourDataAddr),
-                       cip->servCtlAddr.sin_addr.s_addr) < 0) 
+                       cip->servCtlAddr.sin_addr.s_addr) < 0)
 #else
                if (BindToEphemeralPortNumber(dataSocket, &cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0)
 #endif
 #else
                if (BindToEphemeralPortNumber(dataSocket, &cip->ourDataAddr, (int) cip->ephemLo, (int) cip->ephemHi) < 0)
 #endif
@@ -1213,7 +1213,7 @@ tryPort:
                        cip->errNo = kErrConnectDataSocket;
                        goto bad;
                }
                        cip->errNo = kErrConnectDataSocket;
                        goto bad;
                }
-       
+
                /* Need to do this so we can figure out which port the system
                 * gave to us.
                 */
                /* Need to do this so we can figure out which port the system
                 * gave to us.
                 */
@@ -1300,7 +1300,7 @@ AcceptDataConnection(const FTPCIPtr cip)
                                return (kErrAcceptDataSocket);
                        }
                }
                                return (kErrAcceptDataSocket);
                        }
                }
-               
+
                cip->dataSocket = newSocket;
        }
 
                cip->dataSocket = newSocket;
        }
 
@@ -1335,7 +1335,7 @@ SendTelnetInterrupt(const FTPCIPtr cip)
 
        if (cip->cout != NULL)
                (void) fflush(cip->cout);
 
        if (cip->cout != NULL)
                (void) fflush(cip->cout);
-       
+
        msg[0] = (char) (unsigned char) IAC;
        msg[1] = (char) (unsigned char) IP;
        (void) send(cip->ctrlSocketW, msg, 2, 0);
        msg[0] = (char) (unsigned char) IAC;
        msg[1] = (char) (unsigned char) IP;
        (void) send(cip->ctrlSocketW, msg, 2, 0);
index 4b6f7b5..152d3c4 100644 (file)
@@ -531,7 +531,7 @@ UnLslRLine( char *const line,
 #else
                {
                        long fsize2 = 0L;
 #else
                {
                        long fsize2 = 0L;
-                       
+
                        (void) sscanf(sizestart, "%ld", &fsize2);
                        *fsize = (longest_int) fsize2;
                }
                        (void) sscanf(sizestart, "%ld", &fsize2);
                        *fsize = (longest_int) fsize2;
                }
@@ -696,7 +696,7 @@ UnMlsT(const char *const line0, const MLstItemPtr mlip)
        int ec;
        size_t len;
        char line[1024];
        int ec;
        size_t len;
        char line[1024];
-       
+
        memset(mlip, 0, sizeof(MLstItem));
        mlip->mode = -1;
        mlip->fsize = kSizeUnknown;
        memset(mlip, 0, sizeof(MLstItem));
        mlip->mode = -1;
        mlip->fsize = kSizeUnknown;
@@ -770,7 +770,7 @@ UnMlsT(const char *const line0, const MLstItemPtr mlip)
                } else if (ISTREQ(fact, "UNIX.mode")) {
                        if (val[0] == '0')
                                sscanf(val, "%o", &mlip->mode);
                } else if (ISTREQ(fact, "UNIX.mode")) {
                        if (val[0] == '0')
                                sscanf(val, "%o", &mlip->mode);
-                       else    
+                       else
                                sscanf(val, "%i", &mlip->mode);
                        if (mlip->mode != (-1))
                                mlip->mode &= 00777;
                                sscanf(val, "%i", &mlip->mode);
                        if (mlip->mode != (-1))
                                mlip->mode &= 00777;
@@ -1077,7 +1077,7 @@ goback:
                if ((result = FTPChdir(cip, cwd)) < 0) {
                        return (result);
                }
                if ((result = FTPChdir(cip, cwd)) < 0) {
                        return (result);
                }
-       }       
+       }
        return (kNoErr);
 }      /* FTPRemoteRecursiveFileList */
 
        return (kNoErr);
 }      /* FTPRemoteRecursiveFileList */
 
@@ -1133,7 +1133,7 @@ Traverse(FTPCIPtr cip, char *fullpath, struct Stat *st, char *relpath, FileInfoL
                }
 
                (void) strcpy(cp, file);        /* append name after slash */
                }
 
                (void) strcpy(cp, file);        /* append name after slash */
-               (void) strcpy(c2, file);        
+               (void) strcpy(c2, file);
 
                if (Lstat(fullpath, st) < 0) {
                        Error(cip, kDoPerror, "could not stat %s.\n", fullpath);
 
                if (Lstat(fullpath, st) < 0) {
                        Error(cip, kDoPerror, "could not stat %s.\n", fullpath);
@@ -1219,7 +1219,7 @@ Traverse(FTPCIPtr cip, char *fullpath, struct Stat *st, char *relpath, FileInfoL
                        continue;       /* skip "." and ".." directories. */
 
                (void) strcpy(cp, dirp->d_name);        /* append name after slash */
                        continue;       /* skip "." and ".." directories. */
 
                (void) strcpy(cp, dirp->d_name);        /* append name after slash */
-               (void) strcpy(c2, dirp->d_name);        
+               (void) strcpy(c2, dirp->d_name);
                if (Lstat(fullpath, st) < 0) {
                        Error(cip, kDoPerror, "could not stat %s.\n", fullpath);
                        continue;
                if (Lstat(fullpath, st) < 0) {
                        Error(cip, kDoPerror, "could not stat %s.\n", fullpath);
                        continue;
@@ -1271,10 +1271,10 @@ FTPLocalRecursiveFileList2(FTPCIPtr cip, LineListPtr fileList, FileInfoListPtr f
 {
        LinePtr filePtr, nextFilePtr;
 #if defined(WIN32) || defined(_WINDOWS)
 {
        LinePtr filePtr, nextFilePtr;
 #if defined(WIN32) || defined(_WINDOWS)
-       char fullpath[_MAX_PATH + 1];   
+       char fullpath[_MAX_PATH + 1];
        char relpath[_MAX_PATH + 1];
 #else
        char relpath[_MAX_PATH + 1];
 #else
-       char fullpath[512];     
+       char fullpath[512];
        char relpath[512];
 #endif
        struct Stat st;
        char relpath[512];
 #endif
        struct Stat st;
@@ -1358,7 +1358,7 @@ FTPRemoteGlob(FTPCIPtr cip, LineListPtr fileList, const char *pattern, int doGlo
        if ((doGlob == 1) && (GLOBCHARSINSTR(pattern))) {
                /* Use NLST, which lists files one per line. */
                lsflags = "";
        if ((doGlob == 1) && (GLOBCHARSINSTR(pattern))) {
                /* Use NLST, which lists files one per line. */
                lsflags = "";
-               
+
                /* Optimize for "NLST *" case which is same as "NLST". */
                if (strcmp(pattern, "*") == 0) {
                        pattern = "";
                /* Optimize for "NLST *" case which is same as "NLST". */
                if (strcmp(pattern, "*") == 0) {
                        pattern = "";
@@ -1455,7 +1455,7 @@ ExpandTilde(char *pattern, size_t siz)
                                return;         /* Bad user -- leave it alone. */
 #endif
                }
                                return;         /* Bad user -- leave it alone. */
 #endif
                }
-               
+
                (void) Strncpy(pattern, firstent, siz);
                if (rest != NULL) {
                        (void) Strncat(pattern, LOCAL_PATH_DELIM_STR, siz);
                (void) Strncpy(pattern, firstent, siz);
                if (rest != NULL) {
                        (void) Strncat(pattern, LOCAL_PATH_DELIM_STR, siz);
@@ -1536,7 +1536,7 @@ LazyUnixLocalGlob(FTPCIPtr cip, LineListPtr fileList, const char *const pattern)
        longstring gfile;
        FILE *fp;
        FTPSigProc sp;
        longstring gfile;
        FILE *fp;
        FTPSigProc sp;
-       
+
        /* Do it the easy way and have the shell do the dirty
         * work for us.
         */
        /* Do it the easy way and have the shell do the dirty
         * work for us.
         */
@@ -1548,7 +1548,7 @@ LazyUnixLocalGlob(FTPCIPtr cip, LineListPtr fileList, const char *const pattern)
        (void) sprintf(cmd, "%s -c \"%s %s %s\"", "/bin/sh", "/bin/ls",
                "-d", pattern);
 #endif
        (void) sprintf(cmd, "%s -c \"%s %s %s\"", "/bin/sh", "/bin/ls",
                "-d", pattern);
 #endif
-       
+
        fp = (FILE *) popen(cmd, "r");
        if (fp == NULL) {
                Error(cip, kDoPerror, "Could not Lglob: [%s]\n", cmd);
        fp = (FILE *) popen(cmd, "r");
        if (fp == NULL) {
                Error(cip, kDoPerror, "Could not Lglob: [%s]\n", cmd);
@@ -1589,8 +1589,8 @@ FTPLocalGlob(FTPCIPtr cip, LineListPtr fileList, const char *pattern, int doGlob
                return (kErrBadParameter);
 
        (void) STRNCPY(pattern2, pattern);      /* Don't nuke the original. */
                return (kErrBadParameter);
 
        (void) STRNCPY(pattern2, pattern);      /* Don't nuke the original. */
-       
-       /* Pre-process for ~'s. */ 
+
+       /* Pre-process for ~'s. */
        ExpandTilde(pattern2, sizeof(pattern2));
        InitLineList(fileList);
        result = kNoErr;
        ExpandTilde(pattern2, sizeof(pattern2));
        InitLineList(fileList);
        result = kNoErr;
index 3e85baf..b92dd04 100644 (file)
@@ -208,7 +208,7 @@ FTPList(const FTPCIPtr cip, const int outfd, const int longMode, const char *con
                        Error(cip, kDoPerror, "Could not fdopen.\n");
                        return (result);
                }
                        Error(cip, kDoPerror, "Could not fdopen.\n");
                        return (result);
                }
-               
+
                for (;;) {
                        result = SReadline(&lsSrl, line, sizeof(line) - 2);
                        if (result == kTimeoutErr) {
                for (;;) {
                        result = SReadline(&lsSrl, line, sizeof(line) - 2);
                        if (result == kTimeoutErr) {
@@ -243,7 +243,7 @@ FTPList(const FTPCIPtr cip, const int outfd, const int longMode, const char *con
 
 
 #else  /* NO_SIGNALS */
 
 
 #else  /* NO_SIGNALS */
-       
+
        if (result == 0) {
                /* This line sets the buffer pointer so that the first thing
                 * BufferGets will do is reset and fill the buffer using
        if (result == 0) {
                /* This line sets the buffer pointer so that the first thing
                 * BufferGets will do is reset and fill the buffer using
@@ -447,7 +447,7 @@ FTPListToMemory2(const FTPCIPtr cip, const char *const pattern, const LineListPt
                        Error(cip, kDoPerror, "Could not fdopen.\n");
                        return (result);
                }
                        Error(cip, kDoPerror, "Could not fdopen.\n");
                        return (result);
                }
-               
+
                for (;;) {
                        result = SReadline(&lsSrl, line, sizeof(line) - 1);
                        if (result == kTimeoutErr) {
                for (;;) {
                        result = SReadline(&lsSrl, line, sizeof(line) - 1);
                        if (result == kTimeoutErr) {
@@ -787,14 +787,14 @@ FTPPutOneF(
                                 * for Windows' file timestamps being
                                 * imprecise to one second.
                                 */
                                 * for Windows' file timestamps being
                                 * imprecise to one second.
                                 */
-                               zaction = kConfirmResumeProcSaidOverwrite; 
+                               zaction = kConfirmResumeProcSaidOverwrite;
                        } else if ((longest_int) st.st_size == startPoint) {
                                /* Already sent file, done. */
                        } else if ((longest_int) st.st_size == startPoint) {
                                /* Already sent file, done. */
-                               zaction = kConfirmResumeProcSaidSkip; 
+                               zaction = kConfirmResumeProcSaidSkip;
                        } else if ((startPoint != kSizeUnknown) && ((longest_int) st.st_size > startPoint)) {
                        } else if ((startPoint != kSizeUnknown) && ((longest_int) st.st_size > startPoint)) {
-                               zaction = kConfirmResumeProcSaidResume; 
+                               zaction = kConfirmResumeProcSaidResume;
                        } else {
                        } else {
-                               zaction = kConfirmResumeProcSaidOverwrite; 
+                               zaction = kConfirmResumeProcSaidOverwrite;
                        }
                }
 
                        }
                }
 
@@ -1280,7 +1280,7 @@ FTPPutOneFile3(
                return (kErrBadParameter);
        if (strcmp(cip->magic, kLibraryMagic))
                return (kErrBadMagic);
                return (kErrBadParameter);
        if (strcmp(cip->magic, kLibraryMagic))
                return (kErrBadMagic);
-       
+
        if ((dstfile == NULL) || (dstfile[0] == '\0'))
                return (kErrBadParameter);
        if (fdtouse < 0) {
        if ((dstfile == NULL) || (dstfile[0] == '\0'))
                return (kErrBadParameter);
        if (fdtouse < 0) {
@@ -2349,7 +2349,7 @@ FTPGetOneF(
                        } else if (nread == 0) {
                                break;
                        }
                        } else if (nread == 0) {
                                break;
                        }
-#else                  
+#else
                        gCanBrokenDataJmp = 1;
                        if (cip->xferTimeout > 0)
                                (void) alarm(cip->xferTimeout);
                        gCanBrokenDataJmp = 1;
                        if (cip->xferTimeout > 0)
                                (void) alarm(cip->xferTimeout);
@@ -2467,7 +2467,7 @@ FTPGetOneFile3(
                return (kErrBadParameter);
        if (strcmp(cip->magic, kLibraryMagic))
                return (kErrBadMagic);
                return (kErrBadParameter);
        if (strcmp(cip->magic, kLibraryMagic))
                return (kErrBadMagic);
-       
+
        if ((file == NULL) || (file[0] == '\0'))
                return (kErrBadParameter);
        if (fdtouse < 0) {
        if ((file == NULL) || (file[0] == '\0'))
                return (kErrBadParameter);
        if (fdtouse < 0) {
index e1528af..a6e1092 100644 (file)
@@ -33,7 +33,7 @@ void
 DisposeLineListContents(LineListPtr list)
 {
        LinePtr lp, lp2;
 DisposeLineListContents(LineListPtr list)
 {
        LinePtr lp, lp2;
-       
+
        for (lp = list->first; lp != NULL; ) {
                lp2 = lp;
                lp = lp->next;
        for (lp = list->first; lp != NULL; ) {
                lp2 = lp;
                lp = lp->next;
@@ -63,9 +63,9 @@ LinePtr
 RemoveLine(LineListPtr list, LinePtr killMe)
 {
        LinePtr nextLine, prevLine;
 RemoveLine(LineListPtr list, LinePtr killMe)
 {
        LinePtr nextLine, prevLine;
-       
-       nextLine = killMe->next;        
-       prevLine = killMe->prev;        
+
+       nextLine = killMe->next;
+       prevLine = killMe->prev;
        if (killMe->line != NULL) {
                killMe->line[0] = '\0';         /* Make it useless just in case. */
                free(killMe->line);
        if (killMe->line != NULL) {
                killMe->line[0] = '\0';         /* Make it useless just in case. */
                free(killMe->line);
@@ -81,7 +81,7 @@ RemoveLine(LineListPtr list, LinePtr killMe)
        if (prevLine != NULL)
                prevLine->next = nextLine;
 
        if (prevLine != NULL)
                prevLine->next = nextLine;
 
-       free(killMe);   
+       free(killMe);
        list->nLines--;
        return (nextLine);
 }      /* RemoveLine */
        list->nLines--;
        return (nextLine);
 }      /* RemoveLine */
@@ -95,7 +95,7 @@ AddLine(LineListPtr list, const char *buf1)
 {
        LinePtr lp;
        char *buf;
 {
        LinePtr lp;
        char *buf;
-       
+
        lp = (LinePtr) malloc(sizeof(Line));
        if (lp != NULL) {
                buf = StrDup(buf1);
        lp = (LinePtr) malloc(sizeof(Line));
        if (lp != NULL) {
                buf = StrDup(buf1);
@@ -127,7 +127,7 @@ int
 CopyLineList(LineListPtr dst, LineListPtr src)
 {
        LinePtr lp, lp2;
 CopyLineList(LineListPtr dst, LineListPtr src)
 {
        LinePtr lp, lp2;
-       
+
        InitLineList(dst);
        for (lp = src->first; lp != NULL; ) {
                lp2 = lp;
        InitLineList(dst);
        for (lp = src->first; lp != NULL; ) {
                lp2 = lp;
@@ -152,7 +152,7 @@ void
 DisposeFileInfoListContents(FileInfoListPtr list)
 {
        FileInfoPtr lp, lp2;
 DisposeFileInfoListContents(FileInfoListPtr list)
 {
        FileInfoPtr lp, lp2;
-       
+
        for (lp = list->first; lp != NULL; ) {
                lp2 = lp;
                lp = lp->next;
        for (lp = list->first; lp != NULL; ) {
                lp2 = lp;
                lp = lp->next;
@@ -483,9 +483,9 @@ FileInfoPtr
 RemoveFileInfo(FileInfoListPtr list, FileInfoPtr killMe)
 {
        FileInfoPtr nextFileInfo, prevFileInfo;
 RemoveFileInfo(FileInfoListPtr list, FileInfoPtr killMe)
 {
        FileInfoPtr nextFileInfo, prevFileInfo;
-       
-       nextFileInfo = killMe->next;    
-       prevFileInfo = killMe->prev;    
+
+       nextFileInfo = killMe->next;
+       prevFileInfo = killMe->prev;
        if (killMe->lname != NULL) {
                killMe->lname[0] = '\0';                /* Make it useless just in case. */
                free(killMe->lname);
        if (killMe->lname != NULL) {
                killMe->lname[0] = '\0';                /* Make it useless just in case. */
                free(killMe->lname);
@@ -517,7 +517,7 @@ RemoveFileInfo(FileInfoListPtr list, FileInfoPtr killMe)
        if (prevFileInfo != NULL)
                prevFileInfo->next = nextFileInfo;
 
        if (prevFileInfo != NULL)
                prevFileInfo->next = nextFileInfo;
 
-       free(killMe);   
+       free(killMe);
        list->nFileInfos--;
        return (nextFileInfo);
 }      /* RemoveFileInfo */
        list->nFileInfos--;
        return (nextFileInfo);
 }      /* RemoveFileInfo */
@@ -530,7 +530,7 @@ FileInfoPtr
 AddFileInfo(FileInfoListPtr list, FileInfoPtr src)
 {
        FileInfoPtr lp;
 AddFileInfo(FileInfoListPtr list, FileInfoPtr src)
 {
        FileInfoPtr lp;
-       
+
        lp = (FileInfoPtr) malloc(sizeof(FileInfo));
        if (lp != NULL) {
                (void) memcpy(lp, src, sizeof(FileInfo));
        lp = (FileInfoPtr) malloc(sizeof(FileInfo));
        if (lp != NULL) {
                (void) memcpy(lp, src, sizeof(FileInfo));
@@ -557,7 +557,7 @@ ConcatFileInfoList(FileInfoListPtr dst, FileInfoListPtr src)
 {
        FileInfoPtr lp, lp2;
        FileInfo newfi;
 {
        FileInfoPtr lp, lp2;
        FileInfo newfi;
-       
+
        for (lp = src->first; lp != NULL; lp = lp2) {
                lp2 = lp->next;
                newfi = *lp;
        for (lp = src->first; lp != NULL; lp = lp2) {
                lp2 = lp->next;
                newfi = *lp;
index aa15802..28b2e20 100644 (file)
@@ -335,7 +335,7 @@ typedef struct MLstItem{
 /* Suggested timeout values, in seconds, if you use timeouts. */
 #define kSuggestedDefaultXferTimeout   (0)     /* No timeout on data blocks. */
 #define kSuggestedDefaultConnTimeout   30
 /* Suggested timeout values, in seconds, if you use timeouts. */
 #define kSuggestedDefaultXferTimeout   (0)     /* No timeout on data blocks. */
 #define kSuggestedDefaultConnTimeout   30
-#define kSuggestedDefaultCtrlTimeout   135     /* 2*MSL, + slop */ 
+#define kSuggestedDefaultCtrlTimeout   135     /* 2*MSL, + slop */
 #define kSuggestedAbortTimeout         10
 
 #define kDefaultMaxDials               3
 #define kSuggestedAbortTimeout         10
 
 #define kDefaultMaxDials               3
index 29ba1e5..7c24763 100644 (file)
@@ -220,7 +220,7 @@ FTPLoginHost(const FTPCIPtr cip)
                        case 421:       /* 421 Service not available, closing control connection. */
                                result = kErrHostDisconnectedDuringLogin;
                                goto done;
                        case 421:       /* 421 Service not available, closing control connection. */
                                result = kErrHostDisconnectedDuringLogin;
                                goto done;
-                               
+
                        case 331:       /* 331 User name okay, need password. */
                                if ((cip->firewallType == kFirewallNotInUse) || (fwloggedin != 0)) {
                                        if ((cip->pass[0] == '\0') && (cip->passphraseProc != NoGetPassphraseProc))
                        case 331:       /* 331 User name okay, need password. */
                                if ((cip->firewallType == kFirewallNotInUse) || (fwloggedin != 0)) {
                                        if ((cip->pass[0] == '\0') && (cip->passphraseProc != NoGetPassphraseProc))
@@ -271,7 +271,7 @@ FTPLoginHost(const FTPCIPtr cip)
                        case 503:       /* Bad sequence of commands. */
                        case 550:       /* Can't set guest privileges. */
                                goto done;
                        case 503:       /* Bad sequence of commands. */
                        case 550:       /* Can't set guest privileges. */
                                goto done;
-                               
+
                        default:
                        unknown:
                                if (rp->msg.first == NULL) {
                        default:
                        unknown:
                                if (rp->msg.first == NULL) {
@@ -547,7 +547,7 @@ FTPCloseHost(const FTPCIPtr cip)
                        DoneWithResponse(cip, rp);
                }
        }
                        DoneWithResponse(cip, rp);
                }
        }
-       
+
        CloseControlConnection(cip);
 
        /* Dispose dynamic data structures, so you won't leak
        CloseControlConnection(cip);
 
        /* Dispose dynamic data structures, so you won't leak
@@ -700,7 +700,7 @@ FTPDecodeURL(
                if (*cp == '@') {
                        if (at1 == NULL)
                                at1 = cp;
                if (*cp == '@') {
                        if (at1 == NULL)
                                at1 = cp;
-                       else 
+                       else
                                return (kMalformedURL);
                } else if ((*cp == '\0') || (*cp == '/')) {
                        hend = cp;
                                return (kMalformedURL);
                } else if ((*cp == '\0') || (*cp == '/')) {
                        hend = cp;
@@ -755,7 +755,7 @@ FTPDecodeURL(
        if (lastslash == NULL) {
                /* no path, okay */
                return (0);
        if (lastslash == NULL) {
                /* no path, okay */
                return (0);
-       }       
+       }
        *lastslash = '\0';
 
        if ((semi = strchr(lastslash + 1, ';')) != NULL) {
        *lastslash = '\0';
 
        if ((semi = strchr(lastslash + 1, ';')) != NULL) {
@@ -1109,7 +1109,7 @@ FTPRebuildConnectionInfo(const FTPLIPtr lip, const FTPCIPtr cip)
 int
 FTPInitLibrary(const FTPLIPtr lip)
 {
 int
 FTPInitLibrary(const FTPLIPtr lip)
 {
-       struct servent *ftp;    
+       struct servent *ftp;
 
        if (lip == NULL)
                return (kErrBadParameter);
 
        if (lip == NULL)
                return (kErrBadParameter);
index 15fd487..d268640 100644 (file)
@@ -38,7 +38,7 @@ ResponsePtr
 InitResponse(void)
 {
        ResponsePtr rp;
 InitResponse(void)
 {
        ResponsePtr rp;
-       
+
        rp = (ResponsePtr) calloc(SZ(1), sizeof(Response));
        if (rp != NULL)
                InitLineList(&rp->msg);
        rp = (ResponsePtr) calloc(SZ(1), sizeof(Response));
        if (rp != NULL)
                InitLineList(&rp->msg);
@@ -55,7 +55,7 @@ void
 TraceResponse(const FTPCIPtr cip, ResponsePtr rp)
 {
        LinePtr lp;
 TraceResponse(const FTPCIPtr cip, ResponsePtr rp)
 {
        LinePtr lp;
-       
+
        if (rp != NULL) {
                lp = rp->msg.first;
                if (lp != NULL) {
        if (rp != NULL) {
                lp = rp->msg.first;
                if (lp != NULL) {
@@ -74,7 +74,7 @@ void
 PrintResponse(const FTPCIPtr cip, LineListPtr llp)
 {
        LinePtr lp;
 PrintResponse(const FTPCIPtr cip, LineListPtr llp)
 {
        LinePtr lp;
-       
+
        if (llp != NULL) {
                for (lp = llp->first; lp != NULL; lp = lp->next)
                        PrintF(cip, "%s\n", lp->line);
        if (llp != NULL) {
                for (lp = llp->first; lp != NULL; lp = lp->next)
                        PrintF(cip, "%s\n", lp->line);
@@ -221,16 +221,16 @@ eof:
                         * same numerical value of IAC, 255, the sender denotes
                         * that by having an IAC followed by another IAC.
                         */
                         * same numerical value of IAC, 255, the sender denotes
                         * that by having an IAC followed by another IAC.
                         */
-                       
+
                        /* Get the telnet command. */
                        c = fgetc(cin);
                        /* Get the telnet command. */
                        c = fgetc(cin);
-                       
+
                        switch (c) {
                                case WILL:
                                case WONT:
                                        /* Get the option code. */
                                        c = fgetc(cin);
                        switch (c) {
                                case WILL:
                                case WONT:
                                        /* Get the option code. */
                                        c = fgetc(cin);
-                                       
+
                                        /* Tell the other side that we don't want
                                         * to do what they're offering to do.
                                         */
                                        /* Tell the other side that we don't want
                                         * to do what they're offering to do.
                                         */
@@ -241,7 +241,7 @@ eof:
                                case DONT:
                                        /* Get the option code. */
                                        c = fgetc(cin);
                                case DONT:
                                        /* Get the option code. */
                                        c = fgetc(cin);
-                                       
+
                                        /* The other side said they are DOing (or not)
                                         * something, which would happen if our side
                                         * asked them to.  Since we didn't do that,
                                        /* The other side said they are DOing (or not)
                                         * something, which would happen if our side
                                         * asked them to.  Since we didn't do that,
@@ -264,7 +264,7 @@ eof:
 addChar:
                        /* If the buffer supplied has room, add this character to it. */
                        if (n < siz) {
 addChar:
                        /* If the buffer supplied has room, add this character to it. */
                        if (n < siz) {
-                               *cp++ = c;                              
+                               *cp++ = c;
                                ++n;
                        }
                }
                                ++n;
                        }
                }
@@ -414,7 +414,7 @@ GetResponse(const FTPCIPtr cip, ResponsePtr rp)
                /* Read reply, but EOF was there also. */
                rp->hadEof = 1;
        }
                /* Read reply, but EOF was there also. */
                rp->hadEof = 1;
        }
-       
+
        while (continuation) {
 
 #ifdef NO_SIGNALS
        while (continuation) {
 
 #ifdef NO_SIGNALS
@@ -781,7 +781,7 @@ FTPStartDataCmd(const FTPCIPtr cip, int netMode, int type, longest_int startPoin
 
        /* To transfer data, we do these things in order as specifed by
         * the RFC.
 
        /* To transfer data, we do these things in order as specifed by
         * the RFC.
-        * 
+        *
         * First, we tell the other side to set up a data line.  This
         * is done below by calling OpenDataConnection(), which sets up
         * the socket.  When we do that, the other side detects a connection
         * First, we tell the other side to set up a data line.  This
         * is done below by calling OpenDataConnection(), which sets up
         * the socket.  When we do that, the other side detects a connection
@@ -811,7 +811,7 @@ FTPStartDataCmd(const FTPCIPtr cip, int netMode, int type, longest_int startPoin
 #endif /* NO_SIGNALS */
        result = SendCommand(cip, cmdspec, ap);
        va_end(ap);
 #endif /* NO_SIGNALS */
        result = SendCommand(cip, cmdspec, ap);
        va_end(ap);
-       if (result < 0) { 
+       if (result < 0) {
 #ifndef NO_SIGNALS
                if (cip->ctrlTimeout > 0)
                        (void) alarm(0);
 #ifndef NO_SIGNALS
                if (cip->ctrlTimeout > 0)
                        (void) alarm(0);
@@ -866,7 +866,7 @@ done:
 
 
 
 
 
 
-void 
+void
 FTPAbortDataTransfer(const FTPCIPtr cip)
 {
        ResponsePtr rp;
 FTPAbortDataTransfer(const FTPCIPtr cip)
 {
        ResponsePtr rp;
index c2e5155..914fe56 100644 (file)
@@ -51,13 +51,13 @@ FTPGetLocalCWD(char *buf, size_t size)
                cwdBufSize *= 2;
                cwdBuf = (char *) Realloc(cwdBuf, cwdBufSize);
        }
                cwdBufSize *= 2;
                cwdBuf = (char *) Realloc(cwdBuf, cwdBufSize);
        }
-       
+
        return (Strncpy(buf, cwdBuf, size));
 #else
 #ifdef HAVE_GETWD
        static char *cwdBuf = NULL;
        char *dp;
        return (Strncpy(buf, cwdBuf, size));
 #else
 #ifdef HAVE_GETWD
        static char *cwdBuf = NULL;
        char *dp;
-       
+
        /* Due to the way getwd is usually implemented, it's
         * important to have a buffer large enough to hold the
         * whole thing.  getwd usually starts at the end of the
        /* Due to the way getwd is usually implemented, it's
         * important to have a buffer large enough to hold the
         * whole thing.  getwd usually starts at the end of the
@@ -111,7 +111,7 @@ char *
 FGets(char *str, size_t size, FILE *fp)
 {
        char *cp, *nlptr;
 FGets(char *str, size_t size, FILE *fp)
 {
        char *cp, *nlptr;
-       
+
        cp = fgets(str, ((int) size) - 1, fp);
        if (cp != NULL) {
                cp[((int) size) - 1] = '\0';    /* ensure terminator */
        cp = fgets(str, ((int) size) - 1, fp);
        if (cp != NULL) {
                cp[((int) size) - 1] = '\0';    /* ensure terminator */
@@ -166,7 +166,7 @@ GetPwByName(void)
 {
        char *cp;
        struct passwd *pw;
 {
        char *cp;
        struct passwd *pw;
-       
+
        cp = getlogin();
        if (cp == NULL) {
                cp = (char *) getenv("LOGNAME");
        cp = getlogin();
        if (cp == NULL) {
                cp = (char *) getenv("LOGNAME");
@@ -454,14 +454,14 @@ time_t GetUTCOffset(int mon, int mday)
        ZERO(local_tm);
        ZERO(utc_tm);
        utcOffset = 0;
        ZERO(local_tm);
        ZERO(utc_tm);
        utcOffset = 0;
-       
+
        local_tm.tm_year = 94;  /* Doesn't really matter. */
        local_tm.tm_mon = mon;
        local_tm.tm_mday = mday;
        local_tm.tm_hour = 12;
        local_tm.tm_isdst = -1;
        local_t = mktime(&local_tm);
        local_tm.tm_year = 94;  /* Doesn't really matter. */
        local_tm.tm_mon = mon;
        local_tm.tm_mday = mday;
        local_tm.tm_hour = 12;
        local_tm.tm_isdst = -1;
        local_t = mktime(&local_tm);
-       
+
        if (local_t != (time_t) -1) {
                utc_tmptr = gmtime(&local_t);
                utc_tm.tm_year = utc_tmptr->tm_year;
        if (local_t != (time_t) -1) {
                utc_tmptr = gmtime(&local_t);
                utc_tm.tm_year = utc_tmptr->tm_year;
@@ -515,7 +515,7 @@ time_t UnMDTMDate(char *dstr)
                &ut.tm_hour,
                &ut.tm_min,
                &ut.tm_sec) == 6)
                &ut.tm_hour,
                &ut.tm_min,
                &ut.tm_sec) == 6)
-       {       
+       {
                --ut.tm_mon;
                ut.tm_year -= 1900;
                mt = mktime(&ut);
                --ut.tm_mon;
                ut.tm_year -= 1900;
                mt = mktime(&ut);
@@ -1008,7 +1008,7 @@ FilenameExtensionIndicatesASCII(const char *const pathName, const char *const ex
         *
         *      |ext1|ext2|ext3|...|extN|
         *
         *
         *      |ext1|ext2|ext3|...|extN|
         *
-        * I.e, each filename extension is delimited with 
+        * I.e, each filename extension is delimited with
         * a pipe, and we always begin and end the string
         * with a pipe.
         */
         * a pipe, and we always begin and end the string
         * with a pipe.
         */
index 4050f96..d616db0 100644 (file)
@@ -1,8 +1,8 @@
-/* bookmark.c 
+/* bookmark.c
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -296,14 +296,14 @@ OpenBookmarkFile(int *numBookmarks0)
                }
                return NULL;            /* Okay to not have one yet. */
        }
                }
                return NULL;            /* Okay to not have one yet. */
        }
-       
+
        (void) chmod(pathName, 00600);
        if (FGets(line, sizeof(line), fp) == NULL) {
                (void) fprintf(stderr, "%s: invalid format.\n", pathName);
                (void) fclose(fp);
                return NULL;
        }
        (void) chmod(pathName, 00600);
        if (FGets(line, sizeof(line), fp) == NULL) {
                (void) fprintf(stderr, "%s: invalid format.\n", pathName);
                (void) fclose(fp);
                return NULL;
        }
-       
+
        /* Sample line we're looking for:
         * "NcFTP bookmark-file version: 8"
         */
        /* Sample line we're looking for:
         * "NcFTP bookmark-file version: 8"
         */
@@ -328,7 +328,7 @@ OpenBookmarkFile(int *numBookmarks0)
         * "Number of entries: 28" or "# # # 1"
         */
        numBookmarks = -1;
         * "Number of entries: 28" or "# # # 1"
         */
        numBookmarks = -1;
-       
+
        /* At the moment, we can't trust the number stored in the
         * file.  It's there for future use.
         */
        /* At the moment, we can't trust the number stored in the
         * file.  It's there for future use.
         */
@@ -481,7 +481,7 @@ GetBookmark(const char *const bmabbr, Bookmark *bmp)
 static int
 BookmarkSortProc(const void *a, const void *b)
 {
 static int
 BookmarkSortProc(const void *a, const void *b)
 {
-       return (ISTRCMP((*(Bookmark *)a).bookmarkName, (*(Bookmark *)b).bookmarkName)); 
+       return (ISTRCMP((*(Bookmark *)a).bookmarkName, (*(Bookmark *)b).bookmarkName));
 }      /* BookmarkSortProc */
 
 
 }      /* BookmarkSortProc */
 
 
@@ -489,7 +489,7 @@ BookmarkSortProc(const void *a, const void *b)
 static int
 BookmarkSearchProc(const void *key, const void *b)
 {
 static int
 BookmarkSearchProc(const void *key, const void *b)
 {
-       return (ISTRCMP((char *) key, (*(Bookmark *)b).bookmarkName));  
+       return (ISTRCMP((char *) key, (*(Bookmark *)b).bookmarkName));
 }      /* BookmarkSearchProc */
 
 
 }      /* BookmarkSearchProc */
 
 
@@ -821,7 +821,7 @@ DefaultBookmarkName(char *dst, size_t siz, char *src)
        const char *cp;
 
        (void) STRNCPY(str, src);
        const char *cp;
 
        (void) STRNCPY(str, src);
-       
+
        /* Pick the first "significant" part of the hostname.  Usually
         * this is the first word in the name, but if it's something like
         * ftp.unl.edu, we would want to choose "unl" and not "ftp."
        /* Pick the first "significant" part of the hostname.  Usually
         * this is the first word in the name, but if it's something like
         * ftp.unl.edu, we would want to choose "unl" and not "ftp."
index 4a4ae0e..35dd9ae 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 typedef struct Bookmark *BookmarkPtr;
  */
 
 typedef struct Bookmark *BookmarkPtr;
index baa811c..52f3dc9 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
index 84d09b8..574c84b 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -396,7 +396,7 @@ void
 PrintResp(LineListPtr llp)
 {
        LinePtr lp;
 PrintResp(LineListPtr llp)
 {
        LinePtr lp;
-       
+
        if (llp != NULL) {
                for (lp = llp->first; lp != NULL; lp = lp->next) {
                        if ((lp == llp->first) && (ISTRNCMP(lp->line, "CWD command", 11) == 0))
        if (llp != NULL) {
                for (lp = llp->first; lp != NULL; lp = lp->next) {
                        if ((lp == llp->first) && (ISTRNCMP(lp->line, "CWD command", 11) == 0))
@@ -441,7 +441,7 @@ nFTPChdirAndGetCWD(const FTPCIPtr cip, const char *cdCwd, const int quietMode)
                } else {
                        cdCwdLen = strlen(cdCwd);
                        if (strcmp(cdCwd, "..") == 0) {
                } else {
                        cdCwdLen = strlen(cdCwd);
                        if (strcmp(cdCwd, "..") == 0) {
-                               result = RCmd(cip, rp, "CDUP");         
+                               result = RCmd(cip, rp, "CDUP");
                        } else {
                                result = RCmd(cip, rp, "CWD %s", cdCwd);
                        }
                        } else {
                                result = RCmd(cip, rp, "CWD %s", cdCwd);
                        }
@@ -517,7 +517,7 @@ Chdirs(FTPCIPtr cip, const char *const cdCwd)
                cip->errNo = kErrInvalidDirParam;
                return result;
        }
                cip->errNo = kErrInvalidDirParam;
                return result;
        }
-       
+
        if ((cdCwd[0] == '\0') || (strcmp(cdCwd, ".") == 0)) {
                result = 0;
                return (result);
        if ((cdCwd[0] == '\0') || (strcmp(cdCwd, ".") == 0)) {
                result = 0;
                return (result);
@@ -723,7 +723,7 @@ EchoCmd(const int argc, const char **const argv, const CommandPtr cmdp, const Ar
                                        if (np > 0)
                                                (void) printf(" ");
                                        (void) printf("%s", lp->line);
                                        if (np > 0)
                                                (void) printf(" ");
                                        (void) printf("%s", lp->line);
-                                       np++;   
+                                       np++;
                                }
                        }
                }
                                }
                        }
                }
@@ -756,7 +756,7 @@ NcFTPConfirmResumeDownloadProc(
                return (kConfirmResumeProcSaidBestGuess);
 
        tstr[sizeof(tstr) - 1] = '\0';
                return (kConfirmResumeProcSaidBestGuess);
 
        tstr[sizeof(tstr) - 1] = '\0';
-       (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &localmtime)); 
+       (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &localmtime));
        (void) printf(
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                "\nThe local file \"%s\" already exists.\n\tLocal:  %12lld bytes, dated %s.\n",
        (void) printf(
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                "\nThe local file \"%s\" already exists.\n\tLocal:  %12lld bytes, dated %s.\n",
@@ -773,7 +773,7 @@ NcFTPConfirmResumeDownloadProc(
        );
 
        if ((remotemtime != kModTimeUnknown) && (remotesize != kSizeUnknown)) {
        );
 
        if ((remotemtime != kModTimeUnknown) && (remotesize != kSizeUnknown)) {
-               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &remotemtime)); 
+               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &remotemtime));
                (void) printf(
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        "\tRemote: %12lld bytes, dated %s.\n",
                (void) printf(
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        "\tRemote: %12lld bytes, dated %s.\n",
@@ -805,7 +805,7 @@ NcFTPConfirmResumeDownloadProc(
                        remotesize
                );
        } else if (remotemtime != kModTimeUnknown) {
                        remotesize
                );
        } else if (remotemtime != kModTimeUnknown) {
-               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &remotemtime)); 
+               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &remotemtime));
                (void) printf(
                        "\tRemote: size unknown, dated %s.\n",
                        tstr
                (void) printf(
                        "\tRemote: size unknown, dated %s.\n",
                        tstr
@@ -1091,7 +1091,7 @@ commands.  'help <command>' gives a brief description of <command>.\n\n");
 
                /* Leave an extra bit of whitespace for the margins between columns. */
                widestName += 2;
 
                /* Leave an extra bit of whitespace for the margins between columns. */
                widestName += 2;
-               
+
                nCols = (screenColumns + 0) / widestName;
                nRows = nCmds2Print / nCols;
                if ((nCmds2Print % nCols) > 0)
                nCols = (screenColumns + 0) / widestName;
                nRows = nCmds2Print / nCols;
                if ((nCmds2Print % nCols) > 0)
@@ -1205,7 +1205,7 @@ RunBookmarkEditor(char *selectedBmName, size_t dsize)
        OurInstallationPath(ncftpbookmarks, sizeof(ncftpbookmarks), "ncftpbookmarks.exe");
 
 
        OurInstallationPath(ncftpbookmarks, sizeof(ncftpbookmarks), "ncftpbookmarks.exe");
 
 
-       hMailSlot = CreateMailslot(kNcFTPBookmarksMailslot, kNcFTPBookmarksMailslotMsgSize, MAILSLOT_WAIT_FOREVER, NULL); 
+       hMailSlot = CreateMailslot(kNcFTPBookmarksMailslot, kNcFTPBookmarksMailslotMsgSize, MAILSLOT_WAIT_FOREVER, NULL);
 
        if (hMailSlot == INVALID_HANDLE_VALUE) {
                SysPerror("CreateMailslot");
 
        if (hMailSlot == INVALID_HANDLE_VALUE) {
                SysPerror("CreateMailslot");
@@ -1213,7 +1213,7 @@ RunBookmarkEditor(char *selectedBmName, size_t dsize)
                (void) fprintf(stderr, "%s", "This means if you select a bookmark to connect to that NcFTP\n");
                (void) fprintf(stderr, "%s", "will not get the message from %s.\n", "ncftpbookmarks.exe");
        }
                (void) fprintf(stderr, "%s", "This means if you select a bookmark to connect to that NcFTP\n");
                (void) fprintf(stderr, "%s", "will not get the message from %s.\n", "ncftpbookmarks.exe");
        }
+
        winExecResult = WinExec(prog, SW_SHOWNORMAL);
        if (winExecResult <= 31) switch (winExecResult) {
                case ERROR_BAD_FORMAT:
        winExecResult = WinExec(prog, SW_SHOWNORMAL);
        if (winExecResult <= 31) switch (winExecResult) {
                case ERROR_BAD_FORMAT:
@@ -1241,7 +1241,7 @@ RunBookmarkEditor(char *selectedBmName, size_t dsize)
                        &dwRead,
                        NULL
                        );
                        &dwRead,
                        NULL
                        );
-               
+
                if (!rc) {
                        SysPerror("ReadFile");
                } else {
                if (!rc) {
                        SysPerror("ReadFile");
                } else {
@@ -1895,7 +1895,7 @@ LookupCmd(const int argc, const char **const argv, const CommandPtr cmdp, const
 
        ARGSUSED(gUnusedArg);
        shortMode = 1;
 
        ARGSUSED(gUnusedArg);
        shortMode = 1;
-       
+
        GetoptReset();
        while ((opt = Getopt(argc, argv, "v")) >= 0) {
                if (opt == 'v')
        GetoptReset();
        while ((opt = Getopt(argc, argv, "v")) >= 0) {
                if (opt == 'v')
@@ -1922,7 +1922,7 @@ LookupCmd(const int argc, const char **const argv, const CommandPtr cmdp, const
                                Trace(-1, "    Alias:    %s\n", *cpp);
                        for (j = 0, cpp = hp->h_addr_list; *cpp != NULL; cpp++, ++j) {
                                MyInetAddr(ipStr, sizeof(ipStr), hp->h_addr_list, j);
                                Trace(-1, "    Alias:    %s\n", *cpp);
                        for (j = 0, cpp = hp->h_addr_list; *cpp != NULL; cpp++, ++j) {
                                MyInetAddr(ipStr, sizeof(ipStr), hp->h_addr_list, j);
-                               Trace(-1, "    Address:  %s\n", ipStr); 
+                               Trace(-1, "    Address:  %s\n", ipStr);
                        }
                }
        }
                        }
                }
        }
@@ -1975,8 +1975,8 @@ MlsCmd(const int argc, const char **const argv, const CommandPtr cmdp, const Arg
                                linePtr = nextLinePtr)
                        {
                                nextLinePtr = linePtr->next;
                                linePtr = nextLinePtr)
                        {
                                nextLinePtr = linePtr->next;
-                               (void) fprintf(stdout, "%s\n", linePtr->line);  
-                               Trace(0, "%s\n", linePtr->line);        
+                               (void) fprintf(stdout, "%s\n", linePtr->line);
+                               Trace(0, "%s\n", linePtr->line);
                        }
                }
        }
                        }
                }
        }
@@ -1996,8 +1996,8 @@ MlsCmd(const int argc, const char **const argv, const CommandPtr cmdp, const Arg
                                linePtr = nextLinePtr)
                        {
                                nextLinePtr = linePtr->next;
                                linePtr = nextLinePtr)
                        {
                                nextLinePtr = linePtr->next;
-                               (void) fprintf(stdout, "%s\n", linePtr->line);  
-                               Trace(0, "%s\n", linePtr->line);        
+                               (void) fprintf(stdout, "%s\n", linePtr->line);
+                               Trace(0, "%s\n", linePtr->line);
                        }
                }
        }
                        }
                }
        }
@@ -2198,7 +2198,7 @@ DoOpen(void)
                OpenMsg("Connecting to %s...", ipstr);
        } else {
                OpenMsg("Connecting to %s via %s...", gConn.host, gConn.firewallHost);
                OpenMsg("Connecting to %s...", ipstr);
        } else {
                OpenMsg("Connecting to %s via %s...", gConn.host, gConn.firewallHost);
-               Trace(0, "Fw: %s  Type: %d  User: %s  Pass: %s  Port: %u\n", 
+               Trace(0, "Fw: %s  Type: %d  User: %s  Pass: %s  Port: %u\n",
                        gConn.firewallHost,
                        gConn.firewallType,
                        gConn.firewallUser,
                        gConn.firewallHost,
                        gConn.firewallType,
                        gConn.firewallUser,
@@ -2245,7 +2245,7 @@ DoOpen(void)
        gConn.printResponseProc = NcFTPOpenPrintResponseProc;
        gConn.onConnectMsgProc = NcFTPOnConnectMessageProc;
        gConn.onLoginMsgProc = NcFTPOnLoginMessageProc;
        gConn.printResponseProc = NcFTPOpenPrintResponseProc;
        gConn.onConnectMsgProc = NcFTPOnConnectMessageProc;
        gConn.onLoginMsgProc = NcFTPOnLoginMessageProc;
-       gConn.redialStatusProc = NcFTPRedialStatusProc; 
+       gConn.redialStatusProc = NcFTPRedialStatusProc;
 
 #ifdef SIGALRM
        osigalrm = NcSignal(SIGALRM, (FTPSigProc) SIG_IGN);
 
 #ifdef SIGALRM
        osigalrm = NcSignal(SIGALRM, (FTPSigProc) SIG_IGN);
@@ -2254,7 +2254,7 @@ DoOpen(void)
 #else
        result = FTPOpenHost(&gConn);
 #endif
 #else
        result = FTPOpenHost(&gConn);
 #endif
-       
+
        if (gConn.firewallType == kFirewallNotInUse)
                (void) STRNCPY(gConn.host, ohost);              /* Put it back. */
        if (result >= 0) {
        if (gConn.firewallType == kFirewallNotInUse)
                (void) STRNCPY(gConn.host, ohost);              /* Put it back. */
        if (result >= 0) {
@@ -2416,7 +2416,7 @@ OpenCmd(const int argc, const char **const argv, const CommandPtr cmdp, const Ar
        }
 
        if (MayUseFirewall(gConn.host, gFirewallType, gFirewallExceptionList) != 0) {
        }
 
        if (MayUseFirewall(gConn.host, gFirewallType, gFirewallExceptionList) != 0) {
-               gConn.firewallType = gFirewallType; 
+               gConn.firewallType = gFirewallType;
                (void) STRNCPY(gConn.firewallHost, gFirewallHost);
                (void) STRNCPY(gConn.firewallUser, gFirewallUser);
                (void) STRNCPY(gConn.firewallPass, gFirewallPass);
                (void) STRNCPY(gConn.firewallHost, gFirewallHost);
                (void) STRNCPY(gConn.firewallUser, gFirewallUser);
                (void) STRNCPY(gConn.firewallPass, gFirewallPass);
@@ -2435,7 +2435,7 @@ OpenCmd(const int argc, const char **const argv, const CommandPtr cmdp, const Ar
                        (void) STRNCPY(gConn.acct, "");
                        break;
                case 'P':
                        (void) STRNCPY(gConn.acct, "");
                        break;
                case 'P':
-                       gConn.port = atoi(gOptArg);     
+                       gConn.port = atoi(gOptArg);
                        break;
                case 'u':
                        if (uOptInd <= argc)
                        break;
                case 'u':
                        if (uOptInd <= argc)
@@ -2588,7 +2588,7 @@ NcFTPConfirmResumeUploadProc(
        printf("\nThe remote file \"%s\" already exists.\n", *remotepath);
 
        if ((localmtime != kModTimeUnknown) && (localsize != kSizeUnknown)) {
        printf("\nThe remote file \"%s\" already exists.\n", *remotepath);
 
        if ((localmtime != kModTimeUnknown) && (localsize != kSizeUnknown)) {
-               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &localmtime)); 
+               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &localmtime));
                (void) printf(
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        "\tLocal:  %12lld bytes, dated %s.\n",
                (void) printf(
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        "\tLocal:  %12lld bytes, dated %s.\n",
@@ -2620,7 +2620,7 @@ NcFTPConfirmResumeUploadProc(
                        localsize
                );
        } else if (localmtime != kModTimeUnknown) {
                        localsize
                );
        } else if (localmtime != kModTimeUnknown) {
-               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &localmtime)); 
+               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &localmtime));
                (void) printf(
                        "\tLocal:  size unknown, dated %s.\n",
                        tstr
                (void) printf(
                        "\tLocal:  size unknown, dated %s.\n",
                        tstr
@@ -2629,7 +2629,7 @@ NcFTPConfirmResumeUploadProc(
 
        tstr[sizeof(tstr) - 1] = '\0';
        if ((remotemtime != kModTimeUnknown) && (remotesize != kSizeUnknown)) {
 
        tstr[sizeof(tstr) - 1] = '\0';
        if ((remotemtime != kModTimeUnknown) && (remotesize != kSizeUnknown)) {
-               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &remotemtime)); 
+               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &remotemtime));
                (void) printf(
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        "\tRemote: %12lld bytes, dated %s.\n",
                (void) printf(
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        "\tRemote: %12lld bytes, dated %s.\n",
@@ -2657,7 +2657,7 @@ NcFTPConfirmResumeUploadProc(
                        remotesize
                );
        } else if (remotemtime != kModTimeUnknown) {
                        remotesize
                );
        } else if (remotemtime != kModTimeUnknown) {
-               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &remotemtime)); 
+               (void) strftime(tstr, sizeof(tstr) - 1, "%c", localtime((time_t *) &remotemtime));
                (void) printf(
                        "\tRemote: size unknown, dated %s.\n",
                        tstr
                (void) printf(
                        "\tRemote: size unknown, dated %s.\n",
                        tstr
@@ -2971,7 +2971,7 @@ RGlobCmd(const int argc, const char **const argv, const CommandPtr cmdp, const A
                                        if (np > 0)
                                                (void) printf(" ");
                                        (void) printf("%s", lp->line);
                                        if (np > 0)
                                                (void) printf(" ");
                                        (void) printf("%s", lp->line);
-                                       np++;   
+                                       np++;
                                }
                        }
                }
                                }
                        }
                }
@@ -3173,7 +3173,7 @@ GetStartSpoolDate(const char *s)
        STRNCPY(s2, s);
        cp = strchr(s2, ':');
        if ((s2[0] == 'n') || (s2[0] == '+')) {
        STRNCPY(s2, s);
        cp = strchr(s2, ':');
        if ((s2[0] == 'n') || (s2[0] == '+')) {
-               /* "now + XX hours" or 
+               /* "now + XX hours" or
                 * "+ XX hours"
                 */
                cp = strchr(s2, '+');
                 * "+ XX hours"
                 */
                cp = strchr(s2, '+');
index 799852e..7ab5476 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 /* cmds.c */
  */
 
 /* cmds.c */
index ffc275c..55a1612 100644 (file)
@@ -1,10 +1,10 @@
-/* Based on: "$Id: getline.c,v 1.1 2001/12/30 06:30:21 sedwards Exp $"; */
+/* Based on: "$Id$"; */
 static const char copyright[] = "getline:  Copyright (C) 1991, 1992, 1993, Chris Thewalt";
 
 /*
  * Copyright (C) 1991, 1992, 1993 by Chris Thewalt (thewalt@ce.berkeley.edu)
  *
 static const char copyright[] = "getline:  Copyright (C) 1991, 1992, 1993, Chris Thewalt";
 
 /*
  * Copyright (C) 1991, 1992, 1993 by Chris Thewalt (thewalt@ce.berkeley.edu)
  *
- * Permission to use, copy, modify, and distribute this software 
+ * Permission to use, copy, modify, and distribute this software
  * for any purpose and without fee is hereby granted, provided
  * that the above copyright notices appear in all copies and that both the
  * copyright notice and this permission notice appear in supporting
  * for any purpose and without fee is hereby granted, provided
  * that the above copyright notices appear in all copies and that both the
  * copyright notice and this permission notice appear in supporting
@@ -258,7 +258,7 @@ static void
 gl_char_cleanup(void)          /* undo effects of gl_char_init */
 {
 #ifdef __unix__
 gl_char_cleanup(void)          /* undo effects of gl_char_init */
 {
 #ifdef __unix__
-#      ifdef HAVE_TERMIOS_H 
+#      ifdef HAVE_TERMIOS_H
                tcsetattr(0, TCSANOW, &old_termios);
 #      elif defined(TIOCSETN)          /* BSD */
                ioctl(0, TIOCSETN, &old_tty);
                tcsetattr(0, TCSANOW, &old_termios);
 #      elif defined(TIOCSETN)          /* BSD */
                ioctl(0, TIOCSETN, &old_tty);
@@ -422,7 +422,7 @@ gl_getcx(int tlen)
 
 static int
 gl_getcx(int tlen)
 
 static int
 gl_getcx(int tlen)
-{      
+{
        int i, c;
 
        c = (-2);
        int i, c;
 
        c = (-2);
@@ -466,8 +466,8 @@ gl_putc(int c)
 static void
 gl_puts(const char *const buf)
 {
 static void
 gl_puts(const char *const buf)
 {
-    int len; 
-    
+    int len;
+
     if (buf) {
         len = (int) strlen(buf);
         write(1, buf, len);
     if (buf) {
         len = (int) strlen(buf);
         write(1, buf, len);
@@ -638,7 +638,7 @@ getline(char *prompt)
                        gl_check_inputrc_for_vi();
        }
 
                        gl_check_inputrc_for_vi();
        }
 
-    gl_init(); 
+    gl_init();
     gl_prompt = (prompt)? prompt : "";
     gl_buf[0] = 0;
     if (gl_in_hook)
     gl_prompt = (prompt)? prompt : "";
     gl_buf[0] = 0;
     if (gl_in_hook)
@@ -994,7 +994,7 @@ ansi:
 
 static void
 gl_addchar(int c)
 
 static void
 gl_addchar(int c)
-      
+
 /* adds the character c to the input buffer at current location */
 {
     int  i;
 /* adds the character c to the input buffer at current location */
 {
     int  i;
@@ -1022,7 +1022,7 @@ gl_yank(void)
     len = (int) strlen(gl_killbuf);
     if (len > 0) {
        if (gl_overwrite == 0) {
     len = (int) strlen(gl_killbuf);
     if (len > 0) {
        if (gl_overwrite == 0) {
-            if (gl_cnt + len >= GL_BUF_SIZE - 1) 
+            if (gl_cnt + len >= GL_BUF_SIZE - 1)
                gl_error("\n*** Error: getline(): input buffer overflow\n");
             for (i=gl_cnt; i >= gl_pos; i--)
                 gl_buf[i+len] = gl_buf[i];
                gl_error("\n*** Error: getline(): input buffer overflow\n");
             for (i=gl_cnt; i >= gl_pos; i--)
                 gl_buf[i+len] = gl_buf[i];
@@ -1031,7 +1031,7 @@ gl_yank(void)
             gl_fixup(gl_prompt, gl_pos, gl_pos+len);
        } else {
            if (gl_pos + len > gl_cnt) {
             gl_fixup(gl_prompt, gl_pos, gl_pos+len);
        } else {
            if (gl_pos + len > gl_cnt) {
-                if (gl_pos + len >= GL_BUF_SIZE - 1) 
+                if (gl_pos + len >= GL_BUF_SIZE - 1)
                    gl_error("\n*** Error: getline(): input buffer overflow\n");
                gl_buf[gl_pos + len] = 0;
             }
                    gl_error("\n*** Error: getline(): input buffer overflow\n");
                gl_buf[gl_pos + len] = 0;
             }
@@ -1071,12 +1071,12 @@ gl_newline(void)
     int len = gl_cnt;
     int loc = gl_width - 5;    /* shifts line back to start position */
 
     int len = gl_cnt;
     int loc = gl_width - 5;    /* shifts line back to start position */
 
-    if (gl_cnt >= GL_BUF_SIZE - 1) 
+    if (gl_cnt >= GL_BUF_SIZE - 1)
         gl_error("\n*** Error: getline(): input buffer overflow\n");
     if (gl_out_hook) {
        change = gl_out_hook(gl_buf);
         len = (int) strlen(gl_buf);
         gl_error("\n*** Error: getline(): input buffer overflow\n");
     if (gl_out_hook) {
        change = gl_out_hook(gl_buf);
         len = (int) strlen(gl_buf);
-    } 
+    }
     if (loc > len)
        loc = len;
     gl_fixup(gl_prompt, change, loc);  /* must do this before appending \n */
     if (loc > len)
        loc = len;
     gl_fixup(gl_prompt, change, loc);  /* must do this before appending \n */
@@ -1087,7 +1087,7 @@ gl_newline(void)
 
 static void
 gl_del(int loc, int killsave)
 
 static void
 gl_del(int loc, int killsave)
-        
+
 /*
  * Delete a character.  The loc variable can be:
  *    -1 : delete character to left of cursor
 /*
  * Delete a character.  The loc variable can be:
  *    -1 : delete character to left of cursor
@@ -1112,7 +1112,7 @@ gl_del(int loc, int killsave)
 
 static void
 gl_kill(int pos)
 
 static void
 gl_kill(int pos)
-        
+
 /* delete from pos to the end of line */
 {
     if (pos < gl_cnt) {
 /* delete from pos to the end of line */
 {
     if (pos < gl_cnt) {
@@ -1132,7 +1132,7 @@ gl_killword(int direction)
     int i;
 
     if (direction > 0) {               /* forward */
     int i;
 
     if (direction > 0) {               /* forward */
-        while (!isspace(gl_buf[pos]) && pos < gl_cnt) 
+        while (!isspace(gl_buf[pos]) && pos < gl_cnt)
            pos++;
        while (isspace(gl_buf[pos]) && pos < gl_cnt)
            pos++;
            pos++;
        while (isspace(gl_buf[pos]) && pos < gl_cnt)
            pos++;
@@ -1141,7 +1141,7 @@ gl_killword(int direction)
            pos--;
        while (isspace(gl_buf[pos]) && pos > 0)
            pos--;
            pos--;
        while (isspace(gl_buf[pos]) && pos > 0)
            pos--;
-        while (!isspace(gl_buf[pos]) && pos > 0) 
+        while (!isspace(gl_buf[pos]) && pos > 0)
            pos--;
        if (pos < gl_cnt && isspace(gl_buf[pos]))   /* move onto word */
            pos++;
            pos--;
        if (pos < gl_cnt && isspace(gl_buf[pos]))   /* move onto word */
            pos++;
@@ -1162,13 +1162,13 @@ gl_killword(int direction)
 
 static void
 gl_word(int direction)
 
 static void
 gl_word(int direction)
-              
+
 /* move forward or backword one word */
 {
     int pos = gl_pos;
 
     if (direction > 0) {               /* forward */
 /* move forward or backword one word */
 {
     int pos = gl_pos;
 
     if (direction > 0) {               /* forward */
-        while (!isspace(gl_buf[pos]) && pos < gl_cnt) 
+        while (!isspace(gl_buf[pos]) && pos < gl_cnt)
            pos++;
        while (isspace(gl_buf[pos]) && pos < gl_cnt)
            pos++;
            pos++;
        while (isspace(gl_buf[pos]) && pos < gl_cnt)
            pos++;
@@ -1177,7 +1177,7 @@ gl_word(int direction)
            pos--;
        while (isspace(gl_buf[pos]) && pos > 0)
            pos--;
            pos--;
        while (isspace(gl_buf[pos]) && pos > 0)
            pos--;
-        while (!isspace(gl_buf[pos]) && pos > 0) 
+        while (!isspace(gl_buf[pos]) && pos > 0)
            pos--;
        if (pos < gl_cnt && isspace(gl_buf[pos]))   /* move onto word */
            pos++;
            pos--;
        if (pos < gl_cnt && isspace(gl_buf[pos]))   /* move onto word */
            pos++;
@@ -1197,8 +1197,8 @@ gl_redraw(void)
 
 static void
 gl_fixup(const char *prompt, int change, int cursor)
 
 static void
 gl_fixup(const char *prompt, int change, int cursor)
-              
-                      
+
+
 /*
  * This function is used both for redrawing when input changes or for
  * moving within the input line.  The parameters are:
 /*
  * This function is used both for redrawing when input changes or for
  * moving within the input line.  The parameters are:
@@ -1263,7 +1263,7 @@ gl_fixup(const char *prompt, int change, int cursor)
     }
     if (off_right || (off_left && cursor < gl_shift + gl_width - gl_scroll / 2))
        extra = 2;                      /* shift the scrolling boundary */
     }
     if (off_right || (off_left && cursor < gl_shift + gl_width - gl_scroll / 2))
        extra = 2;                      /* shift the scrolling boundary */
-    else 
+    else
        extra = 0;
     new_shift = cursor + extra + gl_scroll - gl_width;
     if (new_shift > 0) {
        extra = 0;
     new_shift = cursor + extra + gl_scroll - gl_width;
     if (new_shift > 0) {
@@ -1286,7 +1286,7 @@ gl_fixup(const char *prompt, int change, int cursor)
        }
        off_right = (gl_cnt > gl_shift + gl_width - 1)? 1 : 0;
        right = (off_right)? gl_shift + gl_width - 2 : gl_cnt;
        }
        off_right = (gl_cnt > gl_shift + gl_width - 1)? 1 : 0;
        right = (off_right)? gl_shift + gl_width - 2 : gl_cnt;
-       new_right = (gl_extent && (right > left + gl_extent))? 
+       new_right = (gl_extent && (right > left + gl_extent))?
                     left + gl_extent : right;
     }
     pad -= (off_right)? gl_width - 1 : gl_cnt - gl_shift;
                     left + gl_extent : right;
     }
     pad -= (off_right)? gl_width - 1 : gl_cnt - gl_shift;
@@ -1304,7 +1304,7 @@ gl_fixup(const char *prompt, int change, int cursor)
        if (off_right && new_right == right) {
            gl_putc('$');
            gl_pos++;
        if (off_right && new_right == right) {
            gl_putc('$');
            gl_pos++;
-       } else { 
+       } else {
            for (i=0; i < pad; i++)     /* erase remains of prev line */
                gl_putc(' ');
            gl_pos += pad;
            for (i=0; i < pad; i++)     /* erase remains of prev line */
                gl_putc(' ');
            gl_pos += pad;
@@ -1372,13 +1372,13 @@ gl_histadd(char *buf)
         hist_init();
         gl_init_done = 0;
     }
         hist_init();
         gl_init_done = 0;
     }
-    while (*p == ' ' || *p == '\t' || *p == '\n') 
+    while (*p == ' ' || *p == '\t' || *p == '\n')
        p++;
     if (*p) {
        len = (int) strlen(buf);
        if (strchr(p, '\n'))    /* previously line already has NL stripped */
            len--;
        p++;
     if (*p) {
        len = (int) strlen(buf);
        if (strchr(p, '\n'))    /* previously line already has NL stripped */
            len--;
-       if ((prev == 0) || ((int) strlen(prev) != len) || 
+       if ((prev == 0) || ((int) strlen(prev) != len) ||
                            strncmp(prev, buf, (size_t) len) != 0) {
             hist_buf[hist_last] = hist_save(buf);
            prev = hist_buf[hist_last];
                            strncmp(prev, buf, (size_t) len) != 0) {
             hist_buf[hist_last] = hist_save(buf);
            prev = hist_buf[hist_last];
@@ -1402,7 +1402,7 @@ hist_prev(void)
     if (hist_buf[hist_pos] != 0 && next != hist_last) {
         hist_pos = next;
         p = hist_buf[hist_pos];
     if (hist_buf[hist_pos] != 0 && next != hist_last) {
         hist_pos = next;
         p = hist_buf[hist_pos];
-    } 
+    }
     if (p == 0) {
        p = hist_empty_elem;
        gl_beep();
     if (p == 0) {
        p = hist_empty_elem;
        gl_beep();
@@ -1419,7 +1419,7 @@ hist_next(void)
     if (hist_pos != hist_last) {
         hist_pos = (hist_pos+1) % HIST_SIZE;
        p = hist_buf[hist_pos];
     if (hist_pos != hist_last) {
         hist_pos = (hist_pos+1) % HIST_SIZE;
        p = hist_buf[hist_pos];
-    } 
+    }
     if (p == 0) {
        p = hist_empty_elem;
        gl_beep();
     if (p == 0) {
        p = hist_empty_elem;
        gl_beep();
@@ -1429,7 +1429,7 @@ hist_next(void)
 
 static char *
 hist_save(char *p)
 
 static char *
 hist_save(char *p)
-        
+
 /* makes a copy of the string */
 {
     char *s = 0;
 /* makes a copy of the string */
 {
     char *s = 0;
@@ -1446,7 +1446,7 @@ hist_save(char *p)
             strcpy(s, p);
         }
     }
             strcpy(s, p);
         }
     }
-    if (s == 0) 
+    if (s == 0)
        gl_error("\n*** Error: hist_save() failed on malloc\n");
     return s;
 }
        gl_error("\n*** Error: hist_save() failed on malloc\n");
     return s;
 }
@@ -1477,7 +1477,7 @@ gl_histsavefile(const char *const path)
                        fprintf(fp, "%s\n", p);
                }
                fclose(fp);
                        fprintf(fp, "%s\n", p);
                }
                fclose(fp);
-       }       
+       }
 }      /* gl_histsavefile */
 
 
 }      /* gl_histsavefile */
 
 
@@ -1516,7 +1516,7 @@ static int   search_pos = 0;      /* current location in search_string */
 static int   search_forw_flg = 0; /* search direction flag */
 static int   search_last = 0;    /* last match found */
 
 static int   search_forw_flg = 0; /* search direction flag */
 static int   search_last = 0;    /* last match found */
 
-static void  
+static void
 search_update(int c)
 {
     if (c == 0) {
 search_update(int c)
 {
     if (c == 0) {
@@ -1547,7 +1547,7 @@ search_update(int c)
     }
 }
 
     }
 }
 
-static void 
+static void
 search_addchar(int c)
 {
     char *loc;
 search_addchar(int c)
 {
     char *loc;
@@ -1575,7 +1575,7 @@ search_addchar(int c)
     }
 }
 
     }
 }
 
-static void     
+static void
 search_term(void)
 {
     gl_search_mode = 0;
 search_term(void)
 {
     gl_search_mode = 0;
@@ -1586,7 +1586,7 @@ search_term(void)
     gl_fixup(gl_prompt, 0, gl_pos);
 }
 
     gl_fixup(gl_prompt, 0, gl_pos);
 }
 
-static void     
+static void
 search_back(int new_search)
 {
     int    found = 0;
 search_back(int new_search)
 {
     int    found = 0;
@@ -1594,8 +1594,8 @@ search_back(int new_search)
 
     search_forw_flg = 0;
     if (gl_search_mode == 0) {
 
     search_forw_flg = 0;
     if (gl_search_mode == 0) {
-       search_last = hist_pos = hist_last;     
-       search_update(0);       
+       search_last = hist_pos = hist_last;
+       search_update(0);
        gl_search_mode = 1;
         gl_buf[0] = 0;
        gl_fixup(search_prompt, 0, 0);
        gl_search_mode = 1;
         gl_buf[0] = 0;
        gl_fixup(search_prompt, 0, 0);
@@ -1612,7 +1612,7 @@ search_back(int new_search)
               if (new_search)
                   search_last = hist_pos;
               found = 1;
               if (new_search)
                   search_last = hist_pos;
               found = 1;
-           } 
+           }
        }
 
     } else {
        }
 
     } else {
@@ -1620,7 +1620,7 @@ search_back(int new_search)
     }
 }
 
     }
 }
 
-static void     
+static void
 search_forw(int new_search)
 {
     int    found = 0;
 search_forw(int new_search)
 {
     int    found = 0;
@@ -1628,8 +1628,8 @@ search_forw(int new_search)
 
     search_forw_flg = 1;
     if (gl_search_mode == 0) {
 
     search_forw_flg = 1;
     if (gl_search_mode == 0) {
-       search_last = hist_pos = hist_last;     
-       search_update(0);       
+       search_last = hist_pos = hist_last;
+       search_update(0);
        gl_search_mode = 1;
         gl_buf[0] = 0;
        gl_fixup(search_prompt, 0, 0);
        gl_search_mode = 1;
         gl_buf[0] = 0;
        gl_fixup(search_prompt, 0, 0);
@@ -1646,7 +1646,7 @@ search_forw(int new_search)
               if (new_search)
                   search_last = hist_pos;
               found = 1;
               if (new_search)
                   search_last = hist_pos;
               found = 1;
-           } 
+           }
        }
     } else {
         gl_beep();
        }
     } else {
         gl_beep();
@@ -1730,14 +1730,14 @@ gl_display_matches(int nused)
                if (ncol < 1)
                        ncol = 1;
 
                if (ncol < 1)
                        ncol = 1;
 
-               colw = (gl_termw - 8) / ncol; 
+               colw = (gl_termw - 8) / ncol;
                nrow = nmax / ncol;
                if ((nused % ncol) != 0)
                        nrow++;
 
                if (nrow > (gl_termh - 4)) {
                        nrow = gl_termh - 4;
                nrow = nmax / ncol;
                if ((nused % ncol) != 0)
                        nrow++;
 
                if (nrow > (gl_termh - 4)) {
                        nrow = gl_termh - 4;
-                       nmax = ncol * nrow; 
+                       nmax = ncol * nrow;
                }
 
                for (i=0; i<(int) sizeof(buf2); i++)
                }
 
                for (i=0; i<(int) sizeof(buf2); i++)
@@ -1814,7 +1814,7 @@ gl_do_tab_completion(char *buf, int *loc, size_t bufsize, int tabtab)
                gl_fixup(gl_prompt, gl_pos, gl_pos + 3);
                memcpy(curposp, ellipsessave, (size_t) 4);
        }
                gl_fixup(gl_prompt, gl_pos, gl_pos + 3);
                memcpy(curposp, ellipsessave, (size_t) 4);
        }
-       
+
        qmode = 0;
        qstart = NULL;
        lastspacestart = NULL;
        qmode = 0;
        qstart = NULL;
        lastspacestart = NULL;
@@ -1851,7 +1851,7 @@ gl_do_tab_completion(char *buf, int *loc, size_t bufsize, int tabtab)
                startp = lastspacestart + 1;
        else
                startp = buf;
                startp = lastspacestart + 1;
        else
                startp = buf;
-       
+
        cp = startp;
        mlen = (curposp - cp);
 
        cp = startp;
        mlen = (curposp - cp);
 
@@ -1873,7 +1873,7 @@ gl_do_tab_completion(char *buf, int *loc, size_t bufsize, int tabtab)
        nalloced = ntoalloc;
        for (i=nused; i<=nalloced; i++)
                gl_matchlist[i] = NULL;
        nalloced = ntoalloc;
        for (i=nused; i<=nalloced; i++)
                gl_matchlist[i] = NULL;
-       
+
        gl_completion_exact_match_extra_char = ' ';
        for (nprocused = 0;; nprocused++) {
                if (nused == nalloced) {
        gl_completion_exact_match_extra_char = ' ';
        for (nprocused = 0;; nprocused++) {
                if (nused == nalloced) {
@@ -2061,7 +2061,7 @@ gl_set_home_dir(const char *homedir)
                                return;
                        }
                }
                                return;
                        }
                }
-               
+
                wdir[0] = '\0';
                if (GetWindowsDirectory(wdir, sizeof(wdir) - 1) < 1)
                        (void) strncpy(wdir, ".", sizeof(wdir));
                wdir[0] = '\0';
                if (GetWindowsDirectory(wdir, sizeof(wdir) - 1) < 1)
                        (void) strncpy(wdir, ".", sizeof(wdir));
@@ -2371,7 +2371,7 @@ gl_local_filename_completion_proc(const char *start, int idx)
                        memcpy(dirtoopen2 + len, "*.*", (size_t) 4);
                else
                        memcpy(dirtoopen2 + len, "\\*.*", (size_t) 5);
                        memcpy(dirtoopen2 + len, "*.*", (size_t) 4);
                else
                        memcpy(dirtoopen2 + len, "\\*.*", (size_t) 5);
-                               
+
                /* "Open" the directory. */
                memset(&ffd, 0, sizeof(ffd));
                searchHandle = FindFirstFile(dirtoopen2, &ffd);
                /* "Open" the directory. */
                memset(&ffd, 0, sizeof(ffd));
                searchHandle = FindFirstFile(dirtoopen2, &ffd);
@@ -2391,13 +2391,13 @@ gl_local_filename_completion_proc(const char *start, int idx)
                filepfx = start + filepfxoffset;
                goto next;
        }
                filepfx = start + filepfxoffset;
                goto next;
        }
-       
+
        for (;;) {
        for (;;) {
-               
+
                name = ffd.cFileName;
                if ((name[0] == '.') && ((name[1] == '\0') || ((name[1] == '.') && (name[2] == '\0'))))
                        goto next;      /* Skip . and .. */
                name = ffd.cFileName;
                if ((name[0] == '.') && ((name[1] == '\0') || ((name[1] == '.') && (name[2] == '\0'))))
                        goto next;      /* Skip . and .. */
-               
+
                if ((filepfxlen == 0) || (strnicmp(name, filepfx, filepfxlen) == 0)) {
                        /* match */
                        len = strlen(name);
                if ((filepfxlen == 0) || (strnicmp(name, filepfx, filepfxlen) == 0)) {
                        /* match */
                        len = strlen(name);
@@ -2429,11 +2429,11 @@ next:
                                searchHandle = NULL;
                                return NULL;
                        }
                                searchHandle = NULL;
                                return NULL;
                        }
-                               
+
                        /* no more items */
                        FindClose(searchHandle);
                        searchHandle = NULL;
                        /* no more items */
                        FindClose(searchHandle);
                        searchHandle = NULL;
-                       
+
                        if (idx == 1) {
                                /* There was exactly one match.
                                 * In this special case, we
                        if (idx == 1) {
                                /* There was exactly one match.
                                 * In this special case, we
index 6953811..fcc702e 100644 (file)
@@ -1,8 +1,8 @@
 #ifndef GETLINE_H
 #define GETLINE_H
 
 #ifndef GETLINE_H
 #define GETLINE_H
 
-/* unix systems can #define POSIX to use termios, otherwise 
- * the bsd or sysv interface will be used 
+/* unix systems can #define POSIX to use termios, otherwise
+ * the bsd or sysv interface will be used
  */
 
 #define GL_BUF_SIZE 1024
  */
 
 #define GL_BUF_SIZE 1024
index e3d79d0..6fe1ecf 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
@@ -68,7 +68,7 @@ Getopt(int nargc, const char **const nargv, const char *const ostr)
                        gOptArg = gOptPlace;
                else if (nargc <= ++gOptInd) {  /* no arg */
                        gOptPlace = kGetoptErrMsg;
                        gOptArg = gOptPlace;
                else if (nargc <= ++gOptInd) {  /* no arg */
                        gOptPlace = kGetoptErrMsg;
-                       if (gOptErr) 
+                       if (gOptErr)
                                (void) fprintf(stderr, "%s%s%c\n", *nargv, ": option requires an argument -- ", gOptOpt);
                        return(kGetoptBadChar);
                } else                                             /* white space */
                                (void) fprintf(stderr, "%s%s%c\n", *nargv, ": option requires an argument -- ", gOptOpt);
                        return(kGetoptBadChar);
                } else                                             /* white space */
index 3fa5d89..cc22059 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #define kGetoptBadChar   ((int) '?')
  */
 
 #define kGetoptBadChar   ((int) '?')
index 0d24d9c..9a304e1 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
index bfb9d6f..9cad588 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #if defined(WIN32) || defined(_WINDOWS)
  */
 
 #if defined(WIN32) || defined(_WINDOWS)
index cf2c236..7a31d0a 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -198,7 +198,7 @@ LsC(FileInfoListPtr dirp, int endChars, FILE *stream)
        ncol = (screenColumns - 1) / ((int) dirp->maxFileLen + 2 + /*1or0*/ endChars);
        if (ncol < 1)
                ncol = 1;
        ncol = (screenColumns - 1) / ((int) dirp->maxFileLen + 2 + /*1or0*/ endChars);
        if (ncol < 1)
                ncol = 1;
-       colw = (screenColumns - 1) / ncol; 
+       colw = (screenColumns - 1) / ncol;
        n = dirp->nFileInfos;
        nrow = n / ncol;
        if ((n % ncol) != 0)
        n = dirp->nFileInfos;
        nrow = n / ncol;
        if ((n % ncol) != 0)
@@ -599,15 +599,15 @@ Ls(const char *const item, int listmode, const char *const options, FILE *stream
        }
 
        if (rlisted != 0) {
        }
 
        if (rlisted != 0) {
-               Trace(0, "Remote listing contents {\n");        
+               Trace(0, "Remote listing contents {\n");
                for (linePtr = dirContents.first;
                        linePtr != NULL;
                        linePtr = nextLinePtr)
                {
                        nextLinePtr = linePtr->next;
                for (linePtr = dirContents.first;
                        linePtr != NULL;
                        linePtr = nextLinePtr)
                {
                        nextLinePtr = linePtr->next;
-                       Trace(0, "    %s\n", linePtr->line);    
+                       Trace(0, "    %s\n", linePtr->line);
                }
                }
-               Trace(0, "}\n");        
+               Trace(0, "}\n");
        }
 
        if (parsed >= 0) {
        }
 
        if (parsed >= 0) {
@@ -629,16 +629,16 @@ Ls(const char *const item, int listmode, const char *const options, FILE *stream
                        linePtr = nextLinePtr)
                {
                        nextLinePtr = linePtr->next;
                        linePtr = nextLinePtr)
                {
                        nextLinePtr = linePtr->next;
-                       (void) fprintf(stream, "%s\n", linePtr->line);  
-                       Trace(0, "    %s\n", linePtr->line);    
+                       (void) fprintf(stream, "%s\n", linePtr->line);
+                       Trace(0, "    %s\n", linePtr->line);
                }
        }
 
        DisposeLineListContents(&dirContents);
 }      /* Ls */
 
                }
        }
 
        DisposeLineListContents(&dirContents);
 }      /* Ls */
 
-       
-       
+
+
 #if defined(WIN32) || defined(_WINDOWS)
 /* Prints a local directory listing in the specified format on the specified
  * output stream.
 #if defined(WIN32) || defined(_WINDOWS)
 /* Prints a local directory listing in the specified format on the specified
  * output stream.
@@ -716,7 +716,7 @@ LLs(const char *const item, int listmode, const char *const options, FILE *strea
                if (strpbrk(itempath, "*?") == NULL)
                        STRNCAT(itempath, "\\*.*");
        }
                if (strpbrk(itempath, "*?") == NULL)
                        STRNCAT(itempath, "\\*.*");
        }
-       
+
        InitLineList(&ll);
        result = FTPLocalGlob(&gConn, &ll, itempath, kGlobYes);
        if (result < 0) {
        InitLineList(&ll);
        result = FTPLocalGlob(&gConn, &ll, itempath, kGlobYes);
        if (result < 0) {
@@ -727,7 +727,7 @@ LLs(const char *const item, int listmode, const char *const options, FILE *strea
        if (LineListToFileInfoList(&ll, &fil) < 0)
                return;
        DisposeLineListContents(&ll);
        if (LineListToFileInfoList(&ll, &fil) < 0)
                return;
        DisposeLineListContents(&ll);
-       
+
        for (fip = fil.first; fip != NULL; fip = fip2) {
                fip2 = fip->next;
                if (Stat(fip->relname, &st) < 0) {
        for (fip = fil.first; fip != NULL; fip = fip2) {
                fip2 = fip->next;
                if (Stat(fip->relname, &st) < 0) {
@@ -772,7 +772,7 @@ LLs(const char *const item, int listmode, const char *const options, FILE *strea
                else
                        LsC(&fil, endChars, stream);
        }
                else
                        LsC(&fil, endChars, stream);
        }
-       
+
        DisposeFileInfoListContents(&fil);
 }      /* LLs */
 #endif
        DisposeFileInfoListContents(&fil);
 }      /* LLs */
 #endif
index 17491e0..6882ea9 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #define kLsCacheItemLifetime 900       /* seconds */
  */
 
 #define kLsCacheItemLifetime 900       /* seconds */
index 1e02f17..5577235 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -202,7 +202,7 @@ SetStartupURL(const char *const urlgiven)
                }
 
                if (MayUseFirewall(gConn.host, gFirewallType, gFirewallExceptionList) != 0) {
                }
 
                if (MayUseFirewall(gConn.host, gFirewallType, gFirewallExceptionList) != 0) {
-                       gConn.firewallType = gFirewallType; 
+                       gConn.firewallType = gFirewallType;
                        (void) STRNCPY(gConn.firewallHost, gFirewallHost);
                        (void) STRNCPY(gConn.firewallUser, gFirewallUser);
                        (void) STRNCPY(gConn.firewallPass, gFirewallPass);
                        (void) STRNCPY(gConn.firewallHost, gFirewallHost);
                        (void) STRNCPY(gConn.firewallUser, gFirewallUser);
                        (void) STRNCPY(gConn.firewallPass, gFirewallPass);
@@ -217,7 +217,7 @@ SetStartupURL(const char *const urlgiven)
                }
                gURLMode = 1;
                if (MayUseFirewall(gConn.host, gFirewallType, gFirewallExceptionList) != 0) {
                }
                gURLMode = 1;
                if (MayUseFirewall(gConn.host, gFirewallType, gFirewallExceptionList) != 0) {
-                       gConn.firewallType = gFirewallType; 
+                       gConn.firewallType = gFirewallType;
                        (void) STRNCPY(gConn.firewallHost, gFirewallHost);
                        (void) STRNCPY(gConn.firewallUser, gFirewallUser);
                        (void) STRNCPY(gConn.firewallPass, gFirewallPass);
                        (void) STRNCPY(gConn.firewallHost, gFirewallHost);
                        (void) STRNCPY(gConn.firewallUser, gFirewallUser);
                        (void) STRNCPY(gConn.firewallPass, gFirewallPass);
@@ -334,7 +334,7 @@ PostInit(void)
        if (gNumProgramRuns <= 1)
                (void) printf("\n%s\n", gCopyright + 5);
 
        if (gNumProgramRuns <= 1)
                (void) printf("\n%s\n", gCopyright + 5);
 
-       Trace(0, "Fw: %s  Type: %d  User: %s  Pass: %s  Port: %u\n", 
+       Trace(0, "Fw: %s  Type: %d  User: %s  Pass: %s  Port: %u\n",
                gFirewallHost,
                gFirewallType,
                gFirewallUser,
                gFirewallHost,
                gFirewallType,
                gFirewallUser,
@@ -430,7 +430,7 @@ main(int argc, const char **const argv)
 
        while ((c = Getopt(argc, argv, "P:u:p:j:J:rd:g:FVLD")) > 0) switch(c) {
                case 'P':
 
        while ((c = Getopt(argc, argv, "P:u:p:j:J:rd:g:FVLD")) > 0) switch(c) {
                case 'P':
-                       gConn.port = atoi(gOptArg);     
+                       gConn.port = atoi(gOptArg);
                        break;
                case 'u':
                        (void) STRNCPY(gConn.user, gOptArg);
                        break;
                case 'u':
                        (void) STRNCPY(gConn.user, gOptArg);
index 9b90513..90fded7 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 /* main.c */
  */
 
 /* main.c */
index 1a6ad79..c11d061 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -478,7 +478,7 @@ HasSeenOneTimeMessage(const char *const msg)
 {
        char buf[256];
        char *a, *b;
 {
        char buf[256];
        char *a, *b;
-       
+
        memcpy(buf, gOneTimeMessagesSeen, sizeof(buf));
        for (a = buf; (b = strtok(a, ",\n")) != NULL; a = NULL) {
                if (strcmp(msg, b) == 0)
        memcpy(buf, gOneTimeMessagesSeen, sizeof(buf));
        for (a = buf; (b = strtok(a, ",\n")) != NULL; a = NULL) {
                if (strcmp(msg, b) == 0)
@@ -499,7 +499,7 @@ SetSeenOneTimeMessage(const char *const msg)
        else {
                STRNCAT(gOneTimeMessagesSeen, ",");
                STRNCAT(gOneTimeMessagesSeen, msg);
        else {
                STRNCAT(gOneTimeMessagesSeen, ",");
                STRNCAT(gOneTimeMessagesSeen, msg);
-       }       
+       }
 }      /* SetSeenOneTimeMessage */
 
 
 }      /* SetSeenOneTimeMessage */
 
 
index 2065643..ca6dcd3 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #if defined(WIN32) || defined(_WINDOWS)
  */
 
 #if defined(WIN32) || defined(_WINDOWS)
index d421524..490b6b9 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
index 1494237..0559f2f 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -190,7 +190,7 @@ try \"get -T\" to resume the directory transfer.\n\n");
 
                                FileToURL(url, sizeof(url), cip->rname, gRemoteCWD, cip->startingWorkingDirectory, cip->user, cip->pass, cip->host, cip->port);
                                LogXfer((cip->netMode == kNetReading) ? "get" : "put", url);
 
                                FileToURL(url, sizeof(url), cip->rname, gRemoteCWD, cip->startingWorkingDirectory, cip->user, cip->pass, cip->host, cip->port);
                                LogXfer((cip->netMode == kNetReading) ? "get" : "put", url);
-                       }       
+                       }
 #endif
                        break;
        }
 #endif
                        break;
        }
@@ -332,7 +332,7 @@ PrStatBar(const FTPCIPtr cip, int mode)
 
                                FileToURL(url, sizeof(url), cip->rname, gRemoteCWD, cip->startingWorkingDirectory, cip->user, cip->pass, cip->host, cip->port);
                                LogXfer((cip->netMode == kNetReading) ? "get" : "put", url);
 
                                FileToURL(url, sizeof(url), cip->rname, gRemoteCWD, cip->startingWorkingDirectory, cip->user, cip->pass, cip->host, cip->port);
                                LogXfer((cip->netMode == kNetReading) ? "get" : "put", url);
-                       }       
+                       }
 #endif
                        break;
        }
 #endif
                        break;
        }
@@ -373,7 +373,7 @@ PrPhilBar(const FTPCIPtr cip, int mode)
                                (cip->netMode == kNetReading) ? "Receiving" : "Sending",
                                cip->lname
                        );
                                (cip->netMode == kNetReading) ? "Receiving" : "Sending",
                                cip->lname
                        );
-                       
+
                        for (i=0; i < (int) sizeof(bar) - 1; i++)
                                bar[i] = '=';
                        bar[i] = '\0';
                        for (i=0; i < (int) sizeof(bar) - 1; i++)
                                bar[i] = '=';
                        bar[i] = '\0';
@@ -386,11 +386,11 @@ PrPhilBar(const FTPCIPtr cip, int mode)
                        maxBarLen = gScreenColumns - 1 - 28;
                        for (s = cip->expectedSize; s > 0; s /= 10L)
                                maxBarLen--;
                        maxBarLen = gScreenColumns - 1 - 28;
                        for (s = cip->expectedSize; s > 0; s /= 10L)
                                maxBarLen--;
-                       
+
                        /* Create a specification we can hand to printf. */
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        (void) sprintf(spec1, "      0 %%%ds %%lld bytes. ETA: --:--", maxBarLen);
                        /* Create a specification we can hand to printf. */
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        (void) sprintf(spec1, "      0 %%%ds %%lld bytes. ETA: --:--", maxBarLen);
-                               
+
                        /* Print the first invocation, which is an empty graph
                         * plus the other stuff.
                         */
                        /* Print the first invocation, which is an empty graph
                         * plus the other stuff.
                         */
@@ -418,7 +418,7 @@ PrPhilBar(const FTPCIPtr cip, int mode)
                         */
                        if (curBarLen < 1)
                                curBarLen = 1;
                         */
                        if (curBarLen < 1)
                                curBarLen = 1;
-                       
+
                        bar[curBarLen - 1] = '>';
                        bar[curBarLen] = '\0';
 
                        bar[curBarLen - 1] = '>';
                        bar[curBarLen] = '\0';
 
@@ -426,27 +426,27 @@ PrPhilBar(const FTPCIPtr cip, int mode)
                        STRNCPY(spec1, "\r%3d%%  0 ");
 
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
                        STRNCPY(spec1, "\r%3d%%  0 ");
 
 #if defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_LLD)
-                       (void) sprintf(spec3, "%%%ds %%lld bytes. %s%%3d:%%02d", 
+                       (void) sprintf(spec3, "%%%ds %%lld bytes. %s%%3d:%%02d",
                                maxBarLen - curBarLen,
                                "ETA:"
                        );
 #elif defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_QD)
                                maxBarLen - curBarLen,
                                "ETA:"
                        );
 #elif defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_QD)
-                       (void) sprintf(spec3, "%%%ds %%qd bytes. %s%%3d:%%02d", 
+                       (void) sprintf(spec3, "%%%ds %%qd bytes. %s%%3d:%%02d",
                                maxBarLen - curBarLen,
                                "ETA:"
                        );
 #elif defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_I64D)
                                maxBarLen - curBarLen,
                                "ETA:"
                        );
 #elif defined(HAVE_LONG_LONG) && defined(PRINTF_LONG_LONG_I64D)
-                       (void) sprintf(spec3, "%%%ds %%I64d bytes. %s%%3d:%%02d", 
+                       (void) sprintf(spec3, "%%%ds %%I64d bytes. %s%%3d:%%02d",
                                maxBarLen - curBarLen,
                                "ETA:"
                        );
 #else
                                maxBarLen - curBarLen,
                                "ETA:"
                        );
 #else
-                       (void) sprintf(spec3, "%%%ds %%ld bytes. %s%%3d:%%02d", 
+                       (void) sprintf(spec3, "%%%ds %%ld bytes. %s%%3d:%%02d",
                                maxBarLen - curBarLen,
                                "ETA:"
                        );
 #endif
                                maxBarLen - curBarLen,
                                "ETA:"
                        );
 #endif
-                       
+
                        /* We also show the percentage as a number at the left side. */
                        perc = (int) (cip->percentCompleted);
                        secsLeft = (int) (cip->secLeft);
                        /* We also show the percentage as a number at the left side. */
                        perc = (int) (cip->percentCompleted);
                        secsLeft = (int) (cip->secLeft);
@@ -456,7 +456,7 @@ PrPhilBar(const FTPCIPtr cip, int mode)
                                minLeft = 999;
                                secsLeft = 59;
                        }
                                minLeft = 999;
                                secsLeft = 59;
                        }
-                       
+
                        /* Print the updated information. */
                        fprintf(stderr, spec1, perc);
                        fprintf(stderr, "%s%s%s", tcap_reverse, bar, tcap_normal);
                        /* Print the updated information. */
                        fprintf(stderr, spec1, perc);
                        fprintf(stderr, "%s%s%s", tcap_reverse, bar, tcap_normal);
@@ -491,7 +491,7 @@ PrPhilBar(const FTPCIPtr cip, int mode)
 
                                FileToURL(url, sizeof(url), cip->rname, gRemoteCWD, cip->startingWorkingDirectory, cip->user, cip->pass, cip->host, cip->port);
                                LogXfer((cip->netMode == kNetReading) ? "get" : "put", url);
 
                                FileToURL(url, sizeof(url), cip->rname, gRemoteCWD, cip->startingWorkingDirectory, cip->user, cip->pass, cip->host, cip->port);
                                LogXfer((cip->netMode == kNetReading) ? "get" : "put", url);
-                       }       
+                       }
 #endif
                        break;
        }
 #endif
                        break;
        }
index 90c613d..dea752c 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #define kKilobyte 1024
  */
 
 #define kKilobyte 1024
index 0246e74..836d52b 100644 (file)
@@ -6,7 +6,7 @@
  * Note: It should still be simple to backport the old GNU Readline
  * support in here.  Feel free to do that if you hate NcFTP's built-in
  * implementation.
  * Note: It should still be simple to backport the old GNU Readline
  * support in here.  Feel free to do that if you hate NcFTP's built-in
  * implementation.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -163,7 +163,7 @@ InitTermcap(void)
        gXterm = gXtermTitle = 1;
 #else
        const char *term;
        gXterm = gXtermTitle = 1;
 #else
        const char *term;
-       
+
        gXterm = gXtermTitle = 0;
        gCurXtermTitleStr[0] = '\0';
 
        gXterm = gXtermTitle = 0;
        gCurXtermTitleStr[0] = '\0';
 
@@ -595,7 +595,7 @@ CompletionFunction(const char *text, int state)
        } else if ((flags & kCompletePrefOpt) != 0) {
                cp = PrefOptCompletionFunction(text, state);
                return cp;
        } else if ((flags & kCompletePrefOpt) != 0) {
                cp = PrefOptCompletionFunction(text, state);
                return cp;
-       }       
+       }
        return NULL;
 }      /* CompletionFunction */
 
        return NULL;
 }      /* CompletionFunction */
 
index 8508682..b6bdc36 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #if defined(WIN32) || defined(_WINDOWS)
  */
 
 #if defined(WIN32) || defined(_WINDOWS)
index d1b87d8..c8df4eb 100644 (file)
@@ -5,7 +5,7 @@
 #define IDI_NCFTP_ICON                  101
 
 // Next default values for new objects
 #define IDI_NCFTP_ICON                  101
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        102
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        102
index ad0c3b5..0a35cfd 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -168,7 +168,7 @@ GetCommandByName(const char *const name, int wantExactMatch)
                 * to match only one name in the list.
                 */
                canp = (CommandPtr) bsearch(name, gCommands, gNumCommands, sizeof(Command), (bsearch_proc_t) CommandSubSearchCmp);
                 * to match only one name in the list.
                 */
                canp = (CommandPtr) bsearch(name, gCommands, gNumCommands, sizeof(Command), (bsearch_proc_t) CommandSubSearchCmp);
-               
+
                if (canp != kNoCommand) {
                        /* Check the entry above us and see if the name we're looking
                         * for would match that, too.
                if (canp != kNoCommand) {
                        /* Check the entry above us and see if the name we're looking
                         * for would match that, too.
@@ -574,7 +574,7 @@ CommandShell(void)
                                ai.noglobargv, 0);
                        if (bUsed <= 0)
                                break;
                                ai.noglobargv, 0);
                        if (bUsed <= 0)
                                break;
-                       tUsed += bUsed; 
+                       tUsed += bUsed;
                        if (ai.cargc == 0)
                                continue;
                        gRunningCommand = 1;
                        if (ai.cargc == 0)
                                continue;
                        gRunningCommand = 1;
index 7ce6190..f6bbbd1 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 typedef struct ArgvInfo {
  */
 
 typedef struct ArgvInfo {
index c34fd1b..42189ad 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -34,7 +34,7 @@ TruncBatchLog(void)
        time_t t;
        int fd;
 
        time_t t;
        int fd;
 
-       if (gOurDirectoryPath[0] != '\0') { 
+       if (gOurDirectoryPath[0] != '\0') {
                time(&t);
                t -= 86400;
                (void) OurDirectoryPath(f, sizeof(f), kSpoolLog);
                time(&t);
                t -= 86400;
                (void) OurDirectoryPath(f, sizeof(f), kSpoolLog);
@@ -59,7 +59,7 @@ MkSpoolDir(char *sdir, size_t size)
        *sdir = '\0';
 
        /* Don't create in root directory. */
        *sdir = '\0';
 
        /* Don't create in root directory. */
-       if (gOurDirectoryPath[0] != '\0') { 
+       if (gOurDirectoryPath[0] != '\0') {
                (void) OurDirectoryPath(sdir, size, kSpoolDir);
                if ((stat(sdir, &st) < 0) && (MkDirs(sdir, 00700) < 0)) {
                        perror(sdir);
                (void) OurDirectoryPath(sdir, size, kSpoolDir);
                if ((stat(sdir, &st) < 0) && (MkDirs(sdir, 00700) < 0)) {
                        perror(sdir);
@@ -374,7 +374,7 @@ RunBatch(int Xstruct, const FTPCIPtr cip)
        }
        prog = ncftpbatch;
        OurInstallationPath(ncftpbatch, sizeof(ncftpbatch), "ncftpbatch.exe");
        }
        prog = ncftpbatch;
        OurInstallationPath(ncftpbatch, sizeof(ncftpbatch), "ncftpbatch.exe");
-       
+
        winExecResult = WinExec(prog, SW_SHOWNORMAL);
        if (winExecResult <= 31) switch (winExecResult) {
                case ERROR_BAD_FORMAT:
        winExecResult = WinExec(prog, SW_SHOWNORMAL);
        if (winExecResult <= 31) switch (winExecResult) {
                case ERROR_BAD_FORMAT:
index 14a4d98..2d65aa0 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #define kSpoolDir "spool"
  */
 
 #define kSpoolDir "spool"
index 7363754..83307c2 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #if defined(HAVE_CONFIG_H)
  */
 
 #if defined(HAVE_CONFIG_H)
index a051a5e..409fff8 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
index dabe0c6..d192f85 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #if defined(WIN32) || defined(_WINDOWS)
  */
 
 #if defined(WIN32) || defined(_WINDOWS)
index f4cf473..57cefff 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 #include "syshdrs.h"
  */
 
 #include "syshdrs.h"
@@ -216,7 +216,7 @@ GetHostEntry(const char *host, struct in_addr *ip_address)
 {
        struct in_addr ip;
        struct hostent *hp;
 {
        struct in_addr ip;
        struct hostent *hp;
-       
+
        /* See if the host was given in the dotted IP format, like "36.44.0.2."
         * If it was, inet_addr will convert that to a 32-bit binary value;
         * it not, inet_addr will return (-1L).
        /* See if the host was given in the dotted IP format, like "36.44.0.2."
         * If it was, inet_addr will convert that to a 32-bit binary value;
         * it not, inet_addr will return (-1L).
@@ -524,11 +524,11 @@ InitOurDirectory(void)
                dwSize = (DWORD) (sizeof(gOurInstallationPath) - 1);
                dwType = 0;
                if (RegQueryValueEx(
                dwSize = (DWORD) (sizeof(gOurInstallationPath) - 1);
                dwType = 0;
                if (RegQueryValueEx(
-                       hkey, 
-                       NULL, 
-                       (DWORD *) 0, 
-                       &dwType, 
-                       (LPBYTE) gOurInstallationPath, 
+                       hkey,
+                       NULL,
+                       (DWORD *) 0,
+                       &dwType,
+                       (LPBYTE) gOurInstallationPath,
                        &dwSize) == ERROR_SUCCESS)
                {
                        // This gave us the path to ncftp.exe;
                        &dwSize) == ERROR_SUCCESS)
                {
                        // This gave us the path to ncftp.exe;
@@ -542,7 +542,7 @@ InitOurDirectory(void)
                }
                RegCloseKey(hkey);
        }
                }
                RegCloseKey(hkey);
        }
-       
+
        if (gOurInstallationPath[0] == '\0') {
                if (GetModuleFileName(NULL, gOurInstallationPath, (DWORD) sizeof(gOurInstallationPath) - 1) <= 0) {
                        ZeroMemory(gOurInstallationPath, (DWORD) sizeof(gOurInstallationPath));
        if (gOurInstallationPath[0] == '\0') {
                if (GetModuleFileName(NULL, gOurInstallationPath, (DWORD) sizeof(gOurInstallationPath) - 1) <= 0) {
                        ZeroMemory(gOurInstallationPath, (DWORD) sizeof(gOurInstallationPath));
@@ -744,12 +744,12 @@ MayUseFirewall(const char *const hn, int firewallType, const char *const firewal
 
 
 
 
 
 
-int 
+int
 StrToBool(const char *const s)
 {
        int c;
        int result;
 StrToBool(const char *const s)
 {
        int c;
        int result;
-       
+
        c = *s;
        if (isupper(c))
                c = tolower(c);
        c = *s;
        if (isupper(c))
                c = tolower(c);
@@ -941,7 +941,7 @@ time_t UnDate(char *dstr)
                &ut.tm_hour,
                &ut.tm_min,
                &ut.tm_sec) == 6)
                &ut.tm_hour,
                &ut.tm_min,
                &ut.tm_sec) == 6)
-       {       
+       {
                --ut.tm_mon;
                ut.tm_year -= 1900;
                result = mktime(&ut);
                --ut.tm_mon;
                ut.tm_year -= 1900;
                result = mktime(&ut);
@@ -1121,7 +1121,7 @@ DecodeDirectoryURL(
 void SysPerror(const char *const errMsg)
 {
        char reason[128];
 void SysPerror(const char *const errMsg)
 {
        char reason[128];
-       
+
        FormatMessage(
                FORMAT_MESSAGE_FROM_SYSTEM,
                NULL,
        FormatMessage(
                FORMAT_MESSAGE_FROM_SYSTEM,
                NULL,
index ef38e71..e434424 100644 (file)
@@ -2,7 +2,7 @@
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
  *
  * Copyright (c) 1992-2001 by Mike Gleason.
  * All rights reserved.
- * 
+ *
  */
 
 typedef int (*qsort_proc_t)(const void *, const void *);
  */
 
 typedef int (*qsort_proc_t)(const void *, const void *);
index a8676b8..13a49bc 100644 (file)
@@ -60,7 +60,7 @@ SClose(int sfd, int tlen)
                }
                if (errno != EINTR)
                        break;
                }
                if (errno != EINTR)
                        break;
-       } 
+       }
        alarm(0);
        (void) SSignal(SIGALRM, (sio_sigproc_t) sigalrm);
 
        alarm(0);
        (void) SSignal(SIGALRM, (sio_sigproc_t) sigalrm);
 
index 31b2963..49979b4 100644 (file)
@@ -74,10 +74,10 @@ SConnect(int sfd, const struct sockaddr_in *const addr, int tlen)
        errno = 0;
        result = connect(sfd, (struct sockaddr *) addr,
                        (int) sizeof(struct sockaddr_in));
        errno = 0;
        result = connect(sfd, (struct sockaddr *) addr,
                        (int) sizeof(struct sockaddr_in));
-       if (result == 0) 
+       if (result == 0)
                return 0;       /* Already?!? */
 
                return 0;       /* Already?!? */
 
-       if ((result < 0) 
+       if ((result < 0)
 #if defined(WIN32) || defined(_WINDOWS)
                && ((wsaErrno = WSAGetLastError()) != WSAEWOULDBLOCK)
                && (wsaErrno != WSAEINPROGRESS)
 #if defined(WIN32) || defined(_WINDOWS)
                && ((wsaErrno = WSAGetLastError()) != WSAEWOULDBLOCK)
                && (wsaErrno != WSAEINPROGRESS)
@@ -105,7 +105,7 @@ SConnect(int sfd, const struct sockaddr_in *const addr, int tlen)
                        /* ready */
                        break;
                } else if (result == 0) {
                        /* ready */
                        break;
                } else if (result == 0) {
-                       /* timeout */           
+                       /* timeout */
                        errno = ETIMEDOUT;
                        SETWSATIMEOUTERR
                        /* Don't bother turning off FIONBIO */
                        errno = ETIMEDOUT;
                        SETWSATIMEOUTERR
                        /* Don't bother turning off FIONBIO */
index f435b17..dee6e53 100644 (file)
@@ -144,7 +144,7 @@ SRead(int sfd, char *const buf0, size_t size, int tlen, int retry)
                        }
                        goto done;
                }
                        }
                        goto done;
                }
-               
+
                if (!firstRead || ((retry & kNoFirstSelect) == 0)) {
                        forever {
                                errno = 0;
                if (!firstRead || ((retry & kNoFirstSelect) == 0)) {
                        forever {
                                errno = 0;
@@ -157,7 +157,7 @@ SRead(int sfd, char *const buf0, size_t size, int tlen, int retry)
                                        /* ready */
                                        break;
                                } else if (result == 0) {
                                        /* ready */
                                        break;
                                } else if (result == 0) {
-                                       /* timeout */           
+                                       /* timeout */
                                        nread = size - nleft;
                                        if ((nread > 0) && ((retry & (kFullBufferRequired|kFullBufferRequiredExceptLast)) == 0))
                                                return (nread);
                                        nread = size - nleft;
                                        if ((nread > 0) && ((retry & (kFullBufferRequired|kFullBufferRequiredExceptLast)) == 0))
                                                return (nread);
index d7b2523..78a095a 100644 (file)
@@ -72,7 +72,7 @@ DisposeSReadlineInfo(SReadlineInfo *srl)
  * set buf[nread - 1] = '\0', if nread > 0.
  */
 
  * set buf[nread - 1] = '\0', if nread > 0.
  */
 
-int 
+int
 SReadline(SReadlineInfo *srl, char *const linebuf, size_t linebufsize)
 {
        int err;
 SReadline(SReadlineInfo *srl, char *const linebuf, size_t linebufsize)
 {
        int err;
index f4a518a..4f7c233 100644 (file)
@@ -133,7 +133,7 @@ SRecv(int sfd, char *const buf0, size_t size, int fl, int tlen, int retry)
                                /* ready */
                                break;
                        } else if (result == 0) {
                                /* ready */
                                break;
                        } else if (result == 0) {
-                               /* timeout */           
+                               /* timeout */
                                nread = size - nleft;
                                if ((nread > 0) && (retry == kFullBufferNotRequired))
                                        return (nread);
                                nread = size - nleft;
                                if ((nread > 0) && (retry == kFullBufferNotRequired))
                                        return (nread);
index fe7b8d8..f8a6e48 100644 (file)
@@ -81,7 +81,7 @@ SRecvfrom(int sfd, char *const buf, size_t size, int fl, struct sockaddr_in *con
        nread = 0;
        forever {
                alen = sizeof(struct sockaddr_in);
        nread = 0;
        forever {
                alen = sizeof(struct sockaddr_in);
-                               
+
                forever {
                        errno = 0;
                        FD_ZERO(&ss);
                forever {
                        errno = 0;
                        FD_ZERO(&ss);
index 4ce4c56..6ed7e41 100644 (file)
@@ -93,7 +93,7 @@ SRecvmsg(int sfd, void *const msg, int fl, int tlen)
        done = now + tlen;
        tleft = (int) (done - now);
        forever {
        done = now + tlen;
        tleft = (int) (done - now);
        forever {
-                               
+
                for (;;) {
                        errno = 0;
                        FD_ZERO(&ss);
                for (;;) {
                        errno = 0;
                        FD_ZERO(&ss);
index f627e2b..0286cc2 100644 (file)
@@ -131,7 +131,7 @@ SSend(int sfd, char *buf0, size_t size, int fl, int tlen)
                                /* ready */
                                break;
                        } else if (result == 0) {
                                /* ready */
                                break;
                        } else if (result == 0) {
-                               /* timeout */           
+                               /* timeout */
                                nwrote = size - nleft;
                                if (nwrote > 0)
                                        return (nwrote);
                                nwrote = size - nleft;
                                if (nwrote > 0)
                                        return (nwrote);
index a0280dc..63fa221 100644 (file)
@@ -94,7 +94,7 @@ SSendto(int sfd, const char *const buf, size_t size, int fl, const struct sockad
                                /* ready */
                                break;
                        } else if (result == 0) {
                                /* ready */
                                break;
                        } else if (result == 0) {
-                               /* timeout */           
+                               /* timeout */
                                errno = ETIMEDOUT;
                                SETWSATIMEOUTERR
                                return (kTimeoutErr);
                                errno = ETIMEDOUT;
                                SETWSATIMEOUTERR
                                return (kTimeoutErr);
index 40b67c6..2d179f9 100644 (file)
@@ -103,7 +103,7 @@ SSendtoByName(int sfd, const char *const buf, size_t size, int fl, const char *c
                                /* ready */
                                break;
                        } else if (result == 0) {
                                /* ready */
                                break;
                        } else if (result == 0) {
-                               /* timeout */           
+                               /* timeout */
                                errno = ETIMEDOUT;
                                return (kTimeoutErr);
                        } else if (errno != EINTR) {
                                errno = ETIMEDOUT;
                                return (kTimeoutErr);
                        } else if (errno != EINTR) {
index 0bba81a..cf20b9d 100644 (file)
@@ -1,6 +1,6 @@
 #include "syshdrs.h"
 
 #include "syshdrs.h"
 
-/* 
+/*
  * Return zero if the operation timed-out or erred-out, otherwise non-zero.
  */
 int
  * Return zero if the operation timed-out or erred-out, otherwise non-zero.
  */
 int
@@ -55,7 +55,7 @@ SWaitUntilReadyForReading(const int sfd, const int tlen)
 
 
 
 
 
 
-/* 
+/*
  * Return zero if the operation timed-out or erred-out, otherwise non-zero.
  */
 int
  * Return zero if the operation timed-out or erred-out, otherwise non-zero.
  */
 int
index d8b1433..bf1c991 100644 (file)
@@ -133,7 +133,7 @@ SWrite(int sfd, const char *const buf0, size_t size, int tlen, int swopts)
                                        /* ready */
                                        break;
                                } else if (result == 0) {
                                        /* ready */
                                        break;
                                } else if (result == 0) {
-                                       /* timeout */           
+                                       /* timeout */
                                        nwrote = size - nleft;
                                        if (nwrote > 0)
                                                return (nwrote);
                                        nwrote = size - nleft;
                                        if (nwrote > 0)
                                                return (nwrote);
@@ -146,7 +146,7 @@ SWrite(int sfd, const char *const buf0, size_t size, int tlen, int swopts)
                        }
                        firstWrite = 0;
                }
                        }
                        firstWrite = 0;
                }
-               
+
 #if defined(WIN32) || defined(_WINDOWS)
                nwrote = send(sfd, buf, size, 0);
 #else
 #if defined(WIN32) || defined(_WINDOWS)
                nwrote = send(sfd, buf, size, 0);
 #else
index 56bd27b..da15648 100644 (file)
@@ -182,7 +182,7 @@ SetSocketLinger(const int fd, const int l_onoff, const int l_linger)
  * if l_onoff == 0:
  *    close(2) returns immediately; any buffered data is sent later
  *    (default)
  * if l_onoff == 0:
  *    close(2) returns immediately; any buffered data is sent later
  *    (default)
- * 
+ *
  * if l_onoff != 0:
  *    if l_linger == 0, close(2) returns after discarding any unsent data
  *    if l_linger != 0, close(2) does not return until buffered data is sent
  * if l_onoff != 0:
  *    if l_linger == 0, close(2) returns after discarding any unsent data
  *    if l_linger != 0, close(2) does not return until buffered data is sent
index 45442b1..466bbaf 100644 (file)
@@ -16,7 +16,7 @@
 /* #undef HAVE_SOCKADDR_UN_SUN_LEN */
 
 /* #define HAVE_STRUCT_CMSGDHR 1 */
 /* #undef HAVE_SOCKADDR_UN_SUN_LEN */
 
 /* #define HAVE_STRUCT_CMSGDHR 1 */
-  
+
 /* Define to the type of arg1 for select(). */
 #define SELECT_TYPE_ARG1 int
 
 /* Define to the type of arg1 for select(). */
 #define SELECT_TYPE_ARG1 int
 
index 4c7cdb8..485e5cf 100644 (file)
@@ -46,7 +46,7 @@ int main(int argc, char **argv)
     int nAdapterCount;
     int i;
 
     int nAdapterCount;
     int i;
 
-       char* PacketLibraryVersion; 
+       char* PacketLibraryVersion;
 
 
     // Attemp to load the WinPCap dynamic link library
 
 
     // Attemp to load the WinPCap dynamic link library
index 509dd96..166dd75 100644 (file)
@@ -1,7 +1,7 @@
-/* $Id: notevil.c,v 1.5 2001/02/18 19:31:38 phreak Exp $
+/* $Id$
  *
  * notevil.c
  *
  * notevil.c
- * 
+ *
  * --------------------------------------------------------------------
  *
  * This software is free software; you can redistribute it and/or
  * --------------------------------------------------------------------
  *
  * This software is free software; you can redistribute it and/or
@@ -17,7 +17,7 @@
  * You should have received a copy of the GNU Library General Public
  * License along with this software; see the file COPYING.LIB. If
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  * You should have received a copy of the GNU Library General Public
  * License along with this software; see the file COPYING.LIB. If
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
- * Cambridge, MA 02139, USA.  
+ * Cambridge, MA 02139, USA.
  *
  * --------------------------------------------------------------------
  * ReactOS Coders Console Parade
  *
  * --------------------------------------------------------------------
  * ReactOS Coders Console Parade
@@ -215,7 +215,7 @@ main(
         LARGE_INTEGER lint;
        DWORD Written;
        COORD Coord = { 0, 0 };
         LARGE_INTEGER lint;
        DWORD Written;
        COORD Coord = { 0, 0 };
-       
+
        myself = GetModuleHandle(NULL);
 
        GetConsoleScreenBufferInfo (GetStdHandle(STD_OUTPUT_HANDLE),
        myself = GetModuleHandle(NULL);
 
        GetConsoleScreenBufferInfo (GetStdHandle(STD_OUTPUT_HANDLE),
index edd2817..28d5099 100644 (file)
@@ -1,13 +1,13 @@
 //======================================================================
 //
 //======================================================================
 //
-// $Id: chkdsk.c,v 1.3 2000/04/25 23:22:57 ea Exp $
+// $Id$
 //
 // Chkdskx
 //
 // Copyright (c) 1998 Mark Russinovich
 //     Systems Internals
 //     http://www.sysinternals.com/
 //
 // Chkdskx
 //
 // Copyright (c) 1998 Mark Russinovich
 //     Systems Internals
 //     http://www.sysinternals.com/
-// 
+//
 // --------------------------------------------------------------------
 //
 // This software is free software; you can redistribute it and/or
 // --------------------------------------------------------------------
 //
 // This software is free software; you can redistribute it and/or
 // You should have received a copy of the GNU Library General Public
 // License along with this software; see the file COPYING.LIB. If
 // not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 // You should have received a copy of the GNU Library General Public
 // License along with this software; see the file COPYING.LIB. If
 // not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-// Cambridge, MA 02139, USA.  
+// Cambridge, MA 02139, USA.
 //
 // --------------------------------------------------------------------
 //
 // --------------------------------------------------------------------
-// 
+//
 // Chkdsk clone that demonstrates the use of the FMIFS file system
 // utility library.
 //
 // 1999 February (Emanuele Aliberti)
 //     Adapted for ReactOS and lcc-win32.
 // Chkdsk clone that demonstrates the use of the FMIFS file system
 // utility library.
 //
 // 1999 February (Emanuele Aliberti)
 //     Adapted for ReactOS and lcc-win32.
-//     
+//
 // 1999 April (Emanuele Aliberti)
 //     Adapted for ReactOS and egcs.
 //
 // 1999 April (Emanuele Aliberti)
 //     Adapted for ReactOS and egcs.
 //
@@ -87,7 +87,7 @@ CtrlCIntercept( DWORD dwCtrlType )
 
 
 //----------------------------------------------------------------------
 
 
 //----------------------------------------------------------------------
-// 
+//
 // Usage
 //
 // Tell the user how to use the program
 // Usage
 //
 // Tell the user how to use the program
@@ -211,7 +211,7 @@ ChkdskCallback(
        PBOOLEAN        status;
        PTEXTOUTPUT     output;
 
        PBOOLEAN        status;
        PTEXTOUTPUT     output;
 
-       // 
+       //
        // We get other types of commands,
        // but we don't have to pay attention to them
        //
        // We get other types of commands,
        // but we don't have to pay attention to them
        //
@@ -220,55 +220,55 @@ ChkdskCallback(
        case UNKNOWN2:
                wprintf(L"UNKNOWN2\r");
                break;
        case UNKNOWN2:
                wprintf(L"UNKNOWN2\r");
                break;
-               
+
        case UNKNOWN3:
                wprintf(L"UNKNOWN3\r");
                break;
        case UNKNOWN3:
                wprintf(L"UNKNOWN3\r");
                break;
-               
+
        case UNKNOWN4:
                wprintf(L"UNKNOWN4\r");
                break;
        case UNKNOWN4:
                wprintf(L"UNKNOWN4\r");
                break;
-               
+
        case UNKNOWN5:
                wprintf(L"UNKNOWN5\r");
                break;
        case UNKNOWN5:
                wprintf(L"UNKNOWN5\r");
                break;
-               
+
        case UNKNOWN7:
                wprintf(L"UNKNOWN7\r");
                break;
        case UNKNOWN7:
                wprintf(L"UNKNOWN7\r");
                break;
-               
+
        case UNKNOWN8:
                wprintf(L"UNKNOWN8\r");
                break;
        case UNKNOWN8:
                wprintf(L"UNKNOWN8\r");
                break;
-               
+
        case UNKNOWN9:
                wprintf(L"UNKNOWN9\r");
                break;
        case UNKNOWN9:
                wprintf(L"UNKNOWN9\r");
                break;
-               
+
        case UNKNOWNA:
                wprintf(L"UNKNOWNA\r");
                break;
        case UNKNOWNA:
                wprintf(L"UNKNOWNA\r");
                break;
-               
+
        case UNKNOWNC:
                wprintf(L"UNKNOWNC\r");
                break;
        case UNKNOWNC:
                wprintf(L"UNKNOWNC\r");
                break;
-               
+
        case UNKNOWND:
                wprintf(L"UNKNOWND\r");
                break;
        case UNKNOWND:
                wprintf(L"UNKNOWND\r");
                break;
-               
+
        case INSUFFICIENTRIGHTS:
                wprintf(L"INSUFFICIENTRIGHTS\r");
                break;
        case INSUFFICIENTRIGHTS:
                wprintf(L"INSUFFICIENTRIGHTS\r");
                break;
-               
+
        case STRUCTUREPROGRESS:
                wprintf(L"STRUCTUREPROGRESS\r");
                break;
        case STRUCTUREPROGRESS:
                wprintf(L"STRUCTUREPROGRESS\r");
                break;
-               
+
        case DONEWITHSTRUCTURE:
                wprintf(L"DONEWITHSTRUCTURE\r");
                break;
        case DONEWITHSTRUCTURE:
                wprintf(L"DONEWITHSTRUCTURE\r");
                break;
-               
+
        case PROGRESS:
                percent = (PDWORD) Argument;
                wprintf(L"%d percent completed.\r", *percent);
        case PROGRESS:
                percent = (PDWORD) Argument;
                wprintf(L"%d percent completed.\r", *percent);
@@ -320,11 +320,11 @@ LoadFMIFSEntryPoints(VOID)
 
 
 //----------------------------------------------------------------------
 
 
 //----------------------------------------------------------------------
-// 
+//
 // WMain
 //
 // WMain
 //
-// Engine. Just get command line switches and fire off a chkdsk. This 
-// could also be done in a GUI like Explorer does when you select a 
+// Engine. Just get command line switches and fire off a chkdsk. This
+// could also be done in a GUI like Explorer does when you select a
 // drive and run a check on it.
 //
 // We do this in UNICODE because the chkdsk command expects PWCHAR
 // drive and run a check on it.
 //
 // We do this in UNICODE because the chkdsk command expects PWCHAR
@@ -372,7 +372,7 @@ ReactOS adaptation 1999 by Emanuele Aliberti\n\n"
                return -1;
        }
 
                return -1;
        }
 
-       // 
+       //
        // Get the drive's format
        //
        if( !Drive )
        // Get the drive's format
        //
        if( !Drive )
@@ -399,16 +399,16 @@ ReactOS adaptation 1999 by Emanuele Aliberti\n\n"
        Drive = CurrentDirectory;
 
        //
        Drive = CurrentDirectory;
 
        //
-       // Determine the drive's file system format, which we need to 
+       // Determine the drive's file system format, which we need to
        // tell chkdsk
        //
        if( !GetVolumeInformationW(
        // tell chkdsk
        //
        if( !GetVolumeInformationW(
-               Drive, 
+               Drive,
                volumeName,
                volumeName,
-               sizeof volumeName, 
+               sizeof volumeName,
                & serialNumber,
                & maxComponent,
                & serialNumber,
                & maxComponent,
-               & flags, 
+               & flags,
                fileSystem,
                sizeof fileSystem
                )
                fileSystem,
                sizeof fileSystem
                )
@@ -432,12 +432,12 @@ ReactOS adaptation 1999 by Emanuele Aliberti\n\n"
                        );
                volumeHandle = CreateFileW(
                                volumeName,
                        );
                volumeHandle = CreateFileW(
                                volumeName,
-                               GENERIC_WRITE, 
+                               GENERIC_WRITE,
                                0,
                                NULL,
                                0,
                                NULL,
-                               OPEN_EXISTING, 
+                               OPEN_EXISTING,
                                0,
                                0,
-                               0 
+                               0
                                );
                if( volumeHandle == INVALID_HANDLE_VALUE )
                {
                                );
                if( volumeHandle == INVALID_HANDLE_VALUE )
                {
index 204ed53..1323ffb 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 /* $Id$
- * 
+ *
  * chklib.c
  * chklib.c
- * 
+ *
  * Copyright (C) 1998, 1999 Emanuele Aliberti.
  *
  * --------------------------------------------------------------------
  * Copyright (C) 1998, 1999 Emanuele Aliberti.
  *
  * --------------------------------------------------------------------
@@ -19,7 +19,7 @@
  * You should have received a copy of the GNU General Public
  * License along with this software; see the file COPYING. If
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  * You should have received a copy of the GNU General Public
  * License along with this software; see the file COPYING. If
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
- * Cambridge, MA 02139, USA.  
+ * Cambridge, MA 02139, USA.
  *
  * --------------------------------------------------------------------
  * Check a PE DLL for loading and get an exported symbol's address
  *
  * --------------------------------------------------------------------
  * Check a PE DLL for loading and get an exported symbol's address
@@ -54,7 +54,7 @@ DisplayVersion(
                ModuleName,
                & Zero
                );
                ModuleName,
                & Zero
                );
-       if (Size == 0) 
+       if (Size == 0)
        {
                PrintWin32Error(
                        L"GetFileVersionInfoSize",
        {
                PrintWin32Error(
                        L"GetFileVersionInfoSize",
@@ -80,8 +80,8 @@ DisplayVersion(
        }
 /*
        VerQueryValue(
        }
 /*
        VerQueryValue(
-               vi, 
-               L"\\StringFileInfo\\040904E4\\FileDescription", 
+               vi,
+               L"\\StringFileInfo\\040904E4\\FileDescription",
                & lpBuffer,
                & dwBytes
                );
                & lpBuffer,
                & dwBytes
                );
@@ -99,7 +99,7 @@ DisplayEntryPoint(
        )
 {
        FARPROC EntryPoint;
        )
 {
        FARPROC EntryPoint;
-       
+
        printf(
                "[%s]\n",
                SymbolName
        printf(
                "[%s]\n",
                SymbolName
@@ -136,10 +136,10 @@ main(
        HINSTANCE       dll;
        TCHAR           ModuleName [_MAX_PATH];
 
        HINSTANCE       dll;
        TCHAR           ModuleName [_MAX_PATH];
 
-       if (argc < 2) 
+       if (argc < 2)
        {
                fprintf(
        {
                fprintf(
-                       stderr, 
+                       stderr,
                        "\
 ReactOS System Tools\n\
 Check a Dynamic Link Library (DLL) for loading\n\
                        "\
 ReactOS System Tools\n\
 Check a Dynamic Link Library (DLL) for loading\n\
@@ -161,7 +161,7 @@ usage: %s module [symbol [, ...]]\n",
                        "%s: loading %s failed (%d).\n",
                        argv[0],
                        argv[1],
                        "%s: loading %s failed (%d).\n",
                        argv[0],
                        argv[1],
-                       LastError       
+                       LastError
                        );
                exit(EXIT_FAILURE);
        }
                        );
                exit(EXIT_FAILURE);
        }
index ec062df..21f87dc 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef _INC_CONFIG_H
 #define _INC_CONFIG_H
 #ifndef _INC_CONFIG_H
 #define _INC_CONFIG_H
-/* $Id: config.h,v 1.1 1999/05/16 07:27:35 ea Exp $ */
+/* $Id$ */
 #define FMIFS_IMPORT_DLL
 #define REACTOS_NO_SECURITY_SS
 #endif /* ndef _INC_CONFIG_H */
 #define FMIFS_IMPORT_DLL
 #define REACTOS_NO_SECURITY_SS
 #endif /* ndef _INC_CONFIG_H */
index ad58130..570b919 100644 (file)
@@ -3,10 +3,10 @@
    ctm.c - main program file
 
    Written by: Aleksey Bragin (aleksey@studiocerebral.com)
    ctm.c - main program file
 
    Written by: Aleksey Bragin (aleksey@studiocerebral.com)
-   
+
    Most of the code dealing with getting system parameters is taken from
    ReactOS Task Manager written by Brian Palmer (brianp@reactos.org)
    Most of the code dealing with getting system parameters is taken from
    ReactOS Task Manager written by Brian Palmer (brianp@reactos.org)
-   
+
    Localization features added by Hervé Poussineau (hpoussineau@fr.st)
 
    History:
    Localization features added by Hervé Poussineau (hpoussineau@fr.st)
 
    History:
        20 March 2003 - v0.03, works good under ReactOS, and allows process
                        killing
        18 March 2003 - Initial version 0.01, doesn't work under RectOS
        20 March 2003 - v0.03, works good under ReactOS, and allows process
                        killing
        18 March 2003 - Initial version 0.01, doesn't work under RectOS
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -61,7 +61,7 @@ DWORD columnRightPositions[5];
 TCHAR lpSeparator[80];
 TCHAR lpHeader[80];
 TCHAR lpMemUnit[3];
 TCHAR lpSeparator[80];
 TCHAR lpHeader[80];
 TCHAR lpMemUnit[3];
-TCHAR lpIdleProcess[80];;
+TCHAR lpIdleProcess[80];
 TCHAR lpTitle[80];
 TCHAR lpHeader[80];
 TCHAR lpMenu[80];
 TCHAR lpTitle[80];
 TCHAR lpHeader[80];
 TCHAR lpMenu[80];
@@ -159,7 +159,7 @@ void DisplayScreen()
                // Footer
                pos.X = 2; pos.Y = ProcPerScreen+6;
                WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos, &numChars);
                // Footer
                pos.X = 2; pos.Y = ProcPerScreen+6;
                WriteConsoleOutputCharacter(hStdout, lpSeparator, _tcslen(lpSeparator), pos, &numChars);
-               
+
                // Menu
                pos.X = 2; pos.Y = ProcPerScreen+7;
                WriteConsoleOutputCharacter(hStdout, lpEmpty, _tcslen(lpEmpty), pos, &numChars);
                // Menu
                pos.X = 2; pos.Y = ProcPerScreen+7;
                WriteConsoleOutputCharacter(hStdout, lpEmpty, _tcslen(lpEmpty), pos, &numChars);
@@ -181,7 +181,7 @@ void DisplayScreen()
                TCHAR lpMemUsg[12];
                TCHAR lpPageFaults[15];
                WORD wColor;
                TCHAR lpMemUsg[12];
                TCHAR lpPageFaults[15];
                WORD wColor;
-               
+
                for (i = 0; i < 80; i++)
                        lpStr[i] = _T(' ');
 
                for (i = 0; i < 80; i++)
                        lpStr[i] = _T(' ');
 
@@ -189,8 +189,8 @@ void DisplayScreen()
                if (idx < lines && scrolled + idx < ProcessCount)
                {
                        // image name
                if (idx < lines && scrolled + idx < ProcessCount)
                {
                        // image name
-#ifdef _UNICODE                
-                  len = wcslen(pPerfData[scrolled+idx].ImageName);  
+#ifdef _UNICODE
+                  len = wcslen(pPerfData[scrolled+idx].ImageName);
 #else
                   WideCharToMultiByte(CP_ACP, 0, pPerfData[scrolled+idx].ImageName, -1,
                                       imgName, MAX_PATH, NULL, NULL);
 #else
                   WideCharToMultiByte(CP_ACP, 0, pPerfData[scrolled+idx].ImageName, -1,
                                       imgName, MAX_PATH, NULL, NULL);
@@ -237,25 +237,25 @@ void DisplayScreen()
                pos.X = 3; pos.Y = 6+idx;
                if (selection == idx)
                {
                pos.X = 3; pos.Y = 6+idx;
                if (selection == idx)
                {
-                       wColor = BACKGROUND_GREEN | 
-                               FOREGROUND_RED | 
-                               FOREGROUND_GREEN | 
+                       wColor = BACKGROUND_GREEN |
+                               FOREGROUND_RED |
+                               FOREGROUND_GREEN |
                                FOREGROUND_BLUE;
                }
                else
                {
                        wColor = BACKGROUND_BLUE |
                                FOREGROUND_BLUE;
                }
                else
                {
                        wColor = BACKGROUND_BLUE |
-                                       FOREGROUND_RED | 
-                                       FOREGROUND_GREEN | 
+                                       FOREGROUND_RED |
+                                       FOREGROUND_GREEN |
                                        FOREGROUND_BLUE;
                }
 
                                        FOREGROUND_BLUE;
                }
 
-               FillConsoleOutputAttribute( 
-                       hStdout,          // screen buffer handle 
-                       wColor,           // color to fill with 
+               FillConsoleOutputAttribute(
+                       hStdout,          // screen buffer handle
+                       wColor,           // color to fill with
                        columnRightPositions[0] - 1,    // number of cells to fill
                        columnRightPositions[0] - 1,    // number of cells to fill
-                       pos,            // first cell to write to 
-                       &numChars);       // actual number written 
+                       pos,            // first cell to write to
+                       &numChars);       // actual number written
        }
 
        return;
        }
 
        return;
@@ -292,7 +292,7 @@ int ProcessKeys(int numEvents)
                        HANDLE hProcess;
                        pId = pPerfData[selection+scrolled].ProcessId;
                        hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pId);
                        HANDLE hProcess;
                        pId = pPerfData[selection+scrolled].ProcessId;
                        hProcess = OpenProcess(PROCESS_TERMINATE, FALSE, pId);
-                       
+
                        if (hProcess)
                        {
                                if (!TerminateProcess(hProcess, 0))
                        if (hProcess)
                        {
                                if (!TerminateProcess(hProcess, 0))
@@ -318,7 +318,7 @@ int ProcessKeys(int numEvents)
                                Sleep(1000);
                        }
                }
                                Sleep(1000);
                        }
                }
-               
+
                first = 0;
        }
        else if (key == VK_UP)
                first = 0;
        }
        else if (key == VK_UP)
@@ -335,7 +335,7 @@ int ProcessKeys(int numEvents)
                else if ((selection == MAX_PROC-1) && (selection+scrolled < ProcessCount-1))
                        scrolled++;
        }
                else if ((selection == MAX_PROC-1) && (selection+scrolled < ProcessCount-1))
                        scrolled++;
        }
-       
+
        return FALSE;
 }
 
        return FALSE;
 }
 
@@ -371,7 +371,7 @@ void PerfDataRefresh()
        if (status != NO_ERROR)
                return;
 #endif
        if (status != NO_ERROR)
                return;
 #endif
-       // Get processor information    
+       // Get processor information
        SysProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)malloc(sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors);
        status = NtQuerySystemInformation(SystemProcessorPerformanceInformation, SysProcessorTimeInfo, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors, &ulSize);
 
        SysProcessorTimeInfo = (PSYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)malloc(sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors);
        status = NtQuerySystemInformation(SystemProcessorPerformanceInformation, SysProcessorTimeInfo, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * SystemBasicInfo.NumberProcessors, &ulSize);
 
@@ -402,9 +402,9 @@ void PerfDataRefresh()
                // CurrentCpuIdle = IdleTime / SystemTime
                dbIdleTime = dbIdleTime / dbSystemTime;
                dbKernelTime = dbKernelTime / dbSystemTime;
                // CurrentCpuIdle = IdleTime / SystemTime
                dbIdleTime = dbIdleTime / dbSystemTime;
                dbKernelTime = dbKernelTime / dbSystemTime;
-               
+
                // CurrentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors
                // CurrentCpuUsage% = 100 - (CurrentCpuIdle * 100) / NumberOfProcessors
-               dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SystemBasicInfo.NumberProcessors;// + 0.5; 
+               dbIdleTime = 100.0 - dbIdleTime * 100.0 / (double)SystemBasicInfo.NumberProcessors;// + 0.5;
                dbKernelTime = 100.0 - dbKernelTime * 100.0 / (double)SystemBasicInfo.NumberProcessors;// + 0.5;
        }
 
                dbKernelTime = 100.0 - dbKernelTime * 100.0 / (double)SystemBasicInfo.NumberProcessors;// + 0.5;
        }
 
@@ -563,7 +563,7 @@ int main(int *argc, char **argv)
 {
        int i;
        TCHAR lpStr[80];
 {
        int i;
        TCHAR lpStr[80];
-       
+
        for (i = 0; i < 80; i++)
                lpEmpty[i] = lpHeader[i] = _T(' ');
        lpEmpty[79] = _T('\0');
        for (i = 0; i < 80; i++)
                lpEmpty[i] = lpHeader[i] = _T(' ');
        lpEmpty[79] = _T('\0');
@@ -595,7 +595,7 @@ int main(int *argc, char **argv)
                columnRightPositions[4] = columnRightPositions[3] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[3] + 2], lpStr, _tcslen(lpStr));
        }
                columnRightPositions[4] = columnRightPositions[3] + _tcslen(lpStr) + 3;
                _tcsncpy(&lpHeader[columnRightPositions[3] + 2], lpStr, _tcslen(lpStr));
        }
-       
+
        for (i = 0; i < columnRightPositions[4]; i++)
                lpSeparator[i] = _T('-');
        lpHeader[0] = _T('|');
        for (i = 0; i < columnRightPositions[4]; i++)
                lpSeparator[i] = _T('-');
        lpHeader[0] = _T('|');
@@ -608,7 +608,7 @@ int main(int *argc, char **argv)
        lpSeparator[columnRightPositions[4] + 1] = _T('\0');
        lpHeader[columnRightPositions[4] + 1] = _T('\0');
 
        lpSeparator[columnRightPositions[4] + 1] = _T('\0');
        lpHeader[columnRightPositions[4] + 1] = _T('\0');
 
-       
+
        if (!LoadString(hInst, IDS_APP_TITLE, lpTitle, 80))
                lpTitle[0] = _T('\0');
        if (!LoadString(hInst, IDS_COLUMN_MEM_UNIT, lpMemUnit, 3))
        if (!LoadString(hInst, IDS_APP_TITLE, lpTitle, 80))
                lpTitle[0] = _T('\0');
        if (!LoadString(hInst, IDS_COLUMN_MEM_UNIT, lpMemUnit, 3))
@@ -617,7 +617,7 @@ int main(int *argc, char **argv)
                lpMenu[0] = _T('\0');
        if (!LoadString(hInst, IDS_IDLE_PROCESS, lpIdleProcess, 80))
                lpIdleProcess[0] = _T('\0');
                lpMenu[0] = _T('\0');
        if (!LoadString(hInst, IDS_IDLE_PROCESS, lpIdleProcess, 80))
                lpIdleProcess[0] = _T('\0');
-       
+
        if (LoadString(hInst, IDS_MENU_QUIT, lpStr, 2))
                KEY_QUIT = lpStr[0];
        if (LoadString(hInst, IDS_MENU_KILL_PROCESS, lpStr, 2))
        if (LoadString(hInst, IDS_MENU_QUIT, lpStr, 2))
                KEY_QUIT = lpStr[0];
        if (LoadString(hInst, IDS_MENU_KILL_PROCESS, lpStr, 2))
index ec1bf31..5aaddb8 100644 (file)
@@ -3,15 +3,15 @@
    ctm.h - header file for main program
 
    Written by: Aleksey Bragin (aleksey@studiocerebral.com)
    ctm.h - header file for main program
 
    Written by: Aleksey Bragin (aleksey@studiocerebral.com)
-   
+
    Most of this file content is taken from
    ReactOS Task Manager written by Brian Palmer (brianp@reactos.org)
    Most of this file content is taken from
    ReactOS Task Manager written by Brian Palmer (brianp@reactos.org)
-   
+
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    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
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
index 1d448fa..3e69e7c 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef _FMIFS_H
 #define _FMIFS_H
 #ifndef _FMIFS_H
 #define _FMIFS_H
-/* $Id: fmifs.h,v 1.1 1999/05/16 07:27:35 ea Exp $
+/* $Id$
  *
  * fmifs.h
  *
  *
  * fmifs.h
  *
@@ -27,7 +27,7 @@ struct
 {
        DWORD Lines;
        PCHAR Output;
 {
        DWORD Lines;
        PCHAR Output;
-       
+
 } TEXTOUTPUT, *PTEXTOUTPUT;
 
 
 } TEXTOUTPUT, *PTEXTOUTPUT;
 
 
@@ -68,13 +68,13 @@ BOOL
 VOID
 STDCALL
 ChkDsk(
 VOID
 STDCALL
 ChkDsk(
-       PWCHAR          DriveRoot, 
+       PWCHAR          DriveRoot,
        PWCHAR          Format,
        PWCHAR          Format,
-       BOOL            CorrectErrors, 
-       BOOL            Verbose, 
+       BOOL            CorrectErrors,
+       BOOL            Verbose,
        BOOL            CheckOnlyIfDirty,
        BOOL            CheckOnlyIfDirty,
-       BOOL            ScanDrive, 
-       PVOID           Unused2, 
+       BOOL            ScanDrive,
+       PVOID           Unused2,
        PVOID           Unused3,
        PFMIFSCALLBACK  Callback
        );
        PVOID           Unused3,
        PFMIFSCALLBACK  Callback
        );
@@ -83,13 +83,13 @@ ChkDsk(
 VOID
 STDCALL
 ChkDskEx(
 VOID
 STDCALL
 ChkDskEx(
-       PWCHAR          DriveRoot, 
+       PWCHAR          DriveRoot,
        PWCHAR          Format,
        PWCHAR          Format,
-       BOOL            CorrectErrors, 
-       BOOL            Verbose, 
+       BOOL            CorrectErrors,
+       BOOL            Verbose,
        BOOL            CheckOnlyIfDirty,
        BOOL            CheckOnlyIfDirty,
-       BOOL            ScanDrive, 
-       PVOID           Unused2, 
+       BOOL            ScanDrive,
+       PVOID           Unused2,
        PVOID           Unused3,
        PFMIFSCALLBACK  Callback
        );
        PVOID           Unused3,
        PFMIFSCALLBACK  Callback
        );
index a8324fd..682d443 100644 (file)
@@ -7,7 +7,7 @@
 // Copyright (c) 1998 Mark Russinovich
 //     Systems Internals
 //     http://www.sysinternals.com/
 // Copyright (c) 1998 Mark Russinovich
 //     Systems Internals
 //     http://www.sysinternals.com/
-//     
+//
 // This software is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Library General Public License as
 // published by the Free Software Foundation; either version 2 of the
 // This software is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Library General Public License as
 // published by the Free Software Foundation; either version 2 of the
@@ -21,7 +21,7 @@
 // You should have received a copy of the GNU Library General Public
 // License along with this software; see the file COPYING.LIB. If
 // not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 // You should have received a copy of the GNU Library General Public
 // License along with this software; see the file COPYING.LIB. If
 // not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-// Cambridge, MA 02139, USA.  
+// Cambridge, MA 02139, USA.
 //
 // ---------------------------------------------------------------------
 // Format clone that demonstrates the use of the FMIFS file system
 //
 // ---------------------------------------------------------------------
 // Format clone that demonstrates the use of the FMIFS file system
@@ -29,7 +29,7 @@
 //
 // 1999 February (Emanuele Aliberti)
 //     Adapted for ReactOS and lcc-win32.
 //
 // 1999 February (Emanuele Aliberti)
 //     Adapted for ReactOS and lcc-win32.
-//     
+//
 // 1999 April (Emanuele Aliberti)
 //     Adapted for ReactOS and egcs.
 //
 // 1999 April (Emanuele Aliberti)
 //     Adapted for ReactOS and egcs.
 //
@@ -79,7 +79,7 @@ struct
 {
        WCHAR  SizeString [16];
        DWORD  ClusterSize;
 {
        WCHAR  SizeString [16];
        DWORD  ClusterSize;
-       
+
 } SIZEDEFINITION, *PSIZEDEFINITION;
 
 
 } SIZEDEFINITION, *PSIZEDEFINITION;
 
 
@@ -101,7 +101,7 @@ LegalSizes [] =
 
 
 //----------------------------------------------------------------------
 
 
 //----------------------------------------------------------------------
-// 
+//
 // Usage
 //
 // Tell the user how to use the program
 // Usage
 //
 // Tell the user how to use the program
@@ -176,7 +176,7 @@ ParseCommandLine(
                        else if( !wcsnicmp( & argv[i][1], L"A:", 2 ))
                        {
                                if ( gotSize ) return -1;
                        else if( !wcsnicmp( & argv[i][1], L"A:", 2 ))
                        {
                                if ( gotSize ) return -1;
-                               j = 0; 
+                               j = 0;
                                while ( LegalSizes[j].ClusterSize &&
                                        wcsicmp(
                                                LegalSizes[j].SizeString,
                                while ( LegalSizes[j].ClusterSize &&
                                        wcsicmp(
                                                LegalSizes[j].SizeString,
@@ -248,7 +248,7 @@ FormatExCallback(
        PBOOLEAN        status;
        //static createStructures = FALSE;
 
        PBOOLEAN        status;
        //static createStructures = FALSE;
 
-       // 
+       //
        // We get other types of commands, but we don't have to pay attention to them
        //
        switch ( Command )
        // We get other types of commands, but we don't have to pay attention to them
        //
        switch ( Command )
@@ -318,11 +318,11 @@ LoadFMIFSEntryPoints(VOID)
 
 
 //----------------------------------------------------------------------
 
 
 //----------------------------------------------------------------------
-// 
+//
 // WMain
 //
 // WMain
 //
-// Engine. Just get command line switches and fire off a format. This 
-// could also be done in a GUI like Explorer does when you select a 
+// Engine. Just get command line switches and fire off a format. This
+// could also be done in a GUI like Explorer does when you select a
 // drive and run a check on it.
 //
 // We do this in UNICODE because the chkdsk command expects PWCHAR
 // drive and run a check on it.
 //
 // We do this in UNICODE because the chkdsk command expects PWCHAR
@@ -333,23 +333,23 @@ int
 wmain( int argc, WCHAR *argv[] )
 {
        int             badArg;
 wmain( int argc, WCHAR *argv[] )
 {
        int             badArg;
-       
+
        DWORD           media = 0;
        DWORD           driveType;
        DWORD           media = 0;
        DWORD           driveType;
-       
+
        WCHAR           fileSystem [1024];
        WCHAR           volumeName [1024];
        WCHAR           input [1024];
        WCHAR           fileSystem [1024];
        WCHAR           volumeName [1024];
        WCHAR           input [1024];
-       
+
        DWORD           serialNumber;
        DWORD           flags,
                        maxComponent;
        DWORD           serialNumber;
        DWORD           flags,
                        maxComponent;
-                       
+
        ULARGE_INTEGER  freeBytesAvailableToCaller,
                        totalNumberOfBytes,
                        totalNumberOfFreeBytes;
 
        ULARGE_INTEGER  freeBytesAvailableToCaller,
                        totalNumberOfBytes,
                        totalNumberOfFreeBytes;
 
-                       
+
        wprintf( L"\
 \nFormatx v1.0 by Mark Russinovich\n\
 Systems Internals - http://www.sysinternals.com\n\
        wprintf( L"\
 \nFormatx v1.0 by Mark Russinovich\n\
 Systems Internals - http://www.sysinternals.com\n\
@@ -378,7 +378,7 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
                Usage(argv[0]);
                return -1;
        }
                Usage(argv[0]);
                return -1;
        }
-       // 
+       //
        // Get the drive's format
        //
        if( !Drive )
        // Get the drive's format
        //
        if( !Drive )
@@ -414,12 +414,12 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
        // Determine the drive's file system format
        //
        if ( !GetVolumeInformationW(
        // Determine the drive's file system format
        //
        if ( !GetVolumeInformationW(
-               RootDirectory, 
+               RootDirectory,
                volumeName,
                volumeName,
-               WBUFSIZE(volumeName), 
+               WBUFSIZE(volumeName),
                & serialNumber,
                & maxComponent,
                & serialNumber,
                & maxComponent,
-               & flags, 
+               & flags,
                fileSystem,
                WBUFSIZE(fileSystem) )
        ) {
                fileSystem,
                WBUFSIZE(fileSystem) )
        ) {
@@ -430,7 +430,7 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
                return -1;
        }
        if( !GetDiskFreeSpaceExW(
                return -1;
        }
        if( !GetDiskFreeSpaceExW(
-                       RootDirectory, 
+                       RootDirectory,
                        & freeBytesAvailableToCaller,
                        & totalNumberOfBytes,
                        & totalNumberOfFreeBytes )
                        & freeBytesAvailableToCaller,
                        & totalNumberOfBytes,
                        & totalNumberOfFreeBytes )
@@ -465,7 +465,7 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
                                        stdin
                                        );
                                input[ wcslen( input ) - 1 ] = 0;
                                        stdin
                                        );
                                input[ wcslen( input ) - 1 ] = 0;
-                               
+
                                if ( !wcsicmp( input, volumeName ))
                                {
                                        break;
                                if ( !wcsicmp( input, volumeName ))
                                {
                                        break;
@@ -486,30 +486,30 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
                        if ( (input[0] == L'Y') || (input[0] == L'y') ) break;
 
                        if ( (input[0] == L'N') || (input[0] == L'n') )
                        if ( (input[0] == L'Y') || (input[0] == L'y') ) break;
 
                        if ( (input[0] == L'N') || (input[0] == L'n') )
-                       {       
+                       {
                                wprintf(L"\n");
                                return 0;
                        }
                }
                media = FMIFS_HARDDISK;
                                wprintf(L"\n");
                                return 0;
                        }
                }
                media = FMIFS_HARDDISK;
-       } 
+       }
        //
        // Tell the user we're doing a long format if appropriate
        //
        if ( !QuickFormat )
        //
        // Tell the user we're doing a long format if appropriate
        //
        if ( !QuickFormat )
-       {       
+       {
                if ( totalNumberOfBytes.QuadPart > 1024*1024*10 )
                {
                if ( totalNumberOfBytes.QuadPart > 1024*1024*10 )
                {
-                       
+
                        wprintf(
                                L"Verifying %dM\n",
                                (DWORD) (totalNumberOfBytes.QuadPart/(1024*1024))
                        wprintf(
                                L"Verifying %dM\n",
                                (DWORD) (totalNumberOfBytes.QuadPart/(1024*1024))
-                               );      
+                               );
                }
                else
                {
                        wprintf(
                }
                else
                {
                        wprintf(
-                               L"Verifying %.1fM\n", 
+                               L"Verifying %.1fM\n",
                                ((float)(LONGLONG)totalNumberOfBytes.QuadPart)/(float)(1024.0*1024.0)
                                );
                }
                                ((float)(LONGLONG)totalNumberOfBytes.QuadPart)/(float)(1024.0*1024.0)
                                );
                }
@@ -517,16 +517,16 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
        else
        {
                if ( totalNumberOfBytes.QuadPart > 1024*1024*10 )
        else
        {
                if ( totalNumberOfBytes.QuadPart > 1024*1024*10 )
-               {       
+               {
                        wprintf(
                                L"QuickFormatting %dM\n",
                                (DWORD) (totalNumberOfBytes.QuadPart / (1024 * 1024))
                        wprintf(
                                L"QuickFormatting %dM\n",
                                (DWORD) (totalNumberOfBytes.QuadPart / (1024 * 1024))
-                               );      
+                               );
                }
                else
                {
                        wprintf(
                }
                else
                {
                        wprintf(
-                               L"QuickFormatting %.2fM\n", 
+                               L"QuickFormatting %.2fM\n",
                                ((float)(LONGLONG)totalNumberOfBytes.QuadPart) / (float)(1024.0*1024.0)
                                );
                }
                                ((float)(LONGLONG)totalNumberOfBytes.QuadPart) / (float)(1024.0*1024.0)
                                );
                }
@@ -534,7 +534,7 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
        }
        //
        // Format away!
        }
        //
        // Format away!
-       //                      
+       //
        FormatEx(
                RootDirectory,
                media,
        FormatEx(
                RootDirectory,
                media,
@@ -576,15 +576,15 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
                                GetLastError()
                                );
                        return -1;
                                GetLastError()
                                );
                        return -1;
-               }       
+               }
        }
        if ( !GetVolumeInformationW(
        }
        if ( !GetVolumeInformationW(
-               RootDirectory, 
+               RootDirectory,
                volumeName,
                volumeName,
-               WBUFSIZE(volumeName), 
+               WBUFSIZE(volumeName),
                & serialNumber,
                & maxComponent,
                & serialNumber,
                & maxComponent,
-               & flags, 
+               & flags,
                fileSystem,
                WBUFSIZE(fileSystem) )
        ) {
                fileSystem,
                WBUFSIZE(fileSystem) )
        ) {
@@ -594,16 +594,16 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
                        );
                return -1;
        }
                        );
                return -1;
        }
-       // 
+       //
        // Print out some stuff including the formatted size
        //
        if ( !GetDiskFreeSpaceExW(
        // Print out some stuff including the formatted size
        //
        if ( !GetDiskFreeSpaceExW(
-               RootDirectory, 
+               RootDirectory,
                & freeBytesAvailableToCaller,
                & totalNumberOfBytes,
                & totalNumberOfFreeBytes )
        ) {
                & freeBytesAvailableToCaller,
                & totalNumberOfBytes,
                & totalNumberOfFreeBytes )
        ) {
-               PrintWin32Error( 
+               PrintWin32Error(
                        L"Could not query volume size",
                        GetLastError()
                        );
                        L"Could not query volume size",
                        GetLastError()
                        );
@@ -621,16 +621,16 @@ ReactOs adaptation 1999 by Emanuele Aliberti\n\n"
        // Get the drive's serial number
        //
        if ( !GetVolumeInformationW(
        // Get the drive's serial number
        //
        if ( !GetVolumeInformationW(
-               RootDirectory, 
+               RootDirectory,
                volumeName,
                volumeName,
-               WBUFSIZE(volumeName), 
+               WBUFSIZE(volumeName),
                & serialNumber,
                & maxComponent,
                & serialNumber,
                & maxComponent,
-               & flags, 
+               & flags,
                fileSystem,
                WBUFSIZE(fileSystem) )
        ) {
                fileSystem,
                WBUFSIZE(fileSystem) )
        ) {
-               PrintWin32Error( 
+               PrintWin32Error(
                        L"Could not query volume",
                        GetLastError()
                        );
                        L"Could not query volume",
                        GetLastError()
                        );
index 991c8d3..d518a48 100644 (file)
@@ -72,7 +72,7 @@ main (int argc, char * argv [] )
        {
                char * NextDosDevice = SymbolicLinks;
                char * NextDevice;
        {
                char * NextDosDevice = SymbolicLinks;
                char * NextDevice;
-               
+
                while (TRUE == GetNextString (
                                        SymbolicLinks,
                                        DosDeviceName,
                while (TRUE == GetNextString (
                                        SymbolicLinks,
                                        DosDeviceName,
@@ -102,7 +102,7 @@ main (int argc, char * argv [] )
                        else
                        {
                                PrintWin32Error (
                        else
                        {
                                PrintWin32Error (
-                                       L"ldd: ", 
+                                       L"ldd: ",
                                        GetLastError ()
                                        );
                        }
                                        GetLastError ()
                                        );
                        }
@@ -112,7 +112,7 @@ main (int argc, char * argv [] )
        else
        {
                PrintWin32Error (
        else
        {
                PrintWin32Error (
-                       L"ldd: ", 
+                       L"ldd: ",
                        GetLastError ()
                        );
                return EXIT_FAILURE;
                        GetLastError ()
                        );
                return EXIT_FAILURE;
index 9a42047..63d4257 100644 (file)
@@ -5,15 +5,15 @@
  * PROJECT    : ReactOS Operating System
  * DESCRIPTION: manual file browser (Use Linux man file syntax)
  * DATE       : 2004-03-29
  * PROJECT    : ReactOS Operating System
  * DESCRIPTION: manual file browser (Use Linux man file syntax)
  * DATE       : 2004-03-29
- * LICENSE    : GPL 
+ * LICENSE    : GPL
  */
  */
+
  /*  Known issues.
   *  1. Scroll screen
   *  2. Non ENVIRONMENT manpath varrible
   *  3. At the end of man page must be ./" tag!
   */
  /*  Known issues.
   *  1. Scroll screen
   *  2. Non ENVIRONMENT manpath varrible
   *  3. At the end of man page must be ./" tag!
   */
-  
+
 
 #include <stdio.h>
 #include <string.h>
 
 #include <stdio.h>
 #include <string.h>
@@ -51,18 +51,18 @@ OpenF(char* name)
 {
     int retval=0;
     char *manpath_local=(char*)malloc(sizeof(char)*MAXLINE);
 {
     int retval=0;
     char *manpath_local=(char*)malloc(sizeof(char)*MAXLINE);
-    
+
     strcpy(manpath_local, manpath); //save mandir value
     strcpy(manpath_local, manpath); //save mandir value
-    
+
     if((manfile=fopen((strcat(manpath_local,name)),"r"))!=NULL)
     if((manfile=fopen((strcat(manpath_local,name)),"r"))!=NULL)
-     { 
+     {
       OpenFlag=1;
       AnalyzeFile();
      }
       OpenFlag=1;
       AnalyzeFile();
      }
-    else 
+    else
      retval=-1;
      retval=-1;
-          
- strcpy(manpath_local, manpath);    
+
+ strcpy(manpath_local, manpath);
  return retval;
 }
 
  return retval;
 }
 
@@ -70,14 +70,14 @@ int
 CloseF()
 {
     int retval=0;
 CloseF()
 {
     int retval=0;
-    
+
     if(fclose(manfile))
      OpenFlag=0;
     else retval=-1;
     if(fclose(manfile))
      OpenFlag=0;
     else retval=-1;
-    
+
     return retval;
 }
     return retval;
 }
+
 void
 Usage()
 {
 void
 Usage()
 {
@@ -93,9 +93,9 @@ AnalyzeArgv(char *argument)
     char *keys[]={"--help","/h","/?","-h"};
     char *sections[]={".1",".2",".3",".4",".5",".6",".7",".8",".9"};
     char *filename=(char*)malloc(sizeof(char)*MAXLINE);
     char *keys[]={"--help","/h","/?","-h"};
     char *sections[]={".1",".2",".3",".4",".5",".6",".7",".8",".9"};
     char *filename=(char*)malloc(sizeof(char)*MAXLINE);
-    
+
     strcpy(filename,argument); //save argument value
     strcpy(filename,argument); //save argument value
+
     for(element=0; element < 5;element++)
      if(!strcmp(keys[element],argument))
      {
     for(element=0; element < 5;element++)
      if(!strcmp(keys[element],argument))
      {
@@ -104,18 +104,18 @@ AnalyzeArgv(char *argument)
      }
 
    element = 0;
      }
 
    element = 0;
-   
+
    if(!HelpFlag)
    if(!HelpFlag)
-   
+
    if(OpenF(filename))
     while(OpenF(strcat(filename,sections[element])) && (element<9))
     {
      strcpy(filename,argument);
      element++;
    if(OpenF(filename))
     while(OpenF(strcat(filename,sections[element])) && (element<9))
     {
      strcpy(filename,argument);
      element++;
-    } 
-    
-    if(element>8) printf("No manual for %s\n",argument);   
-          
+    }
+
+    if(element>8) printf("No manual for %s\n",argument);
+
     return element;
 }
 
     return element;
 }
 
@@ -125,15 +125,15 @@ AnalyzeFile()
     char *cur_string=(char*)malloc(sizeof(char)*MAXLINE);
     int symbol=0;
     char *THtag=(char*)malloc(sizeof(char)*MAXLINE);
     char *cur_string=(char*)malloc(sizeof(char)*MAXLINE);
     int symbol=0;
     char *THtag=(char*)malloc(sizeof(char)*MAXLINE);
-    
-   
+
+
     void sh_outp(void)
      {
       putchar('\n');
       putchar('\n');
       for(symbol=3;putchar(cur_string[symbol]); symbol++);
      }
     void sh_outp(void)
      {
       putchar('\n');
       putchar('\n');
       for(symbol=3;putchar(cur_string[symbol]); symbol++);
      }
-     
+
     void th_outp(void)
      {
       putchar('\n');
     void th_outp(void)
      {
       putchar('\n');
@@ -143,31 +143,31 @@ AnalyzeFile()
       SetCl(ITALIC);
        for(symbol=3;putchar(THtag[symbol]); symbol++);
       putchar('\n');
       SetCl(ITALIC);
        for(symbol=3;putchar(THtag[symbol]); symbol++);
       putchar('\n');
-      SetCl(NORMAL); 
+      SetCl(NORMAL);
      }
 
     void text_outp(void)
      {
       char TagFlag=0;
       symbol=0;
      }
 
     void text_outp(void)
      {
       char TagFlag=0;
       symbol=0;
-      
+
       if(cur_string[0]=='.')
        while(cur_string[symbol]!=' ')
         symbol++;
       if(cur_string[0]=='.')
        while(cur_string[symbol]!=' ')
         symbol++;
-        
+
      if(symbol) TagFlag=1;
      if(symbol) TagFlag=1;
-          
+
      for(;cur_string[symbol]!='\n'; symbol++)
         putchar(cur_string[symbol]);
         putchar(' ');
      }
      for(;cur_string[symbol]!='\n'; symbol++)
         putchar(cur_string[symbol]);
         putchar(' ');
      }
-   
+
     while(fgets(cur_string,MAXLINE,manfile))
     while(fgets(cur_string,MAXLINE,manfile))
-    
+
 /* TAGs processing */
      if((cur_string[0]=='.')&&(cur_string[1]=='S')&&
        (cur_string[2]=='H')) // .SH tag
 /* TAGs processing */
      if((cur_string[0]=='.')&&(cur_string[1]=='S')&&
        (cur_string[2]=='H')) // .SH tag
-      { 
+      {
        SetCl(BOLD);
        sh_outp();
        SetCl(NORMAL);
        SetCl(BOLD);
        sh_outp();
        SetCl(NORMAL);
@@ -183,7 +183,7 @@ AnalyzeFile()
      else
      if((cur_string[0]=='.')&&(cur_string[1]=='/')&&
        (cur_string[2]=='\"')); // ./" tag (comment)
      else
      if((cur_string[0]=='.')&&(cur_string[1]=='/')&&
        (cur_string[2]=='\"')); // ./" tag (comment)
-     
+
      else
      if((cur_string[0]=='.')&&(cur_string[1]=='T')&&
        (cur_string[2]=='H')) // .TH tag
      else
      if((cur_string[0]=='.')&&(cur_string[1]=='T')&&
        (cur_string[2]=='H')) // .TH tag
@@ -201,18 +201,18 @@ AnalyzeFile()
       else
       if((cur_string[0]=='.')&&(cur_string[1]=='N')&&
         (cur_string[2]=='L'))
       else
       if((cur_string[0]=='.')&&(cur_string[1]=='N')&&
         (cur_string[2]=='L'))
-       { 
+       {
         putchar('\n');
         putchar(' ');
         putchar('\n');
         putchar(' ');
-       } 
-      
+       }
+
      else text_outp(); // print plane text
      th_outp();
 /* END of TAGs processing */
      return 0;
 }
      else text_outp(); // print plane text
      th_outp();
 /* END of TAGs processing */
      return 0;
 }
-    
+
+
 int
 main(int argc, char *argv[])
 {
 int
 main(int argc, char *argv[])
 {
@@ -223,7 +223,7 @@ main(int argc, char *argv[])
      case 2:  AnalyzeArgv(argv[1]);break;
      default: Usage();break;
     }
      case 2:  AnalyzeArgv(argv[1]);break;
      default: Usage();break;
     }
-    
+
    if(OpenFlag)CloseF();
    SetCl(NORMAL);
    return 0;
    if(OpenFlag)CloseF();
    SetCl(NORMAL);
    return 0;
index 8a53819..374da47 100644 (file)
@@ -1,14 +1,14 @@
 // $Id$
 //
 // $Id$
 //
-// This program was written by Sang Cho, assistant professor at 
-//                                       the department of 
+// This program was written by Sang Cho, assistant professor at
+//                                       the department of
 //                                                                               computer science and engineering
 //                                                                               chongju university
 // this program is based on the program pefile.c
 // which is written by Randy Kath(Microsoft Developmer Network Technology Group)
 // in june 12, 1993.
 // I have investigated P.E. file format as thoroughly as possible,
 //                                                                               computer science and engineering
 //                                                                               chongju university
 // this program is based on the program pefile.c
 // which is written by Randy Kath(Microsoft Developmer Network Technology Group)
 // in june 12, 1993.
 // I have investigated P.E. file format as thoroughly as possible,
-// but I cannot claim that I am an expert yet, so some of its information  
+// but I cannot claim that I am an expert yet, so some of its information
 // may give you wrong results.
 //
 //
 // may give you wrong results.
 //
 //
@@ -511,18 +511,18 @@ IMAGE_NORMAL_MENU_ITEM, *PIMAGE_NORMAL_MENU_ITEM;
 
 // Dialog Box Resources .................. added by sang cho.
 
 
 // Dialog Box Resources .................. added by sang cho.
 
-// A dialog box is contained in a single resource and has a header and 
+// A dialog box is contained in a single resource and has a header and
 // a portion repeated for each control in the dialog box.
 // The item DWORD IStyle is a standard window style composed of flags found
 // in WINDOWS.H.
 // The default style for a dialog box is:
 // WS_POPUP | WS_BORDER | WS_SYSMENU
 // a portion repeated for each control in the dialog box.
 // The item DWORD IStyle is a standard window style composed of flags found
 // in WINDOWS.H.
 // The default style for a dialog box is:
 // WS_POPUP | WS_BORDER | WS_SYSMENU
-// 
+//
 // The itme marked "Name or Ordinal" are :
 // If the first word is an 0xffff, the next two bytes contain an ordinal ID.
 // Otherwise, the first one or more WORDS contain a double-null-terminated string.
 // An empty string is represented by a single WORD zero in the first location.
 // The itme marked "Name or Ordinal" are :
 // If the first word is an 0xffff, the next two bytes contain an ordinal ID.
 // Otherwise, the first one or more WORDS contain a double-null-terminated string.
 // An empty string is represented by a single WORD zero in the first location.
-// 
+//
 // The WORD wPointSize and WCHAR szFontName entries are present if the FONT
 // statement was included for the dialog box. This can be detected by checking
 // the entry IStyle. If IStyle & DS_SETFONT ( which is 0x40), then these
 // The WORD wPointSize and WCHAR szFontName entries are present if the FONT
 // statement was included for the dialog box. This can be detected by checking
 // the entry IStyle. If IStyle & DS_SETFONT ( which is 0x40), then these
@@ -905,13 +905,13 @@ BOOL WINAPI GetSeparateDebugHeader (LPVOID, PIMAGE_SEPARATE_DEBUG_HEADER);
 
 /**********************************************************************
  * NAME
 
 /**********************************************************************
  * NAME
- * 
+ *
  * DESCRIPTION
  *     Copy DOS header information to structure.
  *
  * ARGUMENTS
  */
  * DESCRIPTION
  *     Copy DOS header information to structure.
  *
  * ARGUMENTS
  */
-BOOL WINAPI 
+BOOL WINAPI
 GetDosHeader (
               LPVOID lpFile,
               PIMAGE_DOS_HEADER pHeader
 GetDosHeader (
               LPVOID lpFile,
               PIMAGE_DOS_HEADER pHeader
@@ -937,7 +937,7 @@ GetDosHeader (
 
 
 /* return file signature */
 
 
 /* return file signature */
-DWORD WINAPI 
+DWORD WINAPI
 ImageFileType (
                LPVOID lpFile)
 {
 ImageFileType (
                LPVOID lpFile)
 {
@@ -965,7 +965,7 @@ ImageFileType (
 
 
 /* copy file header information to structure */
 
 
 /* copy file header information to structure */
-BOOL WINAPI 
+BOOL WINAPI
 GetPEFileHeader (
                  LPVOID lpFile,
                  PIMAGE_FILE_HEADER pHeader)
 GetPEFileHeader (
                  LPVOID lpFile,
                  PIMAGE_FILE_HEADER pHeader)
@@ -984,7 +984,7 @@ GetPEFileHeader (
 
 
 /* copy optional header info to structure */
 
 
 /* copy optional header info to structure */
-BOOL WINAPI 
+BOOL WINAPI
 GetPEOptionalHeader (
                      LPVOID lpFile,
                      PIMAGE_OPTIONAL_HEADER pHeader)
 GetPEOptionalHeader (
                      LPVOID lpFile,
                      PIMAGE_OPTIONAL_HEADER pHeader)
@@ -1003,7 +1003,7 @@ GetPEOptionalHeader (
 
 /* function returns the entry point for an exe module lpFile must
    be a memory mapped file pointer to the beginning of the image file */
 
 /* function returns the entry point for an exe module lpFile must
    be a memory mapped file pointer to the beginning of the image file */
-LPVOID WINAPI 
+LPVOID WINAPI
 GetModuleEntryPoint (
                      LPVOID lpFile)
 {
 GetModuleEntryPoint (
                      LPVOID lpFile)
 {
@@ -1019,7 +1019,7 @@ GetModuleEntryPoint (
 
 
 /* return the total number of sections in the module */
 
 
 /* return the total number of sections in the module */
-int WINAPI 
+int WINAPI
 NumOfSections (
                LPVOID lpFile)
 {
 NumOfSections (
                LPVOID lpFile)
 {
@@ -1031,7 +1031,7 @@ NumOfSections (
 
 
 /* retrieve entry point */
 
 
 /* retrieve entry point */
-LPVOID WINAPI 
+LPVOID WINAPI
 GetImageBase (
               LPVOID lpFile)
 {
 GetImageBase (
               LPVOID lpFile)
 {
@@ -1051,7 +1051,7 @@ GetImageBase (
 //
 /* function returns the actual address of given RVA,      lpFile must
    be a memory mapped file pointer to the beginning of the image file */
 //
 /* function returns the actual address of given RVA,      lpFile must
    be a memory mapped file pointer to the beginning of the image file */
-LPVOID WINAPI 
+LPVOID WINAPI
 GetActualAddress (
                   LPVOID lpFile,
                   DWORD dwRVA)
 GetActualAddress (
                   LPVOID lpFile,
                   DWORD dwRVA)
@@ -1093,7 +1093,7 @@ GetActualAddress (
 //
 //
 /* return offset to specified IMAGE_DIRECTORY entry */
 //
 //
 /* return offset to specified IMAGE_DIRECTORY entry */
-LPVOID WINAPI 
+LPVOID WINAPI
 ImageDirectoryOffset (
                       LPVOID lpFile,
                       DWORD dwIMAGE_DIRECTORY)
 ImageDirectoryOffset (
                       LPVOID lpFile,
                       DWORD dwIMAGE_DIRECTORY)
@@ -1132,7 +1132,7 @@ ImageDirectoryOffset (
 
 
 /* function retrieve names of all the sections in the file */
 
 
 /* function retrieve names of all the sections in the file */
-int WINAPI 
+int WINAPI
 GetSectionNames (
                  LPVOID lpFile,
                  char **pszSections)
 GetSectionNames (
                  LPVOID lpFile,
                  char **pszSections)
@@ -1168,7 +1168,7 @@ GetSectionNames (
 
 
 /* function gets the function header for a section identified by name */
 
 
 /* function gets the function header for a section identified by name */
-BOOL WINAPI 
+BOOL WINAPI
 GetSectionHdrByName (
                      LPVOID lpFile,
                      IMAGE_SECTION_HEADER * sh,
 GetSectionHdrByName (
                      LPVOID lpFile,
                      IMAGE_SECTION_HEADER * sh,
@@ -1204,7 +1204,7 @@ GetSectionHdrByName (
 //
 //
 /* get import modules names separated by null terminators, return module count */
 //
 //
 /* get import modules names separated by null terminators, return module count */
-int WINAPI 
+int WINAPI
 GetImportModuleNames (
                       LPVOID lpFile,
                       char **pszModules)
 GetImportModuleNames (
                       LPVOID lpFile,
                       char **pszModules)
@@ -1261,7 +1261,7 @@ GetImportModuleNames (
 //
 //
 /* get import module function names separated by null terminators, return function count */
 //
 //
 /* get import module function names separated by null terminators, return function count */
-int WINAPI 
+int WINAPI
 GetImportFunctionNamesByModule (
                                 LPVOID lpFile,
                                 char *pszModule,
 GetImportFunctionNamesByModule (
                                 LPVOID lpFile,
                                 char *pszModule,
@@ -1378,7 +1378,7 @@ GetImportFunctionNamesByModule (
 //                                                         October 6, 1997
 //
 /* get numerically expressed string length */
 //                                                         October 6, 1997
 //
 /* get numerically expressed string length */
-int WINAPI 
+int WINAPI
 GetStringLength (
                  char *psz)
 {
 GetStringLength (
                  char *psz)
 {
@@ -1399,7 +1399,7 @@ GetStringLength (
 //
 
 /* translate parameter part of condensed name */
 //
 
 /* translate parameter part of condensed name */
-void WINAPI 
+void WINAPI
 GetPreviousParamString (
                         char *xpin,    // read-only source
                          char *xpout)  // translated result
 GetPreviousParamString (
                         char *xpin,    // read-only source
                          char *xpout)  // translated result
@@ -1464,7 +1464,7 @@ GetPreviousParamString (
 //
 
 /* translate parameter part of condensed name */
 //
 
 /* translate parameter part of condensed name */
-void WINAPI 
+void WINAPI
 TranslateParameters (
                      char **ppin,      // read-only source
                       char **ppout,    // translated result
 TranslateParameters (
                      char **ppin,      // read-only source
                       char **ppout,    // translated result
@@ -1675,7 +1675,7 @@ TranslateParameters (
 //
 
 /* translate parameter part of condensed name */
 //
 
 /* translate parameter part of condensed name */
-BOOL WINAPI 
+BOOL WINAPI
 StringExpands (
                char **ppin,    // read-only source
                 char **ppout,  // translated result
 StringExpands (
                char **ppin,    // read-only source
                 char **ppout,  // translated result
@@ -1925,7 +1925,7 @@ StringExpands (
 //} Str_P;
 //----------------------------------------------------------------------
 //
 //} Str_P;
 //----------------------------------------------------------------------
 //
-// I think I knocked it down finally. But who knows? 
+// I think I knocked it down finally. But who knows?
 //                            october 12, 1997 ... sang
 //
 // well I have to rewrite whole part of TranslateFunctionName..
 //                            october 12, 1997 ... sang
 //
 // well I have to rewrite whole part of TranslateFunctionName..
@@ -1934,11 +1934,11 @@ StringExpands (
 // and i hope this will take care of every symptoms i have experienced..
 //                                                        october 10, 1997 .... sang
 // It took a lot of time for me to figure out what is all about....
 // and i hope this will take care of every symptoms i have experienced..
 //                                                        october 10, 1997 .... sang
 // It took a lot of time for me to figure out what is all about....
-// but still some prefixes like z (static) 
+// but still some prefixes like z (static)
 //     -- or some types like b (byte) ,g (long double) ,s (short) --
 //         -- or postfix  like M ( * )
 //     -- or $or ( & ) which is pretty wierd.         .. added.. october 12
 //     -- or some types like b (byte) ,g (long double) ,s (short) --
 //         -- or postfix  like M ( * )
 //     -- or $or ( & ) which is pretty wierd.         .. added.. october 12
-//     -- also $t business is quite tricky too. (templates) 
+//     -- also $t business is quite tricky too. (templates)
 //             there may be a lot of things undiscovered yet....
 // I am not so sure my interpretation is correct or not
 // If I am wrong please let me know.
 //             there may be a lot of things undiscovered yet....
 // I am not so sure my interpretation is correct or not
 // If I am wrong please let me know.
@@ -1949,7 +1949,7 @@ StringExpands (
 //                                                         October 5, 1997
 //
 /* translate condesed import function name */
 //                                                         October 5, 1997
 //
 /* translate condesed import function name */
-LPVOID WINAPI 
+LPVOID WINAPI
 TranslateFunctionName (
                        char *psz)
 {
 TranslateFunctionName (
                        char *psz)
 {
@@ -1967,7 +1967,7 @@ TranslateFunctionName (
 
   Str_P tok;                   // String token
 
 
   Str_P tok;                   // String token
 
-  Str_P c_str;                 // current string 
+  Str_P c_str;                 // current string
 
   int iend = 0;
   char *endTab[8];             // end of string position check
 
   int iend = 0;
   char *endTab[8];             // end of string position check
@@ -2088,7 +2088,7 @@ TranslateFunctionName (
                  // string mode restored...
                  else;
                }
                  // string mode restored...
                  else;
                }
-             else;             // do nothing.. 
+             else;             // do nothing..
 
            }
 
 
            }
 
@@ -2100,7 +2100,7 @@ TranslateFunctionName (
            break;
 
          //---------------------------------------------------------------
            break;
 
          //---------------------------------------------------------------
-         // string part processing : no '$' met yet 
+         // string part processing : no '$' met yet
          //                       or inside of '%' block
          //                       or inside of '#' block (numbered string)
          //---------------------------------------------------------------
          //                       or inside of '%' block
          //                       or inside of '#' block (numbered string)
          //---------------------------------------------------------------
@@ -2109,7 +2109,7 @@ TranslateFunctionName (
            *pout++ = *pin++;
          //else if (is > 1)         *pout++ = *pin++;
 
            *pout++ = *pin++;
          //else if (is > 1)         *pout++ = *pin++;
 
-         //------------------------------------------------ 
+         //------------------------------------------------
          // parameter part processing: '$' met
          //------------------------------------------------
 
          // parameter part processing: '$' met
          //------------------------------------------------
 
@@ -2155,7 +2155,7 @@ TranslateFunctionName (
 
          if (tok.flag == '%')
            {
 
          if (tok.flag == '%')
            {
-             // pop '%' token and set c_str 
+             // pop '%' token and set c_str
              //if (*pin)
              //printf("\n pop percent token..next char = %c", *pin);
              //else printf("\n pop percent token..next char = NULL");
              //if (*pin)
              //printf("\n pop percent token..next char = %c", *pin);
              //else printf("\n pop percent token..next char = NULL");
@@ -2195,7 +2195,7 @@ TranslateFunctionName (
       //
       // sometimes we need string to use as constructor name or destructor name
       //
       //
       // sometimes we need string to use as constructor name or destructor name
       //
-      else if (c == '@')       // get string from previous marker  upto here. 
+      else if (c == '@')       // get string from previous marker  upto here.
 
        {
          pin++;
 
        {
          pin++;
@@ -2360,7 +2360,7 @@ TranslateFunctionName (
 //
 //
 /* get exported function names separated by null terminators, return count of functions */
 //
 //
 /* get exported function names separated by null terminators, return count of functions */
-int WINAPI 
+int WINAPI
 GetExportFunctionNames (
                         LPVOID lpFile,
                         char **pszFunctions)
 GetExportFunctionNames (
                         LPVOID lpFile,
                         char **pszFunctions)
@@ -2372,7 +2372,7 @@ GetExportFunctionNames (
 
   char *pfns[8192] =
   {NULL,};                     // maximum number of functions
 
   char *pfns[8192] =
   {NULL,};                     // maximum number of functions
-  //=============================  
+  //=============================
 
   char buff[256];              // enough for any string ??
 
 
   char buff[256];              // enough for any string ??
 
@@ -2488,7 +2488,7 @@ GetExportFunctionNames (
 
 
 /* determine the total number of resources in the section */
 
 
 /* determine the total number of resources in the section */
-int WINAPI 
+int WINAPI
 GetNumberOfResources (
                       LPVOID lpFile)
 {
 GetNumberOfResources (
                       LPVOID lpFile)
 {
@@ -2531,7 +2531,7 @@ GetNumberOfResources (
 //
 //
 /* name each type of resource in the section */
 //
 //
 /* name each type of resource in the section */
-int WINAPI 
+int WINAPI
 GetListOfResourceTypes (
                         LPVOID lpFile,
                         char **pszResTypes)
 GetListOfResourceTypes (
                         LPVOID lpFile,
                         char **pszResTypes)
@@ -2705,7 +2705,7 @@ GetListOfResourceTypes (
 //                                                         October 12, 1997
 //
 /* copy menu information */
 //                                                         October 12, 1997
 //
 /* copy menu information */
-void WINAPI 
+void WINAPI
 StrangeMenuFill (
                  char **psz,   // results
                   WORD ** pMenu,       // read-only
 StrangeMenuFill (
                  char **psz,   // results
                   WORD ** pMenu,       // read-only
@@ -2733,7 +2733,7 @@ StrangeMenuFill (
 //                                                         October 1, 1997
 //
 /* obtain menu information */
 //                                                         October 1, 1997
 //
 /* obtain menu information */
-int WINAPI 
+int WINAPI
 MenuScan (
           int *len,
           WORD ** pMenu)
 MenuScan (
           int *len,
           WORD ** pMenu)
@@ -2789,7 +2789,7 @@ MenuScan (
       if (flag1 & 0x0080)
        break;
     }
       if (flag1 & 0x0080)
        break;
     }
-//  fill # of details to num above 
+//  fill # of details to num above
   //(*len) += 2;
   *pMenu = pwd;
   return flag;
   //(*len) += 2;
   *pMenu = pwd;
   return flag;
@@ -2801,7 +2801,7 @@ MenuScan (
 //                                                         October 2, 1997
 //
 /* copy menu information */
 //                                                         October 2, 1997
 //
 /* copy menu information */
-int WINAPI 
+int WINAPI
 MenuFill (
           char **psz,
           WORD ** pMenu)
 MenuFill (
           char **psz,
           WORD ** pMenu)
@@ -2869,7 +2869,7 @@ MenuFill (
       if (flag1 & 0x0080)
        break;
     }
       if (flag1 & 0x0080)
        break;
     }
-//  fill # of details to num above 
+//  fill # of details to num above
   //*(WORD *)pTemp = (WORD)num;
   *pMenu = pwd;
   *psz = ptr;
   //*(WORD *)pTemp = (WORD)num;
   *pMenu = pwd;
   *psz = ptr;
@@ -2880,7 +2880,7 @@ MenuFill (
 //
 //==============================================================================
 // The following program is based on preorder-tree-traversal.
 //
 //==============================================================================
 // The following program is based on preorder-tree-traversal.
-// once you understand how to traverse..... 
+// once you understand how to traverse.....
 // the rest is pretty straight forward.
 // still we need to scan it first and fill it next time.
 // and finally we can print it.
 // the rest is pretty straight forward.
 // still we need to scan it first and fill it next time.
 // and finally we can print it.
@@ -2897,14 +2897,14 @@ MenuFill (
 //     supermenuname                    null terminated string, only ascii is considered.
 //         flag                 tells : node is a leaf or a internal node.
 //         popupname                    null terminated string
 //     supermenuname                    null terminated string, only ascii is considered.
 //         flag                 tells : node is a leaf or a internal node.
 //         popupname                    null terminated string
-//              
+//
 //              flag                normal menu flag (leaf node)
 //                      id                                  normal menu id
 //              name                    normal menu name
 //         or                            or
 //              flag                        popup menu flag (internal node)
 //              flag                normal menu flag (leaf node)
 //                      id                                  normal menu id
 //              name                    normal menu name
 //         or                            or
 //              flag                        popup menu flag (internal node)
-//              popupname                   popup menu name 
-//             
+//              popupname                   popup menu name
+//
 //                 flag                             it may folows
 //                         id                                   normal menu id
 //                 name                                 normal menu name
 //                 flag                             it may folows
 //                         id                                   normal menu id
 //                 name                                 normal menu name
@@ -2916,7 +2916,7 @@ MenuFill (
 //                                 but usually, it only goes a few steps,...
 // ------------------------------------------------------------------------------
 /* scan menu and copy menu */
 //                                 but usually, it only goes a few steps,...
 // ------------------------------------------------------------------------------
 /* scan menu and copy menu */
-int WINAPI 
+int WINAPI
 GetContentsOfMenu (
                    LPVOID lpFile,
                    char **pszResTypes)
 GetContentsOfMenu (
                    LPVOID lpFile,
                    char **pszResTypes)
@@ -3004,7 +3004,7 @@ GetContentsOfMenu (
       // normally wVersion and cbHeaderSize should be zero
       // but if it is not then nothing is known to us...
       // so let's do our best ... namely guessing .... and trying ....
       // normally wVersion and cbHeaderSize should be zero
       // but if it is not then nothing is known to us...
       // so let's do our best ... namely guessing .... and trying ....
-      //                      ... and suffering   ... 
+      //                      ... and suffering   ...
       // it gave me many sleepless (not exactly but I like to say this) nights.
       //
 
       // it gave me many sleepless (not exactly but I like to say this) nights.
       //
 
@@ -3017,7 +3017,7 @@ GetContentsOfMenu (
          // expect to return the length needed to report.
          // sixteen more bytes to do something
          sLength += 16 + size;
          // expect to return the length needed to report.
          // sixteen more bytes to do something
          sLength += 16 + size;
-         //StrangeMenuScan (&sLength, &pwd, size);   
+         //StrangeMenuScan (&sLength, &pwd, size);
        }
       // normal case
       else
        }
       // normal case
       else
@@ -3197,7 +3197,7 @@ GetContentsOfMenu (
 //                                                         October 12, 1997
 //
 /* print contents of menu */
 //                                                         October 12, 1997
 //
 /* print contents of menu */
-int WINAPI 
+int WINAPI
 PrintStrangeMenu (
                   char **psz)
 {
 PrintStrangeMenu (
                   char **psz)
 {
@@ -3239,7 +3239,7 @@ PrintStrangeMenu (
 //                                                         October 2, 1997
 //
 /* print contents of menu */
 //                                                         October 2, 1997
 //
 /* print contents of menu */
-int WINAPI 
+int WINAPI
 PrintMenu (
            int indent,
            char **psz)
 PrintMenu (
            int indent,
            char **psz)
@@ -3271,7 +3271,7 @@ PrintMenu (
          PrintMenu (indent + 5, psz);
          ptr = *psz;
        }
          PrintMenu (indent + 5, psz);
          ptr = *psz;
        }
-      else                     // ispopup == 0 
+      else                     // ispopup == 0
 
        {
          printf ("\n");
 
        {
          printf ("\n");
@@ -3322,7 +3322,7 @@ PrintMenu (
 //                                                         October 2, 1997
 //
 /* the format of menu is not known so I'll do my best */
 //                                                         October 2, 1997
 //
 /* the format of menu is not known so I'll do my best */
-int WINAPI 
+int WINAPI
 dumpMenu (
           char **psz,
           int size)
 dumpMenu (
           char **psz,
           int size)
@@ -3387,7 +3387,7 @@ dumpMenu (
 //                                                         October 13, 1997
 //
 /* scan dialog box and copy dialog box */
 //                                                         October 13, 1997
 //
 /* scan dialog box and copy dialog box */
-int WINAPI 
+int WINAPI
 GetContentsOfDialog (
                      LPVOID lpFile,
                      char **pszResTypes)
 GetContentsOfDialog (
                      LPVOID lpFile,
                      char **pszResTypes)
@@ -3582,7 +3582,7 @@ GetContentsOfDialog (
 //                                                         October 14, 1997
 //
 /* print contents of dialog */
 //                                                         October 14, 1997
 //
 /* print contents of dialog */
-void WINAPI 
+void WINAPI
 PrintNameOrOrdinal (
                     char **psz)
 {
 PrintNameOrOrdinal (
                     char **psz)
 {
@@ -3615,7 +3615,7 @@ PrintNameOrOrdinal (
 //                                                         October 14, 1997
 //
 /* print contents of dialog */
 //                                                         October 14, 1997
 //
 /* print contents of dialog */
-void WINAPI 
+void WINAPI
 PrintDialog (
              char **psz)
 {
 PrintDialog (
              char **psz)
 {
@@ -3696,7 +3696,7 @@ PrintDialog (
       while (*(WORD *) ptr)
        ptr += 2;               // WCHARs
 
       while (*(WORD *) ptr)
        ptr += 2;               // WCHARs
 
-      ptr += 2;                        // double null  
+      ptr += 2;                        // double null
 
     }
 
 
     }
 
@@ -3786,15 +3786,15 @@ PrintDialog (
      if (c<0) c+=256;
      buff[j] = c;
      printf ("%02X",c);
      if (c<0) c+=256;
      buff[j] = c;
      printf ("%02X",c);
-     ptr++; 
+     ptr++;
      if (ptr >= pmax) break;
      n++;
      if (ptr >= pmax) break;
      n++;
-     if (n%4 == 0) printf (" "); 
+     if (n%4 == 0) printf (" ");
      }
      n++; if (n%4 == 0) printf (" ");
      l = j;
      j++;
      }
      n++; if (n%4 == 0) printf (" ");
      l = j;
      j++;
-     for (; j<16; j++) 
+     for (; j<16; j++)
      { n++; if (n%4 == 0) printf ("   "); else printf ("  "); }
      printf ("   ");
      for (k=0; k<l; k++)
      { n++; if (n%4 == 0) printf ("   "); else printf ("  "); }
      printf ("   ");
      for (k=0; k<l; k++)
@@ -3814,7 +3814,7 @@ PrintDialog (
 
 
 /* function indicates whether debug  info has been stripped from file */
 
 
 /* function indicates whether debug  info has been stripped from file */
-BOOL WINAPI 
+BOOL WINAPI
 IsDebugInfoStripped (
                      LPVOID lpFile)
 {
 IsDebugInfoStripped (
                      LPVOID lpFile)
 {
@@ -3829,7 +3829,7 @@ IsDebugInfoStripped (
 
 
 /* retrieve the module name from the debug misc. structure */
 
 
 /* retrieve the module name from the debug misc. structure */
-int WINAPI 
+int WINAPI
 RetrieveModuleName (
                     LPVOID lpFile,
                     char **pszModule)
 RetrieveModuleName (
                     LPVOID lpFile,
                     char **pszModule)
@@ -3868,7 +3868,7 @@ RetrieveModuleName (
 
 
 /* determine if this is a valid debug file */
 
 
 /* determine if this is a valid debug file */
-BOOL WINAPI 
+BOOL WINAPI
 IsDebugFile (
              LPVOID lpFile)
 {
 IsDebugFile (
              LPVOID lpFile)
 {
@@ -3883,7 +3883,7 @@ IsDebugFile (
 
 
 /* copy separate debug header structure from debug file */
 
 
 /* copy separate debug header structure from debug file */
-BOOL WINAPI 
+BOOL WINAPI
 GetSeparateDebugHeader (
                         LPVOID lpFile,
                         PIMAGE_SEPARATE_DEBUG_HEADER psdh)
 GetSeparateDebugHeader (
                         LPVOID lpFile,
                         PIMAGE_SEPARATE_DEBUG_HEADER psdh)
@@ -3904,7 +3904,7 @@ GetSeparateDebugHeader (
 //
 // I tried to immitate the output of w32dasm disassembler.
 // which is a pretty good program.
 //
 // I tried to immitate the output of w32dasm disassembler.
 // which is a pretty good program.
-// but I am disappointed with this program and I myself 
+// but I am disappointed with this program and I myself
 // am writting a disassembler.
 // This PEdump program is a byproduct of that project.
 // so enjoy this program and I hope we will have a little more
 // am writting a disassembler.
 // This PEdump program is a byproduct of that project.
 // so enjoy this program and I hope we will have a little more
@@ -3913,7 +3913,7 @@ GetSeparateDebugHeader (
 
 #define  MAXSECTIONNUMBER 16
 #define  MAXNAMESTRNUMBER 40
 
 #define  MAXSECTIONNUMBER 16
 #define  MAXNAMESTRNUMBER 40
-int 
+int
 main (
        int argc,
        char **argv
 main (
        int argc,
        char **argv
@@ -4190,7 +4190,7 @@ main (
          pst = pmNameBuff;
          printf ("\nNumber of Menus = %4d (decimal)", nMenus);
 
          pst = pmNameBuff;
          printf ("\nNumber of Menus = %4d (decimal)", nMenus);
 
-         //dumpMenu(&pst, 8096); 
+         //dumpMenu(&pst, 8096);
          for (i = 0; i < nMenus; i++)
            {
              // menu ID print
          for (i = 0; i < nMenus; i++)
            {
              // menu ID print
index 3b6337f..63226d8 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: qsi.c,v 1.7 2001/07/12 11:58:57 ekohl Exp $
+/* $Id$
  *
  * PROJECT    : ReactOS Operating System (see http://www.reactos.com/)
  * DESCRIPTION: Tool to query system information
  *
  * PROJECT    : ReactOS Operating System (see http://www.reactos.com/)
  * DESCRIPTION: Tool to query system information
@@ -6,7 +6,7 @@
  * AUTHOR     : Emanuele Aliberti
  * LICENSE    : GNU GPL (see http://www.gnu.org/)
  * DATE       : 1999-07-28
  * AUTHOR     : Emanuele Aliberti
  * LICENSE    : GNU GPL (see http://www.gnu.org/)
  * DATE       : 1999-07-28
- * 
+ *
  * BUILD INSTRUCTIONS
  *     If you got this code directly from the CVS repository on
  *     mok.lcvm.com, it should be ok to run "make sqi.exe" from the
  * BUILD INSTRUCTIONS
  *     If you got this code directly from the CVS repository on
  *     mok.lcvm.com, it should be ok to run "make sqi.exe" from the
@@ -48,7 +48,7 @@ struct
        BOOL    Active;
        HANDLE  Heap;
        INT     ExitCode;
        BOOL    Active;
        HANDLE  Heap;
        INT     ExitCode;
-       
+
 } Application =
 {
        {0, 0},
 } Application =
 {
        {0, 0},
@@ -119,7 +119,7 @@ DumpData (int Size, PVOID pData )
        {
                return;
        }
        {
                return;
        }
-       while (Size > 0) 
+       while (Size > 0)
        {
                printf ("%04x:  ", (Buffer - Base));
                for (   i = 0;
        {
                printf ("%04x:  ", (Buffer - Base));
                for (   i = 0;
@@ -224,7 +224,7 @@ FindRequiredBufferSize (int i, int step)
        INT             Size;
        LONG            Length = 0;
 
        INT             Size;
        LONG            Length = 0;
 
-       
+
        Size = step = (step > 0 ? step : 1);
        while   (       (Size < sizeof Buffer)
                        && (Status == STATUS_INFO_LENGTH_MISMATCH)
        Size = step = (step > 0 ? step : 1);
        while   (       (Size < sizeof Buffer)
                        && (Status == STATUS_INFO_LENGTH_MISMATCH)
@@ -267,7 +267,7 @@ STDCALL
 PrintStatus (NTSTATUS Status)
 {
        LPCSTR StatusName = NULL;
 PrintStatus (NTSTATUS Status)
 {
        LPCSTR StatusName = NULL;
-       
+
        switch (Status)
        {
                case STATUS_INVALID_INFO_CLASS:
        switch (Status)
        {
                case STATUS_INVALID_INFO_CLASS:
@@ -331,7 +331,7 @@ PrintUtcDateTime (LPCSTR Template, PTIME UtcTime)
                UtcTimeFields.Minute,
                UtcTimeFields.Second,
                UtcTimeFields.Milliseconds
                UtcTimeFields.Minute,
                UtcTimeFields.Second,
                UtcTimeFields.Milliseconds
-               ); 
+               );
        printf (
                Template,
                UtcTimeString
        printf (
                Template,
                UtcTimeString
@@ -345,7 +345,7 @@ PrintUtcDateTime (LPCSTR Template, PTIME UtcTime)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *     Dump whatever we get by calling NtQuerySystemInformation with
  *     a user provided system information class id.
  * DESCRIPTION
  *     Dump whatever we get by calling NtQuerySystemInformation with
  *     a user provided system information class id.
@@ -360,7 +360,7 @@ CMD_DEF(unknown)
        PBYTE           Buffer = NULL;
        NTSTATUS        Status;
 
        PBYTE           Buffer = NULL;
        NTSTATUS        Status;
 
-       
+
        printf ("SystemInformation %d:\n", _id);
        /* Find buffer size */
        Size = FindRequiredBufferSize (_id, 1);
        printf ("SystemInformation %d:\n", _id);
        /* Find buffer size */
        Size = FindRequiredBufferSize (_id, 1);
@@ -400,7 +400,7 @@ CMD_DEF(unknown)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -443,7 +443,7 @@ CMD_DEF(0)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -453,7 +453,7 @@ CMD_DEF(1)
 {
        NTSTATUS                        Status;
        SYSTEM_PROCESSOR_INFORMATION    Info;
 {
        NTSTATUS                        Status;
        SYSTEM_PROCESSOR_INFORMATION    Info;
-       
+
        RtlZeroMemory (
                (PVOID) & Info,
                sizeof Info
        RtlZeroMemory (
                (PVOID) & Info,
                sizeof Info
@@ -481,10 +481,10 @@ CMD_DEF(1)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *     System performance information.
  * DESCRIPTION
  *     System performance information.
- *     
+ *
  * NOTE
  *     Class 2.
  */
  * NOTE
  *     Class 2.
  */
@@ -588,7 +588,7 @@ CMD_DEF(2)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -621,7 +621,7 @@ CMD_DEF(3)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -653,7 +653,7 @@ CMD_DEF(4)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *     A snapshot of the process+thread tables.
  *
  * DESCRIPTION
  *     A snapshot of the process+thread tables.
  *
@@ -669,7 +669,7 @@ CMD_DEF(5)
 
        pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT);
        /* FIXME: check NULL==pInfo */
 
        pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT);
        /* FIXME: check NULL==pInfo */
-       
+
        /*
         *      Obtain required buffer size
         */
        /*
         *      Obtain required buffer size
         */
@@ -814,7 +814,7 @@ CMD_DEF(5)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -852,7 +852,7 @@ CMD_DEF(6)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -889,7 +889,7 @@ CMD_DEF(7)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -900,7 +900,7 @@ CMD_DEF(8)
        NTSTATUS                        Status;
        SYSTEM_PROCESSORTIME_INFO       Info;
        ULONG                           Length = 0;
        NTSTATUS                        Status;
        SYSTEM_PROCESSORTIME_INFO       Info;
        ULONG                           Length = 0;
-       
+
        Status = NtQuerySystemInformation (
                        8,
                        & Info,
        Status = NtQuerySystemInformation (
                        8,
                        & Info,
@@ -925,7 +925,7 @@ CMD_DEF(8)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -936,7 +936,7 @@ CMD_DEF(9)
        NTSTATUS                        Status;
        SYSTEM_FLAGS_INFORMATION        Info;
        ULONG                           Length = 0;
        NTSTATUS                        Status;
        SYSTEM_FLAGS_INFORMATION        Info;
        ULONG                           Length = 0;
-       
+
        Status = NtQuerySystemInformation (
                        9,
                        & Info,
        Status = NtQuerySystemInformation (
                        9,
                        & Info,
@@ -987,7 +987,7 @@ CMD_DEF(9)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -998,7 +998,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1033,7 +1033,7 @@ CMD_DEF(11)
                /*
                 *      Allocate buffer
                 */
                /*
                 *      Allocate buffer
                 */
-               pInfo = GlobalAlloc (GMEM_ZEROINIT, Length); 
+               pInfo = GlobalAlloc (GMEM_ZEROINIT, Length);
                if (NULL == pInfo)
                {
                        printf ("Could not allocate memory.\n");
                if (NULL == pInfo)
                {
                        printf ("Could not allocate memory.\n");
@@ -1084,7 +1084,7 @@ CMD_DEF(11)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1118,7 +1118,7 @@ CMD_DEF(12)
                        /*
                         *      Allocate buffer
                         */
                        /*
                         *      Allocate buffer
                         */
-                       pInfo = GlobalReAlloc (pInfo, Length, GMEM_ZEROINIT); 
+                       pInfo = GlobalReAlloc (pInfo, Length, GMEM_ZEROINIT);
                        if (NULL == pInfo)
                        {
                                printf ("Could not allocate memory.\n");
                        if (NULL == pInfo)
                        {
                                printf ("Could not allocate memory.\n");
@@ -1174,7 +1174,7 @@ CMD_DEF(12)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1185,7 +1185,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1196,7 +1196,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1207,7 +1207,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1242,7 +1242,7 @@ CMD_DEF(16)
                        /*
                         *      Allocate buffer
                         */
                        /*
                         *      Allocate buffer
                         */
-                       pInfo = GlobalReAlloc (pInfo, Length, GMEM_ZEROINIT); 
+                       pInfo = GlobalReAlloc (pInfo, Length, GMEM_ZEROINIT);
                        if (NULL == pInfo)
                        {
                                printf ("\tCould not allocate memory.\n");
                        if (NULL == pInfo)
                        {
                                printf ("\tCould not allocate memory.\n");
@@ -1303,7 +1303,7 @@ CMD_DEF(16)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1314,7 +1314,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1325,10 +1325,10 @@ CMD_DEF(18)
        NTSTATUS                        Status;
        PSYSTEM_PAGEFILE_INFORMATION    pInfo = NULL;
        LONG                            Length = 0;
        NTSTATUS                        Status;
        PSYSTEM_PAGEFILE_INFORMATION    pInfo = NULL;
        LONG                            Length = 0;
-       
+
        pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT);
        /* FIXME: check pInfo */
        pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT);
        /* FIXME: check pInfo */
-       
+
        Status = NtQuerySystemInformation(
                        18,
                        pInfo,
        Status = NtQuerySystemInformation(
                        18,
                        pInfo,
@@ -1342,7 +1342,7 @@ CMD_DEF(18)
                        /*
                         *      Allocate buffer
                         */
                        /*
                         *      Allocate buffer
                         */
-                       pInfo = GlobalReAlloc (pInfo, Length, GMEM_ZEROINIT); 
+                       pInfo = GlobalReAlloc (pInfo, Length, GMEM_ZEROINIT);
                        if (NULL == pInfo)
                        {
                                printf ("Could not allocate memory.\n");
                        if (NULL == pInfo)
                        {
                                printf ("Could not allocate memory.\n");
@@ -1386,7 +1386,7 @@ CMD_DEF(18)
        }
 
        DumpData (Length, pInfo);
        }
 
        DumpData (Length, pInfo);
-       
+
        GlobalFree (pInfo);
 
        return EXIT_SUCCESS;
        GlobalFree (pInfo);
 
        return EXIT_SUCCESS;
@@ -1394,7 +1394,7 @@ CMD_DEF(18)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1457,7 +1457,7 @@ CMD_DEF(19)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1468,7 +1468,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1478,7 +1478,7 @@ CMD_DEF(21)
 {
        NTSTATUS                        Status;
        SYSTEM_CACHE_INFORMATION        Si;
 {
        NTSTATUS                        Status;
        SYSTEM_CACHE_INFORMATION        Si;
-       
+
        RtlZeroMemory (
                (PVOID) & Si,
                sizeof Si
        RtlZeroMemory (
                (PVOID) & Si,
                sizeof Si
@@ -1507,7 +1507,7 @@ CMD_DEF(21)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *     Get statistic data about tagged pools. Not implemented in the
  *     free build.
  * DESCRIPTION
  *     Get statistic data about tagged pools. Not implemented in the
  *     free build.
@@ -1524,7 +1524,7 @@ CMD_DEF(22)
 
        pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT);
        /* FIXME: check pInfo */
 
        pInfo = GlobalAlloc (GMEM_ZEROINIT, BUFFER_SIZE_DEFAULT);
        /* FIXME: check pInfo */
-       
+
        Status = NtQuerySystemInformation(
                        22,
                        pInfo,
        Status = NtQuerySystemInformation(
                        22,
                        pInfo,
@@ -1538,7 +1538,7 @@ CMD_DEF(22)
                        /*
                         *      Allocate buffer
                         */
                        /*
                         *      Allocate buffer
                         */
-                       pInfo = GlobalReAlloc (pInfo, Length, GMEM_ZEROINIT); 
+                       pInfo = GlobalReAlloc (pInfo, Length, GMEM_ZEROINIT);
                        if (NULL == pInfo)
                        {
                                printf ("Could not allocate memory.\n");
                        if (NULL == pInfo)
                        {
                                printf ("Could not allocate memory.\n");
@@ -1590,7 +1590,7 @@ CMD_DEF(22)
        }
 
        DumpData (Length, pInfo);
        }
 
        DumpData (Length, pInfo);
-       
+
        GlobalFree (pInfo);
 
        return EXIT_SUCCESS;
        GlobalFree (pInfo);
 
        return EXIT_SUCCESS;
@@ -1598,7 +1598,7 @@ CMD_DEF(22)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1631,7 +1631,7 @@ CMD_DEF(23)
        printf ("\tTimerResolution  = %ld\n", Info.TimerResolution);
        printf ("\tnDPCBypasses     = %ld\n", Info.nDPCBypasses);
        printf ("\tnAPCBypasses     = %ld\n", Info.nAPCBypasses);
        printf ("\tTimerResolution  = %ld\n", Info.TimerResolution);
        printf ("\tnDPCBypasses     = %ld\n", Info.nDPCBypasses);
        printf ("\tnAPCBypasses     = %ld\n", Info.nAPCBypasses);
-               
+
        DumpData (sizeof Info, & Info);
 
        return EXIT_SUCCESS;
        DumpData (sizeof Info, & Info);
 
        return EXIT_SUCCESS;
@@ -1640,7 +1640,7 @@ CMD_DEF(23)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1683,7 +1683,7 @@ CMD_DEF(24)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1694,7 +1694,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1704,7 +1704,7 @@ CMD_DEF(26)
 CMD_NOT_IMPLEMENTED
 
 /**********************************************************************
 CMD_NOT_IMPLEMENTED
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1715,7 +1715,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1747,7 +1747,7 @@ CMD_DEF(28)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1758,7 +1758,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1769,7 +1769,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1780,7 +1780,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1791,7 +1791,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1802,7 +1802,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1813,7 +1813,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1846,7 +1846,7 @@ CMD_DEF(35)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1857,7 +1857,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1889,7 +1889,7 @@ CMD_DEF(37)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1900,7 +1900,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1911,7 +1911,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1922,7 +1922,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1933,7 +1933,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1944,7 +1944,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -1955,7 +1955,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *     Dump the system TIME_ZONE_INFORMATION object.
  *
  * DESCRIPTION
  *     Dump the system TIME_ZONE_INFORMATION object.
  *
@@ -1984,7 +1984,7 @@ CMD_DEF(44)
                "  Bias........: %ld'\n",
                Tzi.Bias /* LONG */
                );
                "  Bias........: %ld'\n",
                Tzi.Bias /* LONG */
                );
-       
+
        printf ("  Standard\n");
        RtlZeroMemory (
                (PVOID) Name,
        printf ("  Standard\n");
        RtlZeroMemory (
                (PVOID) Name,
@@ -1999,16 +1999,16 @@ CMD_DEF(44)
                L"\tName: \"%s\"\n",
                Name
                );
                L"\tName: \"%s\"\n",
                Name
                );
-               
+
        PrintUtcDateTime (
                "\tDate: %s\n",
                (PTIME) & Tzi.StandardDate      /* SYSTEMTIME */
                );
        PrintUtcDateTime (
                "\tDate: %s\n",
                (PTIME) & Tzi.StandardDate      /* SYSTEMTIME */
                );
-               
+
        printf ("\tBias: %ld'\n",
                Tzi.StandardBias /* LONG */
                );
        printf ("\tBias: %ld'\n",
                Tzi.StandardBias /* LONG */
                );
-       
+
        printf ("  Daylight\n");
        RtlZeroMemory (
                (PVOID) Name,
        printf ("  Daylight\n");
        RtlZeroMemory (
                (PVOID) Name,
@@ -2016,22 +2016,22 @@ CMD_DEF(44)
                );
        lstrcpynW (
                Name,
                );
        lstrcpynW (
                Name,
-               Tzi.DaylightName, /* WCHAR [32] */ 
+               Tzi.DaylightName, /* WCHAR [32] */
                32
                );
        wprintf (
                L"\tName: \"%s\"\n",
                Name
                );
                32
                );
        wprintf (
                L"\tName: \"%s\"\n",
                Name
                );
-               
+
        PrintUtcDateTime (
                "\tDate: %s\n",
        PrintUtcDateTime (
                "\tDate: %s\n",
-               (PTIME) & Tzi.DaylightDate /* SYSTEMTIME */ 
+               (PTIME) & Tzi.DaylightDate /* SYSTEMTIME */
                );
                );
-               
+
        printf (
                "\tBias: %ld'\n",
        printf (
                "\tBias: %ld'\n",
-               Tzi.DaylightBias /* LONG */ 
+               Tzi.DaylightBias /* LONG */
                );
 
        return EXIT_SUCCESS;
                );
 
        return EXIT_SUCCESS;
@@ -2039,7 +2039,7 @@ CMD_DEF(44)
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2050,7 +2050,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2061,7 +2061,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2072,7 +2072,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2083,7 +2083,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2094,7 +2094,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2105,7 +2105,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2116,7 +2116,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2127,7 +2127,7 @@ CMD_NOT_IMPLEMENTED
 
 
 /**********************************************************************
 
 
 /**********************************************************************
- * 
+ *
  * DESCRIPTION
  *
  * NOTE
  * DESCRIPTION
  *
  * NOTE
@@ -2144,7 +2144,7 @@ CMD_NOT_IMPLEMENTED
 CMD_DEF(ver)
 {
        INT     Total = 0;
 CMD_DEF(ver)
 {
        INT     Total = 0;
-       
+
        Total =
        printf (
        "ReactOS Operating System - http://www.reactos.com/\n"
        Total =
        printf (
        "ReactOS Operating System - http://www.reactos.com/\n"
@@ -2190,7 +2190,7 @@ extern COMMAND_DESCRIPTOR Commands [];
 CMD_DEF(help)
 {
        int i;
 CMD_DEF(help)
 {
        int i;
-       
+
        if (Application.Flag.Verbose)
        {
                printf ("Commands:\n");
        if (Application.Flag.Verbose)
        {
                printf ("Commands:\n");
@@ -2219,7 +2219,7 @@ CMD_DEF(credits)
                "\nReactOS (http://www.reactos.com/):\n"
                "\tEmanuele Aliberti\n"
                "\tEric Kohl\n\n"
                "\nReactOS (http://www.reactos.com/):\n"
                "\tEmanuele Aliberti\n"
                "\tEric Kohl\n\n"
-               
+
                "HandleEx:\n"
                "\tMark Russinovich (http://www.sysinternals.com/)\n\n"
 
                "HandleEx:\n"
                "\tMark Russinovich (http://www.sysinternals.com/)\n\n"
 
@@ -2228,7 +2228,7 @@ CMD_DEF(credits)
 
                "Undocumented SYSTEM_POOL_INFORMATION:\n"
                "\tKlaus P. Gerlicher\n\n"
 
                "Undocumented SYSTEM_POOL_INFORMATION:\n"
                "\tKlaus P. Gerlicher\n\n"
-               
+
                "Undocumented Windows NT:\n"
                "\tPrasad Dabak, Sandeep Phadke, and Milind Borate\n\n"
 
                "Undocumented Windows NT:\n"
                "\tPrasad Dabak, Sandeep Phadke, and Milind Borate\n\n"
 
@@ -2269,19 +2269,19 @@ COMMAND_DESCRIPTOR
 Commands [] =
 {
 /* System information classes */
 Commands [] =
 {
 /* System information classes */
-       
+
        {                                               /* 0  Q  */
                "basic",
                CMD_REF(0),
                "Basic system information"
        },
        {                                               /* 1  Q  */
        {                                               /* 0  Q  */
                "basic",
                CMD_REF(0),
                "Basic system information"
        },
        {                                               /* 1  Q  */
-               "processor",    
+               "processor",
                CMD_REF(1),
                "Processor characteristics"
        },
        {                                               /* 2  Q  */
                CMD_REF(1),
                "Processor characteristics"
        },
        {                                               /* 2  Q  */
-               "perf", 
+               "perf",
                CMD_REF(2),
                "System performance data"
        },
                CMD_REF(2),
                "System performance data"
        },
@@ -2376,7 +2376,7 @@ Commands [] =
                "Bop (VDM)"
        },
        {                                               /* 21 QS */
                "Bop (VDM)"
        },
        {                                               /* 21 QS */
-               "cache",        
+               "cache",
                CMD_REF(21),
                "File cache"
        },
                CMD_REF(21),
                "File cache"
        },
@@ -2577,7 +2577,7 @@ Commands [] =
                CMD_REF(verbose),
                "Enable/disable printing unused, unknown, and service fields"
        },
                CMD_REF(verbose),
                "Enable/disable printing unused, unknown, and service fields"
        },
-       
+
        { NULL, NULL }
 };
 
        { NULL, NULL }
 };
 
@@ -2672,7 +2672,7 @@ main (int argc, char * argv [])
                                printf ("Unknown command (type help for a list of valid commands).\n");
                        }
                }
                                printf ("Unknown command (type help for a list of valid commands).\n");
                        }
                }
-               
+
        }
        if (! Application.Flag.Batch)
        {
        }
        if (! Application.Flag.Batch)
        {
index 00ef2b5..c6e1c7c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ArgumentParser.h,v 1.2 2001/01/13 23:53:46 narnaoud Exp $ */
+/* $Id$ */
 
 // ArgumentParser.h: interface for the CArgumentParser class.
 //
 
 // ArgumentParser.h: interface for the CArgumentParser class.
 //
index f530c05..10c92e1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Completion.h,v 1.2 2001/01/13 23:54:07 narnaoud Exp $ */
+/* $Id$ */
 
 // Completion.h - declaration for completion related functions
 
 
 // Completion.h - declaration for completion related functions
 
index 4042fe0..3cad540 100644 (file)
@@ -1,5 +1,5 @@
-/* $Id: Console.h,v 1.4 2001/01/13 23:54:07 narnaoud Exp $ */
+/* $Id$ */
+
 // Console.h: interface for the CConsole class.
 //
 //////////////////////////////////////////////////////////////////////
 // Console.h: interface for the CConsole class.
 //
 //////////////////////////////////////////////////////////////////////
@@ -10,7 +10,7 @@
 #include "TextHistory.h"
 #include "Completion.h"
 
 #include "TextHistory.h"
 #include "Completion.h"
 
-class CConsole  
+class CConsole
 {
 public:
        void EnableWrite();
 {
 public:
        void EnableWrite();
index 50d7516..eb21131 100644 (file)
@@ -1,7 +1,7 @@
-/* $Id: CrtSupplement.c,v 1.2 2002/09/03 18:44:18 chorns Exp $
+/* $Id$
  *
  * Written by EA because ReactOS hasn't yet _ui64toa()
  *
  * Written by EA because ReactOS hasn't yet _ui64toa()
- * (it's in msvcrt.dll, and not in crtdll.dll). 
+ * (it's in msvcrt.dll, and not in crtdll.dll).
  */
 
 #include <stdlib.h>
  */
 
 #include <stdlib.h>
@@ -41,7 +41,7 @@ _ui64toa (
                string [i ++] = *(-- w);
        }
        string [len] = '\0';
                string [i ++] = *(-- w);
        }
        string [len] = '\0';
-       
+
        return string;
 }
 
        return string;
 }
 
index 2aaa0d1..35dcabb 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Pattern.h,v 1.1 2001/01/10 01:25:29 narnaoud Exp $ */
+/* $Id$ */
 
 // Pattern.h: decalration for pattern functions
 
 
 // Pattern.h: decalration for pattern functions
 
index 59fe271..9491b01 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: RegistryKey.h,v 1.4 2001/01/13 23:54:41 narnaoud Exp $ */
+/* $Id$ */
 
 // RegistryKey.h: interface for the CRegistryKey class.
 //
 
 // RegistryKey.h: interface for the CRegistryKey class.
 //
@@ -7,12 +7,12 @@
 #if !defined(REGISTRYKEY_H__FEF419ED_6EB6_11D3_907D_204C4F4F5020__INCLUDED_)
 #define REGISTRYKEY_H__FEF419ED_6EB6_11D3_907D_204C4F4F5020__INCLUDED_
 
 #if !defined(REGISTRYKEY_H__FEF419ED_6EB6_11D3_907D_204C4F4F5020__INCLUDED_)
 #define REGISTRYKEY_H__FEF419ED_6EB6_11D3_907D_204C4F4F5020__INCLUDED_
 
-class CRegistryKey  
+class CRegistryKey
 {
 public:
   // Constructor. Call InitXXX methods to make real construct.
   CRegistryKey();
 {
 public:
   // Constructor. Call InitXXX methods to make real construct.
   CRegistryKey();
-  
+
   // Call this key to init root key.
   //
   // Parameters:
   // Call this key to init root key.
   //
   // Parameters:
@@ -47,7 +47,7 @@ public:
   //   S_OK - All ok.
   //   E_XXX - Error.
   HRESULT Uninit();
   //   S_OK - All ok.
   //   E_XXX - Error.
   HRESULT Uninit();
-  
+
   // Destructor
        virtual ~CRegistryKey();
 
   // Destructor
        virtual ~CRegistryKey();
 
@@ -80,7 +80,7 @@ public:
   //   If the method succeeds, the return value is ERROR_SUCCESS.
   //   If the method fails, the return value is a nonzero error code defined in winerror.h.
        LONG OpenSubkey(REGSAM samDesired, const TCHAR *pszSubkeyName, HKEY &rhKey);
   //   If the method succeeds, the return value is ERROR_SUCCESS.
   //   If the method fails, the return value is a nonzero error code defined in winerror.h.
        LONG OpenSubkey(REGSAM samDesired, const TCHAR *pszSubkeyName, HKEY &rhKey);
-  
+
   // Call this method to open existing subkey of this key.
   //
   // Parameters:
   // Call this method to open existing subkey of this key.
   //
   // Parameters:
@@ -165,7 +165,7 @@ public:
                             BYTE *pbValueDataBuffer,
                             DWORD dwValueDataBufferSize,
                             DWORD *pdwType);
                             BYTE *pbValueDataBuffer,
                             DWORD dwValueDataBufferSize,
                             DWORD *pdwType);
-  
+
   // Call this method to get next value  name/data/type. Name/data/type is/are stored in buffer(s) specified in call to InitValueEnumeration.
   //
   // Parameters:
   // Call this method to get next value  name/data/type. Name/data/type is/are stored in buffer(s) specified in call to InitValueEnumeration.
   //
   // Parameters:
@@ -177,7 +177,7 @@ public:
   //   If the method fails, the return value is a nonzero error code defined in winerror.h.
   //   If no more items available, return error is ERROR_NO_MORE_ITEMS.
        LONG GetNextValue(DWORD *pdwNameActualSize = NULL, DWORD *pdwDataActualSize = NULL);
   //   If the method fails, the return value is a nonzero error code defined in winerror.h.
   //   If no more items available, return error is ERROR_NO_MORE_ITEMS.
        LONG GetNextValue(DWORD *pdwNameActualSize = NULL, DWORD *pdwDataActualSize = NULL);
-  
+
   // Call this method to get count of values.
   //
   // Parameters:
   // Call this method to get count of values.
   //
   // Parameters:
@@ -195,7 +195,7 @@ public:
   //   pbValueDataBuffer - optional pointer to buffer receiving default value data. NULL if not requred.
   //   dwValueDataBufferSize - size of buffer pointer by pbValueDataBuffer. Ignored if pbValueDataBuffer is NULL.
   //   pdwValueDataActualSize - optional pointer to variable receiving size, in bytes, of data stored into buffer. If pbValueDataBuffer is NULL, returned value is size of default value data, in bytes.
   //   pbValueDataBuffer - optional pointer to buffer receiving default value data. NULL if not requred.
   //   dwValueDataBufferSize - size of buffer pointer by pbValueDataBuffer. Ignored if pbValueDataBuffer is NULL.
   //   pdwValueDataActualSize - optional pointer to variable receiving size, in bytes, of data stored into buffer. If pbValueDataBuffer is NULL, returned value is size of default value data, in bytes.
-  // 
+  //
   // Return value:
   //   If the method succeeds, the return value is ERROR_SUCCESS.
   //   If the method fails, the return value is a nonzero error code defined in winerror.h.
   // Return value:
   //   If the method succeeds, the return value is ERROR_SUCCESS.
   //   If the method fails, the return value is a nonzero error code defined in winerror.h.
@@ -209,7 +209,7 @@ public:
   // Return value:
   //   text representation od value type.
        static const TCHAR * GetValueTypeName(DWORD dwType);
   // Return value:
   //   text representation od value type.
        static const TCHAR * GetValueTypeName(DWORD dwType);
-  
+
        DWORD GetValue(TCHAR *pchValueName, DWORD *pdwType, LPBYTE lpValueDataBuffer, DWORD *pdwValueDataSize);
 
   // Call this method to create subkey of this key.
        DWORD GetValue(TCHAR *pchValueName, DWORD *pdwType, LPBYTE lpValueDataBuffer, DWORD *pdwValueDataSize);
 
   // Call this method to create subkey of this key.
@@ -225,13 +225,13 @@ public:
   //   If the method succeeds, the return value is ERROR_SUCCESS.
   //   If the method fails, the return value is a nonzero error code defined in winerror.h.
        LONG CreateSubkey(REGSAM samDesired, const TCHAR *pszKeyName, HKEY &rhKey, BOOL *pblnOpened = NULL, BOOL blnVolatile = FALSE);
   //   If the method succeeds, the return value is ERROR_SUCCESS.
   //   If the method fails, the return value is a nonzero error code defined in winerror.h.
        LONG CreateSubkey(REGSAM samDesired, const TCHAR *pszKeyName, HKEY &rhKey, BOOL *pblnOpened = NULL, BOOL blnVolatile = FALSE);
-  
+
        LONG GetLastWriteTime(SYSTEMTIME& st);
        const TCHAR * GetLastWriteTime();
        LONG GetLastWriteTime(SYSTEMTIME& st);
        const TCHAR * GetLastWriteTime();
-  
+
        LONG DeleteValue(const TCHAR *pszValueName);
        LONG DeleteSubkey(const TCHAR *pszPatternSubkeyName);
        LONG DeleteValue(const TCHAR *pszValueName);
        LONG DeleteSubkey(const TCHAR *pszPatternSubkeyName);
-  
+
        LONG SetValue(LPCTSTR pszValueName, DWORD dwType, BYTE *lpData, DWORD dwDataSize);
        TCHAR * GetSubKeyNameByIndex(DWORD dwIndex);
        LONG GetSecurityDescriptor(SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, LPDWORD lpcbSecurityDescriptor);
        LONG SetValue(LPCTSTR pszValueName, DWORD dwType, BYTE *lpData, DWORD dwDataSize);
        TCHAR * GetSubKeyNameByIndex(DWORD dwIndex);
        LONG GetSecurityDescriptor(SECURITY_INFORMATION SecurityInformation, PSECURITY_DESCRIPTOR pSecurityDescriptor, LPDWORD lpcbSecurityDescriptor);
@@ -242,14 +242,14 @@ private:
        DWORD m_dwCurrentSubKeyIndex;
   TCHAR *m_pchSubkeyNameBuffer;
   DWORD m_dwSubkeyNameBufferSize;
        DWORD m_dwCurrentSubKeyIndex;
   TCHAR *m_pchSubkeyNameBuffer;
   DWORD m_dwSubkeyNameBufferSize;
-  
+
        DWORD m_dwCurrentValueIndex;
   TCHAR *m_pszValueNameBuffer;
   DWORD m_dwValueNameBufferSize;
   BYTE *m_pbValueDataBuffer;
   DWORD m_dwValueDataBufferSize;
   DWORD *m_pdwType;
        DWORD m_dwCurrentValueIndex;
   TCHAR *m_pszValueNameBuffer;
   DWORD m_dwValueNameBufferSize;
   BYTE *m_pbValueDataBuffer;
   DWORD m_dwValueDataBufferSize;
   DWORD *m_pdwType;
-  
+
        HKEY m_hKey;
        TCHAR *m_pszKeyName;
        TCHAR *m_pszMachineName;
        HKEY m_hKey;
        TCHAR *m_pszKeyName;
        TCHAR *m_pszMachineName;
index 83471c7..c92447c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: RegistryTree.h,v 1.2 2001/01/10 01:25:29 narnaoud Exp $ */
+/* $Id$ */
 
 // RegistryTree.h: interface for the CRegistryTree class.
 //
 
 // RegistryTree.h: interface for the CRegistryTree class.
 //
@@ -12,7 +12,7 @@
 // Max size of error description.
 #define ERROR_MSG_BUFFER_SIZE  1024
 
 // Max size of error description.
 #define ERROR_MSG_BUFFER_SIZE  1024
 
-class CRegistryTree  
+class CRegistryTree
 {
 public:
        // Constructor
 {
 public:
        // Constructor
@@ -77,9 +77,9 @@ public:
   //   TRUE - key opened successfully.
   //   FALSE - error. Call GetLastErrorDescription() to get error description.
        BOOL DeleteSubkeys(const TCHAR *pszKeyPattern, const TCHAR *pszPath, BOOL blnRecursive = FALSE);
   //   TRUE - key opened successfully.
   //   FALSE - error. Call GetLastErrorDescription() to get error description.
        BOOL DeleteSubkeys(const TCHAR *pszKeyPattern, const TCHAR *pszPath, BOOL blnRecursive = FALSE);
-  
+
        BOOL NewKey(const TCHAR *pszKeyName, const TCHAR *pszPath, BOOL blnVolatile = FALSE);
        BOOL NewKey(const TCHAR *pszKeyName, const TCHAR *pszPath, BOOL blnVolatile = FALSE);
-  
+
        BOOL SetMachineName(LPCTSTR pszMachineName);
 
 // Internal methods
        BOOL SetMachineName(LPCTSTR pszMachineName);
 
 // Internal methods
@@ -99,7 +99,7 @@ private:
   BOOL InternalGetSubkey(const TCHAR *pszSubkeyName, REGSAM DesiredAccess, CRegistryKey& rKey);
   void GotoRoot();
   BOOL DeleteSubkeys(CRegistryKey& rKey, const TCHAR *pszKeyPattern, BOOL blnRecursive);
   BOOL InternalGetSubkey(const TCHAR *pszSubkeyName, REGSAM DesiredAccess, CRegistryKey& rKey);
   void GotoRoot();
   BOOL DeleteSubkeys(CRegistryKey& rKey, const TCHAR *pszKeyPattern, BOOL blnRecursive);
-  
+
 private:
   class CNode
   {
 private:
   class CNode
   {
@@ -107,7 +107,7 @@ private:
     CNode *m_pUp;
     CRegistryKey m_Key;
   } m_Root;
     CNode *m_pUp;
     CRegistryKey m_Key;
   } m_Root;
-  
+
        CNode *m_pCurrentKey;              // The current key.
        TCHAR m_ErrorMsg[ERROR_MSG_BUFFER_SIZE+1];   // Last error description buffer.
        LPTSTR m_pszMachineName;                     // Pointer to buffer containing machine name with leading backslashes. NULL if local.
        CNode *m_pCurrentKey;              // The current key.
        TCHAR m_ErrorMsg[ERROR_MSG_BUFFER_SIZE+1];   // Last error description buffer.
        LPTSTR m_pszMachineName;                     // Pointer to buffer containing machine name with leading backslashes. NULL if local.
index 0cef15a..a213ed5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: SecurityDescriptor.h,v 1.3 2001/01/13 23:54:41 narnaoud Exp $ */
+/* $Id$ */
 
 // SecurityDescriptor.h: interface for the CSecurityDescriptor class.
 //
 
 // SecurityDescriptor.h: interface for the CSecurityDescriptor class.
 //
@@ -15,7 +15,7 @@ BOOL GetTextualSid(
 
 const TCHAR * GetSidTypeName(SID_NAME_USE Use);
 
 
 const TCHAR * GetSidTypeName(SID_NAME_USE Use);
 
-class CSecurityDescriptor  
+class CSecurityDescriptor
 {
 public:
        void GetCurrentACE_Flags(BYTE& bFlags);
 {
 public:
        void GetCurrentACE_Flags(BYTE& bFlags);
index 471e9fd..4a4c88a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: Settings.h,v 1.2 2001/04/24 22:53:00 narnaoud Exp $ */
+/* $Id$ */
 
 #ifndef OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED
 #define OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED
 
 #ifndef OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED
 #define OPTIONS_H__a7382d2d_96b4_4472_974d_801281bd5327___INCLUDED
index cd8fc8b..77ec7ba 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommand.h,v 1.2 2001/01/13 23:55:36 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommand.h: interface for the CShellCommand class.
 //
 
 // ShellCommand.h: interface for the CShellCommand class.
 //
@@ -11,7 +11,7 @@
 #include "ArgumentParser.h"
 
 // this class provides common interface to shell commands
 #include "ArgumentParser.h"
 
 // this class provides common interface to shell commands
-class CShellCommand  
+class CShellCommand
 {
 public:
        CShellCommand();
 {
 public:
        CShellCommand();
index 671c72e..f325a2c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandChangeKey.h,v 1.2 2001/01/13 23:55:36 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandChangeKey.h: interface for the CShellCommandChangeKey class.
 //
 
 // ShellCommandChangeKey.h: interface for the CShellCommandChangeKey class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandChangeKey : public CShellCommand  
+class CShellCommandChangeKey : public CShellCommand
 {
 public:
        CShellCommandChangeKey(CRegistryTree& rTree);
 {
 public:
        CShellCommandChangeKey(CRegistryTree& rTree);
index 66f0ef9..d4e18fe 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandConnect.h,v 1.2 2001/01/13 23:55:36 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandConnect.h: interface for the CShellCommandConnect class.
 //
 
 // ShellCommandConnect.h: interface for the CShellCommandConnect class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandConnect : public CShellCommand  
+class CShellCommandConnect : public CShellCommand
 {
 public:
        CShellCommandConnect(CRegistryTree& rTree);
 {
 public:
        CShellCommandConnect(CRegistryTree& rTree);
index b98966e..1184285 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandDACL.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandDACL.h: interface for the CShellCommandDACL class.
 //
 
 // ShellCommandDACL.h: interface for the CShellCommandDACL class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandDACL : public CShellCommand  
+class CShellCommandDACL : public CShellCommand
 {
 public:
        CShellCommandDACL(CRegistryTree& rTree);
 {
 public:
        CShellCommandDACL(CRegistryTree& rTree);
index 8db95f6..a249f6c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandDOKA.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandDOKA.h: interface for the CShellCommandDOKA class.
 //
 
 // ShellCommandDOKA.h: interface for the CShellCommandDOKA class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandDOKA : public CShellCommand  
+class CShellCommandDOKA : public CShellCommand
 {
 public:
        CShellCommandDOKA(CRegistryTree& rTree);
 {
 public:
        CShellCommandDOKA(CRegistryTree& rTree);
index 2a22509..275e813 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandDeleteKey.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandDeleteKey.h: interface for the CShellCommandDeleteKey class.
 //
 
 // ShellCommandDeleteKey.h: interface for the CShellCommandDeleteKey class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandDeleteKey : public CShellCommand  
+class CShellCommandDeleteKey : public CShellCommand
 {
 public:
        CShellCommandDeleteKey(CRegistryTree& rTree);
 {
 public:
        CShellCommandDeleteKey(CRegistryTree& rTree);
index 7fb1a18..b1d8ad9 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandDeleteValue.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandDeleteValue.h: interface for the CShellCommandDeleteValue class.
 //
 
 // ShellCommandDeleteValue.h: interface for the CShellCommandDeleteValue class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandDeleteValue : public CShellCommand  
+class CShellCommandDeleteValue : public CShellCommand
 {
 public:
        CShellCommandDeleteValue(CRegistryTree& rTree);
 {
 public:
        CShellCommandDeleteValue(CRegistryTree& rTree);
index 7ef733f..5bd8c98 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandDir.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandDir.h: interface for the CShellCommandDir class.
 //
 
 // ShellCommandDir.h: interface for the CShellCommandDir class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandDir : public CShellCommand  
+class CShellCommandDir : public CShellCommand
 {
 public:
        CShellCommandDir(CRegistryTree& rTree);
 {
 public:
        CShellCommandDir(CRegistryTree& rTree);
index 4bd9dfd..9985266 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandExit.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandExit.h: interface for the CShellCommandExit class.
 //
 
 // ShellCommandExit.h: interface for the CShellCommandExit class.
 //
@@ -9,7 +9,7 @@
 
 #include "ShellCommand.h"
 
 
 #include "ShellCommand.h"
 
-class CShellCommandExit : public CShellCommand  
+class CShellCommandExit : public CShellCommand
 {
 public:
        CShellCommandExit();
 {
 public:
        CShellCommandExit();
index 0b43ce4..31d95d7 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandHelp.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandHelp.h: interface for the CShellCommandHelp class.
 //
 
 // ShellCommandHelp.h: interface for the CShellCommandHelp class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "ShellCommandsLinkedList.h"
 
 #include "ShellCommand.h"
 #include "ShellCommandsLinkedList.h"
 
-class CShellCommandHelp : public CShellCommand  
+class CShellCommandHelp : public CShellCommand
 {
 public:
        CShellCommandHelp(CShellCommandsLinkedList& rCommandsLinkedList);
 {
 public:
        CShellCommandHelp(CShellCommandsLinkedList& rCommandsLinkedList);
index ba9a01c..7a330e0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandNewKey.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandNewKey.h: interface for the CShellCommandNewKey class.
 //
 
 // ShellCommandNewKey.h: interface for the CShellCommandNewKey class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandNewKey : public CShellCommand  
+class CShellCommandNewKey : public CShellCommand
 {
 public:
        CShellCommandNewKey(CRegistryTree& rTree);
 {
 public:
        CShellCommandNewKey(CRegistryTree& rTree);
index d96c50d..1d304a2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandOwner.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandOwner.h: interface for the CShellCommandOwner class.
 //
 
 // ShellCommandOwner.h: interface for the CShellCommandOwner class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandOwner : public CShellCommand  
+class CShellCommandOwner : public CShellCommand
 {
 public:
        CShellCommandOwner(CRegistryTree& rTree);
 {
 public:
        CShellCommandOwner(CRegistryTree& rTree);
index 9089215..7e99e39 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandSACL.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandSACL.h: interface for the CShellCommandSACL class.
 //
 
 // ShellCommandSACL.h: interface for the CShellCommandSACL class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandSACL : public CShellCommand  
+class CShellCommandSACL : public CShellCommand
 {
 public:
        CShellCommandSACL(CRegistryTree& rTree);
 {
 public:
        CShellCommandSACL(CRegistryTree& rTree);
index 47a6353..30ff1c1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandSetValue.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandSetValue.h: interface for the CShellCommandSetValue class.
 //
 
 // ShellCommandSetValue.h: interface for the CShellCommandSetValue class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandSetValue : public CShellCommand  
+class CShellCommandSetValue : public CShellCommand
 {
 public:
        CShellCommandSetValue(CRegistryTree& rTree);
 {
 public:
        CShellCommandSetValue(CRegistryTree& rTree);
index 64adbbb..dc24d94 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandValue.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandValue.h: interface for the CShellCommandValue class.
 //
 
 // ShellCommandValue.h: interface for the CShellCommandValue class.
 //
@@ -10,7 +10,7 @@
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
 #include "ShellCommand.h"
 #include "RegistryTree.h"
 
-class CShellCommandValue : public CShellCommand  
+class CShellCommandValue : public CShellCommand
 {
 public:
        CShellCommandValue(CRegistryTree& rTree);
 {
 public:
        CShellCommandValue(CRegistryTree& rTree);
index 2c1596b..d92b74e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandVersion.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandVersion.h: interface for the CShellCommandVersion class.
 //
 
 // ShellCommandVersion.h: interface for the CShellCommandVersion class.
 //
@@ -9,7 +9,7 @@
 
 #include "ShellCommand.h"
 
 
 #include "ShellCommand.h"
 
-class CShellCommandVersion : public CShellCommand  
+class CShellCommandVersion : public CShellCommand
 {
 public:
        CShellCommandVersion();
 {
 public:
        CShellCommandVersion();
index 4cec3f0..a7b03a4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ShellCommandsLinkedList.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // ShellCommandsLinkedList.h: interface for the CShellCommandsLinkedList class.
 //
 
 // ShellCommandsLinkedList.h: interface for the CShellCommandsLinkedList class.
 //
@@ -12,7 +12,7 @@
 
 #define POSITION int *
 
 
 #define POSITION int *
 
-class CShellCommandsLinkedList  
+class CShellCommandsLinkedList
 {
 public:
        CShellCommandsLinkedList(CConsole& rConsole);
 {
 public:
        CShellCommandsLinkedList(CConsole& rConsole);
index 39a7c23..a58cd6b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: TextHistory.h,v 1.2 2001/01/13 23:55:37 narnaoud Exp $ */
+/* $Id$ */
 
 // TextHistory.h: interface for the CTextHistory class.
 //
 
 // TextHistory.h: interface for the CTextHistory class.
 //
@@ -7,7 +7,7 @@
 #if !defined(TEXTHISTORY_H__AD9C6555_1D97_11D4_9F58_204C4F4F5020__INCLUDED_)
 #define TEXTHISTORY_H__AD9C6555_1D97_11D4_9F58_204C4F4F5020__INCLUDED_
 
 #if !defined(TEXTHISTORY_H__AD9C6555_1D97_11D4_9F58_204C4F4F5020__INCLUDED_)
 #define TEXTHISTORY_H__AD9C6555_1D97_11D4_9F58_204C4F4F5020__INCLUDED_
 
-class CTextHistory  
+class CTextHistory
 {
 public:
        CTextHistory();
 {
 public:
        CTextHistory();
index ce16ad6..19c1c18 100644 (file)
@@ -1,7 +1,7 @@
-/* $Id: shutdown.c,v 1.2 2000/04/25 23:22:57 ea Exp $
- * 
+/* $Id$
+ *
  * EAU shutdown.c 1.4.1
  * EAU shutdown.c 1.4.1
- * 
+ *
  * Copyright (C) 1997,1998,1999 Emanuele Aliberti
  *
  * --------------------------------------------------------------------
  * Copyright (C) 1997,1998,1999 Emanuele Aliberti
  *
  * --------------------------------------------------------------------
@@ -19,7 +19,7 @@
  * You should have received a copy of the GNU Library General Public
  * License along with this software; see the file COPYING.LIB. If
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  * You should have received a copy of the GNU Library General Public
  * License along with this software; see the file COPYING.LIB. If
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
- * Cambridge, MA 02139, USA.  
+ * Cambridge, MA 02139, USA.
  *
  * --------------------------------------------------------------------
  * 1999-05-14 (Emanuele Aliberti)
  *
  * --------------------------------------------------------------------
  * 1999-05-14 (Emanuele Aliberti)
@@ -40,7 +40,7 @@
 #endif
 
 
 #endif
 
 
-struct _EWX 
+struct _EWX
 {
        CHAR    mode;
        UINT    id;
 {
        CHAR    mode;
        UINT    id;
@@ -81,7 +81,7 @@ DecodeArg( CHAR * modestr )
 
 
 static
 
 
 static
-const 
+const
 char * usage = "\
 Shutdown ver. 1.4.1  (compiled on %s, at %s)\n\
 Copyright (C) 1997-1999 Emanuele Aliberti\n\n\
 char * usage = "\
 Shutdown ver. 1.4.1  (compiled on %s, at %s)\n\
 Copyright (C) 1997-1999 Emanuele Aliberti\n\n\
@@ -104,7 +104,7 @@ main(
        HANDLE           h;
        TOKEN_PRIVILEGES tp;
 
        HANDLE           h;
        TOKEN_PRIVILEGES tp;
 
-       mode = (argc == 2) 
+       mode = (argc == 2)
                ? DecodeArg(argv[1])
                : DecodeArg("-?");
        if (mode == (UINT) -1)
                ? DecodeArg(argv[1])
                : DecodeArg("-?");
        if (mode == (UINT) -1)
@@ -114,13 +114,13 @@ main(
                        usage,
                        __DATE__,
                        __TIME__,
                        usage,
                        __DATE__,
                        __TIME__,
-                       argv[0] 
+                       argv[0]
                        );
                return EXIT_SUCCESS;
        }
                        );
                return EXIT_SUCCESS;
        }
-       /* 
-        * Get the current process token handle 
-        * so we can get shutdown privilege. 
+       /*
+        * Get the current process token handle
+        * so we can get shutdown privilege.
         */
        if (FALSE == OpenProcessToken(
                GetCurrentProcess(),
         */
        if (FALSE == OpenProcessToken(
                GetCurrentProcess(),
@@ -139,7 +139,7 @@ main(
         */
        if (FALSE == LookupPrivilegeValue(
                        NULL,
         */
        if (FALSE == LookupPrivilegeValue(
                        NULL,
-                       SE_SHUTDOWN_NAME, 
+                       SE_SHUTDOWN_NAME,
                        & tp.Privileges[0].Luid
                        )
        ) {
                        & tp.Privileges[0].Luid
                        )
        ) {
index 405bef1..3ad7130 100644 (file)
@@ -5,9 +5,9 @@
  * PROJECT    : ReactOS Operating System
  * DESCRIPTION: file concatenation tool
  * DATE       : 2004-01-21
  * PROJECT    : ReactOS Operating System
  * DESCRIPTION: file concatenation tool
  * DATE       : 2004-01-21
- * LICENSE    : GPL 
+ * LICENSE    : GPL
  */
  */
+
 #include <stdio.h>
 #include <string.h>
 #define F_O_ERR "can not open file"
 #include <stdio.h>
 #include <string.h>
 #define F_O_ERR "can not open file"
@@ -16,7 +16,7 @@ void help(void)
 {
  puts("File concatenation tool");
  puts("Usage: cat [file]");
 {
  puts("File concatenation tool");
  puts("Usage: cat [file]");
-} 
+}
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
      if ((!strcmp(argv[1],keys[0]))||(!strcmp(argv[1],keys[1])))
       help();
      else
      if ((!strcmp(argv[1],keys[0]))||(!strcmp(argv[1],keys[1])))
       help();
      else
-      {  
+      {
       if((srcf=fopen(argv[1],"r"))!=NULL)
       {
        while(i!=EOF)
       if((srcf=fopen(argv[1],"r"))!=NULL)
       {
        while(i!=EOF)
@@ -38,8 +38,8 @@ int main(int argc, char *argv[])
           putchar(i);
         }
        fclose(srcf);
           putchar(i);
         }
        fclose(srcf);
-      } 
-      else 
+      }
+      else
       {
        printf("%s %s %s\n",argv[0],F_O_ERR,argv[1]);
        ret=-1;
       {
        printf("%s %s %s\n",argv[0],F_O_ERR,argv[1]);
        ret=-1;
index 4702b17..43e00a2 100644 (file)
@@ -151,7 +151,7 @@ int STDCALL PrintProcessInfoDepth (
   INT     d = 0;
   LPWSTR  Module = L"";
   LPWSTR  Title = L"";
   INT     d = 0;
   LPWSTR  Module = L"";
   LPWSTR  Title = L"";
-  
+
   for (d = 0; d < Depth; d ++) printf ("  ");
   GetProcessInfo (pInfo, & Module, & Title);
   wprintf (
   for (d = 0; d < Depth; d ++) printf ("  ");
   GetProcessInfo (pInfo, & Module, & Title);
   wprintf (
@@ -204,7 +204,7 @@ PrintProcessAndDescendants (
     pInfo = (PSYSTEM_PROCESS_INFORMATION)((PBYTE)pInfo + pInfo->NextEntryOffset);
 
   } while (0 != pInfo->NextEntryOffset);
     pInfo = (PSYSTEM_PROCESS_INFORMATION)((PBYTE)pInfo + pInfo->NextEntryOffset);
 
   } while (0 != pInfo->NextEntryOffset);
-  
+
   return EXIT_SUCCESS;
 }
 
   return EXIT_SUCCESS;
 }
 
@@ -234,7 +234,7 @@ int STDCALL PrintProcessList (BOOL DisplayTree)
          pInfo->InheritedFromUniqueProcessId
          );
       }
          pInfo->InheritedFromUniqueProcessId
          );
       }
-      else 
+      else
       {
        if (ALREADY_PROCESSED != (DWORD)pInfo->InheritedFromUniqueProcessId)
        {
       {
        if (ALREADY_PROCESSED != (DWORD)pInfo->InheritedFromUniqueProcessId)
        {
@@ -244,9 +244,9 @@ int STDCALL PrintProcessList (BOOL DisplayTree)
 
       pInfo = PsaWalkNextProcess(pInfo);
     }
 
       pInfo = PsaWalkNextProcess(pInfo);
     }
-  
+
     PsaFreeCapture(pInfoBase);
     PsaFreeCapture(pInfoBase);
-  
+
     return EXIT_SUCCESS;
 }
 
     return EXIT_SUCCESS;
 }
 
@@ -263,7 +263,7 @@ int STDCALL PrintThreads (PSYSTEM_PROCESS_INFORMATION pInfo)
   PSYSTEM_THREAD_INFORMATION          CurThread;
 
   if (NULL == pInfo) return EXIT_FAILURE;
   PSYSTEM_THREAD_INFORMATION          CurThread;
 
   if (NULL == pInfo) return EXIT_FAILURE;
-   
+
   CurThread = PsaWalkFirstThread(pInfo);
 
   wprintf (L"   NumberOfThreads: %d\n", pInfo->NumberOfThreads);
   CurThread = PsaWalkFirstThread(pInfo);
 
   wprintf (L"   NumberOfThreads: %d\n", pInfo->NumberOfThreads);
@@ -280,7 +280,7 @@ int STDCALL PrintThreads (PSYSTEM_PROCESS_INFORMATION pInfo)
     {
       continue;
     }
     {
       continue;
     }
-    
+
     Status = NtQueryInformationThread (
                hThread,
               ThreadBasicInformation,
     Status = NtQueryInformationThread (
                hThread,
               ThreadBasicInformation,
@@ -306,7 +306,7 @@ int STDCALL PrintThreads (PSYSTEM_PROCESS_INFORMATION pInfo)
       NtClose (hThread);
       continue;
     }
       NtClose (hThread);
       continue;
     }
-    
+
     NtClose (hThread);
 
     /* Now print the collected information */
     NtClose (hThread);
 
     /* Now print the collected information */
@@ -316,7 +316,7 @@ int STDCALL PrintThreads (PSYSTEM_PROCESS_INFORMATION pInfo)
       0 /* FIXME: ((PTEB) tInfo.TebBaseAddress)->LastErrorValue */,
       ThreadStateName[CurThread->ThreadState]
       );
       0 /* FIXME: ((PTEB) tInfo.TebBaseAddress)->LastErrorValue */,
       ThreadStateName[CurThread->ThreadState]
       );
-  } 
+  }
   return EXIT_SUCCESS;
 }
 
   return EXIT_SUCCESS;
 }
 
@@ -356,14 +356,14 @@ int STDCALL PrintProcess (char * PidStr)
   OBJECT_ATTRIBUTES           Oa = {0};
   CLIENT_ID                   ClientId = {0, 0};
 
   OBJECT_ATTRIBUTES           Oa = {0};
   CLIENT_ID                   ClientId = {0, 0};
 
-  
+
   ClientId.UniqueProcess = (PVOID) atol (PidStr);
   ClientId.UniqueProcess = (PVOID) atol (PidStr);
+
   if (FALSE == AcquirePrivileges ())
   {
     return EXIT_FAILURE;
   }
   if (FALSE == AcquirePrivileges ())
   {
     return EXIT_FAILURE;
   }
-  
+
   Status = NtOpenProcess (
              & hProcess,
              PROCESS_QUERY_INFORMATION,
   Status = NtOpenProcess (
              & hProcess,
              PROCESS_QUERY_INFORMATION,
@@ -380,7 +380,7 @@ int STDCALL PrintProcess (char * PidStr)
     LONG                        pInfoBaseLength = 0;
     LPWSTR                      Module = L"";
     LPWSTR                      Title = L"";
     LONG                        pInfoBaseLength = 0;
     LPWSTR                      Module = L"";
     LPWSTR                      Title = L"";
-    
+
     Status = NtQueryInformationProcess (
                hProcess,
               ProcessBasicInformation,
     Status = NtQueryInformationProcess (
                hProcess,
               ProcessBasicInformation,
@@ -411,7 +411,7 @@ int STDCALL PrintProcess (char * PidStr)
     if (NULL == pInfo) return EXIT_FAILURE;
 
     GetProcessInfo (pInfo, & Module, & Title);
     if (NULL == pInfo) return EXIT_FAILURE;
 
     GetProcessInfo (pInfo, & Module, & Title);
-    
+
     wprintf (L"%4d %s\n", ClientId.UniqueProcess, Module);
 #if 0
     printf ("   CWD:     %s\n", ""); /* it won't appear if empty */
     wprintf (L"%4d %s\n", ClientId.UniqueProcess, Module);
 #if 0
     printf ("   CWD:     %s\n", ""); /* it won't appear if empty */
@@ -425,15 +425,15 @@ int STDCALL PrintProcess (char * PidStr)
       ((LONG) PsVm.WorkingSetSize / 1024),
       ((LONG) PsVm.PeakWorkingSetSize / 1024)
       );
       ((LONG) PsVm.WorkingSetSize / 1024),
       ((LONG) PsVm.PeakWorkingSetSize / 1024)
       );
-    
+
     PrintThreads (pInfo);
 
     PrintModules ();
 
     PsaFreeCapture(pInfoBase);
     PrintThreads (pInfo);
 
     PrintModules ();
 
     PsaFreeCapture(pInfoBase);
-  
+
     NtClose (hProcess);
     NtClose (hProcess);
-    
+
     return EXIT_SUCCESS;
   }
   return EXIT_FAILURE;
     return EXIT_SUCCESS;
   }
   return EXIT_FAILURE;
index 36e01cd..e0349db 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright (c) 1998 Mark Russinovich
  *     Systems Internals
  *     http://www.sysinternals.com/
  * Copyright (c) 1998 Mark Russinovich
  *     Systems Internals
  *     http://www.sysinternals.com/
- * 
+ *
  * --------------------------------------------------------------------
  *
  * This software is free software; you can redistribute it and/or
  * --------------------------------------------------------------------
  *
  * This software is free software; you can redistribute it and/or
  * You should have received a copy of the GNU Library General Public
  * License along with this software; see the file COPYING.LIB. If
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  * You should have received a copy of the GNU Library General Public
  * License along with this software; see the file COPYING.LIB. If
  * not, write to the Free Software Foundation, Inc., 675 Mass Ave,
- * Cambridge, MA 02139, USA.  
+ * Cambridge, MA 02139, USA.
  *
  * --------------------------------------------------------------------
  *
  * --------------------------------------------------------------------
- * 
+ *
  * Print a Win32 error.
  *
  * 1999 February (Emanuele Aliberti)
  *     Taken from chkdskx.c and formatx.c by Mark Russinovich
  *     to be used in all sysutils.
  * Print a Win32 error.
  *
  * 1999 February (Emanuele Aliberti)
  *     Taken from chkdskx.c and formatx.c by Mark Russinovich
  *     to be used in all sysutils.
- */    
+ */
 #include <windows.h>
 #include <stdio.h>
 
 #include <windows.h>
 #include <stdio.h>
 
@@ -48,11 +48,11 @@ PrintWin32Error(
        )
 {
        PVOID lpMsgBuf;
        )
 {
        PVOID lpMsgBuf;
+
        FormatMessageW(
                (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM),
                NULL,
        FormatMessageW(
                (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM),
                NULL,
-               ErrorCode, 
+               ErrorCode,
                MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                (LPWSTR)& lpMsgBuf,
                0,
                MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
                (LPWSTR)& lpMsgBuf,
                0,
index b60ecd1..02e68df 100644 (file)
@@ -35,7 +35,7 @@ int main(int argc, char *argv[])
        wchar_t ** wargv;
        int     i;
        int     ec;
        wchar_t ** wargv;
        int     i;
        int     ec;
-       
+
        wargv = (wchar_t **) GlobalAlloc(
                                sizeof(void*) * argc,
                                0
        wargv = (wchar_t **) GlobalAlloc(
                                sizeof(void*) * argc,
                                0
index 0d06b7c..4f3c390 100644 (file)
@@ -32,9 +32,9 @@
 #define _USE_MSG_PUMP_
 
 typedef struct tagDialogData {
 #define _USE_MSG_PUMP_
 
 typedef struct tagDialogData {
-    HWND hWnd; 
+    HWND hWnd;
     LONG lData;
     LONG lData;
-} DialogData; 
+} DialogData;
 
 HINSTANCE hInst;
 HWND      hTabWnd;
 
 HINSTANCE hInst;
 HWND      hTabWnd;
@@ -46,7 +46,7 @@ LRESULT CreateMemoryDialog(HINSTANCE, HWND hwndOwner, LPSTR lpszMessage);
 LRESULT CALLBACK PageWndProc1(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK PageWndProc2(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK PageWndProc3(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK PageWndProc1(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK PageWndProc2(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK PageWndProc3(HWND, UINT, WPARAM, LPARAM);
+
 ////////////////////////////////////////////////////////////////////////////////
 
 static BOOL OnCreate(HWND hWnd, LONG lData)
 ////////////////////////////////////////////////////////////////////////////////
 
 static BOOL OnCreate(HWND hWnd, LONG lData)
index 99036ed..6bbb191 100644 (file)
@@ -66,9 +66,9 @@ LRESULT CreateMemoryDialog(HINSTANCE hinst, HWND hwndOwner, LPSTR lpszMessage)
     hgbl = GlobalAlloc(GMEM_ZEROINIT, 1024);
     if (!hgbl)
         return -1;
     hgbl = GlobalAlloc(GMEM_ZEROINIT, 1024);
     if (!hgbl)
         return -1;
+
     lpdt = (LPDLGTEMPLATE)GlobalLock(hgbl);
     lpdt = (LPDLGTEMPLATE)GlobalLock(hgbl);
+
     // Define a dialog box.
     lpdt->style = WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION;
     lpdt->cdit = 3;  // number of controls
     // Define a dialog box.
     lpdt->style = WS_POPUP | WS_BORDER | WS_SYSMENU | DS_MODALFRAME | WS_CAPTION;
     lpdt->cdit = 3;  // number of controls
@@ -136,23 +136,23 @@ LRESULT CreateMemoryDialog(HINSTANCE hinst, HWND hwndOwner, LPSTR lpszMessage)
     *lpw++ = 0xFFFF;
     *lpw++ = 0x0082;                         // static class
 
     *lpw++ = 0xFFFF;
     *lpw++ = 0x0082;                         // static class
 
-    for (lpwsz = (LPWSTR)lpw;    
+    for (lpwsz = (LPWSTR)lpw;
         *lpwsz++ = (WCHAR)*lpszMessage++;
     );
     lpw = (LPWORD)lpwsz;
     lpw = lpwAlign(lpw);  // align creation data on DWORD boundary
     *lpw++ = 0;           // no creation data
 
         *lpwsz++ = (WCHAR)*lpszMessage++;
     );
     lpw = (LPWORD)lpwsz;
     lpw = lpwAlign(lpw);  // align creation data on DWORD boundary
     *lpw++ = 0;           // no creation data
 
-    GlobalUnlock(hgbl); 
-    ret = DialogBoxIndirect(hinst, (LPDLGTEMPLATE)hgbl, hwndOwner, (DLGPROC)DialogWndProc); 
+    GlobalUnlock(hgbl);
+    ret = DialogBoxIndirect(hinst, (LPDLGTEMPLATE)hgbl, hwndOwner, (DLGPROC)DialogWndProc);
     if (ret == 0) {
         TRACE(_T("DialogBoxIndirect() failed due to invalid handle to parent window: 0x%08X"), hwndOwner);
     } else if (ret == -1) {
         DWORD error = GetLastError();
         TRACE(_T("DialogBoxIndirect() failed, GetLastError returned 0x%08X"), error);
     }
     if (ret == 0) {
         TRACE(_T("DialogBoxIndirect() failed due to invalid handle to parent window: 0x%08X"), hwndOwner);
     } else if (ret == -1) {
         DWORD error = GetLastError();
         TRACE(_T("DialogBoxIndirect() failed, GetLastError returned 0x%08X"), error);
     }
-    GlobalFree(hgbl); 
-    return ret; 
+    GlobalFree(hgbl);
+    return ret;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 }
 
 ////////////////////////////////////////////////////////////////////////////////
index aa0ec23..fdc2217 100644 (file)
 #include "trace.h"
 
 
 #include "trace.h"
 
 
-#define XBITMAP 80 
-#define YBITMAP 20 
-#define BUFFER_LEN MAX_PATH 
+#define XBITMAP 80
+#define YBITMAP 20
+
+#define BUFFER_LEN MAX_PATH
+
 extern HINSTANCE hInst;
 
 extern HINSTANCE hInst;
 
-HBITMAP hbmpPicture; 
-HBITMAP hbmpOld; 
+HBITMAP hbmpPicture;
+HBITMAP hbmpOld;
 
 
 ////////////////////////////////////////////////////////////////////////////////
 
 
 
 ////////////////////////////////////////////////////////////////////////////////
 
-static void AddItem(HWND hListBox, LPCTSTR lpstr, HBITMAP hbmp) 
-{ 
-    int nItem = SendMessage(hListBox, LB_ADDSTRING, 0, (LPARAM)lpstr); 
-    SendMessage(hListBox, LB_SETITEMDATA, nItem, (LPARAM)hbmp); 
-} 
+static void AddItem(HWND hListBox, LPCTSTR lpstr, HBITMAP hbmp)
+{
+    int nItem = SendMessage(hListBox, LB_ADDSTRING, 0, (LPARAM)lpstr);
+    SendMessage(hListBox, LB_SETITEMDATA, nItem, (LPARAM)hbmp);
+}
 
 static TCHAR* items[] = {
     _T("services"),
 
 static TCHAR* items[] = {
     _T("services"),
@@ -70,61 +70,61 @@ static void InitListCtrl(HWND hDlg)
         SendMessage(hListBox, LB_ADDSTRING, 0, (LPARAM)szBuffer);
     }
 
         SendMessage(hListBox, LB_ADDSTRING, 0, (LPARAM)szBuffer);
     }
 
-    SetFocus(hListBox); 
-    SendMessage(hListBox, LB_SETCURSEL, 0, 0); 
+    SetFocus(hListBox);
+    SendMessage(hListBox, LB_SETCURSEL, 0, 0);
 }
 
 static void OnDrawItem(HWND hWnd, LPARAM lParam)
 {
 }
 
 static void OnDrawItem(HWND hWnd, LPARAM lParam)
 {
-//    int nItem; 
-    TCHAR tchBuffer[BUFFER_LEN]; 
-//    HBITMAP hbmp; 
-    TEXTMETRIC tm; 
-    int y; 
-    HDC hdcMem; 
-    LPDRAWITEMSTRUCT lpdis; 
-    RECT rcBitmap; 
-
-    lpdis = (LPDRAWITEMSTRUCT)lParam; 
-    // If there are no list box items, skip this message. 
-    if (lpdis->itemID != -1) { 
-        // Draw the bitmap and text for the list box item. Draw a rectangle around the bitmap if it is selected. 
-        switch (lpdis->itemAction) { 
-        case ODA_SELECT: 
-        case ODA_DRAWENTIRE: 
-            // Display the bitmap associated with the item. 
-            hbmpPicture = (HBITMAP)SendMessage(lpdis->hwndItem, LB_GETITEMDATA, lpdis->itemID, (LPARAM)0); 
-            hdcMem = CreateCompatibleDC(lpdis->hDC); 
-            hbmpOld = SelectObject(hdcMem, hbmpPicture); 
-            BitBlt(lpdis->hDC, 
-                   lpdis->rcItem.left, lpdis->rcItem.top, 
-                   lpdis->rcItem.right - lpdis->rcItem.left, 
-                   lpdis->rcItem.bottom - lpdis->rcItem.top, 
-                   hdcMem, 0, 0, SRCCOPY); 
-            // Display the text associated with the item. 
-            SendMessage(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, (LPARAM)tchBuffer); 
-            GetTextMetrics(lpdis->hDC, &tm); 
-            y = (lpdis->rcItem.bottom + lpdis->rcItem.top - tm.tmHeight) / 2; 
-            TextOut(lpdis->hDC, XBITMAP + 6, y, tchBuffer, _tcslen(tchBuffer)); 
-            SelectObject(hdcMem, hbmpOld); 
-            DeleteDC(hdcMem); 
-            // Is the item selected? 
-            if (lpdis->itemState & ODS_SELECTED) { 
-                // Set RECT coordinates to surround only the bitmap. 
-                rcBitmap.left = lpdis->rcItem.left; 
-                rcBitmap.top = lpdis->rcItem.top; 
-                rcBitmap.right = lpdis->rcItem.left + XBITMAP; 
-                rcBitmap.bottom = lpdis->rcItem.top + YBITMAP; 
-                // Draw a rectangle around bitmap to indicate the selection. 
-                DrawFocusRect(lpdis->hDC, &rcBitmap); 
-            } 
-            break; 
-        case ODA_FOCUS: 
-            // Do not process focus changes. The focus caret (outline rectangle) 
-            // indicates the selection. The IDOK button indicates the final selection. 
-            break; 
-        } 
-    } 
+//    int nItem;
+    TCHAR tchBuffer[BUFFER_LEN];
+//    HBITMAP hbmp;
+    TEXTMETRIC tm;
+    int y;
+    HDC hdcMem;
+    LPDRAWITEMSTRUCT lpdis;
+    RECT rcBitmap;
+
+    lpdis = (LPDRAWITEMSTRUCT)lParam;
+    // If there are no list box items, skip this message.
+    if (lpdis->itemID != -1) {
+        // Draw the bitmap and text for the list box item. Draw a rectangle around the bitmap if it is selected.
+        switch (lpdis->itemAction) {
+        case ODA_SELECT:
+        case ODA_DRAWENTIRE:
+            // Display the bitmap associated with the item.
+            hbmpPicture = (HBITMAP)SendMessage(lpdis->hwndItem, LB_GETITEMDATA, lpdis->itemID, (LPARAM)0);
+            hdcMem = CreateCompatibleDC(lpdis->hDC);
+            hbmpOld = SelectObject(hdcMem, hbmpPicture);
+            BitBlt(lpdis->hDC,
+                   lpdis->rcItem.left, lpdis->rcItem.top,
+                   lpdis->rcItem.right - lpdis->rcItem.left,
+                   lpdis->rcItem.bottom - lpdis->rcItem.top,
+                   hdcMem, 0, 0, SRCCOPY);
+            // Display the text associated with the item.
+            SendMessage(lpdis->hwndItem, LB_GETTEXT, lpdis->itemID, (LPARAM)tchBuffer);
+            GetTextMetrics(lpdis->hDC, &tm);
+            y = (lpdis->rcItem.bottom + lpdis->rcItem.top - tm.tmHeight) / 2;
+            TextOut(lpdis->hDC, XBITMAP + 6, y, tchBuffer, _tcslen(tchBuffer));
+            SelectObject(hdcMem, hbmpOld);
+            DeleteDC(hdcMem);
+            // Is the item selected?
+            if (lpdis->itemState & ODS_SELECTED) {
+                // Set RECT coordinates to surround only the bitmap.
+                rcBitmap.left = lpdis->rcItem.left;
+                rcBitmap.top = lpdis->rcItem.top;
+                rcBitmap.right = lpdis->rcItem.left + XBITMAP;
+                rcBitmap.bottom = lpdis->rcItem.top + YBITMAP;
+                // Draw a rectangle around bitmap to indicate the selection.
+                DrawFocusRect(lpdis->hDC, &rcBitmap);
+            }
+            break;
+        case ODA_FOCUS:
+            // Do not process focus changes. The focus caret (outline rectangle)
+            // indicates the selection. The IDOK button indicates the final selection.
+            break;
+        }
+    }
 }
 
 
 }
 
 
@@ -143,15 +143,15 @@ void OnSetFont(HWND hWnd, WPARAM wParam, LPARAM lParam)
 
 void OnMeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
 {
 
 void OnMeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct)
 {
-    HFONT hFont; 
+    HFONT hFont;
        LOGFONT lf;
 
        LOGFONT lf;
 
-    hFont = GetStockObject(SYSTEM_FONT); 
+    hFont = GetStockObject(SYSTEM_FONT);
     GetObject(hFont, sizeof(LOGFONT), &lf);
        if (lf.lfHeight < 0)
     GetObject(hFont, sizeof(LOGFONT), &lf);
        if (lf.lfHeight < 0)
-               lpMeasureItemStruct->itemHeight = -lf.lfHeight; 
+               lpMeasureItemStruct->itemHeight = -lf.lfHeight;
        else
        else
-               lpMeasureItemStruct->itemHeight = lf.lfHeight; 
+               lpMeasureItemStruct->itemHeight = lf.lfHeight;
 }
 
 LRESULT CALLBACK PageWndProc1(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 }
 
 LRESULT CALLBACK PageWndProc1(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
@@ -160,15 +160,15 @@ LRESULT CALLBACK PageWndProc1(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
     case WM_INITDIALOG:
         InitListCtrl(hDlg);
         return TRUE;
     case WM_INITDIALOG:
         InitListCtrl(hDlg);
         return TRUE;
-    case WM_SETFONT: 
+    case WM_SETFONT:
         OnSetFont(hDlg, wParam, lParam);
         return TRUE;
         OnSetFont(hDlg, wParam, lParam);
         return TRUE;
-    case WM_MEASUREITEM: 
+    case WM_MEASUREITEM:
         OnMeasureItem((LPMEASUREITEMSTRUCT)lParam);
         OnMeasureItem((LPMEASUREITEMSTRUCT)lParam);
-        return TRUE; 
-    case WM_DRAWITEM: 
+        return TRUE;
+    case WM_DRAWITEM:
         OnDrawItem(hDlg, lParam);
         OnDrawItem(hDlg, lParam);
-        return TRUE; 
+        return TRUE;
     case WM_COMMAND:
         switch (LOWORD(wParam)) {
         case IDOK:
     case WM_COMMAND:
         switch (LOWORD(wParam)) {
         case IDOK:
index d225a22..948b520 100644 (file)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // Diagnostic Trace
 //
 /////////////////////////////////////////////////////////////////////////////
 // Diagnostic Trace
 //
-#include <stdio.h> 
+#include <stdio.h>
 #include <stdarg.h>
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <stdarg.h>
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
index 9b42210..84191f0 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifdef _MSC_VER
 #include "stdafx.h"
 #else
 #ifdef _MSC_VER
 #include "stdafx.h"
 #else
@@ -33,7 +33,7 @@
 #include <process.h>
 #include <stdio.h>
 #endif
 #include <process.h>
 #include <stdio.h>
 #endif
-    
+
 #include "main.h"
 #include "about.h"
 
 #include "main.h"
 #include "about.h"
 
index 4dd6e6d..1f94d62 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __ABOUT_H__
 #define __ABOUT_H__
 
 #ifndef __ABOUT_H__
 #define __ABOUT_H__
 
index 4d5c1ac..c2a1668 100644 (file)
@@ -33,7 +33,7 @@
 #include <process.h>
 #include <stdio.h>
 #endif
 #include <process.h>
 #include <stdio.h>
 #endif
-    
+
 #include <assert.h>
 #define ASSERT assert
 
 #include <assert.h>
 #define ASSERT assert
 
index b9e680d..c6fb609 100644 (file)
@@ -33,7 +33,7 @@ extern "C" {
 
 
 LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT CALLBACK ChildWndProc(HWND, UINT, WPARAM, LPARAM);
-    
+
 
 #ifdef __cplusplus
 };
 
 #ifdef __cplusplus
 };
index 850a6a2..ab70495 100644 (file)
@@ -33,7 +33,7 @@
 #include <process.h>
 #include <stdio.h>
 #endif
 #include <process.h>
 #include <stdio.h>
 #endif
-    
+
 #include "main.h"
 #include "about.h"
 #include "framewnd.h"
 #include "main.h"
 #include "about.h"
 #include "framewnd.h"
index d72290b..94b7a5f 100644 (file)
@@ -33,7 +33,7 @@ extern "C" {
 
 
 LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT CALLBACK FrameWndProc(HWND, UINT, WPARAM, LPARAM);
-    
+
 
 #ifdef __cplusplus
 };
 
 #ifdef __cplusplus
 };
index 22f09b4..c7fbf3f 100644 (file)
@@ -33,7 +33,7 @@
 #include <process.h>
 #include <stdio.h>
 #endif
 #include <process.h>
 #include <stdio.h>
 #endif
-    
+
 #include "main.h"
 #include "framewnd.h"
 #include "childwnd.h"
 #include "main.h"
 #include "framewnd.h"
 #include "childwnd.h"
@@ -156,7 +156,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
         CheckMenuItem(hMenuOptions, ID_OPTIONS_TOOLBAR, MF_BYCOMMAND|MF_CHECKED);
 
         // Create the status bar
         CheckMenuItem(hMenuOptions, ID_OPTIONS_TOOLBAR, MF_BYCOMMAND|MF_CHECKED);
 
         // Create the status bar
-        hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS, 
+        hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS,
                                         "", hFrameWnd, IDC_STATUSBAR);
         if (!hStatusBar)
             return FALSE;
                                         "", hFrameWnd, IDC_STATUSBAR);
         if (!hStatusBar)
             return FALSE;
@@ -230,7 +230,7 @@ int APIENTRY WinMain(HINSTANCE hInstance,
     LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
     LoadString(hInstance, IDC_MDI_APP, szFrameClass, MAX_LOADSTRING);
     LoadString(hInstance, IDC_MDI_APP_CHILD, szChildClass, MAX_LOADSTRING);
     LoadString(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
     LoadString(hInstance, IDC_MDI_APP, szFrameClass, MAX_LOADSTRING);
     LoadString(hInstance, IDC_MDI_APP_CHILD, szChildClass, MAX_LOADSTRING);
-    
+
     // Allow only one running instance
     EnumWindows(EnumWndProc, (LPARAM)szFrameClass);
     if (g_foundPrevInstance)
     // Allow only one running instance
     EnumWindows(EnumWndProc, (LPARAM)szFrameClass);
     if (g_foundPrevInstance)
@@ -247,13 +247,13 @@ int APIENTRY WinMain(HINSTANCE hInstance,
     hMDIClient = GetWindow(hFrameWnd, GW_CHILD);
 
     // Main message loop:
     hMDIClient = GetWindow(hFrameWnd, GW_CHILD);
 
     // Main message loop:
-    while (GetMessage(&msg, (HWND)NULL, 0, 0)) { 
-        if (!TranslateMDISysAccel(hMDIClient, &msg) && 
-            !TranslateAccelerator(hFrameWnd, hAccel, &msg)) { 
-            TranslateMessage(&msg); 
-            DispatchMessage(&msg); 
-        } 
-    } 
+    while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
+        if (!TranslateMDISysAccel(hMDIClient, &msg) &&
+            !TranslateAccelerator(hFrameWnd, hAccel, &msg)) {
+            TranslateMessage(&msg);
+            DispatchMessage(&msg);
+        }
+    }
     ExitInstance();
     return msg.wParam;
 }
     ExitInstance();
     return msg.wParam;
 }
index d65df5d..2872061 100644 (file)
@@ -33,7 +33,7 @@
 #include <process.h>
 #include <stdio.h>
 #endif
 #include <process.h>
 #include <stdio.h>
 #endif
-    
+
 #include <assert.h>
 #define ASSERT assert
 
 #include <assert.h>
 #define ASSERT assert
 
index fc6978d..50af937 100644 (file)
@@ -33,7 +33,7 @@ extern "C" {
 
 
 LRESULT CALLBACK PanelWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT CALLBACK PanelWndProc(HWND, UINT, WPARAM, LPARAM);
-    
+
 
 #ifdef __cplusplus
 };
 
 #ifdef __cplusplus
 };
index 463b8f7..5bdb454 100644 (file)
@@ -60,7 +60,7 @@
 #define IDC_STATIC                      -1
 
 // Next default values for new objects
 #define IDC_STATIC                      -1
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        138
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        138
index c4ac607..2c5bba1 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifdef _MSC_VER
 #include "stdafx.h"
 #else
 #ifdef _MSC_VER
 #include "stdafx.h"
 #else
@@ -78,5 +78,5 @@ LRESULT CALLBACK RosMDIChildProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
 }
 
 
 }
 
 
-/*    
+/*
 */
\ No newline at end of file
 */
\ No newline at end of file
index 134ff3f..4de025f 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __ROS2WIN_H__
 #define __ROS2WIN_H__
 
 #ifndef __ROS2WIN_H__
 #define __ROS2WIN_H__
 
index 0b7aca6..116d4f1 100644 (file)
@@ -22,7 +22,7 @@ static char Event[200];
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
index 4cfeca8..5c99760 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: alive.c,v 1.1 2004/10/21 04:48:44 sedwards Exp $
+/* $Id$
  *
  */
 #include <windows.h>
  *
  */
 #include <windows.h>
index ee3942d..65e3982 100644 (file)
@@ -7,10 +7,10 @@
 
 HINSTANCE HInst;
 const char* WndClassName = "GMainWnd";
 
 HINSTANCE HInst;
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam);
    LPARAM LParam);
-   
-WINBOOL 
+
+WINBOOL
 STDCALL
 GdiAlphaBlend(HDC hdcDst,LONG DstX,LONG DstY,LONG DstCx,LONG DstCy,HDC hdcSrc,LONG SrcX,LONG SrcY,LONG SrcCx,LONG SrcCy,BLENDFUNCTION BlendFunction);
 
 STDCALL
 GdiAlphaBlend(HDC hdcDst,LONG DstX,LONG DstY,LONG DstCx,LONG DstCy,HDC hdcSrc,LONG SrcX,LONG SrcY,LONG SrcCx,LONG SrcCy,BLENDFUNCTION BlendFunction);
 
@@ -24,7 +24,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
    HInst = HInstance;
 
    memset(&wc, 0, sizeof(WNDCLASS));
    HInst = HInstance;
 
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = HInstance;
    wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = HInstance;
@@ -35,15 +35,15 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
 
    if (RegisterClass(&wc))
    {
 
    if (RegisterClass(&wc))
    {
-      HWND HWnd = 
+      HWND HWnd =
          CreateWindow(
             WndClassName, TEXT("AlphaBlend Rendering Demo"),
          CreateWindow(
             WndClassName, TEXT("AlphaBlend Rendering Demo"),
-            WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | 
+            WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |
             WS_VISIBLE | WS_CLIPSIBLINGS,
             0, 0, 320, 430,
             NULL, NULL, HInst, NULL
             );
             WS_VISIBLE | WS_CLIPSIBLINGS,
             0, 0, 320, 430,
             NULL, NULL, HInst, NULL
             );
-                                 
+
       if (HWnd)
       {
          ShowWindow(HWnd, nCmdShow);
       if (HWnd)
       {
          ShowWindow(HWnd, nCmdShow);
@@ -53,7 +53,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
-         }      
+         }
       }
     }
     return 0;
       }
     }
     return 0;
@@ -84,9 +84,9 @@ BOOL ConvertBitmapTo32Bpp(HDC hDC, BITMAP *bmp)
     HBITMAP bmpalpha;
     SelectObject(hDC, H32BppBitmap);
     BitBlt(hDC, 0, 0, bmp->bmWidth, bmp->bmHeight, HMemDC, 0, 0, SRCCOPY);
     HBITMAP bmpalpha;
     SelectObject(hDC, H32BppBitmap);
     BitBlt(hDC, 0, 0, bmp->bmWidth, bmp->bmHeight, HMemDC, 0, 0, SRCCOPY);
-    
+
     /* load and apply alpha channel */
     /* load and apply alpha channel */
-    bmpalpha = LoadImage(HInst, TEXT("lenaalpha.bmp"), IMAGE_BITMAP, 
+    bmpalpha = LoadImage(HInst, TEXT("lenaalpha.bmp"), IMAGE_BITMAP,
                             0, 0, LR_LOADFROMFILE);
     if(bmpalpha)
     {
                             0, 0, LR_LOADFROMFILE);
     if(bmpalpha)
     {
@@ -99,7 +99,7 @@ BOOL ConvertBitmapTo32Bpp(HDC hDC, BITMAP *bmp)
         return FALSE;
       }
       SelectObject(hdcTemp, bmpalpha);
         return FALSE;
       }
       SelectObject(hdcTemp, bmpalpha);
-      
+
       for(y = 0; y < bmp->bmHeight; y++)
       {
         for(x = 0; x < bmp->bmWidth; x++)
       for(y = 0; y < bmp->bmHeight; y++)
       {
         for(x = 0; x < bmp->bmWidth; x++)
@@ -108,7 +108,7 @@ BOOL ConvertBitmapTo32Bpp(HDC hDC, BITMAP *bmp)
           *col++ |= Color;
         }
       }
           *col++ |= Color;
         }
       }
-      
+
       DeleteObject(bmpalpha);
       DeleteDC(hdcTemp);
       return TRUE;
       DeleteObject(bmpalpha);
       DeleteDC(hdcTemp);
       return TRUE;
@@ -118,25 +118,25 @@ BOOL ConvertBitmapTo32Bpp(HDC hDC, BITMAP *bmp)
   return FALSE;
 }
 
   return FALSE;
 }
 
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam)
 {
    switch (Msg)
    {
       case WM_CREATE:
    LPARAM LParam)
 {
    switch (Msg)
    {
       case WM_CREATE:
-      {         
+      {
          /* create a memory DC */
          HMemDC = CreateCompatibleDC(NULL);
          if (HMemDC)
          {
             /* load a bitmap from file */
          /* create a memory DC */
          HMemDC = CreateCompatibleDC(NULL);
          if (HMemDC)
          {
             /* load a bitmap from file */
-            HBITMAP HBmp = 
+            HBITMAP HBmp =
                /* static_cast<HBITMAP> */(
                /* static_cast<HBITMAP> */(
-                  LoadImage(HInst, filename, IMAGE_BITMAP, 
+                  LoadImage(HInst, filename, IMAGE_BITMAP,
                             0, 0, LR_LOADFROMFILE)
                             0, 0, LR_LOADFROMFILE)
-                            );  
+                            );
             if (HBmp)
             if (HBmp)
-            { 
+            {
                /* extract dimensions of the bitmap */
                GetObject(HBmp, sizeof(BITMAP), &bmp);
 
                /* extract dimensions of the bitmap */
                GetObject(HBmp, sizeof(BITMAP), &bmp);
 
@@ -151,7 +151,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
                   return 0;
                 }
             }
                   return 0;
                 }
             }
-         }         
+         }
       }
       case WM_PAINT:
       {
       }
       case WM_PAINT:
       {
@@ -162,33 +162,33 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
          try
 #endif
          {
          try
 #endif
          {
-            
+
             BlendFunc.BlendOp = AC_SRC_OVER;
             BlendFunc.BlendFlags = 0;
             BlendFunc.SourceConstantAlpha = 128;
             BlendFunc.AlphaFormat = 0;
             BlendFunc.BlendOp = AC_SRC_OVER;
             BlendFunc.BlendFlags = 0;
             BlendFunc.SourceConstantAlpha = 128;
             BlendFunc.AlphaFormat = 0;
-            
-            BitBlt(Hdc, 100, 90, 
+
+            BitBlt(Hdc, 100, 90,
                    bmp.bmWidth, bmp.bmHeight,
                    bmp.bmWidth, bmp.bmHeight,
-                   HMemDC2, 0, 0, 
-                   SRCCOPY); 
+                   HMemDC2, 0, 0,
+                   SRCCOPY);
             GdiAlphaBlend(Hdc, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           HMemDC2, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           BlendFunc);
             GdiAlphaBlend(Hdc, bmp.bmWidth - 15, 10, bmp.bmWidth / 2, bmp.bmHeight / 2,
                           HMemDC2, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           BlendFunc);
             GdiAlphaBlend(Hdc, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           HMemDC2, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           BlendFunc);
             GdiAlphaBlend(Hdc, bmp.bmWidth - 15, 10, bmp.bmWidth / 2, bmp.bmHeight / 2,
                           HMemDC2, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           BlendFunc);
-            
+
             BlendFunc.SourceConstantAlpha = 255;
             BlendFunc.AlphaFormat = AC_SRC_ALPHA;
             BlendFunc.SourceConstantAlpha = 255;
             BlendFunc.AlphaFormat = AC_SRC_ALPHA;
-            
+
             GdiAlphaBlend(Hdc, 140, 200, bmp.bmWidth, bmp.bmHeight,
                           HMemDC2, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           BlendFunc);
             GdiAlphaBlend(Hdc, 20, 210, (bmp.bmWidth / 3) * 2, (bmp.bmHeight / 3) * 2,
                           HMemDC2, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           BlendFunc);
             GdiAlphaBlend(Hdc, 140, 200, bmp.bmWidth, bmp.bmHeight,
                           HMemDC2, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           BlendFunc);
             GdiAlphaBlend(Hdc, 20, 210, (bmp.bmWidth / 3) * 2, (bmp.bmHeight / 3) * 2,
                           HMemDC2, 0, 0, bmp.bmWidth, bmp.bmHeight,
                           BlendFunc);
-         }           
+         }
 #if 0
          catch (...)
          {
 #if 0
          catch (...)
          {
index d33da63..51eaf6a 100644 (file)
@@ -8,7 +8,7 @@
 HANDLE OutputHandle;
 HANDLE InputHandle;
 
 HANDLE OutputHandle;
 HANDLE InputHandle;
 
-VOID STDCALL 
+VOID STDCALL
 ApcRoutine(PVOID Context,
           PIO_STATUS_BLOCK IoStatus,
           ULONG Reserved)
 ApcRoutine(PVOID Context,
           PIO_STATUS_BLOCK IoStatus,
           ULONG Reserved)
@@ -27,13 +27,13 @@ int main(int argc, char* argv[])
    CHAR Buffer[256];
    HANDLE EventHandle;
    LARGE_INTEGER off;
    CHAR Buffer[256];
    HANDLE EventHandle;
    LARGE_INTEGER off;
-  
+
    AllocConsole();
    InputHandle = GetStdHandle(STD_INPUT_HANDLE);
    OutputHandle =  GetStdHandle(STD_OUTPUT_HANDLE);
 
    printf("APC test program\n");
    AllocConsole();
    InputHandle = GetStdHandle(STD_INPUT_HANDLE);
    OutputHandle =  GetStdHandle(STD_OUTPUT_HANDLE);
 
    printf("APC test program\n");
-   
+
    EventHandle = CreateEventW(NULL,
                              FALSE,
                              FALSE,
    EventHandle = CreateEventW(NULL,
                              FALSE,
                              FALSE,
@@ -43,14 +43,14 @@ int main(int argc, char* argv[])
        printf("Failed to create event\n");
        return 0;
      }
        printf("Failed to create event\n");
        return 0;
      }
-   
+
    printf("Opening file\n");
    InitializeObjectAttributes(&ObjectAttributes,
                              &FileName,
                              0,
                              NULL,
                              NULL);
    printf("Opening file\n");
    InitializeObjectAttributes(&ObjectAttributes,
                              &FileName,
                              0,
                              NULL,
                              NULL);
-   
+
    printf("Creating file\n");
    FileHandle = CreateFileW(L"C:\\a.txt",
                            FILE_GENERIC_READ | FILE_GENERIC_WRITE,
    printf("Creating file\n");
    FileHandle = CreateFileW(L"C:\\a.txt",
                            FILE_GENERIC_READ | FILE_GENERIC_WRITE,
@@ -59,16 +59,16 @@ int main(int argc, char* argv[])
                            OPEN_EXISTING,
                            FILE_FLAG_OVERLAPPED,
                            NULL);
                            OPEN_EXISTING,
                            FILE_FLAG_OVERLAPPED,
                            NULL);
-         
+
    if (FileHandle == INVALID_HANDLE_VALUE)
      {
 
   printf("Open failed last err 0x%lu\n",GetLastError());
        return 0;
      }
    if (FileHandle == INVALID_HANDLE_VALUE)
      {
 
   printf("Open failed last err 0x%lu\n",GetLastError());
        return 0;
      }
-     
+
      off.QuadPart = 0;
      off.QuadPart = 0;
-     
+
    printf("Reading file\n");
    Status = ZwReadFile(FileHandle,
                        NULL,
    printf("Reading file\n");
    Status = ZwReadFile(FileHandle,
                        NULL,
@@ -77,9 +77,9 @@ int main(int argc, char* argv[])
                        &IoStatus,
                        Buffer,
                        256,//len
                        &IoStatus,
                        Buffer,
                        256,//len
-                       &off ,//offset must exist if file was opened for asynch. i/o aka. OVERLAPPED 
-                       NULL); 
-      
+                       &off ,//offset must exist if file was opened for asynch. i/o aka. OVERLAPPED
+                       NULL);
+
    if (!NT_SUCCESS(Status))
      {
        printf("Read failed status 0x%lu\n",Status);
    if (!NT_SUCCESS(Status))
      {
        printf("Read failed status 0x%lu\n",Status);
index ca3699c..1638062 100644 (file)
@@ -5,13 +5,13 @@
 VOID CALLBACK TimerApcProc(
   LPVOID lpArg,
   DWORD dwTimerLowValue,
 VOID CALLBACK TimerApcProc(
   LPVOID lpArg,
   DWORD dwTimerLowValue,
-  DWORD dwTimerHighValue ) 
+  DWORD dwTimerHighValue )
 {
   printf("APC Callback %lu\n", *(PDWORD)lpArg);
 }
 
 
 {
   printf("APC Callback %lu\n", *(PDWORD)lpArg);
 }
 
 
-int main() 
+int main()
 {
   HANDLE          hTimer;
   BOOL            bSuccess;
 {
   HANDLE          hTimer;
   BOOL            bSuccess;
@@ -19,12 +19,12 @@ int main()
   DWORD           value = 1;
 
   hTimer = CreateWaitableTimer(NULL, FALSE, NULL );
   DWORD           value = 1;
 
   hTimer = CreateWaitableTimer(NULL, FALSE, NULL );
-  
+
   if (!hTimer)
   {
     printf("CreateWaitableTimer failed!\n");
     return 0;
   if (!hTimer)
   {
     printf("CreateWaitableTimer failed!\n");
     return 0;
-  } 
+  }
 
   DueTime.QuadPart = -(LONGLONG)(5 * 10000000);
 
 
   DueTime.QuadPart = -(LONGLONG)(5 * 10000000);
 
@@ -42,7 +42,7 @@ int main()
     return 0;
   }
 
     return 0;
   }
 
-  for (;value <= 10; value++ ) 
+  for (;value <= 10; value++ )
   {
     SleepEx(INFINITE, TRUE /*alertable*/ );
   }
   {
     SleepEx(INFINITE, TRUE /*alertable*/ );
   }
index 447bc0f..621b3a1 100644 (file)
@@ -1,8 +1,8 @@
 /*
 /*
- * 
+ *
  */
 
 int main(int argc, char* argv[])
 {
  */
 
 int main(int argc, char* argv[])
 {
-   
+
 }
 }
index 6648a25..6a8e4b9 100644 (file)
@@ -47,7 +47,7 @@ int main (void)
      }
 
    printf("All threads created...\n");
      }
 
    printf("All threads created...\n");
-   
+
    /*
     * Waiting for threads is not implemented yet.
     * If you want to see all threads running, uncomment the
    /*
     * Waiting for threads is not implemented yet.
     * If you want to see all threads running, uncomment the
index b538f7c..1815d73 100644 (file)
@@ -6,7 +6,7 @@
  * Created by Damon Chandler <dmc27@ee.cornell.edu>
  * Updates can be downloaded at: <www.coriolis.com>
  *
  * Created by Damon Chandler <dmc27@ee.cornell.edu>
  * Updates can be downloaded at: <www.coriolis.com>
  *
- * Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+ * Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
  * if you have any questions about this code.
  */
 
  * if you have any questions about this code.
  */
 
@@ -16,7 +16,7 @@
 
 HINSTANCE HInst;
 const char* WndClassName = "GMainWnd";
 
 HINSTANCE HInst;
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam);
 
 
    LPARAM LParam);
 
 
@@ -29,7 +29,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
    HInst = HInstance;
 
    memset(&wc, 0, sizeof(WNDCLASS));
    HInst = HInstance;
 
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = HInstance;
    wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = HInstance;
@@ -40,15 +40,15 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
 
    if (RegisterClass(&wc))
    {
 
    if (RegisterClass(&wc))
    {
-      HWND HWnd = 
+      HWND HWnd =
          CreateWindow(
             WndClassName, TEXT("BitBlt Bitmap Rendering Demo"),
          CreateWindow(
             WndClassName, TEXT("BitBlt Bitmap Rendering Demo"),
-            WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION | 
+            WS_OVERLAPPED | WS_SYSMENU | WS_CAPTION |
             WS_VISIBLE | WS_CLIPSIBLINGS,
             0, 0, 220, 230,
             NULL, NULL, HInst, NULL
             );
             WS_VISIBLE | WS_CLIPSIBLINGS,
             0, 0, 220, 230,
             NULL, NULL, HInst, NULL
             );
-                                 
+
       if (HWnd)
       {
          ShowWindow(HWnd, nCmdShow);
       if (HWnd)
       {
          ShowWindow(HWnd, nCmdShow);
@@ -58,7 +58,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
          {
              TranslateMessage(&msg);
              DispatchMessage(&msg);
-         }      
+         }
       }
     }
     return 0;
       }
     }
     return 0;
@@ -70,25 +70,25 @@ LPCSTR filename = TEXT("lena.bmp");
 HDC HMemDC = NULL;
 HBITMAP HOldBmp = NULL;
 
 HDC HMemDC = NULL;
 HBITMAP HOldBmp = NULL;
 
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam)
 {
    switch (Msg)
    {
       case WM_CREATE:
    LPARAM LParam)
 {
    switch (Msg)
    {
       case WM_CREATE:
-      {         
+      {
          /* create a memory DC */
          HMemDC = CreateCompatibleDC(NULL);
          if (HMemDC)
          {
             /* load a bitmap from file */
          /* create a memory DC */
          HMemDC = CreateCompatibleDC(NULL);
          if (HMemDC)
          {
             /* load a bitmap from file */
-            HBITMAP HBmp = 
+            HBITMAP HBmp =
                /* static_cast<HBITMAP> */(
                /* static_cast<HBITMAP> */(
-                  LoadImage(HInst, filename, IMAGE_BITMAP, 
+                  LoadImage(HInst, filename, IMAGE_BITMAP,
                             0, 0, LR_LOADFROMFILE)
                             0, 0, LR_LOADFROMFILE)
-                            );  
+                            );
             if (HBmp)
             if (HBmp)
-            { 
+            {
                /* extract dimensions of the bitmap */
                GetObject(HBmp, sizeof(BITMAP), &bmp);
 
                /* extract dimensions of the bitmap */
                GetObject(HBmp, sizeof(BITMAP), &bmp);
 
@@ -97,7 +97,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
                (SelectObject(HMemDC, HBmp)
                   );
             }
                (SelectObject(HMemDC, HBmp)
                   );
             }
-         }         
+         }
       }
       case WM_PAINT:
       {
       }
       case WM_PAINT:
       {
@@ -107,15 +107,15 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
          try
 #endif
          {
          try
 #endif
          {
-            
+
             /* TODO: add palette support (see Chapter 9)... */
             /* TODO: add palette support (see Chapter 9)... */
-            
 
 
-            BitBlt(Hdc, 20, 15, 
+
+            BitBlt(Hdc, 20, 15,
                    bmp.bmWidth, bmp.bmHeight,
                    bmp.bmWidth, bmp.bmHeight,
-                   HMemDC, 0, 0, 
-                   SRCCOPY);  
-         }           
+                   HMemDC, 0, 0,
+                   SRCCOPY);
+         }
 #if 0
          catch (...)
 #endif
 #if 0
          catch (...)
 #endif
index b16c905..0fa4ed7 100644 (file)
@@ -4,7 +4,7 @@
 HFONT tf;
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 HFONT tf;
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -103,7 +103,7 @@ WinMain(HINSTANCE hInstance,
   hbtn[11] = CreateWindow(
     "BUTTON","BS_DEFPUSHBUTTON|BS_LEFT",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_LEFT,
       480, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
   hbtn[11] = CreateWindow(
     "BUTTON","BS_DEFPUSHBUTTON|BS_LEFT",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_LEFT,
       480, 10, 250, 40, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
+
   hbtn[12] = CreateWindow(
     "BUTTON","BS_DEFPUSHBUTTON|BS_RIGHT|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_RIGHT |BS_MULTILINE,
       740, 10, 150, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
   hbtn[12] = CreateWindow(
     "BUTTON","BS_DEFPUSHBUTTON|BS_RIGHT|BS_MULTILINE",WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON | BS_RIGHT |BS_MULTILINE,
       740, 10, 150, 60, hWnd, NULL, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
index 6a45468..326da11 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: capclock.c,v 1.1 2004/10/21 05:11:59 sedwards Exp $
+/* $Id$
  *
  * DESCRIPTION: Simple Win32 Caption Clock
  * PROJECT    : ReactOS (test applications)
  *
  * DESCRIPTION: Simple Win32 Caption Clock
  * PROJECT    : ReactOS (test applications)
index 4900781..e8eeaec 100644 (file)
@@ -10,7 +10,7 @@ static HBITMAP CaretBitmap;
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -19,7 +19,7 @@ WinMain(HINSTANCE hInstance,
   WNDCLASS wc;
   MSG msg;
   HWND hWnd;
   WNDCLASS wc;
   MSG msg;
   HWND hWnd;
-  
+
   CaretBitmap = LoadBitmap(hInstance, (LPCTSTR)IDB_CARET);
 
   wc.lpszClassName = "CaretTestClass";
   CaretBitmap = LoadBitmap(hInstance, (LPCTSTR)IDB_CARET);
 
   wc.lpszClassName = "CaretTestClass";
@@ -87,7 +87,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           break;
       }
       break;
           break;
       }
       break;
-    
+
     case WM_KEYDOWN:
       if(!GetCaretPos(&pt))
       {
     case WM_KEYDOWN:
       if(!GetCaretPos(&pt))
       {
@@ -112,7 +112,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
       if(!SetCaretPos(pt.x, pt.y))
         DbgPrint("SetCaretPos() failed!\n");
       break;
       if(!SetCaretPos(pt.x, pt.y))
         DbgPrint("SetCaretPos() failed!\n");
       break;
-    
+
     case WM_RBUTTONDOWN:
       if(!CreateCaret(hWnd, CaretBitmap, 0, 0))
         DbgPrint("CreateCaret() for window 0x%x failed!\n", hWnd);
     case WM_RBUTTONDOWN:
       if(!CreateCaret(hWnd, CaretBitmap, 0, 0))
         DbgPrint("CreateCaret() for window 0x%x failed!\n", hWnd);
@@ -120,7 +120,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
         if(!ShowCaret(hWnd))
           DbgPrint("ShowCaret(0x%x)\n", hWnd);
       break;
         if(!ShowCaret(hWnd))
           DbgPrint("ShowCaret(0x%x)\n", hWnd);
       break;
-    
+
     case WM_LBUTTONDOWN:
       if(!CreateCaret(hWnd, (HBITMAP)0, CaretWidth, CaretHeight))
         DbgPrint("CreateCaret() for window 0x%x failed!\n", hWnd);
     case WM_LBUTTONDOWN:
       if(!CreateCaret(hWnd, (HBITMAP)0, CaretWidth, CaretHeight))
         DbgPrint("CreateCaret() for window 0x%x failed!\n", hWnd);
@@ -128,7 +128,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
         if(!ShowCaret(hWnd))
           DbgPrint("ShowCaret(0x%x)\n", hWnd);
       break;
         if(!ShowCaret(hWnd))
           DbgPrint("ShowCaret(0x%x)\n", hWnd);
       break;
-    
+
     case WM_CREATE:
       if(!CreateCaret(hWnd, (HBITMAP)0, CaretWidth, CaretHeight))
         DbgPrint("CreateCaret() for window 0x%x failed!\n", hWnd);
     case WM_CREATE:
       if(!CreateCaret(hWnd, (HBITMAP)0, CaretWidth, CaretHeight))
         DbgPrint("CreateCaret() for window 0x%x failed!\n", hWnd);
@@ -136,13 +136,13 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
         if(!SetCaretPos(1, 1))
           DbgPrint("SetCaretPos(%i, %i) failed!\n", 1, 1);
       break;
         if(!SetCaretPos(1, 1))
           DbgPrint("SetCaretPos(%i, %i) failed!\n", 1, 1);
       break;
-    
+
     case WM_DESTROY:
       if(!DestroyCaret())
         DbgPrint("DestroyCaret() failed!\n");
       PostQuitMessage(0);
       break;
     case WM_DESTROY:
       if(!DestroyCaret())
         DbgPrint("DestroyCaret() failed!\n");
       PostQuitMessage(0);
       break;
-    
+
     default:
       return DefWindowProc(hWnd, msg, wParam, lParam);
        }
     default:
       return DefWindowProc(hWnd, msg, wParam, lParam);
        }
index f99fc87..27f1cc7 100644 (file)
@@ -257,7 +257,7 @@ Styles[] = {
        {"WS_VSCROLL",WS_VSCROLL}
     };
 
        {"WS_VSCROLL",WS_VSCROLL}
     };
 
-/* The number of check buttons we have. 
+/* The number of check buttons we have.
 * Maybe some calculations at compile time would be better
 */
 
 * Maybe some calculations at compile time would be better
 */
 
@@ -284,7 +284,7 @@ CreateCheckButton(const char* lpWindowName, DWORD xSize, DWORD id)
         g_hwnd,
         (HMENU) id,
         g_hInst,
         g_hwnd,
         (HMENU) id,
         g_hInst,
-        NULL    
+        NULL
         );
     yButPos += 21;
     return h;
         );
     yButPos += 21;
     return h;
@@ -367,7 +367,7 @@ ShowWindow(NextBut,SW_HIDE);
 LRESULT
 CALLBACK
 WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
 LRESULT
 CALLBACK
 WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
-    {   
+    {
     int i;
     switch ( msg )
         {
     int i;
     switch ( msg )
         {
index f1eff54..563191e 100644 (file)
@@ -11,7 +11,7 @@ VOID  htoa (unsigned int val, char *buf)
 {
    int i;
    buf += 7;
 {
    int i;
    buf += 7;
-   
+
    for (i=0;i<8;i++)
        {
             *buf-- = hexvals[val & 0x0000000F];
    for (i=0;i<8;i++)
        {
             *buf-- = hexvals[val & 0x0000000F];
index 81a52ca..5ff2203 100644 (file)
@@ -7,10 +7,10 @@
 ULONG x[SIZE / 4096];
 
 int main()
 ULONG x[SIZE / 4096];
 
 int main()
-{  
+{
    int i;
    PUCHAR BaseAddress;
    int i;
    PUCHAR BaseAddress;
-   
+
    BaseAddress = VirtualAlloc(NULL,
                              SIZE,
                              MEM_COMMIT,
    BaseAddress = VirtualAlloc(NULL,
                              SIZE,
                              MEM_COMMIT,
@@ -26,6 +26,6 @@ int main()
        printf("%.8x  ", i*4096);
        x[i] = BaseAddress[i*4096];
      }
        printf("%.8x  ", i*4096);
        x[i] = BaseAddress[i*4096];
      }
-   
+
    return(0);
 }
    return(0);
 }
index f938368..de7df85 100644 (file)
@@ -45,15 +45,15 @@ CreateTestFile(LPCTSTR filename, DWORD attributes)
        DWORD wrote;
        int c;
 
        DWORD wrote;
        int c;
 
-       DeleteTestFile(filename);   
-       file = CreateFile(filename, 
-                         GENERIC_READ | GENERIC_WRITE, 
-                         0, 
-                         NULL, 
-                         CREATE_ALWAYS, 
-                         0, 
+       DeleteTestFile(filename);
+       file = CreateFile(filename,
+                         GENERIC_READ | GENERIC_WRITE,
+                         0,
+                         NULL,
+                         CREATE_ALWAYS,
+                         0,
                          0);
                          0);
-   
+
        if (INVALID_HANDLE_VALUE == file) {
                fprintf(stderr, "CreateFile failed with code %lu\n", GetLastError());
                exit(1);
        if (INVALID_HANDLE_VALUE == file) {
                fprintf(stderr, "CreateFile failed with code %lu\n", GetLastError());
                exit(1);
@@ -126,7 +126,7 @@ CheckTestFile(LPCTSTR filename, DWORD attributes)
        }
 
        CloseHandle(file);
        }
 
        CloseHandle(file);
-       
+
        diskattr = GetFileAttributes(filename);
        if (INVALID_FILE_ATTRIBUTES == diskattr) {
                fprintf(stderr, "GetFileAttributes failed with code %lu\n", GetLastError());
        diskattr = GetFileAttributes(filename);
        if (INVALID_FILE_ATTRIBUTES == diskattr) {
                fprintf(stderr, "GetFileAttributes failed with code %lu\n", GetLastError());
index 5d3ebb2..f129569 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: count.c,v 1.1 2004/10/21 05:12:00 sedwards Exp $
+/* $Id$
  *
  */
 #include <stdio.h>
  *
  */
 #include <stdio.h>
index 27ce809..3db6168 100644 (file)
@@ -26,7 +26,7 @@ static RGBQUAD Colors[] =
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
index fdcb074..932a098 100644 (file)
@@ -7,7 +7,7 @@
 static char selected[MAX_PATH + 1];
 
 INT_PTR
 static char selected[MAX_PATH + 1];
 
 INT_PTR
-CALLBACK 
+CALLBACK
 DlgMainProc(
   HWND hwndDlg,
   UINT uMsg,
 DlgMainProc(
   HWND hwndDlg,
   UINT uMsg,
@@ -16,7 +16,7 @@ DlgMainProc(
 )
 {
   char dir[MAX_PATH + 1];
 )
 {
   char dir[MAX_PATH + 1];
-  
+
   switch(uMsg)
   {
     case WM_COMMAND:
   switch(uMsg)
   {
     case WM_COMMAND:
@@ -52,7 +52,7 @@ DlgMainProc(
             {
               char file[MAX_PATH + 1];
               int len;
             {
               char file[MAX_PATH + 1];
               int len;
-              
+
               if(!DlgDirSelectEx(hwndDlg, file, MAX_PATH, IDC_DIRS))
               {
                 GetCurrentDirectory(MAX_PATH, selected);
               if(!DlgDirSelectEx(hwndDlg, file, MAX_PATH, IDC_DIRS))
               {
                 GetCurrentDirectory(MAX_PATH, selected);
@@ -97,7 +97,7 @@ DlgMainProc(
   return FALSE;
 }
 
   return FALSE;
 }
 
-int WINAPI 
+int WINAPI
 WinMain(
   HINSTANCE hInstance,
   HINSTANCE hPrevInstance,
 WinMain(
   HINSTANCE hInstance,
   HINSTANCE hPrevInstance,
index fa089b9..c007de6 100644 (file)
@@ -5,7 +5,7 @@
  * PROJECT:         ReactOS diskspeed.exe
  * FILE:            apps/tests/diskspeed/diskspeed.c
  * PURPOSE:         Determines disk transfer rates
  * PROJECT:         ReactOS diskspeed.exe
  * FILE:            apps/tests/diskspeed/diskspeed.c
  * PURPOSE:         Determines disk transfer rates
- * PROGRAMMER:      Hartmut Birr 
+ * PROGRAMMER:      Hartmut Birr
  */
 
 #include <windows.h>
  */
 
 #include <windows.h>
@@ -93,7 +93,7 @@ int main(void)
     INQUIRYDATA InquiryData;
 
 
     INQUIRYDATA InquiryData;
 
 
-    Drive = 0; 
+    Drive = 0;
     while (1)
       {
         sprintf(Name, "\\\\.\\PHYSICALDRIVE%ld", Drive);
     while (1)
       {
         sprintf(Name, "\\\\.\\PHYSICALDRIVE%ld", Drive);
@@ -121,7 +121,7 @@ int main(void)
             printf("Transfer Size (kB)           1     2     4     8    16    32    64   128   256\n");
             printf("Transfer Rate (MB/s)\n");
             printf("-------------------------------------------------------------------------------\n");
             printf("Transfer Size (kB)           1     2     4     8    16    32    64   128   256\n");
             printf("Transfer Rate (MB/s)\n");
             printf("-------------------------------------------------------------------------------\n");
-            
+
            Buffer = VirtualAlloc(NULL, 512 * 1024, MEM_COMMIT, PAGE_READWRITE);
          }
         Result = GetInquiryData(hDevice, &InquiryData);
            Buffer = VirtualAlloc(NULL, 512 * 1024, MEM_COMMIT, PAGE_READWRITE);
          }
         Result = GetInquiryData(hDevice, &InquiryData);
index b85a1f2..8876445 100644 (file)
@@ -19,7 +19,7 @@ int main( int argc, char **argv ) {
   while( AddrResponse ) {
     if( AddrResponse->wType == DNS_TYPE_A ) {
       Addr = ntohl( AddrResponse->Data.A.IpAddress );
   while( AddrResponse ) {
     if( AddrResponse->wType == DNS_TYPE_A ) {
       Addr = ntohl( AddrResponse->Data.A.IpAddress );
-      printf( "www.reactos.com == %d.%d.%d.%d\n", 
+      printf( "www.reactos.com == %d.%d.%d.%d\n",
              (int)(Addr >> 24) & 0xff,
              (int)(Addr >> 16) & 0xff,
              (int)(Addr >> 8) & 0xff,
              (int)(Addr >> 24) & 0xff,
              (int)(Addr >> 16) & 0xff,
              (int)(Addr >> 8) & 0xff,
index 4578020..cbba437 100644 (file)
@@ -14,7 +14,7 @@ int main( int argc, char **argv ) {
   while( AddrResponse ) {
     if( AddrResponse->wType == DNS_TYPE_A ) {
       Addr = ntohl( AddrResponse->Data.A.IpAddress );
   while( AddrResponse ) {
     if( AddrResponse->wType == DNS_TYPE_A ) {
       Addr = ntohl( AddrResponse->Data.A.IpAddress );
-      printf( "www.reactos.com == %d.%d.%d.%d\n", 
+      printf( "www.reactos.com == %d.%d.%d.%d\n",
              (int)(Addr >> 24) & 0xff,
              (int)(Addr >> 16) & 0xff,
              (int)(Addr >> 8) & 0xff,
              (int)(Addr >> 24) & 0xff,
              (int)(Addr >> 16) & 0xff,
              (int)(Addr >> 8) & 0xff,
index 6ae2aeb..c2f49bc 100644 (file)
@@ -5,7 +5,7 @@ int main()
 {
   int i;
 
 {
   int i;
 
-  printf("TickCountLow: %lx\n", 
+  printf("TickCountLow: %lx\n",
         SharedUserData->TickCountLow);
   printf("Drives: ");
   for (i = 0; i < 26; i++)
         SharedUserData->TickCountLow);
   printf("Drives: ");
   for (i = 0; i < 26; i++)
index 7234646..35ab9b5 100644 (file)
@@ -25,7 +25,7 @@
 #define BUFFERLEN 80 /* Size of buffer to hold result strings */
 
 /* Edit is created with this text */
 #define BUFFERLEN 80 /* Size of buffer to hold result strings */
 
 /* Edit is created with this text */
-#define TestStr "The quick brown fox jumps over the lazy dog" 
+#define TestStr "The quick brown fox jumps over the lazy dog"
 
 #define TestStrW L"This is a WCHAR string" /*  Wide to support unicode edits */
 
 
 #define TestStrW L"This is a WCHAR string" /*  Wide to support unicode edits */
 
@@ -68,7 +68,7 @@ PrintTextXY(char* Text,int x,int y,int len)
       HDC hdc;
       hdc = GetDC (g_hwnd);
       SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT));
       HDC hdc;
       hdc = GetDC (g_hwnd);
       SelectObject (hdc, GetStockObject (SYSTEM_FIXED_FONT));
-      
+
       TextOut (hdc, x,y,Text,len);
       ReleaseDC (g_hwnd, hdc);
       ValidateRect (g_hwnd, &rect);
       TextOut (hdc, x,y,Text,len);
       ReleaseDC (g_hwnd, hdc);
       ValidateRect (g_hwnd, &rect);
@@ -148,7 +148,7 @@ static
 VOID
 HandlePrintPasswdChar(HWND handle,DWORD Msg,WPARAM wParam,LPARAM lParam)
     {
 VOID
 HandlePrintPasswdChar(HWND handle,DWORD Msg,WPARAM wParam,LPARAM lParam)
     {
-      HDC hdc; 
+      HDC hdc;
       int ret = SendMessage(handle,Msg,wParam,lParam);
 
       int s;
       int ret = SendMessage(handle,Msg,wParam,lParam);
 
       int s;
@@ -200,11 +200,11 @@ Msg[] =
 
        {"EM_GETMODIFY",EM_GETMODIFY,0,0,&HandlePrintReturnHex},
        {"EM_SETMODIFY",EM_SETMODIFY,TRUE,0,&HandlePrintReturnHex},
 
        {"EM_GETMODIFY",EM_GETMODIFY,0,0,&HandlePrintReturnHex},
        {"EM_SETMODIFY",EM_SETMODIFY,TRUE,0,&HandlePrintReturnHex},
-     
+
        {"EM_GETSEL",EM_GETSEL,(WPARAM)&StartP,(LPARAM)&EndP,&HandlePrintReturnHex},
 
        {"EM_GETTHUMB",EM_GETTHUMB,0,0,&HandlePrintReturnHex},
        {"EM_GETSEL",EM_GETSEL,(WPARAM)&StartP,(LPARAM)&EndP,&HandlePrintReturnHex},
 
        {"EM_GETTHUMB",EM_GETTHUMB,0,0,&HandlePrintReturnHex},
-     
+
        {"EM_LIMITTEXT",EM_LIMITTEXT,10,0,&HandlePrintReturnHex},
        {"EM_LINEFROMCHAR",EM_LINEFROMCHAR,-1,0,&HandlePrintReturnHex},
        {"EM_POSFROMCHAR",EM_POSFROMCHAR,10,0,&HandlePrintReturnHex},
        {"EM_LIMITTEXT",EM_LIMITTEXT,10,0,&HandlePrintReturnHex},
        {"EM_LINEFROMCHAR",EM_LINEFROMCHAR,-1,0,&HandlePrintReturnHex},
        {"EM_POSFROMCHAR",EM_POSFROMCHAR,10,0,&HandlePrintReturnHex},
@@ -240,7 +240,7 @@ Msg[] =
 
        {"WM_CUT",WM_CUT,0,0,&HandlePrintReturnHex},
        {"WM_COPY",WM_COPY,0,0,&HandlePrintReturnHex}
 
        {"WM_CUT",WM_CUT,0,0,&HandlePrintReturnHex},
        {"WM_COPY",WM_COPY,0,0,&HandlePrintReturnHex}
-     
+
 };
 
 DWORD EditStyles[] = {
 };
 
 DWORD EditStyles[] = {
@@ -279,7 +279,7 @@ CreateCheckButton(const char* lpWindowName, DWORD xSize, DWORD id)
                          g_hwnd,
                          (HMENU) id,
                          g_hInst,
                          g_hwnd,
                          (HMENU) id,
                          g_hInst,
-                         NULL    
+                         NULL
                          );
        yButPos += 21;
        return h;
                          );
        yButPos += 21;
        return h;
@@ -362,7 +362,7 @@ BackToInitialPage()
 LRESULT
 CALLBACK
 WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
 LRESULT
 CALLBACK
 WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
-{   
+{
     int i;
        switch ( msg )
        {
     int i;
        switch ( msg )
        {
@@ -389,7 +389,7 @@ WndProc ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam )
         Buttons[i++] = CreatePushButton("CreateWindowA",140,CREATEWINDOW,WS_VISIBLE);
         Buttons[i++] = CreatePushButton("CreateWindowExA",140,CREATEWINDOWEX,WS_VISIBLE);
         Buttons[i++] = CreatePushButton("CreateWindowExW",140,CREATEWINDOWW,WS_VISIBLE);
         Buttons[i++] = CreatePushButton("CreateWindowA",140,CREATEWINDOW,WS_VISIBLE);
         Buttons[i++] = CreatePushButton("CreateWindowExA",140,CREATEWINDOWEX,WS_VISIBLE);
         Buttons[i++] = CreatePushButton("CreateWindowExW",140,CREATEWINDOWW,WS_VISIBLE);
-        
+
 
         /* ---- The 1st page of buttons ---- */
 
 
         /* ---- The 1st page of buttons ---- */
 
@@ -591,7 +591,7 @@ RegisterAndCreateWindow (HINSTANCE hInst,
        wc.lpfnWndProc = WndProc;   /* window procedure */
        wc.hInstance = hInst;       /* owner of the class */
 
        wc.lpfnWndProc = WndProc;   /* window procedure */
        wc.hInstance = hInst;       /* owner of the class */
 
-       wc.lpszClassName = className; 
+       wc.lpszClassName = className;
        wc.hCursor = LoadCursor ( 0, (LPCTSTR)IDC_ARROW );
        wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
        wc.style = CS_HREDRAW | CS_VREDRAW;
        wc.hCursor = LoadCursor ( 0, (LPCTSTR)IDC_ARROW );
        wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
        wc.style = CS_HREDRAW | CS_VREDRAW;
index f1eff54..563191e 100644 (file)
@@ -11,7 +11,7 @@ VOID  htoa (unsigned int val, char *buf)
 {
    int i;
    buf += 7;
 {
    int i;
    buf += 7;
-   
+
    for (i=0;i<8;i++)
        {
             *buf-- = hexvals[val & 0x0000000F];
    for (i=0;i<8;i++)
        {
             *buf-- = hexvals[val & 0x0000000F];
index cd90e6e..ff41e56 100644 (file)
@@ -7,7 +7,7 @@ HENHMETAFILE EnhMetafile;
 SIZE EnhMetafileSize;
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 SIZE EnhMetafileSize;
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -17,11 +17,11 @@ WinMain(HINSTANCE hInstance,
   MSG msg;
   HWND hWnd;
   ENHMETAHEADER emh;
   MSG msg;
   HWND hWnd;
   ENHMETAHEADER emh;
-  
+
   EnhMetafile = GetEnhMetaFile("test.emf");
   if(!EnhMetafile)
   {
   EnhMetafile = GetEnhMetaFile("test.emf");
   if(!EnhMetafile)
   {
-    fprintf(stderr, "GetEnhMetaFile failed (last error 0x%lX)\n", 
+    fprintf(stderr, "GetEnhMetaFile failed (last error 0x%lX)\n",
         GetLastError());
     return(1);
   }
         GetLastError());
     return(1);
   }
@@ -69,7 +69,7 @@ WinMain(HINSTANCE hInstance,
        //tf = CreateFontA(14, 0, 0, TA_BASELINE, FW_NORMAL, FALSE, FALSE, FALSE,
        //      ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
        //      DEFAULT_QUALITY, FIXED_PITCH|FF_DONTCARE, "Timmons");
        //tf = CreateFontA(14, 0, 0, TA_BASELINE, FW_NORMAL, FALSE, FALSE, FALSE,
        //      ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
        //      DEFAULT_QUALITY, FIXED_PITCH|FF_DONTCARE, "Timmons");
-  
+
   ShowWindow(hWnd, nCmdShow);
 
   while(GetMessage(&msg, NULL, 0, 0))
   ShowWindow(hWnd, nCmdShow);
 
   while(GetMessage(&msg, NULL, 0, 0))
@@ -77,7 +77,7 @@ WinMain(HINSTANCE hInstance,
     TranslateMessage(&msg);
     DispatchMessage(&msg);
   }
     TranslateMessage(&msg);
     DispatchMessage(&msg);
   }
-  
+
   DeleteEnhMetaFile(EnhMetafile);
 
   //DeleteObject(tf);
   DeleteEnhMetaFile(EnhMetafile);
 
   //DeleteObject(tf);
@@ -97,7 +97,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          RECT rc;
       HDC hDC;
       int bk;
          RECT rc;
       HDC hDC;
       int bk;
-      
+
          GetClientRect(hWnd, &rc);
          hDC = BeginPaint(hWnd, &ps);
          rc.left = (rc.right / 2) - (EnhMetafileSize.cx / 2);
          GetClientRect(hWnd, &rc);
          hDC = BeginPaint(hWnd, &ps);
          rc.left = (rc.right / 2) - (EnhMetafileSize.cx / 2);
index c5b60ef..f1d1acc 100644 (file)
@@ -17,7 +17,7 @@ const TCHAR* CLASS_NAME = "EnumWndTestClass";
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
index 2c0aefc..9aee0ec 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fiber.c,v 1.1 2004/10/21 05:12:02 sedwards Exp $
+/* $Id$
 */
 
 #include <assert.h>
 */
 
 #include <assert.h>
@@ -239,7 +239,7 @@ void Fbt_Dispatch(struct FiberData * pfdCur, int bExit)
      ++ k;
      continue;
     }
      ++ k;
      continue;
     }
+
     ple = (PLIST_ENTRY)a_leQueues[nQueue].Flink;
    }
    else
     ple = (PLIST_ENTRY)a_leQueues[nQueue].Flink;
    }
    else
index 1f9479f..9a42c4d 100644 (file)
@@ -1,21 +1,21 @@
-#include <stdio.h>\r
-#include <winsock2.h>\r
-\r
-int main( int argc, char **argv ) {\r
-  WSADATA wdata;\r
-\r
-  WSAStartup( 0x0101, &wdata );\r
-\r
-  if( argc > 1 ) {\r
-    struct hostent *he = gethostbyname( argv[1] );\r
-    if( !he ) {\r
-      printf( "lookup of host %s failed: %d\n", argv[1], WSAGetLastError() );\r
-      return 1;\r
-    } else {\r
-      printf( "Lookup of host %s returned %s\n", \r
-             argv[1], inet_ntoa(*((struct in_addr *)he->h_addr_list[0])) );\r
-      return 0;\r
-    }\r
-  } else\r
-    return 1;\r
-}\r
+#include <stdio.h>
+#include <winsock2.h>
+
+int main( int argc, char **argv ) {
+  WSADATA wdata;
+
+  WSAStartup( 0x0101, &wdata );
+
+  if( argc > 1 ) {
+    struct hostent *he = gethostbyname( argv[1] );
+    if( !he ) {
+      printf( "lookup of host %s failed: %d\n", argv[1], WSAGetLastError() );
+      return 1;
+    } else {
+      printf( "Lookup of host %s returned %s\n",
+             argv[1], inet_ntoa(*((struct in_addr *)he->h_addr_list[0])) );
+      return 0;
+    }
+  } else
+    return 1;
+}
index b9cb714..9d5ba22 100644 (file)
@@ -19,7 +19,7 @@
 
 /*
 ** This define controls the size of a memory allocation request.
 
 /*
 ** This define controls the size of a memory allocation request.
-** For this test suite to really be comprehensive, we should 
+** For this test suite to really be comprehensive, we should
 ** probably be testing many different block sizes.
 */
 #define MEM_BLOCK_SIZE 0x80000
 ** probably be testing many different block sizes.
 */
 #define MEM_BLOCK_SIZE 0x80000
@@ -38,7 +38,7 @@ typedef enum TestStatus
 
 /*---------------------------------------------------------------------------
 ** This is a relation used to combine two test statuses.
 
 /*---------------------------------------------------------------------------
 ** This is a relation used to combine two test statuses.
-** The combine rules are as follows: 
+** The combine rules are as follows:
 **                   FAIL & Anything == FAIL
 **                SKIPPED & Anything == Anything
 **
 **                   FAIL & Anything == FAIL
 **                SKIPPED & Anything == Anything
 **
@@ -53,7 +53,7 @@ TEST_STATUS TEST_CombineStatus(TEST_STATUS a, TEST_STATUS b)
     case FAILED:  result = FAILED; break;
     case SKIPPED: result = b; break;
     }
     case FAILED:  result = FAILED; break;
     case SKIPPED: result = b; break;
     }
-     
+
     return result;
 }
 
     return result;
 }
 
@@ -83,7 +83,7 @@ void OUTPUT_Line(const char *szLine)
 
     memset(output, 0, DISPLAY_COLUMNS + 2);
 
 
     memset(output, 0, DISPLAY_COLUMNS + 2);
 
-    /*If this line is longer than DISPLAY_COLUMNS, 
+    /*If this line is longer than DISPLAY_COLUMNS,
     * break it at the first space.
     */
     if (DISPLAY_COLUMNS - 2 < strlen(szLine))
     * break it at the first space.
     */
     if (DISPLAY_COLUMNS - 2 < strlen(szLine))
@@ -101,7 +101,7 @@ void OUTPUT_Line(const char *szLine)
         output[1] = ' ';
         output[strlen(output)] = '\n';
         printf(output);
         output[1] = ' ';
         output[strlen(output)] = '\n';
         printf(output);
-        
+
         OUTPUT_Line(szLine + spaceIndex + 1);
     }
     else
         OUTPUT_Line(szLine + spaceIndex + 1);
     }
     else
@@ -109,7 +109,7 @@ void OUTPUT_Line(const char *szLine)
         sprintf(output,"| %s\n", szLine);
         printf(output);
     }
         sprintf(output,"| %s\n", szLine);
         printf(output);
     }
-   
+
 }
 
 /*---------------------------------------------------------------------------
 }
 
 /*---------------------------------------------------------------------------
@@ -159,7 +159,7 @@ void OutputAllocFlags(UINT pFlags)
     {
         OUTPUT_Line("Fixed Memory");
     }
     {
         OUTPUT_Line("Fixed Memory");
     }
-    
+
     if (pFlags & GMEM_ZEROINIT)
     {
         OUTPUT_Line("Zero Initialized Memory");
     if (pFlags & GMEM_ZEROINIT)
     {
         OUTPUT_Line("Zero Initialized Memory");
@@ -183,12 +183,12 @@ void OutputErrorCode()
 TEST_STATUS TEST_MemoryWrite(LPVOID mem, DWORD cbSize)
 {
     TEST_STATUS result = FAILED;
 TEST_STATUS TEST_MemoryWrite(LPVOID mem, DWORD cbSize)
 {
     TEST_STATUS result = FAILED;
-    
+
     if (0 == IsBadWritePtr(mem, cbSize))
     {
         result = PASSED;
     }
     if (0 == IsBadWritePtr(mem, cbSize))
     {
         result = PASSED;
     }
-    return result;    
+    return result;
 }
 
 /*---------------------------------------------------------------------------
 }
 
 /*---------------------------------------------------------------------------
@@ -197,12 +197,12 @@ TEST_STATUS TEST_MemoryWrite(LPVOID mem, DWORD cbSize)
 TEST_STATUS TEST_MemoryRead(LPVOID mem, DWORD cbSize)
 {
     TEST_STATUS result = FAILED;
 TEST_STATUS TEST_MemoryRead(LPVOID mem, DWORD cbSize)
 {
     TEST_STATUS result = FAILED;
-    
+
     if (0 == IsBadReadPtr(mem, cbSize))
     {
         result = PASSED;
     }
     if (0 == IsBadReadPtr(mem, cbSize))
     {
         result = PASSED;
     }
-    return result;    
+    return result;
 }
 
 /*---------------------------------------------------------------------------
 }
 
 /*---------------------------------------------------------------------------
@@ -221,7 +221,7 @@ int IsMovable(HGLOBAL hMem)
         rc = 1;
     }
     GlobalUnlock(hMem);
         rc = 1;
     }
     GlobalUnlock(hMem);
-    
+
     return rc;
 }
 
     return rc;
 }
 
@@ -233,7 +233,7 @@ TEST_STATUS TestGlobalAllocNFree(UINT allocFlags)
     TEST_STATUS status = SKIPPED;
     HGLOBAL hTest = 0;
     OUTPUT_Banner("Testing the GlobalAlloc and GlobalFree calls");
     TEST_STATUS status = SKIPPED;
     HGLOBAL hTest = 0;
     OUTPUT_Banner("Testing the GlobalAlloc and GlobalFree calls");
-    OUTPUT_Line("Allocate a buffer"); 
+    OUTPUT_Line("Allocate a buffer");
 
     OutputAllocFlags(allocFlags);
 
 
     OutputAllocFlags(allocFlags);
 
@@ -263,7 +263,7 @@ TEST_STATUS TestGlobalLockNUnlock(UINT allocFlags)
     LPVOID      pMem      = 0;
     TEST_STATUS subtest   = SKIPPED;
     TEST_STATUS result    = FAILED;
     LPVOID      pMem      = 0;
     TEST_STATUS subtest   = SKIPPED;
     TEST_STATUS result    = FAILED;
-    
+
     OUTPUT_Banner("Testing the GlobalLock/Unlock functions.");
     OutputAllocFlags(allocFlags);
     OUTPUT_Line("");
     OUTPUT_Banner("Testing the GlobalLock/Unlock functions.");
     OutputAllocFlags(allocFlags);
     OUTPUT_Line("");
@@ -272,24 +272,24 @@ TEST_STATUS TestGlobalLockNUnlock(UINT allocFlags)
     if (0 != hMem)
     {
         OUTPUT_Line("Allocated a memory block");
     if (0 != hMem)
     {
         OUTPUT_Line("Allocated a memory block");
-        
+
         OUTPUT_Line("Testing Lock");
         pMem = GlobalLock(hMem);
         if (0 != pMem)
         {
             OUTPUT_Result(PASSED);
         OUTPUT_Line("Testing Lock");
         pMem = GlobalLock(hMem);
         if (0 != pMem)
         {
             OUTPUT_Result(PASSED);
-            
+
             OUTPUT_Line("Testing memory for read.");
             subtest = TEST_MemoryRead(pMem, MEM_BLOCK_SIZE);
             OUTPUT_Result(subtest);
             result = TEST_CombineStatus(PASSED, subtest);
             OUTPUT_Line("Testing memory for read.");
             subtest = TEST_MemoryRead(pMem, MEM_BLOCK_SIZE);
             OUTPUT_Result(subtest);
             result = TEST_CombineStatus(PASSED, subtest);
-            
+
 
             OUTPUT_Line("Testing memory for write.");
             subtest = TEST_MemoryRead(pMem, MEM_BLOCK_SIZE);
             OUTPUT_Result(subtest);
             result = TEST_CombineStatus(result, subtest);
 
             OUTPUT_Line("Testing memory for write.");
             subtest = TEST_MemoryRead(pMem, MEM_BLOCK_SIZE);
             OUTPUT_Result(subtest);
             result = TEST_CombineStatus(result, subtest);
-            
+
 
             OUTPUT_Line("Unlocking memory");
             if (GlobalUnlock(hMem))
 
             OUTPUT_Line("Unlocking memory");
             if (GlobalUnlock(hMem))
@@ -339,7 +339,7 @@ TEST_STATUS TestGlobalReAllocFixed()
     LPVOID      pMem       = 0;
     TEST_STATUS subtest    = SKIPPED;
     TEST_STATUS result     = SKIPPED;
     LPVOID      pMem       = 0;
     TEST_STATUS subtest    = SKIPPED;
     TEST_STATUS result     = SKIPPED;
-    
+
     OUTPUT_Line("Testing GlobalReAlloc() on memory allocated as GMEM_FIXED");
 
     /* Case 1: convert a fixed block to a movable block. */
     OUTPUT_Line("Testing GlobalReAlloc() on memory allocated as GMEM_FIXED");
 
     /* Case 1: convert a fixed block to a movable block. */
@@ -417,9 +417,9 @@ TEST_STATUS TestGlobalReAllocFixed()
             OUTPUT_HexDword((DWORD)hReAlloced);
             if (hMem == hReAlloced)
             {
             OUTPUT_HexDword((DWORD)hReAlloced);
             if (hMem == hReAlloced)
             {
-                OUTPUT_Line("GlobalReAlloc returned the same pointer.  The documentation states that this is wrong, but Windows NT works this way.");    
+                OUTPUT_Line("GlobalReAlloc returned the same pointer.  The documentation states that this is wrong, but Windows NT works this way.");
             }
             }
-            
+
             hMem = hReAlloced;
             subtest = TEST_CombineStatus(subtest, PASSED);
             subtest = TEST_CombineStatus(subtest, TEST_MemoryRead((LPVOID)hMem, MEM_BLOCK_SIZE - 100));
             hMem = hReAlloced;
             subtest = TEST_CombineStatus(subtest, PASSED);
             subtest = TEST_CombineStatus(subtest, TEST_MemoryRead((LPVOID)hMem, MEM_BLOCK_SIZE - 100));
@@ -497,9 +497,9 @@ TEST_STATUS TestGlobalReAllocMovable()
     LPVOID      pMem       = 0;
     TEST_STATUS subtest    = SKIPPED;
     TEST_STATUS result     = SKIPPED;
     LPVOID      pMem       = 0;
     TEST_STATUS subtest    = SKIPPED;
     TEST_STATUS result     = SKIPPED;
-    
+
     OUTPUT_Line("Testing GlobalReAlloc() on memory allocated as GMGM_MOVEABLE");
     OUTPUT_Line("Testing GlobalReAlloc() on memory allocated as GMGM_MOVEABLE");
-    
+
     /* case 1 test reallocing a movable block that is unlocked. */
     OUTPUT_Line("Allocating buffer");
     hMem = GlobalAlloc(GMEM_MOVEABLE, MEM_BLOCK_SIZE);
     /* case 1 test reallocing a movable block that is unlocked. */
     OUTPUT_Line("Allocating buffer");
     hMem = GlobalAlloc(GMEM_MOVEABLE, MEM_BLOCK_SIZE);
@@ -519,7 +519,7 @@ TEST_STATUS TestGlobalReAllocMovable()
             OUTPUT_HexDword((DWORD)hMem);
             OUTPUT_Line("ReAlloced Handle: ");
             OUTPUT_HexDword((DWORD)hReAlloced);
             OUTPUT_HexDword((DWORD)hMem);
             OUTPUT_Line("ReAlloced Handle: ");
             OUTPUT_HexDword((DWORD)hReAlloced);
-            
+
             pMem = GlobalLock(hReAlloced);
             hMem = hReAlloced;
             subtest = TEST_CombineStatus(subtest, PASSED);
             pMem = GlobalLock(hReAlloced);
             hMem = hReAlloced;
             subtest = TEST_CombineStatus(subtest, PASSED);
@@ -575,7 +575,7 @@ TEST_STATUS TestGlobalReAllocMovable()
         }
 
         GlobalUnlock(hMem);
         }
 
         GlobalUnlock(hMem);
-        
+
         GlobalFree(hMem);
     }
     else
         GlobalFree(hMem);
     }
     else
@@ -587,7 +587,7 @@ TEST_STATUS TestGlobalReAllocMovable()
     OUTPUT_Line("");
 
     result = TEST_CombineStatus(result, subtest);
     OUTPUT_Line("");
 
     result = TEST_CombineStatus(result, subtest);
-    
+
     OUTPUT_Line("");
     return result;
 }
     OUTPUT_Line("");
     return result;
 }
@@ -602,7 +602,7 @@ TEST_STATUS TestGlobalReAlloc()
 
     result = TEST_CombineStatus(result, TestGlobalReAllocFixed());
     result = TEST_CombineStatus(result, TestGlobalReAllocMovable());
 
     result = TEST_CombineStatus(result, TestGlobalReAllocFixed());
     result = TEST_CombineStatus(result, TestGlobalReAllocMovable());
-    
+
     OUTPUT_Line("GlobalReAlloc test result:");
     OUTPUT_Result(result);
     return result;
     OUTPUT_Line("GlobalReAlloc test result:");
     OUTPUT_Result(result);
     return result;
@@ -636,10 +636,10 @@ TEST_STATUS TestGlobalFlagsMoveable()
             result = TEST_CombineStatus(result, FAILED);
         }
         OUTPUT_Result(result);
             result = TEST_CombineStatus(result, FAILED);
         }
         OUTPUT_Result(result);
-        
+
         OUTPUT_Line("Pointer from handle: ");
         OUTPUT_HexDword((DWORD)GlobalLock(hMem));
         OUTPUT_Line("Pointer from handle: ");
         OUTPUT_HexDword((DWORD)GlobalLock(hMem));
-        
+
         OUTPUT_Line("Testing after a lock");
         OUTPUT_Line("Testing for a lock of 1");
         uFlags = GlobalFlags(hMem);
         OUTPUT_Line("Testing after a lock");
         OUTPUT_Line("Testing for a lock of 1");
         uFlags = GlobalFlags(hMem);
@@ -683,7 +683,7 @@ TEST_STATUS TestGlobalFlagsMoveable()
         OUTPUT_Line("Testing for a discarded flag");
         uFlags = GlobalFlags(hMem);
         if (0 != (uFlags & GMEM_DISCARDED)) /*discarded*/
         OUTPUT_Line("Testing for a discarded flag");
         uFlags = GlobalFlags(hMem);
         if (0 != (uFlags & GMEM_DISCARDED)) /*discarded*/
-        {   
+        {
             result = TEST_CombineStatus(result, PASSED);
         }
         else
             result = TEST_CombineStatus(result, PASSED);
         }
         else
@@ -759,7 +759,7 @@ TEST_STATUS TestGlobalFlagsFixed()
         OUTPUT_Line("GlobalAlloc failed!");
         result = TEST_CombineStatus(result, FAILED);
     }
         OUTPUT_Line("GlobalAlloc failed!");
         result = TEST_CombineStatus(result, FAILED);
     }
-    
+
     return result;
 }
 /*---------------------------------------------------------------------------
     return result;
 }
 /*---------------------------------------------------------------------------
@@ -769,10 +769,10 @@ TEST_STATUS TestGlobalFlags()
 {
     OUTPUT_Banner("Testing GlobalFlags()");
     TEST_STATUS result = SKIPPED;
 {
     OUTPUT_Banner("Testing GlobalFlags()");
     TEST_STATUS result = SKIPPED;
-    
-    result = TEST_CombineStatus(result, TestGlobalFlagsFixed()); 
-    result = TEST_CombineStatus(result, TestGlobalFlagsMoveable()); 
-    
+
+    result = TEST_CombineStatus(result, TestGlobalFlagsFixed());
+    result = TEST_CombineStatus(result, TestGlobalFlagsMoveable());
+
     OUTPUT_Line("GlobalFlags result:");
     OUTPUT_Result(result);
     return result;
     OUTPUT_Line("GlobalFlags result:");
     OUTPUT_Result(result);
     return result;
@@ -789,7 +789,7 @@ TEST_STATUS TestGlobalHandle()
     TEST_STATUS result  = SKIPPED;
 
     OUTPUT_Banner("Testing GlobalHandle()");
     TEST_STATUS result  = SKIPPED;
 
     OUTPUT_Banner("Testing GlobalHandle()");
-    
+
     OUTPUT_Line("Testing GlobalHandle with a block of GMEM_FIXED memory");
     hMem = GlobalAlloc(GMEM_FIXED, MEM_BLOCK_SIZE);
     if (0 != hMem)
     OUTPUT_Line("Testing GlobalHandle with a block of GMEM_FIXED memory");
     hMem = GlobalAlloc(GMEM_FIXED, MEM_BLOCK_SIZE);
     if (0 != hMem)
@@ -797,7 +797,7 @@ TEST_STATUS TestGlobalHandle()
 
         OUTPUT_Line("Allocation handle: ");
         OUTPUT_HexDword((DWORD)hMem);
 
         OUTPUT_Line("Allocation handle: ");
         OUTPUT_HexDword((DWORD)hMem);
-        
+
         hTest = GlobalHandle(hMem);
         if (hMem == hTest)
         {
         hTest = GlobalHandle(hMem);
         if (hMem == hTest)
         {
@@ -856,7 +856,7 @@ TEST_STATUS TestGlobalHandle()
     OUTPUT_Line("Result from subtest:");
     OUTPUT_Result(subtest);
     result = TEST_CombineStatus(result, subtest);
     OUTPUT_Line("Result from subtest:");
     OUTPUT_Result(subtest);
     result = TEST_CombineStatus(result, subtest);
-    
+
 
     OUTPUT_Line("Global Handle test results:");
     OUTPUT_Result(result);
 
     OUTPUT_Line("Global Handle test results:");
     OUTPUT_Result(result);
@@ -873,7 +873,7 @@ TEST_STATUS TestGlobalSize()
     TEST_STATUS subtest = SKIPPED;
     TEST_STATUS result  = SKIPPED;
     OUTPUT_Banner("Testing GlobalSize()");
     TEST_STATUS subtest = SKIPPED;
     TEST_STATUS result  = SKIPPED;
     OUTPUT_Banner("Testing GlobalSize()");
-    
+
     OUTPUT_Line("Testing GlobalSize with a block of GMEM_FIXED memory");
     hMem = GlobalAlloc(GMEM_FIXED, MEM_BLOCK_SIZE);
     if (0 != hMem)
     OUTPUT_Line("Testing GlobalSize with a block of GMEM_FIXED memory");
     hMem = GlobalAlloc(GMEM_FIXED, MEM_BLOCK_SIZE);
     if (0 != hMem)
@@ -905,7 +905,7 @@ TEST_STATUS TestGlobalSize()
     OUTPUT_Line("Testing GlobalSize with a block of GMEM_MOVEABLE memory");
     hMem = GlobalAlloc(GMEM_MOVEABLE, MEM_BLOCK_SIZE);
     if (0 != hMem)
     OUTPUT_Line("Testing GlobalSize with a block of GMEM_MOVEABLE memory");
     hMem = GlobalAlloc(GMEM_MOVEABLE, MEM_BLOCK_SIZE);
     if (0 != hMem)
-    {   
+    {
         size = GlobalSize(hMem);
         if (MEM_BLOCK_SIZE <= size)
         {
         size = GlobalSize(hMem);
         if (MEM_BLOCK_SIZE <= size)
         {
@@ -980,7 +980,7 @@ TEST_STATUS TestGlobalDiscard()
     {
         OUTPUT_Line("Allocation handle: ");
         OUTPUT_HexDword((DWORD)hMem);
     {
         OUTPUT_Line("Allocation handle: ");
         OUTPUT_HexDword((DWORD)hMem);
-        
+
         hTest = GlobalDiscard(hMem);
         if (0 == hTest)
         {
         hTest = GlobalDiscard(hMem);
         if (0 == hTest)
         {
@@ -1044,15 +1044,15 @@ int main(int argc, char ** argv)
     test_set = TEST_CombineStatus(test_set, TestGlobalLockNUnlock(GHND));
     test_set = TEST_CombineStatus(test_set, TestGlobalLockNUnlock(GMEM_FIXED));
     test_set = TEST_CombineStatus(test_set, TestGlobalLockNUnlock(GMEM_MOVEABLE));
     test_set = TEST_CombineStatus(test_set, TestGlobalLockNUnlock(GHND));
     test_set = TEST_CombineStatus(test_set, TestGlobalLockNUnlock(GMEM_FIXED));
     test_set = TEST_CombineStatus(test_set, TestGlobalLockNUnlock(GMEM_MOVEABLE));
-    
+
     test_set = TEST_CombineStatus(test_set, TestGlobalReAlloc());
 
     test_set = TEST_CombineStatus(test_set, TestGlobalFlags());
     test_set = TEST_CombineStatus(test_set, TestGlobalReAlloc());
 
     test_set = TEST_CombineStatus(test_set, TestGlobalFlags());
-    
+
     test_set = TEST_CombineStatus(test_set, TestGlobalHandle());
     test_set = TEST_CombineStatus(test_set, TestGlobalHandle());
-    
+
     test_set = TEST_CombineStatus(test_set, TestGlobalSize());
     test_set = TEST_CombineStatus(test_set, TestGlobalSize());
-    
+
     test_set = TEST_CombineStatus(test_set, TestGlobalDiscard());
 
     /* output the result for the entire set of tests*/
     test_set = TEST_CombineStatus(test_set, TestGlobalDiscard());
 
     /* output the result for the entire set of tests*/
index e291b21..7aba611 100644 (file)
@@ -4,7 +4,7 @@
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -78,7 +78,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           GRADIENT_TRIANGLE    gTRi[3];
           GRADIENT_RECT        gRect[2];
          hDC = BeginPaint(hWnd, &ps);
           GRADIENT_TRIANGLE    gTRi[3];
           GRADIENT_RECT        gRect[2];
          hDC = BeginPaint(hWnd, &ps);
-         
+
          vert [0] .x       =  0;
          vert [0] .y       =  0;
          vert [0] .Red     =  0xff00;
          vert [0] .x       =  0;
          vert [0] .y       =  0;
          vert [0] .Red     =  0xff00;
@@ -92,23 +92,23 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          vert [1] .Green   =  0x0000;
          vert [1] .Blue    =  0xff00;
          vert [1] .Alpha   =  0x0000;
          vert [1] .Green   =  0x0000;
          vert [1] .Blue    =  0xff00;
          vert [1] .Alpha   =  0x0000;
-         
+
          vert [2] .x       =  100;
          vert [2] .x       =  100;
-         vert [2] .y       =  200; 
+         vert [2] .y       =  200;
          vert [2] .Red     =  0xff00;
          vert [2] .Green   =  0x0000;
          vert [2] .Blue    =  0x0000;
          vert [2] .Alpha   =  0x0000;
 
          vert [3] .x       =  250;
          vert [2] .Red     =  0xff00;
          vert [2] .Green   =  0x0000;
          vert [2] .Blue    =  0x0000;
          vert [2] .Alpha   =  0x0000;
 
          vert [3] .x       =  250;
-         vert [3] .y       =  300; 
+         vert [3] .y       =  300;
          vert [3] .Red     =  0x8000;
          vert [3] .Green   =  0x8000;
          vert [3] .Blue    =  0x0000;
          vert [3] .Alpha   =  0x0000;
 
          vert [4] .x       =  325;
          vert [3] .Red     =  0x8000;
          vert [3] .Green   =  0x8000;
          vert [3] .Blue    =  0x0000;
          vert [3] .Alpha   =  0x0000;
 
          vert [4] .x       =  325;
-         vert [4] .y       =  300; 
+         vert [4] .y       =  300;
          vert [4] .Red     =  0x0000;
          vert [4] .Green   =  0xff00;
          vert [4] .Blue    =  0x0000;
          vert [4] .Red     =  0x0000;
          vert [4] .Green   =  0xff00;
          vert [4] .Blue    =  0x0000;
@@ -137,12 +137,12 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          vert [0] .Alpha  = 0x0000;
 
          vert [1] .x      = 90;
          vert [0] .Alpha  = 0x0000;
 
          vert [1] .x      = 90;
-         vert [1] .y      = 240; 
+         vert [1] .y      = 240;
          vert [1] .Red    = 0x0000;
          vert [1] .Green  = 0x0000;
          vert [1] .Blue   = 0xff00;
          vert [1] .Alpha  = 0x0000;
          vert [1] .Red    = 0x0000;
          vert [1] .Green  = 0x0000;
          vert [1] .Blue   = 0xff00;
          vert [1] .Alpha  = 0x0000;
-         
+
          vert [2] .x      = 5;
          vert [2] .y      = 245;
          vert [2] .Red    = 0x0000;
          vert [2] .x      = 5;
          vert [2] .y      = 245;
          vert [2] .Red    = 0x0000;
@@ -151,7 +151,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          vert [2] .Alpha  = 0x0000;
 
          vert [3] .x      = 90;
          vert [2] .Alpha  = 0x0000;
 
          vert [3] .x      = 90;
-         vert [3] .y      = 300; 
+         vert [3] .y      = 300;
          vert [3] .Red    = 0x0000;
          vert [3] .Green  = 0x0000;
          vert [3] .Blue   = 0xff00;
          vert [3] .Red    = 0x0000;
          vert [3] .Green  = 0x0000;
          vert [3] .Blue   = 0xff00;
@@ -159,10 +159,10 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
          gRect[0].UpperLeft  = 0;
          gRect[0].LowerRight = 1;
 
          gRect[0].UpperLeft  = 0;
          gRect[0].LowerRight = 1;
-         
+
          gRect[1].UpperLeft  = 2;
          gRect[1].LowerRight = 3;
          gRect[1].UpperLeft  = 2;
          gRect[1].LowerRight = 3;
-         
+
          GdiGradientFill(hDC,vert,4,&gRect[0],1,GRADIENT_FILL_RECT_H);
          GdiGradientFill(hDC,vert,4,&gRect[1],1,GRADIENT_FILL_RECT_V);
 
          GdiGradientFill(hDC,vert,4,&gRect[0],1,GRADIENT_FILL_RECT_H);
          GdiGradientFill(hDC,vert,4,&gRect[1],1,GRADIENT_FILL_RECT_V);
 
index 8e8da78..6a0cce6 100644 (file)
@@ -6,7 +6,7 @@ static GUITHREADINFO gti;
 //HFONT tf;
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 //HFONT tf;
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -57,7 +57,7 @@ WinMain(HINSTANCE hInstance,
 
   gti.cbSize = sizeof(GUITHREADINFO);
   GetGUIThreadInfo(0, &gti);
 
   gti.cbSize = sizeof(GUITHREADINFO);
   GetGUIThreadInfo(0, &gti);
-  
+
   SetTimer(hWnd, 1, 1000, NULL);
   ShowWindow(hWnd, nCmdShow);
 
   SetTimer(hWnd, 1, 1000, NULL);
   ShowWindow(hWnd, nCmdShow);
 
@@ -91,7 +91,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          if(gti.flags & GUI_POPUPMENUMODE) lstrcat(str, "GUI_POPUPMENUMODE ");
          if(gti.flags & GUI_SYSTEMMENUMODE) lstrcat(str, "GUI_SYSTEMMENUMODE ");
          TextOut(hDC, 10, 10, str, strlen(str));
          if(gti.flags & GUI_POPUPMENUMODE) lstrcat(str, "GUI_POPUPMENUMODE ");
          if(gti.flags & GUI_SYSTEMMENUMODE) lstrcat(str, "GUI_SYSTEMMENUMODE ");
          TextOut(hDC, 10, 10, str, strlen(str));
-         
+
          wsprintf(str, "hwndActive == %08X", gti.hwndActive);
          TextOut(hDC, 10, 30, str, strlen(str));
          wsprintf(str, "hwndFocus == %08X", gti.hwndFocus);
          wsprintf(str, "hwndActive == %08X", gti.hwndActive);
          TextOut(hDC, 10, 30, str, strlen(str));
          wsprintf(str, "hwndFocus == %08X", gti.hwndFocus);
@@ -106,7 +106,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          TextOut(hDC, 10, 130, str, strlen(str));
          wsprintf(str, "rcCaret == (%lu, %lu, %lu, %lu)", gti.rcCaret.left, gti.rcCaret.top, gti.rcCaret.right, gti.rcCaret.bottom);
          TextOut(hDC, 10, 150, str, strlen(str));
          TextOut(hDC, 10, 130, str, strlen(str));
          wsprintf(str, "rcCaret == (%lu, %lu, %lu, %lu)", gti.rcCaret.left, gti.rcCaret.top, gti.rcCaret.right, gti.rcCaret.bottom);
          TextOut(hDC, 10, 150, str, strlen(str));
-         
+
          wsprintf(str, "GetGuiResources for the current process: %08X", GetCurrentProcess());
          TextOut(hDC, 10, 180, str, strlen(str));
          wsprintf(str, "GetGuiResources: GR_GDIOBJECTS == %04X", GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS));
          wsprintf(str, "GetGuiResources for the current process: %08X", GetCurrentProcess());
          TextOut(hDC, 10, 180, str, strlen(str));
          wsprintf(str, "GetGuiResources: GR_GDIOBJECTS == %04X", GetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS));
@@ -115,7 +115,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          TextOut(hDC, 10, 220, str, strlen(str));
          EndPaint(hWnd, &ps);
          break;
          TextOut(hDC, 10, 220, str, strlen(str));
          EndPaint(hWnd, &ps);
          break;
-    
+
     case WM_TIMER:
       GetGUIThreadInfo(0, &gti);
       InvalidateRect(hWnd, NULL, TRUE);
     case WM_TIMER:
       GetGUIThreadInfo(0, &gti);
       InvalidateRect(hWnd, NULL, TRUE);
index 9e79338..bba959a 100644 (file)
@@ -2,7 +2,7 @@
 #include <string.h>
 
 int main(int argc, char* argv[])
 #include <string.h>
 
 int main(int argc, char* argv[])
-{  
+{
    printf("Hello world\n");
    return(0);
 }
    printf("Hello world\n");
    return(0);
 }
index 2dc2fa3..1fbd274 100644 (file)
@@ -367,8 +367,8 @@ void EnumerateValueTest(void)
 void test1(void)
 {
  HKEY hKey = NULL, hKey1;
 void test1(void)
 {
  HKEY hKey = NULL, hKey1;
- OBJECT_ATTRIBUTES ObjectAttributes; 
- NTSTATUS Status; 
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ NTSTATUS Status;
 #if 0
  UNICODE_STRING KeyName = ROS_STRING_INITIALIZER(L"\\Registry");
 #endif
 #if 0
  UNICODE_STRING KeyName = ROS_STRING_INITIALIZER(L"\\Registry");
 #endif
@@ -494,9 +494,9 @@ void test1(void)
 void test3(void)
 {
  HKEY hKey;
 void test3(void)
 {
  HKEY hKey;
- OBJECT_ATTRIBUTES ObjectAttributes; 
+ OBJECT_ATTRIBUTES ObjectAttributes;
  UNICODE_STRING KeyName;
  UNICODE_STRING KeyName;
- NTSTATUS Status; 
+ NTSTATUS Status;
  char Buffer[10];
  DWORD Result;
   dprintf("NtCreateKey non volatile: \n");
  char Buffer[10];
  DWORD Result;
   dprintf("NtCreateKey non volatile: \n");
@@ -650,7 +650,7 @@ void test4(void)
                            L"System\\Setup",
                            0,
                            KEY_ALL_ACCESS,
                            L"System\\Setup",
                            0,
                            KEY_ALL_ACCESS,
-                           &hKey1); 
+                           &hKey1);
   dprintf("\t\tdwError =%x\n",dwError);
   if (dwError == ERROR_SUCCESS)
     {
   dprintf("\t\tdwError =%x\n",dwError);
   if (dwError == ERROR_SUCCESS)
     {
@@ -679,7 +679,7 @@ void test4(void)
                            L"System\\ControlSet001\\Services\\Serial",
                            0,
                            KEY_ALL_ACCESS,
                            L"System\\ControlSet001\\Services\\Serial",
                            0,
                            KEY_ALL_ACCESS,
-                           &hKey); 
+                           &hKey);
    dprintf ("\t\t\t\t\tdwError %x\n", dwError);
    RegDataSize = sizeof(GlobalFifoEnable);
    if (dwError == ERROR_SUCCESS)
    dprintf ("\t\t\t\t\tdwError %x\n", dwError);
    RegDataSize = sizeof(GlobalFifoEnable);
    if (dwError == ERROR_SUCCESS)
@@ -814,7 +814,7 @@ void test6(void)
   HKEY hKey;
   OBJECT_ATTRIBUTES ObjectAttributes;
   UNICODE_STRING KeyName,ValueName;
   HKEY hKey;
   OBJECT_ATTRIBUTES ObjectAttributes;
   UNICODE_STRING KeyName,ValueName;
-  NTSTATUS Status; 
+  NTSTATUS Status;
   KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
   ULONG Length,i;
 
   KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
   ULONG Length,i;
 
@@ -923,7 +923,7 @@ void test7(void)
   HKEY hKey;
   OBJECT_ATTRIBUTES ObjectAttributes;
   UNICODE_STRING KeyName,ValueName;
   HKEY hKey;
   OBJECT_ATTRIBUTES ObjectAttributes;
   UNICODE_STRING KeyName,ValueName;
-  NTSTATUS Status; 
+  NTSTATUS Status;
 
   dprintf("Open link key\n");
   dprintf("  Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
 
   dprintf("Open link key\n");
   dprintf("  Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
@@ -968,9 +968,9 @@ void test8(void)
  UNICODE_STRING KeyName;
  NTSTATUS Status;
  LONG dwError;
  UNICODE_STRING KeyName;
  NTSTATUS Status;
  LONG dwError;
- TOKEN_PRIVILEGES NewPrivileges; 
+ TOKEN_PRIVILEGES NewPrivileges;
  HANDLE Token,hKey;
  HANDLE Token,hKey;
- LUID Luid; 
+ LUID Luid;
  BOOLEAN bRes;
   Status=NtOpenProcessToken(GetCurrentProcess()
        ,TOKEN_ADJUST_PRIVILEGES,&Token);
  BOOLEAN bRes;
   Status=NtOpenProcessToken(GetCurrentProcess()
        ,TOKEN_ADJUST_PRIVILEGES,&Token);
@@ -978,24 +978,24 @@ void test8(void)
   dprintf("\t\t\t\tStatus =%x\n",Status);
 //  bRes=LookupPrivilegeValueA(NULL,SE_RESTORE_NAME,&Luid);
 //  dprintf("\t\t\t\tbRes =%x\n",bRes);
   dprintf("\t\t\t\tStatus =%x\n",Status);
 //  bRes=LookupPrivilegeValueA(NULL,SE_RESTORE_NAME,&Luid);
 //  dprintf("\t\t\t\tbRes =%x\n",bRes);
-  NewPrivileges.PrivilegeCount = 1; 
-  NewPrivileges.Privileges[0].Luid = Luid; 
+  NewPrivileges.PrivilegeCount = 1;
+  NewPrivileges.Privileges[0].Luid = Luid;
 //  NewPrivileges.Privileges[0].Luid.u.LowPart=18;
 //  NewPrivileges.Privileges[0].Luid.u.HighPart=0;
 //  NewPrivileges.Privileges[0].Luid.u.LowPart=18;
 //  NewPrivileges.Privileges[0].Luid.u.HighPart=0;
-  NewPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 
-//  Status = NtAdjustPrivilegesToken( 
-  bRes = AdjustTokenPrivileges( 
-            Token, 
-            FALSE, 
-            &NewPrivileges, 
-            0, 
-            NULL, 
-            NULL 
-            ); 
+  NewPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+
+//  Status = NtAdjustPrivilegesToken(
+  bRes = AdjustTokenPrivileges(
+            Token,
+            FALSE,
+            &NewPrivileges,
+            0,
+            NULL,
+            NULL
+            );
   dprintf("\t\t\t\tbRes =%x\n",bRes);
   dprintf("\t\t\t\tbRes =%x\n",bRes);
-//  Status=NtClose(Token); 
+
+//  Status=NtClose(Token);
 //  dprintf("\t\t\t\tStatus =%x\n",Status);
 
 
 //  dprintf("\t\t\t\tStatus =%x\n",Status);
 
 
@@ -1027,8 +1027,8 @@ void test8(void)
 void test9(void)
 {
     HKEY hKey = NULL, hKey1;
 void test9(void)
 {
     HKEY hKey = NULL, hKey1;
-    OBJECT_ATTRIBUTES ObjectAttributes; 
-    NTSTATUS Status; 
+    OBJECT_ATTRIBUTES ObjectAttributes;
+    NTSTATUS Status;
     UNICODE_STRING KeyName = ROS_STRING_INITIALIZER(L"\\Registry");
     ULONG Index,Length,i;
     KEY_BASIC_INFORMATION KeyInformation[5];
     UNICODE_STRING KeyName = ROS_STRING_INITIALIZER(L"\\Registry");
     ULONG Index,Length,i;
     KEY_BASIC_INFORMATION KeyInformation[5];
index e93adcf..e29d649 100644 (file)
@@ -27,7 +27,7 @@ HINSTANCE hInst;
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
     HINSTANCE hPrevInstance,
     LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
     HINSTANCE hPrevInstance,
     LPSTR lpszCmdLine,
@@ -38,7 +38,7 @@ WinMain(HINSTANCE hInstance,
   HWND hWnd;
 
   hInst = hInstance;
   HWND hWnd;
 
   hInst = hInstance;
-  
+
   #ifdef _GetCursorInfo
   GetCursorInfo = (GETCURSORINFO)GetProcAddress(GetModuleHandleW(L"user32.dll"), "GetCursorInfo");
   #endif
   #ifdef _GetCursorInfo
   GetCursorInfo = (GETCURSORINFO)GetProcAddress(GetModuleHandleW(L"user32.dll"), "GetCursorInfo");
   #endif
@@ -75,13 +75,13 @@ WinMain(HINSTANCE hInstance,
     DbgPrint("CreateWindow failed (last error 0x%X)\n", GetLastError());
     return(1);
   }
     DbgPrint("CreateWindow failed (last error 0x%X)\n", GetLastError());
     return(1);
   }
-    
+
   tf = CreateFontA(14,0, 0, TA_BASELINE, FW_NORMAL, FALSE, FALSE, FALSE,
                    ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
                    DEFAULT_QUALITY, FIXED_PITCH|FF_DONTCARE, "Timmons");
 
   ShowWindow(hWnd, nCmdShow);
   tf = CreateFontA(14,0, 0, TA_BASELINE, FW_NORMAL, FALSE, FALSE, FALSE,
                    ANSI_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
                    DEFAULT_QUALITY, FIXED_PITCH|FF_DONTCARE, "Timmons");
 
   ShowWindow(hWnd, nCmdShow);
-  
+
   SetTimer(hWnd, 1, 1000, NULL);
 
   while(GetMessage(&msg, NULL, 0, 0))
   SetTimer(hWnd, 1, 1000, NULL);
 
   while(GetMessage(&msg, NULL, 0, 0))
@@ -105,19 +105,19 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
     BITMAP bmp;
     RECT rc;
     CHAR str[20];
     BITMAP bmp;
     RECT rc;
     CHAR str[20];
-        
+
     switch(msg)
     {
     case WM_PAINT:
       hDC = BeginPaint(hWnd, &ps);
       SelectObject(hDC, tf);
       SetBkMode(hDC, TRANSPARENT);
     switch(msg)
     {
     case WM_PAINT:
       hDC = BeginPaint(hWnd, &ps);
       SelectObject(hDC, tf);
       SetBkMode(hDC, TRANSPARENT);
-      
+
       TextOut(hDC, 160, 10, file, strlen(file));
       TextOut(hDC, 15, 85, titleDrwIco, strlen(titleDrwIco));
       TextOut(hDC, 160, 85, titleMask, strlen(titleMask));
       TextOut(hDC, 300, 85, titleXor, strlen(titleXor));
       TextOut(hDC, 160, 10, file, strlen(file));
       TextOut(hDC, 15, 85, titleDrwIco, strlen(titleDrwIco));
       TextOut(hDC, 160, 85, titleMask, strlen(titleMask));
       TextOut(hDC, 300, 85, titleXor, strlen(titleXor));
-      
+
       hIcon = LoadImage(NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE|LR_LOADFROMFILE);
       DrawIcon(hDC,50,50,hIcon);
 
       hIcon = LoadImage(NULL, "icon.ico", IMAGE_ICON, 0, 0, LR_DEFAULTSIZE|LR_LOADFROMFILE);
       DrawIcon(hDC,50,50,hIcon);
 
@@ -132,18 +132,18 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
       DeleteObject(iconinfo.hbmMask);
       DeleteObject(iconinfo.hbmColor);
 
       DeleteObject(iconinfo.hbmMask);
       DeleteObject(iconinfo.hbmColor);
-      
+
       TextOut(hDC, 145, 150, res, strlen(res));
       TextOut(hDC, 15, 225, titleDrwIco, strlen(titleDrwIco));
       TextOut(hDC, 160, 225, titleMask, strlen(titleMask));
       TextOut(hDC, 300, 225, titleXor, strlen(titleXor));
       TextOut(hDC, 145, 150, res, strlen(res));
       TextOut(hDC, 15, 225, titleDrwIco, strlen(titleDrwIco));
       TextOut(hDC, 160, 225, titleMask, strlen(titleMask));
       TextOut(hDC, 300, 225, titleXor, strlen(titleXor));
-          
-      hIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);          
+
+      hIcon = LoadImage(hInst, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
       DrawIcon(hDC,50,190,hIcon);
       DrawIcon(hDC,50,190,hIcon);
-          
+
       GetIconInfo(hIcon, &iconinfo);
       GetIconInfo(hIcon, &iconinfo);
-      DestroyIcon(hIcon);          
-          
+      DestroyIcon(hIcon);
+
       SelectObject(hMemDC, iconinfo.hbmMask);
       BitBlt(hDC, 200, 190, 32, 32, hMemDC, 0, 0, SRCCOPY);
       SelectObject(hMemDC, iconinfo.hbmColor);
       SelectObject(hMemDC, iconinfo.hbmMask);
       BitBlt(hDC, 200, 190, 32, 32, hMemDC, 0, 0, SRCCOPY);
       SelectObject(hMemDC, iconinfo.hbmColor);
@@ -151,7 +151,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
       DeleteObject(iconinfo.hbmMask);
       DeleteObject(iconinfo.hbmColor);
 
       DeleteObject(iconinfo.hbmMask);
       DeleteObject(iconinfo.hbmColor);
-      
+
       cursorinfo.cbSize = sizeof(CURSORINFO);
       if(GetCursorInfo(&cursorinfo))
       {
       cursorinfo.cbSize = sizeof(CURSORINFO);
       if(GetCursorInfo(&cursorinfo))
       {
@@ -161,10 +161,10 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           DrawIcon(hDC, 50, 330, cursorinfo.hCursor);
           GetIconInfo(cursorinfo.hCursor, &iconinfo);
           TextOut(hDC, 15, 365, titleDrwIco, strlen(titleDrwIco));
           DrawIcon(hDC, 50, 330, cursorinfo.hCursor);
           GetIconInfo(cursorinfo.hCursor, &iconinfo);
           TextOut(hDC, 15, 365, titleDrwIco, strlen(titleDrwIco));
-          
+
           sprintf(str, "Hotspot: %ld; %ld", iconinfo.xHotspot, iconinfo.yHotspot);
           TextOut(hDC, 15, 380, str, strlen(str));
           sprintf(str, "Hotspot: %ld; %ld", iconinfo.xHotspot, iconinfo.yHotspot);
           TextOut(hDC, 15, 380, str, strlen(str));
-          
+
           if(iconinfo.hbmMask)
           {
             GetObjectW(iconinfo.hbmMask, sizeof(BITMAP), &bmp);
           if(iconinfo.hbmMask)
           {
             GetObjectW(iconinfo.hbmMask, sizeof(BITMAP), &bmp);
@@ -172,11 +172,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
             BitBlt(hDC, 200, 330, bmp.bmWidth, bmp.bmHeight, hMemDC, 0, 0, SRCCOPY);
             DeleteObject(iconinfo.hbmMask);
             TextOut(hDC, 160, 365 - 32 + bmp.bmHeight, cursormask, strlen(cursormask));
             BitBlt(hDC, 200, 330, bmp.bmWidth, bmp.bmHeight, hMemDC, 0, 0, SRCCOPY);
             DeleteObject(iconinfo.hbmMask);
             TextOut(hDC, 160, 365 - 32 + bmp.bmHeight, cursormask, strlen(cursormask));
-            
+
             sprintf(str, "%dBPP", bmp.bmBitsPixel);
             TextOut(hDC, 160, 380 - 32 + bmp.bmHeight, str, strlen(str));
           }
             sprintf(str, "%dBPP", bmp.bmBitsPixel);
             TextOut(hDC, 160, 380 - 32 + bmp.bmHeight, str, strlen(str));
           }
-          
+
           if(iconinfo.hbmColor)
           {
             GetObjectW(iconinfo.hbmColor, sizeof(BITMAP), &bmp);
           if(iconinfo.hbmColor)
           {
             GetObjectW(iconinfo.hbmColor, sizeof(BITMAP), &bmp);
@@ -184,19 +184,19 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
             BitBlt(hDC, 350, 330, bmp.bmWidth, bmp.bmHeight, hMemDC, 0, 0, SRCCOPY);
             DeleteObject(iconinfo.hbmColor);
             TextOut(hDC, 300, 365 - 32 + bmp.bmHeight, cursorcolor, strlen(cursorcolor));
             BitBlt(hDC, 350, 330, bmp.bmWidth, bmp.bmHeight, hMemDC, 0, 0, SRCCOPY);
             DeleteObject(iconinfo.hbmColor);
             TextOut(hDC, 300, 365 - 32 + bmp.bmHeight, cursorcolor, strlen(cursorcolor));
-            
+
             sprintf(str, "%dBPP", bmp.bmBitsPixel);
             TextOut(hDC, 300, 380 - 32 + bmp.bmHeight, str, strlen(str));
           }
         }
       }
             sprintf(str, "%dBPP", bmp.bmBitsPixel);
             TextOut(hDC, 300, 380 - 32 + bmp.bmHeight, str, strlen(str));
           }
         }
       }
-      
+
       SelectObject(hMemDC, hOld);
       SelectObject(hMemDC, hOld);
-      
-      DeleteObject(hMemDC);          
+
+      DeleteObject(hMemDC);
       EndPaint(hWnd, &ps);
     break;
       EndPaint(hWnd, &ps);
     break;
-    
+
     case WM_TIMER:
       rc.left = 0;
       rc.top = 330;
     case WM_TIMER:
       rc.left = 0;
       rc.top = 330;
index 3fba19c..113125f 100644 (file)
@@ -3,7 +3,7 @@
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
index f6da86d..26ff844 100644 (file)
@@ -5,7 +5,7 @@ LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 const TCHAR* CLASS_NAME = _T("LineTestClass");
 
 
 const TCHAR* CLASS_NAME = _T("LineTestClass");
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -144,7 +144,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
   HDC hDC;
   RECT clr;
   HBRUSH hbr;
   HDC hDC;
   RECT clr;
   HBRUSH hbr;
-  
+
   switch(msg)
   {
   case WM_PAINT:
   switch(msg)
   {
   case WM_PAINT:
@@ -169,11 +169,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
     DrawLines(hDC);
     EndPaint(hWnd, &ps);
     break;
     DrawLines(hDC);
     EndPaint(hWnd, &ps);
     break;
-    
+
   case WM_DESTROY:
     PostQuitMessage(0);
     break;
   case WM_DESTROY:
     PostQuitMessage(0);
     break;
-    
+
   default:
     return DefWindowProc(hWnd, msg, wParam, lParam);
   }
   default:
     return DefWindowProc(hWnd, msg, wParam, lParam);
   }
index c22781a..a3d3101 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: conport.c,v 1.1 2004/10/21 04:58:59 sedwards Exp $
+/* $Id$
  *
  * reactos/apps/lpc/conport.c
  *
  *
  * reactos/apps/lpc/conport.c
  *
@@ -6,7 +6,7 @@
  * "\SmApiPort" as argument. Do not try to
  * connect to "\Windows\ApiPort" since that
  * reboots immeditely.
  * "\SmApiPort" as argument. Do not try to
  * connect to "\Windows\ApiPort" since that
  * reboots immeditely.
- * 
+ *
  * Use Russinovich' HandleEx to verify
  * conport.exe owns two unnamed LPC ports:
  * the one created by kernel32.dll connecting
  * Use Russinovich' HandleEx to verify
  * conport.exe owns two unnamed LPC ports:
  * the one created by kernel32.dll connecting
@@ -50,7 +50,7 @@ NTSTATUS
        IN      ULONG   Length,
        OUT     PULONG  ResultLength
        );
        IN      ULONG   Length,
        OUT     PULONG  ResultLength
        );
-  
+
 NTSTATUS
 (STDCALL * YieldExecution)(VOID);
 
 NTSTATUS
 (STDCALL * YieldExecution)(VOID);
 
index b6e30a1..ab0f028 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: creport.c,v 1.1 2004/10/21 04:58:59 sedwards Exp $
+/* $Id$
  *
  * reactos/apps/lpc/creport.c
  *
  * To be run in a real WNT 4.0 system to
  * create an LPC named port.
  *
  * reactos/apps/lpc/creport.c
  *
  * To be run in a real WNT 4.0 system to
  * create an LPC named port.
- * 
+ *
  * Use Russinovich' HandleEx to verify
  * creport.exe owns the named LPC port
  * you asked to create.
  * Use Russinovich' HandleEx to verify
  * creport.exe owns the named LPC port
  * you asked to create.
@@ -26,7 +26,7 @@ NTSTATUS
 (STDCALL * CreatePort)(
        /*OUT   PHANDLE                 PortHandle,*/
        PVOID   Buffer,
 (STDCALL * CreatePort)(
        /*OUT   PHANDLE                 PortHandle,*/
        PVOID   Buffer,
-       IN      POBJECT_ATTRIBUTES      PortAttributes  OPTIONAL,  
+       IN      POBJECT_ATTRIBUTES      PortAttributes  OPTIONAL,
        IN      ACCESS_MASK             DesiredAccess,
        IN      DWORD                   Unknown3,
        IN      ULONG                   Flags
        IN      ACCESS_MASK             DesiredAccess,
        IN      DWORD                   Unknown3,
        IN      ULONG                   Flags
@@ -40,7 +40,7 @@ NTSTATUS
        IN      ULONG   Length,
        OUT     PULONG  ResultLength
        );
        IN      ULONG   Length,
        OUT     PULONG  ResultLength
        );
-  
+
 NTSTATUS
 (STDCALL * YieldExecution)(VOID);
 
 NTSTATUS
 (STDCALL * YieldExecution)(VOID);
 
index b701229..404c2cd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: dumpinfo.c,v 1.1 2004/10/21 04:58:59 sedwards Exp $
+/* $Id$
  *
  * reactos/apps/lpc/dumpinfo.c
  *
  *
  * reactos/apps/lpc/dumpinfo.c
  *
@@ -12,7 +12,7 @@
  *     Added code to find the basic information buffer size
  *     for the LPC port object.
  * 19990710 (EA)
  *     Added code to find the basic information buffer size
  *     for the LPC port object.
  * 19990710 (EA)
- * 
+ *
  */
 #include <windows.h>
 #include <stdio.h>
  */
 #include <windows.h>
 #include <stdio.h>
@@ -77,7 +77,7 @@ DumpInfo (
 {
        BYTE                    ObjectInformation [BUF_SIZE] = {0};
        ULONG                   ResultLength;
 {
        BYTE                    ObjectInformation [BUF_SIZE] = {0};
        ULONG                   ResultLength;
-       
+
        wprintf(
                L"Port \"%s\" %s:\n",
                Name,
        wprintf(
                L"Port \"%s\" %s:\n",
                Name,
@@ -102,7 +102,7 @@ DumpInfo (
                PLPC_PORT_BASIC_INFORMATION     i;
 
                i = (PLPC_PORT_BASIC_INFORMATION) ObjectInformation;
                PLPC_PORT_BASIC_INFORMATION     i;
 
                i = (PLPC_PORT_BASIC_INFORMATION) ObjectInformation;
-       
+
                printf( "\tUnknown01 = 0x%08X\n", i->Unknown0 );
                printf( "\tUnknown02 = 0x%08X\n", i->Unknown1 );
                printf( "\tUnknown03 = 0x%08X\n", i->Unknown2 );
                printf( "\tUnknown01 = 0x%08X\n", i->Unknown0 );
                printf( "\tUnknown02 = 0x%08X\n", i->Unknown1 );
                printf( "\tUnknown03 = 0x%08X\n", i->Unknown2 );
@@ -135,7 +135,7 @@ DumpInfo (
                OBJECT_TYPE_INFORMATION * i;
 
                i = (OBJECT_TYPE_INFORMATION *) ObjectInformation;
                OBJECT_TYPE_INFORMATION * i;
 
                i = (OBJECT_TYPE_INFORMATION *) ObjectInformation;
-               
+
                wprintf(
                        L"\tName: \"%s\"\n",
                        (i->Name.Length ? i->Name.Buffer : L"")
                wprintf(
                        L"\tName: \"%s\"\n",
                        (i->Name.Length ? i->Name.Buffer : L"")
index c227eca..ecf102d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lpcclt.c,v 1.1 2004/10/21 04:58:59 sedwards Exp $
+/* $Id$
  *
  * DESCRIPTION: Simple LPC Client
  * PROGRAMMER:  David Welch
  *
  * DESCRIPTION: Simple LPC Client
  * PROGRAMMER:  David Welch
@@ -38,9 +38,9 @@ int main(int argc, char* argv[])
    ULONG ConnectInfo;
    ULONG ConnectInfoLength = 0;
    SECURITY_QUALITY_OF_SERVICE Sqos;
    ULONG ConnectInfo;
    ULONG ConnectInfoLength = 0;
    SECURITY_QUALITY_OF_SERVICE Sqos;
-   
+
    printf("%s: Lpc test client\n", MyName);
    printf("%s: Lpc test client\n", MyName);
-   
+
    printf("%s: Connecting to port \"%s\"...\n", MyName, TEST_PORT_NAME);
    ConnectInfoLength = 0;
    ZeroMemory (& Sqos, sizeof Sqos);
    printf("%s: Connecting to port \"%s\"...\n", MyName, TEST_PORT_NAME);
    ConnectInfoLength = 0;
    ZeroMemory (& Sqos, sizeof Sqos);
@@ -63,24 +63,24 @@ int main(int argc, char* argv[])
    ZeroMemory(& Request, sizeof Request);
    strcpy(Request.Data, GetCommandLineA());
    Request.Header.DataSize = strlen(Request.Data);
    ZeroMemory(& Request, sizeof Request);
    strcpy(Request.Data, GetCommandLineA());
    Request.Header.DataSize = strlen(Request.Data);
-   Request.Header.MessageSize = sizeof(LPC_MESSAGE) + 
+   Request.Header.MessageSize = sizeof(LPC_MESSAGE) +
      Request.Header.DataSize;
      Request.Header.DataSize;
-   
-   printf("%s: Sending to port 0x%x message \"%s\"...\n", 
+
+   printf("%s: Sending to port 0x%x message \"%s\"...\n",
           MyName,
           PortHandle,
          (char *) Request.Data);
           MyName,
           PortHandle,
          (char *) Request.Data);
-   Status = NtRequestPort(PortHandle, 
+   Status = NtRequestPort(PortHandle,
                          &Request.Header);
    if (!NT_SUCCESS(Status))
      {
                          &Request.Header);
    if (!NT_SUCCESS(Status))
      {
-       printf("%s: NtRequestPort(0x%x) failed with status = 0x%8X.\n", 
+       printf("%s: NtRequestPort(0x%x) failed with status = 0x%8X.\n",
                MyName,
                PortHandle,
               Status);
        return EXIT_FAILURE;
      }
                MyName,
                PortHandle,
               Status);
        return EXIT_FAILURE;
      }
-   
+
    printf("%s: Sending datagram to port 0x%x succeeded.\n", MyName, PortHandle);
 
    Sleep(2000);
    printf("%s: Sending datagram to port 0x%x succeeded.\n", MyName, PortHandle);
 
    Sleep(2000);
index ee0acee..6af9a20 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lpcsrv.c,v 1.1 2004/10/21 04:58:59 sedwards Exp $
+/* $Id$
  *
  * DESCRIPTION: Simple LPC Server
  * PROGRAMMER:  David Welch
  *
  * DESCRIPTION: Simple LPC Server
  * PROGRAMMER:  David Welch
@@ -38,7 +38,7 @@ int main(int argc, char* argv[])
    HANDLE NamedPortHandle;
    HANDLE PortHandle;
    LPC_MAX_MESSAGE ConnectMsg;
    HANDLE NamedPortHandle;
    HANDLE PortHandle;
    LPC_MAX_MESSAGE ConnectMsg;
-   
+
    printf("%s: Lpc test server\n", MyName);
 
    InitializeObjectAttributes(&ObjectAttributes,
    printf("%s: Lpc test server\n", MyName);
 
    InitializeObjectAttributes(&ObjectAttributes,
@@ -46,7 +46,7 @@ int main(int argc, char* argv[])
                              0,
                              NULL,
                              NULL);
                              0,
                              NULL,
                              NULL);
-   
+
    printf("%s: Creating port \"%s\"...\n", MyName, TEST_PORT_NAME);
    Status = NtCreatePort(&NamedPortHandle,
                         &ObjectAttributes,
    printf("%s: Creating port \"%s\"...\n", MyName, TEST_PORT_NAME);
    Status = NtCreatePort(&NamedPortHandle,
                         &ObjectAttributes,
@@ -59,9 +59,9 @@ int main(int argc, char* argv[])
        return EXIT_FAILURE;
      }
    printf("%s: Port \"%s\" created (0x%x).\n\n", MyName, TEST_PORT_NAME, NamedPortHandle);
        return EXIT_FAILURE;
      }
    printf("%s: Port \"%s\" created (0x%x).\n\n", MyName, TEST_PORT_NAME, NamedPortHandle);
-   
+
    for (;;)
    for (;;)
-   { 
+   {
      printf("%s: Listening for connections requests on port 0x%x...\n", MyName, NamedPortHandle);
      Status = NtListenPort(NamedPortHandle,
                         &ConnectMsg.Header);
      printf("%s: Listening for connections requests on port 0x%x...\n", MyName, NamedPortHandle);
      Status = NtListenPort(NamedPortHandle,
                         &ConnectMsg.Header);
@@ -75,8 +75,8 @@ int main(int argc, char* argv[])
         ConnectMsg.Header.MessageId, NamedPortHandle);
      printf("%s: Request from: PID=%x, TID=%x.\n", MyName,
         ConnectMsg.Header.ClientId.UniqueProcess, ConnectMsg.Header.ClientId.UniqueThread);
         ConnectMsg.Header.MessageId, NamedPortHandle);
      printf("%s: Request from: PID=%x, TID=%x.\n", MyName,
         ConnectMsg.Header.ClientId.UniqueProcess, ConnectMsg.Header.ClientId.UniqueThread);
-   
-     printf("%s: Accepting connection request 0x%08x...\n", MyName, 
+
+     printf("%s: Accepting connection request 0x%08x...\n", MyName,
         ConnectMsg.Header.MessageId);
      Status = NtAcceptConnectPort(&PortHandle,
                                NamedPortHandle,
         ConnectMsg.Header.MessageId);
      Status = NtAcceptConnectPort(&PortHandle,
                                NamedPortHandle,
@@ -88,11 +88,11 @@ int main(int argc, char* argv[])
        {
          printf("%s: NtAcceptConnectPort() failed with status = 0x%08lX.\n", MyName, Status);
          return EXIT_FAILURE;
        {
          printf("%s: NtAcceptConnectPort() failed with status = 0x%08lX.\n", MyName, Status);
          return EXIT_FAILURE;
-       }   
-     printf("%s: Connection request 0x%08x accepted as port 0x%x.\n", MyName, 
+       }
+     printf("%s: Connection request 0x%08x accepted as port 0x%x.\n", MyName,
         ConnectMsg.Header.MessageId, PortHandle);
         ConnectMsg.Header.MessageId, PortHandle);
-   
-     printf("%s: Completing connection for port 0x%x (0x%08x).\n", MyName, 
+
+     printf("%s: Completing connection for port 0x%x (0x%08x).\n", MyName,
         PortHandle, ConnectMsg.Header.MessageId);
      Status = NtCompleteConnectPort(PortHandle);
      if (!NT_SUCCESS(Status))
         PortHandle, ConnectMsg.Header.MessageId);
      Status = NtCompleteConnectPort(PortHandle);
      if (!NT_SUCCESS(Status))
@@ -100,12 +100,12 @@ int main(int argc, char* argv[])
          printf("%s: NtCompleteConnectPort() failed with status = 0x%08lX.\n", MyName, Status);
          return EXIT_FAILURE;
        }
          printf("%s: NtCompleteConnectPort() failed with status = 0x%08lX.\n", MyName, Status);
          return EXIT_FAILURE;
        }
-  
-     printf("%s: Entering server loop for port 0x%x...\n", MyName, PortHandle); 
+
+     printf("%s: Entering server loop for port 0x%x...\n", MyName, PortHandle);
      for(;;)
        {
          LPC_MAX_MESSAGE Request;
      for(;;)
        {
          LPC_MAX_MESSAGE Request;
-       
+
          Status = NtReplyWaitReceivePort(PortHandle,
                                        0,
                                        NULL,
          Status = NtReplyWaitReceivePort(PortHandle,
                                        0,
                                        NULL,
@@ -119,7 +119,7 @@ int main(int argc, char* argv[])
          if (LPC_DATAGRAM == PORT_MESSAGE_TYPE(Request))
            {
              printf("%s: Datagram message contents are <%s>.\n",
          if (LPC_DATAGRAM == PORT_MESSAGE_TYPE(Request))
            {
              printf("%s: Datagram message contents are <%s>.\n",
-               MyName, 
+               MyName,
               Request.Data);
            }
          else
               Request.Data);
            }
          else
index 2abd2ca..f6db860 100644 (file)
@@ -18,46 +18,46 @@ int main( int argc, char **argv ) {
   if( argc == 2 ) {
     file_map = (void *)atoi(argv[1]);
   } else {
   if( argc == 2 ) {
     file_map = (void *)atoi(argv[1]);
   } else {
-    file_map = CreateFileMapping( INVALID_HANDLE_VALUE, 
-                                 NULL, 
-                                 PAGE_READWRITE | SEC_RESERVE, 
+    file_map = CreateFileMapping( INVALID_HANDLE_VALUE,
+                                 NULL,
+                                 PAGE_READWRITE | SEC_RESERVE,
                                  0, 0x1000, NULL );
                                  0, 0x1000, NULL );
-    if( !SetHandleInformation( file_map, 
-                              HANDLE_FLAG_INHERIT, 
+    if( !SetHandleInformation( file_map,
+                              HANDLE_FLAG_INHERIT,
                               HANDLE_FLAG_INHERIT ) ) {
       fprintf( stderr, "%lu: Could not make handle inheritable.\n",
               GetCurrentProcessId() );
       return 100;
     }
   }
                               HANDLE_FLAG_INHERIT ) ) {
       fprintf( stderr, "%lu: Could not make handle inheritable.\n",
               GetCurrentProcessId() );
       return 100;
     }
   }
-   
+
   if( !file_map ) {
     fprintf( stderr, "%lu: Could not create anonymous file map.\n",
             GetCurrentProcessId() );
     return 1;
   }
   if( !file_map ) {
     fprintf( stderr, "%lu: Could not create anonymous file map.\n",
             GetCurrentProcessId() );
     return 1;
   }
-  
+
   file_view = MapViewOfFile( file_map,
                             FILE_MAP_WRITE,
                             0,
                             0,
                             0x1000 );
   file_view = MapViewOfFile( file_map,
                             FILE_MAP_WRITE,
                             0,
                             0,
                             0x1000 );
-  
+
   if( !file_view ) {
     fprintf( stderr, "%lu: Could not map view of file.\n",
             GetCurrentProcessId() );
     return 2;
   }
   if( !file_view ) {
     fprintf( stderr, "%lu: Could not map view of file.\n",
             GetCurrentProcessId() );
     return 2;
   }
-  
+
   if( !VirtualAlloc( file_view, 0x1000, MEM_COMMIT, PAGE_READWRITE ) ) {
     fprintf( stderr, "%lu: VirtualAlloc failed to realize the page.\n",
             GetCurrentProcessId() );
     return 3;
   }
   if( !VirtualAlloc( file_view, 0x1000, MEM_COMMIT, PAGE_READWRITE ) ) {
     fprintf( stderr, "%lu: VirtualAlloc failed to realize the page.\n",
             GetCurrentProcessId() );
     return 3;
   }
-  
+
   x = (int *)file_view;
   x[0] = 0x12345678;
   x = (int *)file_view;
   x[0] = 0x12345678;
-  
+
   if( x[0] != 0x12345678 ) {
     fprintf( stderr, "%lu: Can't write to the memory (%08x != 0x12345678)\n",
             GetCurrentProcessId(), x[0] );
   if( x[0] != 0x12345678 ) {
     fprintf( stderr, "%lu: Can't write to the memory (%08x != 0x12345678)\n",
             GetCurrentProcessId(), x[0] );
index ecbbbea..d3f2aaf 100644 (file)
@@ -208,7 +208,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                        // Send the TB_BUTTONSTRUCTSIZE message, which is required for
                        // backward compatibility.
                        SendMessage(hTool, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
                        // Send the TB_BUTTONSTRUCTSIZE message, which is required for
                        // backward compatibility.
                        SendMessage(hTool, TB_BUTTONSTRUCTSIZE, (WPARAM)sizeof(TBBUTTON), 0);
-                       
+
                        tbab.hInst = HINST_COMMCTRL;
                        tbab.nID = IDB_STD_SMALL_COLOR;
                        SendMessage(hTool, TB_ADDBITMAP, 0, (LPARAM)&tbab);
                        tbab.hInst = HINST_COMMCTRL;
                        tbab.nID = IDB_STD_SMALL_COLOR;
                        SendMessage(hTool, TB_ADDBITMAP, 0, (LPARAM)&tbab);
@@ -301,7 +301,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                                        HWND hChild = CreateNewMDIChild(g_hMDIClient);
                                        if(hChild)
                                        {
                                        HWND hChild = CreateNewMDIChild(g_hMDIClient);
                                        if(hChild)
                                        {
-                                               DoFileOpen(hChild);     
+                                               DoFileOpen(hChild);
                                        }
                                }
                                break;
                                        }
                                }
                                break;
@@ -326,7 +326,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
                                        {
                                                DefFrameProc(hwnd, g_hMDIClient, WM_COMMAND, wParam, lParam);
                                        }
                                        {
                                                DefFrameProc(hwnd, g_hMDIClient, WM_COMMAND, wParam, lParam);
                                        }
-                                       else 
+                                       else
                                        {
                                                HWND hChild = (HWND)SendMessage(g_hMDIClient, WM_MDIGETACTIVE,0,0);
                                                if(hChild)
                                        {
                                                HWND hChild = (HWND)SendMessage(g_hMDIClient, WM_MDIGETACTIVE,0,0);
                                                if(hChild)
@@ -354,8 +354,8 @@ LRESULT CALLBACK MDIChildWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
 
                        // Create Edit Control
 
 
                        // Create Edit Control
 
-                       hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "", 
-                               WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL, 
+                       hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", "",
+                               WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL,
                                0, 0, 100, 100, hwnd, (HMENU)IDC_CHILD_EDIT, GetModuleHandle(NULL), NULL);
                        if(hEdit == NULL)
                                MessageBox(hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR);
                                0, 0, 100, 100, hwnd, (HMENU)IDC_CHILD_EDIT, GetModuleHandle(NULL), NULL);
                        if(hEdit == NULL)
                                MessageBox(hwnd, "Could not create edit box.", "Error", MB_OK | MB_ICONERROR);
@@ -426,7 +426,7 @@ LRESULT CALLBACK MDIChildWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
                return DefMDIChildProc(hwnd, msg, wParam, lParam);
                default:
                        return DefMDIChildProc(hwnd, msg, wParam, lParam);
                return DefMDIChildProc(hwnd, msg, wParam, lParam);
                default:
                        return DefMDIChildProc(hwnd, msg, wParam, lParam);
-       
+
        }
        return 0;
 }
        }
        return 0;
 }
index 3ea6b7e..548807b 100644 (file)
@@ -16,7 +16,7 @@
 #define ID_EDIT_PASTE                   40017
 
 // Next default values for new objects
 #define ID_EDIT_PASTE                   40017
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        101
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        101
index 3c4ef68..f783412 100644 (file)
@@ -31,13 +31,13 @@ int SocketTest()
    WORD wVersionRequested;
    WSADATA wsaData;
    int err;
    WORD wVersionRequested;
    WSADATA wsaData;
    int err;
-    
+
    /*
     * Initialization.
     */
    /*
     * Initialization.
     */
-   
+
    wVersionRequested = MAKEWORD( 2, 2 );
    wVersionRequested = MAKEWORD( 2, 2 );
-    
+
    DBG("Calling WSAStartup\n");
    err = WSAStartup( wVersionRequested, &wsaData );
    if ( err != 0 ) {
    DBG("Calling WSAStartup\n");
    err = WSAStartup( wVersionRequested, &wsaData );
    if ( err != 0 ) {
@@ -46,22 +46,22 @@ int SocketTest()
        DBG("WSAStartup failed\n");
        return 1;
    }
        DBG("WSAStartup failed\n");
        return 1;
    }
-    
+
    /* Confirm that the WinSock DLL supports 2.2.*/
    /* Note that if the DLL supports versions greater    */
    /* than 2.2 in addition to 2.2, it will still return */
    /* 2.2 in wVersion since that is the version we      */
    /* requested.                                        */
    /* Confirm that the WinSock DLL supports 2.2.*/
    /* Note that if the DLL supports versions greater    */
    /* than 2.2 in addition to 2.2, it will still return */
    /* 2.2 in wVersion since that is the version we      */
    /* requested.                                        */
-    
+
    if ( LOBYTE( wsaData.wVersion ) != 2 ||
            HIBYTE( wsaData.wVersion ) != 2 ) {
        /* Tell the user that we could not find a usable */
        /* WinSock DLL.                                  */
        DBG("WSAStartup version unacceptable\n");
        WSACleanup( );
    if ( LOBYTE( wsaData.wVersion ) != 2 ||
            HIBYTE( wsaData.wVersion ) != 2 ) {
        /* Tell the user that we could not find a usable */
        /* WinSock DLL.                                  */
        DBG("WSAStartup version unacceptable\n");
        WSACleanup( );
-       return 1; 
+       return 1;
    }
    }
-    
+
    /* The WinSock DLL is acceptable. Proceed. */
 
    DBG("Calling socket\n");
    /* The WinSock DLL is acceptable. Proceed. */
 
    DBG("Calling socket\n");
@@ -71,7 +71,7 @@ int SocketTest()
        DBG("socket failed\n");
        goto failed;
    }
        DBG("socket failed\n");
        goto failed;
    }
-   
+
    selfAddr.sin_family = AF_INET;
    selfAddr.sin_port = 0;
    selfAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); /* BugZilla: 35408 */
    selfAddr.sin_family = AF_INET;
    selfAddr.sin_port = 0;
    selfAddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); /* BugZilla: 35408 */
index 873148f..15551c4 100644 (file)
@@ -14,7 +14,7 @@ int main(int argc, char *argv[])
    LPSTR lpszMailslotName = "\\\\.\\MAILSLOT\\mymailslot";
    LPSTR lpszTestMessage = "Mailslot test message!";
    DWORD cbLength, cbWritten;
    LPSTR lpszMailslotName = "\\\\.\\MAILSLOT\\mymailslot";
    LPSTR lpszTestMessage = "Mailslot test message!";
    DWORD cbLength, cbWritten;
-   
+
    hMailslot = CreateFile(lpszMailslotName,
                          GENERIC_WRITE,
                          FILE_SHARE_READ,
    hMailslot = CreateFile(lpszMailslotName,
                          GENERIC_WRITE,
                          FILE_SHARE_READ,
@@ -28,17 +28,17 @@ int main(int argc, char *argv[])
        printf("CreateFile() failed\n");
        return 0;
      }
        printf("CreateFile() failed\n");
        return 0;
      }
-   
+
    cbLength = (ULONG)strlen(lpszTestMessage)+1;
    cbLength = (ULONG)strlen(lpszTestMessage)+1;
-   
+
    WriteFile(hMailslot,
             lpszTestMessage,
             cbLength,
             &cbWritten,
             NULL);
    WriteFile(hMailslot,
             lpszTestMessage,
             cbLength,
             &cbWritten,
             NULL);
-   
+
    CloseHandle(hMailslot);
    CloseHandle(hMailslot);
-   
+
    return 0;
 }
 
    return 0;
 }
 
index fa7e838..213227a 100644 (file)
@@ -25,9 +25,9 @@ WindowThreadProc(LPVOID lpParameter)
   MSG msg;
   char caption[64];
   PTHRDCREATEWIN cw = (PTHRDCREATEWIN)lpParameter;
   MSG msg;
   char caption[64];
   PTHRDCREATEWIN cw = (PTHRDCREATEWIN)lpParameter;
-  
+
   sprintf(caption, cw->Caption, GetCurrentThreadId());
   sprintf(caption, cw->Caption, GetCurrentThreadId());
-  
+
   cw->Window = CreateWindow("MultiClass",
                             caption,
                             cw->Style | WS_VISIBLE,
   cw->Window = CreateWindow("MultiClass",
                             caption,
                             cw->Style | WS_VISIBLE,
@@ -39,9 +39,9 @@ WindowThreadProc(LPVOID lpParameter)
                             NULL,
                             hAppInstance,
                             NULL);
                             NULL,
                             hAppInstance,
                             NULL);
-  
+
   SetEvent(WinCreatedEvent);
   SetEvent(WinCreatedEvent);
-  
+
   if(!cw->Window)
   {
     fprintf(stderr, "CreateWindow failed (last error 0x%lX)\n",
   if(!cw->Window)
   {
     fprintf(stderr, "CreateWindow failed (last error 0x%lX)\n",
@@ -57,11 +57,11 @@ WindowThreadProc(LPVOID lpParameter)
     TranslateMessage(&msg);
     DispatchMessage(&msg);
   }
     TranslateMessage(&msg);
     DispatchMessage(&msg);
   }
-  
+
   return 0;
 }
 
   return 0;
 }
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -70,14 +70,14 @@ WinMain(HINSTANCE hInstance,
   WNDCLASS wc;
   int i;
   HANDLE Threads[3];
   WNDCLASS wc;
   int i;
   HANDLE Threads[3];
-  
+
   hAppInstance = hInstance;
   hAppInstance = hInstance;
-  
+
   WinCreatedEvent = CreateEvent(NULL,
                                 FALSE,
                                 FALSE,
                                 NULL);
   WinCreatedEvent = CreateEvent(NULL,
                                 FALSE,
                                 FALSE,
                                 NULL);
-  
+
   if(!WinCreatedEvent)
   {
     fprintf(stderr, "Failed to create event (last error 0x%lX)\n",
   if(!WinCreatedEvent)
   {
     fprintf(stderr, "Failed to create event (last error 0x%lX)\n",
@@ -108,14 +108,14 @@ WinMain(HINSTANCE hInstance,
   wnds[0].Position.x = wnds[0].Position.y = 0;
   wnds[0].Size.cx = 320;
   wnds[0].Size.cy = 240;
   wnds[0].Position.x = wnds[0].Position.y = 0;
   wnds[0].Size.cx = 320;
   wnds[0].Size.cy = 240;
-  
+
   wnds[1].Caption = "Child1 of TopLevel1 (ThreadID: %d)";
   wnds[1].Parent = &wnds[0].Window;
   wnds[1].Style = WS_CHILD | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
   wnds[1].Position.x = 20;
   wnds[1].Position.y = 120;
   wnds[1].Size.cx = wnds[1].Size.cy = 240;
   wnds[1].Caption = "Child1 of TopLevel1 (ThreadID: %d)";
   wnds[1].Parent = &wnds[0].Window;
   wnds[1].Style = WS_CHILD | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_SYSMENU | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
   wnds[1].Position.x = 20;
   wnds[1].Position.y = 120;
   wnds[1].Size.cx = wnds[1].Size.cy = 240;
-  
+
   wnds[2].Caption = "TopLevel2 (ThreadID: %d)";
   wnds[2].Parent = NULL;
   wnds[2].Style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
   wnds[2].Caption = "TopLevel2 (ThreadID: %d)";
   wnds[2].Parent = NULL;
   wnds[2].Style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
@@ -123,7 +123,7 @@ WinMain(HINSTANCE hInstance,
   wnds[2].Position.y = 0;
   wnds[2].Size.cx = 160;
   wnds[2].Size.cy = 490;
   wnds[2].Position.y = 0;
   wnds[2].Size.cx = 160;
   wnds[2].Size.cy = 490;
-  
+
   for(i = 0; i < (sizeof(wnds) / sizeof(THRDCREATEWIN)); i++)
   {
     wnds[i].hThread = CreateThread(NULL,
   for(i = 0; i < (sizeof(wnds) / sizeof(THRDCREATEWIN)); i++)
   {
     wnds[i].hThread = CreateThread(NULL,
@@ -141,11 +141,11 @@ WinMain(HINSTANCE hInstance,
     }
     WaitForSingleObject(WinCreatedEvent, INFINITE);
   }
     }
     WaitForSingleObject(WinCreatedEvent, INFINITE);
   }
-  
+
   WaitForMultipleObjects(sizeof(Threads) / sizeof(HANDLE), &Threads[0], TRUE, INFINITE);
   WaitForMultipleObjects(sizeof(Threads) / sizeof(HANDLE), &Threads[0], TRUE, INFINITE);
-  
+
   UnregisterClass("MultiClass", hInstance);
   UnregisterClass("MultiClass", hInstance);
-  
+
   return 0;
 }
 
   return 0;
 }
 
@@ -156,7 +156,7 @@ LRESULT CALLBACK MultiWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
   RECT Client;
   HBRUSH Brush;
   DWORD Ret;
   RECT Client;
   HBRUSH Brush;
   DWORD Ret;
-  
+
   static COLORREF Colors[] =
     {
       RGB(0x00, 0x00, 0x00),
   static COLORREF Colors[] =
     {
       RGB(0x00, 0x00, 0x00),
@@ -192,7 +192,7 @@ LRESULT CALLBACK MultiWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          }
        EndPaint(hWnd, &ps);
        break;
          }
        EndPaint(hWnd, &ps);
        break;
-      
+
       case WM_COMMAND:
         switch(LOWORD(wParam))
         {
       case WM_COMMAND:
         switch(LOWORD(wParam))
         {
@@ -223,7 +223,7 @@ LRESULT CALLBACK MultiWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
             break;
         }
         break;
             break;
         }
         break;
-      
+
       case WM_DESTROY:
        PostQuitMessage(0);
        break;
       case WM_DESTROY:
        PostQuitMessage(0);
        break;
index 12b6b26..73f8f67 100644 (file)
@@ -4,7 +4,7 @@
 static UINT WindowCount;
 LRESULT WINAPI MultiWndProc(HWND, UINT, WPARAM, LPARAM);
 
 static UINT WindowCount;
 LRESULT WINAPI MultiWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
index 9faab02..2f7f923 100644 (file)
@@ -19,10 +19,10 @@ int main( int argc, char **argv ) {
 
   GetNetworkParams(pFixedInfo,&OutBufLen);
 
 
   GetNetworkParams(pFixedInfo,&OutBufLen);
 
-  for( Addr = &pFixedInfo->DnsServerList; 
+  for( Addr = &pFixedInfo->DnsServerList;
        Addr;
        Addr = Addr->Next ) {
        Addr;
        Addr = Addr->Next ) {
-    printf( "%c%s\n", 
+    printf( "%c%s\n",
            Addr == pFixedInfo->CurrentDnsServer ? '*' : ' ',
            Addr->IpAddress.String );
   }
            Addr == pFixedInfo->CurrentDnsServer ? '*' : ' ',
            Addr->IpAddress.String );
   }
index aca7050..f5819da 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: noexecute.c,v 1.1 2004/10/21 04:59:00 sedwards Exp $
+ * $Id$
  */
 
 #include <stdio.h>
  */
 
 #include <stdio.h>
index 0969b42..70ed6d5 100644 (file)
@@ -91,7 +91,7 @@ VOID InstanceThread (LPVOID lpvParam)
    DWORD cbBytesRead, cbReplyBytes, cbWritten;
    BOOL fSuccess;
    HANDLE hPipe;
    DWORD cbBytesRead, cbReplyBytes, cbWritten;
    BOOL fSuccess;
    HANDLE hPipe;
-   
+
    hPipe = (HANDLE)lpvParam;
    while (1)
      {
    hPipe = (HANDLE)lpvParam;
    while (1)
      {
index 7ffa852..786eb30 100644 (file)
@@ -50,7 +50,7 @@ void DoBlt(HBITMAP hBM)
 
        hDC = GetDC(ActiveWindow);
        GetClientRect(ActiveWindow,&dest);
 
        hDC = GetDC(ActiveWindow);
        GetClientRect(ActiveWindow,&dest);
-       
+
        Context = CreateCompatibleDC(0);
        dflBmp = SelectObject(Context, hBM);
        BitBlt(hDC, 0, 0, dest.right, dest.bottom, Context, 0, 0, SRCCOPY);
        Context = CreateCompatibleDC(0);
        dflBmp = SelectObject(Context, hBM);
        BitBlt(hDC, 0, 0, dest.right, dest.bottom, Context, 0, 0, SRCCOPY);
@@ -73,7 +73,7 @@ void UpdatePalette(HBITMAP hBM){
                else
                        c++; // It's operation of incrementing of c variable, not reference of a cool OO language :-)
        }
                else
                        c++; // It's operation of incrementing of c variable, not reference of a cool OO language :-)
        }
-       
+
        DoBlt(hBM);
 }
 
        DoBlt(hBM);
 }
 
@@ -117,13 +117,13 @@ void InitBitmap(HANDLE *hBM){
 
        // Create palette
        PalHan = CreatePalette((LOGPALETTE*)&palInf);
 
        // Create palette
        PalHan = CreatePalette((LOGPALETTE*)&palInf);
-       
+
        // Select it into hDC
        SelectPalette(hDC,PalHan,FALSE);
        // Select it into hDC
        SelectPalette(hDC,PalHan,FALSE);
-       
+
        // Realize palette in hDC
        RealizePalette(hDC);
        // Realize palette in hDC
        RealizePalette(hDC);
-       
+
        // Delete handle to palette
        DeleteObject(PalHan);
 
        // Delete handle to palette
        DeleteObject(PalHan);
 
@@ -179,14 +179,14 @@ int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance, LPSTR lpszCmdPar
        ShowWindow(hWnd,nCmdShow);
 
        // Prepare bitmap to be bitblt
        ShowWindow(hWnd,nCmdShow);
 
        // Prepare bitmap to be bitblt
-       InitBitmap(&hBM);       
+       InitBitmap(&hBM);
 
        // Main message loop
        while (!exit)
        {
                UpdatePalette(hBM);
                Sleep(200);
 
        // Main message loop
        while (!exit)
        {
                UpdatePalette(hBM);
                Sleep(200);
-               
+
                if(PeekMessage(&msg,0,0,0,PM_NOREMOVE) == TRUE)
                {
                        if (!GetMessage(&msg,0,0,0))
                if(PeekMessage(&msg,0,0,0,PM_NOREMOVE) == TRUE)
                {
                        if (!GetMessage(&msg,0,0,0))
index e6a33c2..5fc41f3 100644 (file)
@@ -5,7 +5,7 @@
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
 
 LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -77,11 +77,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
     {
       POINT pos;
       HMENU Menu;
     {
       POINT pos;
       HMENU Menu;
-      
+
       pos.x = LOWORD(lParam);
       pos.y = HIWORD(lParam);
       ClientToScreen(hWnd, &pos);
       pos.x = LOWORD(lParam);
       pos.y = HIWORD(lParam);
       ClientToScreen(hWnd, &pos);
-      
+
       if((Menu = GetMenu(hWnd)) && (Menu = GetSubMenu(Menu, 1)))
       {
         TrackPopupMenu(Menu, 0, pos.x, pos.y, 0, hWnd, NULL);
       if((Menu = GetMenu(hWnd)) && (Menu = GetSubMenu(Menu, 1)))
       {
         TrackPopupMenu(Menu, 0, pos.x, pos.y, 0, hWnd, NULL);
index 98c164c..b84f894 100644 (file)
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
@@ -28,8 +28,8 @@ static const ULONG FS_UNDERLINE = 0x00000004;
 static const ULONG FS_STRIKEOUT = 0x00000008;
 
 // creates a logical font
 static const ULONG FS_STRIKEOUT = 0x00000008;
 
 // creates a logical font
-HFONT MakeFont(IN HDC hDestDC, IN LPCSTR typeface_name, 
-   IN int point_size, IN const BYTE charset = ANSI_CHARSET, 
+HFONT MakeFont(IN HDC hDestDC, IN LPCSTR typeface_name,
+   IN int point_size, IN const BYTE charset = ANSI_CHARSET,
    IN const DWORD style = FS_NONE);
 
 }
    IN const DWORD style = FS_NONE);
 
 }
index f91a2c1..23cf8e4 100644 (file)
@@ -6,7 +6,7 @@ int main(int argc, char* argv[])
 {
    int x;
    PTEB Teb;
 {
    int x;
    PTEB Teb;
-   
+
    printf("TEB dumpper\n");
    __asm__("movl %%fs:0x18, %0\n\t"
           : "=a" (x)
    printf("TEB dumpper\n");
    __asm__("movl %%fs:0x18, %0\n\t"
           : "=a" (x)
index 30e288e..13ea7a1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: regcmds.c,v 1.1 2004/10/21 04:59:00 sedwards Exp $
+/* $Id$
  *
  *  ReactOS regedit
  *
  *
  *  ReactOS regedit
  *
index ed8b29b..d133958 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: regdump.c,v 1.1 2004/10/21 04:59:00 sedwards Exp $
+/* $Id$
  *
  *  ReactOS regedit
  *
  *
  *  ReactOS regedit
  *
index 6fb0a2d..56832b9 100644 (file)
@@ -44,7 +44,7 @@
 #include <process.h>
 #include <stdio.h>
 #include <wchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <wchar.h>
-    
+
 #include <ctype.h>
 #include <limits.h>
 #include <winnt.h>
 #include <ctype.h>
 #include <limits.h>
 #include <winnt.h>
@@ -112,9 +112,9 @@ static HKEY reg_class_keys[REG_CLASS_NUMBER] = {
 #endif
 
 #ifdef UNICODE
 #endif
 
 #ifdef UNICODE
-#define _TEOF WEOF 
+#define _TEOF WEOF
 #else
 #else
-#define _TEOF EOF 
+#define _TEOF EOF
 #endif
 
 /******************************************************************************
 #endif
 
 /******************************************************************************
index 008d8c3..b482cd3 100644 (file)
@@ -18,8 +18,8 @@ int main( int argc, char **argv ) {
     printf( "Returns an HKEY_LOCAL_MACHINE value from the given key.\n" );
     return 1;
   }
     printf( "Returns an HKEY_LOCAL_MACHINE value from the given key.\n" );
     return 1;
   }
-  
-  if ( RegOpenKeyExA( HKEY_LOCAL_MACHINE, argv[1], 0, KEY_READ, &RegKey ) 
+
+  if ( RegOpenKeyExA( HKEY_LOCAL_MACHINE, argv[1], 0, KEY_READ, &RegKey )
       != 0 ) {
     printf( "Could not open key %s\n", argv[1] );
     return 2;
       != 0 ) {
     printf( "Could not open key %s\n", argv[1] );
     return 2;
@@ -33,17 +33,17 @@ int main( int argc, char **argv ) {
     printf( "The value %S does not exist.\n", ValueNameWC );
     return 5;
   }
     printf( "The value %S does not exist.\n", ValueNameWC );
     return 5;
   }
-  
+
   WcharResult = malloc( (ResultSize + 1) * sizeof(WCHAR) );
   WcharResult = malloc( (ResultSize + 1) * sizeof(WCHAR) );
-  
+
   if( !WcharResult ) {
     printf( "Could not alloc %d wchars\n", (int)(ResultSize + 1) );
     return 6;
   }
 
   if( !WcharResult ) {
     printf( "Could not alloc %d wchars\n", (int)(ResultSize + 1) );
     return 6;
   }
 
-  RegQueryValueExW( RegKey, ValueNameWC, NULL, NULL, (LPBYTE)WcharResult, 
+  RegQueryValueExW( RegKey, ValueNameWC, NULL, NULL, (LPBYTE)WcharResult,
                    &ResultSize );
                    &ResultSize );
-  
+
   printf( "wchar Value: %S\n", WcharResult );
   fflush( stdout );
 
   printf( "wchar Value: %S\n", WcharResult );
   fflush( stdout );
 
@@ -57,7 +57,7 @@ int main( int argc, char **argv ) {
   }
 
   RegQueryValueExA( RegKey, argv[2], NULL, NULL, CharResult, &ResultSize );
   }
 
   RegQueryValueExA( RegKey, argv[2], NULL, NULL, CharResult, &ResultSize );
-  
+
   printf( " char Value: %s\n", CharResult );
   fflush( stdout );
 
   printf( " char Value: %s\n", CharResult );
   fflush( stdout );
 
index ca867d2..5f93fd3 100644 (file)
@@ -53,8 +53,8 @@ void do_enumeratekey(PWSTR Name)
 void test1(void)
 {
  HKEY hKey = NULL, hKey1;
 void test1(void)
 {
  HKEY hKey = NULL, hKey1;
- OBJECT_ATTRIBUTES ObjectAttributes; 
- NTSTATUS Status; 
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ NTSTATUS Status;
  UNICODE_STRING KeyName = ROS_STRING_INITIALIZER(L"\\Registry");
  ULONG Index,Length,i;
  KEY_BASIC_INFORMATION KeyInformation[5];
  UNICODE_STRING KeyName = ROS_STRING_INITIALIZER(L"\\Registry");
  ULONG Index,Length,i;
  KEY_BASIC_INFORMATION KeyInformation[5];
@@ -173,9 +173,9 @@ void test1(void)
 void test2(void)
 {
  HKEY hKey,hKey1;
 void test2(void)
 {
  HKEY hKey,hKey1;
- OBJECT_ATTRIBUTES ObjectAttributes; 
+ OBJECT_ATTRIBUTES ObjectAttributes;
  UNICODE_STRING KeyName,ValueName;
  UNICODE_STRING KeyName,ValueName;
- NTSTATUS Status; 
+ NTSTATUS Status;
  KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
  ULONG Index,Length,i;
  char Buffer[10];
  KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
  ULONG Index,Length,i;
  char Buffer[10];
@@ -295,9 +295,9 @@ void test2(void)
 void test3(void)
 {
  HKEY hKey,hKey1;
 void test3(void)
 {
  HKEY hKey,hKey1;
- OBJECT_ATTRIBUTES ObjectAttributes; 
+ OBJECT_ATTRIBUTES ObjectAttributes;
  UNICODE_STRING KeyName,ValueName;
  UNICODE_STRING KeyName,ValueName;
- NTSTATUS Status; 
+ NTSTATUS Status;
  KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
  ULONG Index,Length,i;
  char Buffer[10];
  KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
  ULONG Index,Length,i;
  char Buffer[10];
@@ -447,7 +447,7 @@ void test4(void)
                            L"System\\Setup",
                            0,
                            KEY_ALL_ACCESS,
                            L"System\\Setup",
                            0,
                            KEY_ALL_ACCESS,
-                           &hKey1); 
+                           &hKey1);
   dprintf("\t\tdwError =%x\n",dwError);
   if (dwError == ERROR_SUCCESS)
     {
   dprintf("\t\tdwError =%x\n",dwError);
   if (dwError == ERROR_SUCCESS)
     {
@@ -476,7 +476,7 @@ void test4(void)
                            L"System\\ControlSet001\\Services\\Serial",
                            0,
                            KEY_ALL_ACCESS,
                            L"System\\ControlSet001\\Services\\Serial",
                            0,
                            KEY_ALL_ACCESS,
-                           &hKey); 
+                           &hKey);
    dprintf ("\t\t\t\t\tdwError %x\n", dwError);
    RegDataSize = sizeof(GlobalFifoEnable);
    if (dwError == ERROR_SUCCESS)
    dprintf ("\t\t\t\t\tdwError %x\n", dwError);
    RegDataSize = sizeof(GlobalFifoEnable);
    if (dwError == ERROR_SUCCESS)
@@ -611,7 +611,7 @@ void test6(void)
   HKEY hKey;
   OBJECT_ATTRIBUTES ObjectAttributes;
   UNICODE_STRING KeyName,ValueName;
   HKEY hKey;
   OBJECT_ATTRIBUTES ObjectAttributes;
   UNICODE_STRING KeyName,ValueName;
-  NTSTATUS Status; 
+  NTSTATUS Status;
   KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
   ULONG Length,i;
 
   KEY_VALUE_FULL_INFORMATION KeyValueInformation[5];
   ULONG Length,i;
 
@@ -720,7 +720,7 @@ void test7(void)
   HKEY hKey;
   OBJECT_ATTRIBUTES ObjectAttributes;
   UNICODE_STRING KeyName,ValueName;
   HKEY hKey;
   OBJECT_ATTRIBUTES ObjectAttributes;
   UNICODE_STRING KeyName,ValueName;
-  NTSTATUS Status; 
+  NTSTATUS Status;
 
   dprintf("Open link key\n");
   dprintf("  Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
 
   dprintf("Open link key\n");
   dprintf("  Key: \\Registry\\Machine\\SOFTWARE\\Test\n");
@@ -765,9 +765,9 @@ void test8(void)
  UNICODE_STRING KeyName;
  NTSTATUS Status;
  LONG dwError;
  UNICODE_STRING KeyName;
  NTSTATUS Status;
  LONG dwError;
- TOKEN_PRIVILEGES NewPrivileges; 
+ TOKEN_PRIVILEGES NewPrivileges;
  HANDLE Token,hKey;
  HANDLE Token,hKey;
- LUID Luid; 
+ LUID Luid;
  BOOLEAN bRes;
   Status=NtOpenProcessToken(GetCurrentProcess()
        ,TOKEN_ADJUST_PRIVILEGES,&Token);
  BOOLEAN bRes;
   Status=NtOpenProcessToken(GetCurrentProcess()
        ,TOKEN_ADJUST_PRIVILEGES,&Token);
@@ -775,24 +775,24 @@ void test8(void)
   dprintf("\t\t\t\tStatus =%x\n",Status);
 //  bRes=LookupPrivilegeValueA(NULL,SE_RESTORE_NAME,&Luid);
 //  dprintf("\t\t\t\tbRes =%x\n",bRes);
   dprintf("\t\t\t\tStatus =%x\n",Status);
 //  bRes=LookupPrivilegeValueA(NULL,SE_RESTORE_NAME,&Luid);
 //  dprintf("\t\t\t\tbRes =%x\n",bRes);
-  NewPrivileges.PrivilegeCount = 1; 
-  NewPrivileges.Privileges[0].Luid = Luid; 
+  NewPrivileges.PrivilegeCount = 1;
+  NewPrivileges.Privileges[0].Luid = Luid;
 //  NewPrivileges.Privileges[0].Luid.u.LowPart=18;
 //  NewPrivileges.Privileges[0].Luid.u.HighPart=0;
 //  NewPrivileges.Privileges[0].Luid.u.LowPart=18;
 //  NewPrivileges.Privileges[0].Luid.u.HighPart=0;
-  NewPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; 
-//  Status = NtAdjustPrivilegesToken( 
-  bRes = AdjustTokenPrivileges( 
-            Token, 
-            FALSE, 
-            &NewPrivileges, 
-            0, 
-            NULL, 
-            NULL 
-            ); 
+  NewPrivileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+
+//  Status = NtAdjustPrivilegesToken(
+  bRes = AdjustTokenPrivileges(
+            Token,
+            FALSE,
+            &NewPrivileges,
+            0,
+            NULL,
+            NULL
+            );
   dprintf("\t\t\t\tbRes =%x\n",bRes);
   dprintf("\t\t\t\tbRes =%x\n",bRes);
-//  Status=NtClose(Token); 
+
+//  Status=NtClose(Token);
 //  dprintf("\t\t\t\tStatus =%x\n",Status);
 
 
 //  dprintf("\t\t\t\tStatus =%x\n",Status);
 
 
@@ -824,8 +824,8 @@ void test8(void)
 void test9(void)
 {
     HKEY hKey = NULL, hKey1;
 void test9(void)
 {
     HKEY hKey = NULL, hKey1;
-    OBJECT_ATTRIBUTES ObjectAttributes; 
-    NTSTATUS Status; 
+    OBJECT_ATTRIBUTES ObjectAttributes;
+    NTSTATUS Status;
     UNICODE_STRING KeyName = ROS_STRING_INITIALIZER(L"\\Registry");
     ULONG Index,Length,i;
     KEY_BASIC_INFORMATION KeyInformation[5];
     UNICODE_STRING KeyName = ROS_STRING_INITIALIZER(L"\\Registry");
     ULONG Index,Length,i;
     KEY_BASIC_INFORMATION KeyInformation[5];
index 669848d..bb730a3 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sectest.c,v 1.1 2004/10/21 04:53:21 sedwards Exp $ */
+/* $Id$ */
 #define UNICODE
 #define _UNICODE
 #include <windows.h>
 #define UNICODE
 #define _UNICODE
 #include <windows.h>
@@ -10,25 +10,25 @@ int main(int argc, char* argv[])
   HANDLE hFile;
   HANDLE Section;
   PVOID BaseAddress;
   HANDLE hFile;
   HANDLE Section;
   PVOID BaseAddress;
-  
+
   printf("Section Test\n");
   printf("Section Test\n");
-  
+
   hFile = CreateFile(_T("sectest.txt"),
   hFile = CreateFile(_T("sectest.txt"),
-                    GENERIC_READ | GENERIC_WRITE, 
-                    0, 
-                    NULL, 
-                    CREATE_ALWAYS, 
-                    0, 
+                    GENERIC_READ | GENERIC_WRITE,
+                    0,
+                    NULL,
+                    CREATE_ALWAYS,
+                    0,
                     0);
   if (hFile == INVALID_HANDLE_VALUE)
     {
       printf("Failed to create file (err=%ld)", GetLastError());
       return 1;
     }
                     0);
   if (hFile == INVALID_HANDLE_VALUE)
     {
       printf("Failed to create file (err=%ld)", GetLastError());
       return 1;
     }
-  
+
   Section = CreateFileMapping(hFile,
                              NULL,
   Section = CreateFileMapping(hFile,
                              NULL,
-                             PAGE_READWRITE, 
+                             PAGE_READWRITE,
                              0,
                              4096,
                              NULL);
                              0,
                              4096,
                              NULL);
@@ -37,7 +37,7 @@ int main(int argc, char* argv[])
       printf("Failed to create section (err=%ld)", GetLastError());
       return 1;
     }
       printf("Failed to create section (err=%ld)", GetLastError());
       return 1;
     }
-  
+
   printf("Mapping view of section\n");
   BaseAddress = MapViewOfFile(Section,
                              FILE_MAP_ALL_ACCESS,
   printf("Mapping view of section\n");
   BaseAddress = MapViewOfFile(Section,
                              FILE_MAP_ALL_ACCESS,
@@ -50,24 +50,24 @@ int main(int argc, char* argv[])
       printf("Failed to map section (%ld)\n", GetLastError());
       return 1;
     }
       printf("Failed to map section (%ld)\n", GetLastError());
       return 1;
     }
-  
+
   printf("Clearing section\n");
   FillMemory(BaseAddress, 4096, ' ');
   printf("Copying test data to section\n");
   strcpy(BaseAddress, "test data");
   printf("Clearing section\n");
   FillMemory(BaseAddress, 4096, ' ');
   printf("Copying test data to section\n");
   strcpy(BaseAddress, "test data");
-  
+
   if (!UnmapViewOfFile(BaseAddress))
   if (!UnmapViewOfFile(BaseAddress))
-    {  
+    {
       printf("Failed to unmap view of file (%ld)\n", GetLastError());
       return 1;
     }
       printf("Failed to unmap view of file (%ld)\n", GetLastError());
       return 1;
     }
-  
+
   if (!CloseHandle(hFile))
   if (!CloseHandle(hFile))
-    {  
+    {
       printf("Failed to close file (%ld)\n", GetLastError());
       return 1;
     }
       printf("Failed to close file (%ld)\n", GetLastError());
       return 1;
     }
-  
+
   return 0;
 }
 
   return 0;
 }
 
index 693cfc3..8400a4c 100644 (file)
@@ -164,7 +164,7 @@ void shaptest( HDC hdc )
 }
 
 
 }
 
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -233,7 +233,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
   switch(msg)
   {
 
   switch(msg)
   {
-  
+
   case WM_PAINT:
     hDC = BeginPaint(hWnd, &ps);
     shaptest( hDC );
   case WM_PAINT:
     hDC = BeginPaint(hWnd, &ps);
     shaptest( hDC );
index 4b1f5da..f7ff5ac 100644 (file)
@@ -25,9 +25,9 @@ main(int argc, char* argv[])
    HANDLE Section;
    PVOID BaseAddress;
    char buffer[256];
    HANDLE Section;
    PVOID BaseAddress;
    char buffer[256];
-   
+
    printf("Shm test server\n");
    printf("Shm test server\n");
-   
+
    Section = OpenFileMappingW (
 //             PAGE_EXECUTE_READWRITE, invalid parameter
                FILE_MAP_WRITE,
    Section = OpenFileMappingW (
 //             PAGE_EXECUTE_READWRITE, invalid parameter
                FILE_MAP_WRITE,
@@ -39,7 +39,7 @@ main(int argc, char* argv[])
        printf("Failed to open section (err=%d)", GetLastError());
        return 1;
      }
        printf("Failed to open section (err=%d)", GetLastError());
        return 1;
      }
-   
+
    BaseAddress = MapViewOfFile(Section,
                               FILE_MAP_ALL_ACCESS,
                               0,
    BaseAddress = MapViewOfFile(Section,
                               FILE_MAP_ALL_ACCESS,
                               0,
@@ -54,7 +54,7 @@ main(int argc, char* argv[])
    printf("Copying from section\n");
    strcpy(buffer, BaseAddress);
    printf("Copyed <%s>\n", buffer);
    printf("Copying from section\n");
    strcpy(buffer, BaseAddress);
    printf("Copyed <%s>\n", buffer);
-   
+
 //   for(;;);
        return 0;
 }
 //   for(;;);
        return 0;
 }
index 427686c..79527ea 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: shmsrv.c,v 1.1 2004/10/21 04:59:01 sedwards Exp $
+/* $Id$
  *
  * FILE  : reactos/apps/shm/shmsrv.c
  * AUTHOR: David Welch
  *
  * FILE  : reactos/apps/shm/shmsrv.c
  * AUTHOR: David Welch
@@ -13,13 +13,13 @@ int main(int argc, char* argv[])
 {
    HANDLE Section;
    PVOID BaseAddress;
 {
    HANDLE Section;
    PVOID BaseAddress;
-   
+
    printf("Shm test server\n");
    printf("Shm test server\n");
-   
+
    Section = CreateFileMappingW (
                        (HANDLE) 0xFFFFFFFF,
                        NULL,
    Section = CreateFileMappingW (
                        (HANDLE) 0xFFFFFFFF,
                        NULL,
-                       PAGE_READWRITE, 
+                       PAGE_READWRITE,
                        0,
                        8192,
                        L"TestSection"
                        0,
                        8192,
                        L"TestSection"
@@ -29,7 +29,7 @@ int main(int argc, char* argv[])
        printf("Failed to create section (err=%d)", GetLastError());
        return 1;
      }
        printf("Failed to create section (err=%d)", GetLastError());
        return 1;
      }
-   
+
    printf("Mapping view of section\n");
    BaseAddress = MapViewOfFile(Section,
                               FILE_MAP_ALL_ACCESS,
    printf("Mapping view of section\n");
    BaseAddress = MapViewOfFile(Section,
                               FILE_MAP_ALL_ACCESS,
@@ -41,11 +41,11 @@ int main(int argc, char* argv[])
      {
        printf("Failed to map section\n");
      }
      {
        printf("Failed to map section\n");
      }
-   
+
    printf("Copying to section\n");
    printf("Copying %s\n", GetCommandLineA());
    strcpy(BaseAddress, GetCommandLineA());
    printf("Copying to section\n");
    printf("Copying %s\n", GetCommandLineA());
    strcpy(BaseAddress, GetCommandLineA());
-   
+
    Sleep(INFINITE);
 
    return 0;
    Sleep(INFINITE);
 
    return 0;
index 9340e74..db299a4 100644 (file)
@@ -8,7 +8,7 @@ LRESULT WINAPI AnsiSubclassProc(HWND, UINT, WPARAM, LPARAM);
 static WNDPROC SavedWndProcW;
 static WNDPROC SavedWndProcA;
 
 static WNDPROC SavedWndProcW;
 static WNDPROC SavedWndProcA;
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
index 10eda65..8f1d6b8 100644 (file)
@@ -1,9 +1,9 @@
-/* tcpServer.c 
+/* tcpServer.c
  *
  * Simple Winsock TCP server test.
  *
  * Simple Winsock TCP server test.
- * Later will be used as base for ReactOS telnetd  
- * 
- * HISTORY: 
+ * Later will be used as base for ReactOS telnetd
+ *
+ * HISTORY:
  * 6-15-02 - Added Winsock support to UNIX tcp test
  * 6-16-02 - Removed Unix support
  * 6-17-02 - Added extra comments to code
  * 6-15-02 - Added Winsock support to UNIX tcp test
  * 6-16-02 - Removed Unix support
  * 6-17-02 - Added extra comments to code
 int read_line();
 
 int main (int argc, char *argv[]) {
 int read_line();
 
 int main (int argc, char *argv[]) {
-  
+
   WORD       wVersionRequested;
   WSADATA    WsaData;
   INT       Status;
   int sd, newSd, cliLen;
 
   struct sockaddr_in cliAddr, servAddr;
   WORD       wVersionRequested;
   WSADATA    WsaData;
   INT       Status;
   int sd, newSd, cliLen;
 
   struct sockaddr_in cliAddr, servAddr;
-  char line[MAX_MSG]; 
+  char line[MAX_MSG];
 
     wVersionRequested = MAKEWORD(2, 2);
 
     wVersionRequested = MAKEWORD(2, 2);
+
     Status = WSAStartup(wVersionRequested, &WsaData);
     if (Status != 0) {
     Status = WSAStartup(wVersionRequested, &WsaData);
     if (Status != 0) {
-        printf("Could not initialize winsock dll.\n"); 
+        printf("Could not initialize winsock dll.\n");
         return FALSE;
     }
 
         return FALSE;
     }
 
@@ -51,12 +51,12 @@ int main (int argc, char *argv[]) {
     WSACleanup();
     return ERROR;
   }
     WSACleanup();
     return ERROR;
   }
-  
+
   /* bind server port */
   servAddr.sin_family = AF_INET;
   servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
   servAddr.sin_port = htons(SERVER_PORT);
   /* bind server port */
   servAddr.sin_family = AF_INET;
   servAddr.sin_addr.s_addr = htonl(INADDR_ANY);
   servAddr.sin_port = htons(SERVER_PORT);
-  
+
   if(bind(sd, (struct sockaddr *) &servAddr, sizeof(servAddr))<0) {
     perror("cannot bind port ");
     WSACleanup();
   if(bind(sd, (struct sockaddr *) &servAddr, sizeof(servAddr))<0) {
     perror("cannot bind port ");
     WSACleanup();
@@ -64,7 +64,7 @@ int main (int argc, char *argv[]) {
   }
 
   listen(sd,5);
   }
 
   listen(sd,5);
-  
+
   while(1) {
 
     printf("%s: \n"
   while(1) {
 
     printf("%s: \n"
@@ -79,21 +79,21 @@ int main (int argc, char *argv[]) {
       WSACleanup();
       return ERROR;
     }
       WSACleanup();
       return ERROR;
     }
-    
+
     /* init line */
     memset(line,0x0,MAX_MSG);
     /* init line */
     memset(line,0x0,MAX_MSG);
-    
+
     /* receive segments */
     while(read_line(newSd,line)!=ERROR) {
     /* receive segments */
     while(read_line(newSd,line)!=ERROR) {
-      
-      printf("%s: received from %s:TCP%d : %s\n", argv[0], 
+
+      printf("%s: received from %s:TCP%d : %s\n", argv[0],
             inet_ntoa(cliAddr.sin_addr),
             ntohs(cliAddr.sin_port), line);
       /* init line */
       memset(line,0x0,MAX_MSG);
             inet_ntoa(cliAddr.sin_addr),
             ntohs(cliAddr.sin_port), line);
       /* init line */
       memset(line,0x0,MAX_MSG);
-      
+
     } /* while(read_line) */
     } /* while(read_line) */
-    
+
   } /* while (1) */
 
 }
   } /* while (1) */
 
 }
@@ -112,11 +112,11 @@ int main (int argc, char *argv[]) {
 /* You can set END_CHAR to whatever means endofline for you. (0x0A is \n)*/
 /* read_lin returns the number of bytes returned in line_to_return       */
 int read_line(int newSd, char *line_to_return) {
 /* You can set END_CHAR to whatever means endofline for you. (0x0A is \n)*/
 /* read_lin returns the number of bytes returned in line_to_return       */
 int read_line(int newSd, char *line_to_return) {
-  
+
   static int rcv_ptr=0;
   static char rcv_msg[MAX_MSG];
   static int n;
   static int rcv_ptr=0;
   static char rcv_msg[MAX_MSG];
   static int n;
-  int offset;  
+  int offset;
 
   offset=0;
 
 
   offset=0;
 
@@ -135,7 +135,7 @@ int read_line(int newSd, char *line_to_return) {
        return ERROR;
       }
     }
        return ERROR;
       }
     }
-  
+
     /* if new data read on socket */
     /* OR */
     /* if another line is still in buffer */
     /* if new data read on socket */
     /* OR */
     /* if another line is still in buffer */
@@ -146,15 +146,15 @@ int read_line(int newSd, char *line_to_return) {
       offset++;
       rcv_ptr++;
     }
       offset++;
       rcv_ptr++;
     }
-    
+
     /* end of line + end of buffer => return line */
     /* end of line + end of buffer => return line */
-    if(rcv_ptr==n-1) { 
+    if(rcv_ptr==n-1) {
       /* set last byte to END_LINE */
       *(line_to_return+offset)=END_LINE;
       rcv_ptr=0;
       return ++offset;
       /* set last byte to END_LINE */
       *(line_to_return+offset)=END_LINE;
       rcv_ptr=0;
       return ++offset;
-    } 
-    
+    }
+
     /* end of line but still some data in buffer => return line */
     if(rcv_ptr <n-1) {
       /* set last byte to END_LINE */
     /* end of line but still some data in buffer => return line */
     if(rcv_ptr <n-1) {
       /* set last byte to END_LINE */
@@ -167,9 +167,9 @@ int read_line(int newSd, char *line_to_return) {
     /*  wait for more data to arrive on socket */
     if(rcv_ptr == n) {
       rcv_ptr = 0;
     /*  wait for more data to arrive on socket */
     if(rcv_ptr == n) {
       rcv_ptr = 0;
-    } 
-    
+    }
+
   } /* while */
 }
   } /* while */
 }
-  
-  
+
+
index 986de45..eb46a74 100644 (file)
@@ -38,7 +38,7 @@ main(int argc, char *argv[])
   DWORD z = 0;
 
   context.ContextFlags=CONTEXT_CONTROL;
   DWORD z = 0;
 
   context.ContextFlags=CONTEXT_CONTROL;
-  
+
   while (z < 50)
     {
       z++;
   while (z < 50)
     {
       z++;
@@ -48,15 +48,15 @@ main(int argc, char *argv[])
                          NULL,
                          0,
                          &thread_id);
                          NULL,
                          0,
                          &thread_id);
-      
+
       if(!thread)
        {
          printf("Error: could not create thread ...\n");
          ExitProcess(0);
        }
       if(!thread)
        {
          printf("Error: could not create thread ...\n");
          ExitProcess(0);
        }
-      
+
       Sleep(1000);
       Sleep(1000);
-      
+
       printf("T");
       if ((z % 5) == 0)
        {
       printf("T");
       if ((z % 5) == 0)
        {
@@ -67,7 +67,7 @@ main(int argc, char *argv[])
       printf("S");
       SuspendThread(thread);
       printf("R");
       printf("S");
       SuspendThread(thread);
       printf("R");
-      ResumeThread(thread);      
+      ResumeThread(thread);
       TerminateThread(thread, 0);
     }
 
       TerminateThread(thread, 0);
     }
 
index 38df7a2..d906264 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: thread.c,v 1.1 2004/10/21 04:48:45 sedwards Exp $
+/* $Id$
  *
  *
  *
  *
  *
  *
@@ -16,7 +16,7 @@ ULONG nr;
 DWORD WINAPI thread_main1(LPVOID param)
 {
    ULONG s;
 DWORD WINAPI thread_main1(LPVOID param)
 {
    ULONG s;
-   
+
    printf("Thread %ld running\n", (DWORD)param);
    s = nr = ((nr * 1103515245) + 12345) & 0x7fffffff;
    s = s % 10;
    printf("Thread %ld running\n", (DWORD)param);
    s = nr = ((nr * 1103515245) + 12345) & 0x7fffffff;
    s = s % 10;
@@ -51,11 +51,11 @@ int main (int argc, char* argv[])
    //          showHelp();
    //          return 1;
    //   }
    //          showHelp();
    //          return 1;
    //   }
-               
+
    //   nr = atoi(argv[1]);
    nr = 500;
    printf("Seed %ld\n", nr);
    //   nr = atoi(argv[1]);
    nr = 500;
    printf("Seed %ld\n", nr);
-   
+
    printf("Creating %d threads...\n",NR_THREADS*2);
    for (i=0;i<NR_THREADS;i++)
      {
    printf("Creating %d threads...\n",NR_THREADS*2);
    for (i=0;i<NR_THREADS;i++)
      {
index dc8359b..cbb2221 100644 (file)
@@ -91,7 +91,7 @@ int main( int argc, char **argv )
        assert( PostThreadMessage( id, WM_QUIT, 0,0 ) );
 
        WaitForSingleObject( hOkToTerminate, INFINITE );
        assert( PostThreadMessage( id, WM_QUIT, 0,0 ) );
 
        WaitForSingleObject( hOkToTerminate, INFINITE );
-       printf( "Test complete.\n" );   
+       printf( "Test complete.\n" );
 
        return 0;
 }
 
        return 0;
 }
index 5dd2df7..d7c4f4b 100644 (file)
@@ -24,34 +24,34 @@ VOID RunTests(VOID)
 {
   int i, nTests;
   static HANDLE hEvent;
 {
   int i, nTests;
   static HANDLE hEvent;
-  
+
   hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
   if(hEvent == NULL)
   {
     _tprintf(_T("Unable to create event!"));
     return;
   }
   hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
   if(hEvent == NULL)
   {
     _tprintf(_T("Unable to create event!"));
     return;
   }
-  
+
   nTests = sizeof(Tests) / sizeof(TEST);
   nTests = sizeof(Tests) / sizeof(TEST);
-  
+
   for(i = 0; i < nTests; i++)
   {
     Tests[i].id = i + 1;
   for(i = 0; i < nTests; i++)
   {
     Tests[i].id = i + 1;
-    
+
     if(Tests[i].Routine == NULL)
     {
       continue;
     }
     if(Tests[i].Routine == NULL)
     {
       continue;
     }
-    
+
     _tprintf(_T("+++ TEST %d: %s\n"), Tests[i].id, Tests[i].description);
     _tprintf(_T("+++ TEST %d: %s\n"), Tests[i].id, Tests[i].description);
-    
+
     Tests[i].Routine(&Tests[i], hEvent);
     Tests[i].Routine(&Tests[i], hEvent);
-    
+
     WaitForSingleObject(hEvent, INFINITE);
     WaitForSingleObject(hEvent, INFINITE);
-    
+
     _tprintf(_T("\n\n"));
   }
     _tprintf(_T("\n\n"));
   }
-  
+
   CloseHandle(hEvent);
 }
 
   CloseHandle(hEvent);
 }
 
@@ -59,9 +59,9 @@ VOID PrintTestResults(VOID)
 {
   int i, nTests, nsuccess = 0, nfailed = 0;
   TCHAR *status;
 {
   int i, nTests, nsuccess = 0, nfailed = 0;
   TCHAR *status;
-  
+
   nTests = sizeof(Tests) / sizeof(TEST);
   nTests = sizeof(Tests) / sizeof(TEST);
-  
+
   for(i = 0; i < nTests; i++)
   {
     if(Tests[i].Routine == NULL)
   for(i = 0; i < nTests; i++)
   {
     if(Tests[i].Routine == NULL)
@@ -78,10 +78,10 @@ VOID PrintTestResults(VOID)
       status = _T("FAILED ");
       nfailed++;
     }
       status = _T("FAILED ");
       nfailed++;
     }
-    
+
     _tprintf(_T("Test %d: %s %s\n"), i, status, Tests[i].description);
   }
     _tprintf(_T("Test %d: %s %s\n"), i, status, Tests[i].description);
   }
-  
+
   _tprintf(_T("\nTests succeeded: %d, failed: %d\n"), nsuccess, nfailed);
   if(nfailed == 0)
   {
   _tprintf(_T("\nTests succeeded: %d, failed: %d\n"), nsuccess, nfailed);
   if(nfailed == 0)
   {
@@ -106,7 +106,7 @@ typedef struct _TESTINFO
     } Test1;
     struct
     {
     } Test1;
     struct
     {
-      HANDLE hWaitEvent; 
+      HANDLE hWaitEvent;
     } Test2;
     struct
     {
     } Test2;
     struct
     {
@@ -119,13 +119,13 @@ typedef struct _TESTINFO
 VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
 {
   PTESTINFO Info = (PTESTINFO)Param;
 VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
 {
   PTESTINFO Info = (PTESTINFO)Param;
-  
+
   _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
   _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
-  
+
   if(Info->secsleft == 0)
   {
     BOOL stat;
   if(Info->secsleft == 0)
   {
     BOOL stat;
-    
+
     _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Info->Test->id);
     stat = DeleteTimerQueueTimer(NULL, Info->hTimer, NULL);
     if(stat)
     _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Info->Test->id);
     stat = DeleteTimerQueueTimer(NULL, Info->hTimer, NULL);
     if(stat)
@@ -133,7 +133,7 @@ VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
     else
     {
       int error = GetLastError();
     else
     {
       int error = GetLastError();
-      
+
       switch(error)
       {
         case ERROR_IO_PENDING:
       switch(error)
       {
         case ERROR_IO_PENDING:
@@ -146,7 +146,7 @@ VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
           break;
       }
     }
           break;
       }
     }
-    
+
     /* set the event to continue tests */
     SetEvent(Info->hEvent);
   }
     /* set the event to continue tests */
     SetEvent(Info->hEvent);
   }
@@ -155,11 +155,11 @@ VOID CALLBACK TimerCallback1(PVOID Param, BOOLEAN Fired)
 VOID Test1(PTEST Test, HANDLE hEvent)
 {
   static TESTINFO Info;
 VOID Test1(PTEST Test, HANDLE hEvent)
 {
   static TESTINFO Info;
-  
+
   Info.Test = Test;
   Info.hEvent = hEvent;
   Info.secsleft = N_TIMEOUT;
   Info.Test = Test;
   Info.hEvent = hEvent;
   Info.secsleft = N_TIMEOUT;
-  
+
   if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback1, &Info, 1000, 1000, 0))
   {
     _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
   if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback1, &Info, 1000, 1000, 0))
   {
     _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
@@ -167,7 +167,7 @@ VOID Test1(PTEST Test, HANDLE hEvent)
     SetEvent(hEvent);
     return;
   }
     SetEvent(hEvent);
     return;
   }
-  
+
   _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Info.Test->id, (int)Info.hTimer, (int)Info.secsleft);
 }
 
   _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Info.Test->id, (int)Info.hTimer, (int)Info.secsleft);
 }
 
@@ -176,16 +176,16 @@ VOID Test1(PTEST Test, HANDLE hEvent)
 VOID CALLBACK TimerCallback2(PVOID Param, BOOLEAN Fired)
 {
   PTESTINFO Info = (PTESTINFO)Param;
 VOID CALLBACK TimerCallback2(PVOID Param, BOOLEAN Fired)
 {
   PTESTINFO Info = (PTESTINFO)Param;
-  
+
   _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
   _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
-  
+
   if(Info->secsleft == 0)
   {
     /* set the event to continue tests */
     SetEvent(Info->Test2.hWaitEvent);
   if(Info->secsleft == 0)
   {
     /* set the event to continue tests */
     SetEvent(Info->Test2.hWaitEvent);
-    
+
     /* sleep a bit */
     /* sleep a bit */
-    Sleep(1500);       
+    Sleep(1500);
   }
 }
 
   }
 }
 
@@ -193,32 +193,32 @@ VOID Test2(PTEST Test, HANDLE hEvent)
 {
   static TESTINFO Info;
   BOOL stat;
 {
   static TESTINFO Info;
   BOOL stat;
-  
+
   Info.Test = Test;
   Info.hEvent = hEvent;
   Info.secsleft = N_TIMEOUT;
   Info.Test = Test;
   Info.hEvent = hEvent;
   Info.secsleft = N_TIMEOUT;
-  
+
   Info.Test2.hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
   if(Info.Test2.hWaitEvent == NULL)
   {
     _tprintf(_T("[%d]Unable to create event!\n"), (int)Info.Test->id);
     return;
   }
   Info.Test2.hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
   if(Info.Test2.hWaitEvent == NULL)
   {
     _tprintf(_T("[%d]Unable to create event!\n"), (int)Info.Test->id);
     return;
   }
-  
+
   if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback2, &Info, 1000, 1000, 0))
   {
     _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
   if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback2, &Info, 1000, 1000, 0))
   {
     _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
-    
+
     CloseHandle(Info.Test2.hWaitEvent);
     /* we failed, set the event to continue tests */
     SetEvent(hEvent);
     return;
   }
     CloseHandle(Info.Test2.hWaitEvent);
     /* we failed, set the event to continue tests */
     SetEvent(hEvent);
     return;
   }
-  
+
   _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Test->id, (int)Info.hTimer, (int)Info.secsleft);
   _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Test->id, (int)Info.hTimer, (int)Info.secsleft);
-  
+
   WaitForSingleObject(Info.Test2.hWaitEvent, INFINITE);
   WaitForSingleObject(Info.Test2.hWaitEvent, INFINITE);
-  
+
   _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Test->id);
   stat = DeleteTimerQueueTimer(NULL, Info.hTimer, INVALID_HANDLE_VALUE);
   if(stat)
   _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Test->id);
   stat = DeleteTimerQueueTimer(NULL, Info.hTimer, INVALID_HANDLE_VALUE);
   if(stat)
@@ -230,7 +230,7 @@ VOID Test2(PTEST Test, HANDLE hEvent)
   else
   {
     int error = GetLastError();
   else
   {
     int error = GetLastError();
-    
+
     switch(error)
     {
       case ERROR_IO_PENDING:
     switch(error)
     {
       case ERROR_IO_PENDING:
@@ -241,7 +241,7 @@ VOID Test2(PTEST Test, HANDLE hEvent)
         break;
     }
   }
         break;
     }
   }
-  
+
   SetEvent(Info.hEvent);
 }
 
   SetEvent(Info.hEvent);
 }
 
@@ -250,16 +250,16 @@ VOID Test2(PTEST Test, HANDLE hEvent)
 VOID CALLBACK TimerCallback3(PVOID Param, BOOLEAN Fired)
 {
   PTESTINFO Info = (PTESTINFO)Param;
 VOID CALLBACK TimerCallback3(PVOID Param, BOOLEAN Fired)
 {
   PTESTINFO Info = (PTESTINFO)Param;
-  
+
   _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
   _tprintf(_T("[%d]TimerCallback(0x%x, %d) called (%d)\n"), (int)Info->Test->id, (int)Info->hTimer, (int)Fired, --Info->secsleft);
-  
+
   if(Info->secsleft == 0)
   {
     /* set the event to continue tests */
     SetEvent(Info->Test3.hWaitEvent);
   if(Info->secsleft == 0)
   {
     /* set the event to continue tests */
     SetEvent(Info->Test3.hWaitEvent);
-    
+
     /* sleep a bit */
     /* sleep a bit */
-    Sleep(1500);       
+    Sleep(1500);
   }
 }
 
   }
 }
 
@@ -267,40 +267,40 @@ VOID Test3(PTEST Test, HANDLE hEvent)
 {
   static TESTINFO Info;
   BOOL stat;
 {
   static TESTINFO Info;
   BOOL stat;
-  
+
   Info.Test = Test;
   Info.hEvent = hEvent;
   Info.secsleft = N_TIMEOUT;
   Info.Test = Test;
   Info.hEvent = hEvent;
   Info.secsleft = N_TIMEOUT;
-  
+
   Info.Test3.hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
   if(Info.Test3.hWaitEvent == NULL)
   {
     _tprintf(_T("[%d]Unable to create event!\n"), (int)Info.Test->id);
     return;
   }
   Info.Test3.hWaitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
   if(Info.Test3.hWaitEvent == NULL)
   {
     _tprintf(_T("[%d]Unable to create event!\n"), (int)Info.Test->id);
     return;
   }
-  
+
   Info.Test3.hNotification = CreateEvent(NULL, FALSE, FALSE, NULL);
   if(Info.Test3.hNotification == NULL)
   {
     _tprintf(_T("[%d]Unable to create notification event!\n"), (int)Info.Test->id);
     return;
   }
   Info.Test3.hNotification = CreateEvent(NULL, FALSE, FALSE, NULL);
   if(Info.Test3.hNotification == NULL)
   {
     _tprintf(_T("[%d]Unable to create notification event!\n"), (int)Info.Test->id);
     return;
   }
-  
+
   if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback3, &Info, 1000, 1000, 0))
   {
     _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
   if(!CreateTimerQueueTimer(&Info.hTimer, NULL, TimerCallback3, &Info, 1000, 1000, 0))
   {
     _tprintf(_T("[%d]CreateTimerQueueTimer() failed, LastError: %d!"), (int)Info.Test->id, (int)GetLastError());
-    
+
     CloseHandle(Info.Test3.hWaitEvent);
     CloseHandle(Info.Test3.hNotification);
     /* we failed, set the event to continue tests */
     SetEvent(hEvent);
     return;
   }
     CloseHandle(Info.Test3.hWaitEvent);
     CloseHandle(Info.Test3.hNotification);
     /* we failed, set the event to continue tests */
     SetEvent(hEvent);
     return;
   }
-  
+
   _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Test->id, (int)Info.hTimer, (int)Info.secsleft);
   _tprintf(_T("[%d]CreateTimerQueueTimer() created timer 0x%x, countdown (%d sec)...\n"), (int)Test->id, (int)Info.hTimer, (int)Info.secsleft);
-  
+
   WaitForSingleObject(Info.Test3.hWaitEvent, INFINITE);
   WaitForSingleObject(Info.Test3.hWaitEvent, INFINITE);
-  
+
   _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Test->id);
   stat = DeleteTimerQueueTimer(NULL, Info.hTimer, Info.Test3.hNotification);
   if(stat)
   _tprintf(_T("[%d]Timout finished, delete timer queue..."), (int)Test->id);
   stat = DeleteTimerQueueTimer(NULL, Info.hTimer, Info.Test3.hNotification);
   if(stat)
@@ -310,7 +310,7 @@ VOID Test3(PTEST Test, HANDLE hEvent)
   else
   {
     int error = GetLastError();
   else
   {
     int error = GetLastError();
-    
+
     switch(error)
     {
       case ERROR_IO_PENDING:
     switch(error)
     {
       case ERROR_IO_PENDING:
@@ -323,12 +323,12 @@ VOID Test3(PTEST Test, HANDLE hEvent)
         break;
     }
   }
         break;
     }
   }
-  
+
   WaitForSingleObject(Info.Test3.hNotification, INFINITE);
   WaitForSingleObject(Info.Test3.hNotification, INFINITE);
-  
+
   CloseHandle(Info.Test3.hWaitEvent);
   CloseHandle(Info.Test3.hNotification);
   CloseHandle(Info.Test3.hWaitEvent);
   CloseHandle(Info.Test3.hNotification);
-  
+
   SetEvent(Info.hEvent);
 }
 
   SetEvent(Info.hEvent);
 }
 
@@ -338,13 +338,13 @@ VOID
 InitTests(VOID)
 {
   ZeroMemory(Tests, sizeof(Tests));
 InitTests(VOID)
 {
   ZeroMemory(Tests, sizeof(Tests));
-  
+
   Tests[0].description = _T("non-blocking DeleteTimerQueueTimer() call from callback");
   Tests[0].Routine = Test1;
   Tests[0].description = _T("non-blocking DeleteTimerQueueTimer() call from callback");
   Tests[0].Routine = Test1;
-  
+
   Tests[1].description = _T("blocking DeleteTimerQueueTimer() call");
   Tests[1].Routine = Test2;
   Tests[1].description = _T("blocking DeleteTimerQueueTimer() call");
   Tests[1].Routine = Test2;
-  
+
   Tests[2].description = _T("blocking DeleteTimerQueueTimer() call with specified event");
   Tests[2].Routine = Test3;
 }
   Tests[2].description = _T("blocking DeleteTimerQueueTimer() call with specified event");
   Tests[2].Routine = Test3;
 }
@@ -352,14 +352,14 @@ InitTests(VOID)
 int main(int argc, char* argv[])
 {
   _tprintf(_T("+++ TimerQueue test running +++\n\n"));
 int main(int argc, char* argv[])
 {
   _tprintf(_T("+++ TimerQueue test running +++\n\n"));
-  
+
   InitTests();
   InitTests();
-  
-  RunTests(); 
-  
+
+  RunTests();
+
   _tprintf(_T("\n+++ RESULTS +++\n"));
   _tprintf(_T("\n+++ RESULTS +++\n"));
-  
+
   PrintTestResults();
   PrintTestResults();
-  
+
   return 0;
 }
   return 0;
 }
index f2a50f4..16c1f41 100644 (file)
@@ -111,7 +111,7 @@ ZwCreateToken(
 
 #define INITIAL_PRIV_ENABLED SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED
 #define INITIAL_PRIV_DISABLED 0
 
 #define INITIAL_PRIV_ENABLED SE_PRIVILEGE_ENABLED_BY_DEFAULT|SE_PRIVILEGE_ENABLED
 #define INITIAL_PRIV_DISABLED 0
-LUID_AND_ATTRIBUTES InitialPrivilegeSet[] = 
+LUID_AND_ATTRIBUTES InitialPrivilegeSet[] =
 {
        { { 0x00000007, 0x00000000 }, INITIAL_PRIV_ENABLED  },  // SeTcbPrivilege
        { { 0x00000002, 0x00000000 }, INITIAL_PRIV_DISABLED },  // SeCreateTokenPrivilege
 {
        { { 0x00000007, 0x00000000 }, INITIAL_PRIV_ENABLED  },  // SeTcbPrivilege
        { { 0x00000002, 0x00000000 }, INITIAL_PRIV_DISABLED },  // SeCreateTokenPrivilege
@@ -286,7 +286,7 @@ GetFromToken(HANDLE hToken, TOKEN_INFORMATION_CLASS tic)
                free(p);
                return 0;
        }
                free(p);
                return 0;
        }
-       
+
        return p;
 }
 
        return p;
 }
 
index 98c164c..b84f894 100644 (file)
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
@@ -28,8 +28,8 @@ static const ULONG FS_UNDERLINE = 0x00000004;
 static const ULONG FS_STRIKEOUT = 0x00000008;
 
 // creates a logical font
 static const ULONG FS_STRIKEOUT = 0x00000008;
 
 // creates a logical font
-HFONT MakeFont(IN HDC hDestDC, IN LPCSTR typeface_name, 
-   IN int point_size, IN const BYTE charset = ANSI_CHARSET, 
+HFONT MakeFont(IN HDC hDestDC, IN LPCSTR typeface_name,
+   IN int point_size, IN const BYTE charset = ANSI_CHARSET,
    IN const DWORD style = FS_NONE);
 
 }
    IN const DWORD style = FS_NONE);
 
 }
index ec7235c..95a8aa0 100644 (file)
@@ -5,7 +5,7 @@ int main()
 {
    PVOID Base;
    PVOID Ret;
 {
    PVOID Base;
    PVOID Ret;
-   
+
    Base = VirtualAlloc(NULL,
                       1048576,
                       MEM_RESERVE,
    Base = VirtualAlloc(NULL,
                       1048576,
                       MEM_RESERVE,
@@ -14,7 +14,7 @@ int main()
      {
        printf("VirtualAlloc failed 1\n");
      }
      {
        printf("VirtualAlloc failed 1\n");
      }
-   
+
    Ret = VirtualAlloc(Base + 4096,
                      4096,
                      MEM_COMMIT,
    Ret = VirtualAlloc(Base + 4096,
                      4096,
                      MEM_COMMIT,
@@ -23,7 +23,7 @@ int main()
      {
        printf("VirtualAlloc failed 2\n");
      }
      {
        printf("VirtualAlloc failed 2\n");
      }
-   
+
    Ret = VirtualAlloc(Base + 12288,
                      4096,
                      MEM_COMMIT,
    Ret = VirtualAlloc(Base + 12288,
                      4096,
                      MEM_COMMIT,
@@ -32,7 +32,7 @@ int main()
      {
        printf("VirtualAlloc failed 3\n");
      }
      {
        printf("VirtualAlloc failed 3\n");
      }
-   
+
    Ret = VirtualAlloc(Base + 20480,
                      4096,
                      MEM_COMMIT,
    Ret = VirtualAlloc(Base + 20480,
                      4096,
                      MEM_COMMIT,
@@ -41,7 +41,7 @@ int main()
      {
        printf("VirtualAlloc failed 4\n");
      }
      {
        printf("VirtualAlloc failed 4\n");
      }
-   
+
    Ret = VirtualAlloc(Base + 4096,
                      28672,
                      MEM_RESERVE,
    Ret = VirtualAlloc(Base + 4096,
                      28672,
                      MEM_RESERVE,
index e55df9d..184274f 100644 (file)
@@ -35,7 +35,7 @@ LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
 BOOLEAN bolWM_CHAR;
 BOOLEAN bolWM_KEYDOWN;
 
 BOOLEAN bolWM_CHAR;
 BOOLEAN bolWM_KEYDOWN;
 
-int WINAPI 
+int WINAPI
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
 WinMain(HINSTANCE hInstance,
        HINSTANCE hPrevInstance,
        LPSTR lpszCmdLine,
@@ -116,15 +116,15 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
 
        switch(msg)
        {
 
        switch(msg)
        {
-            
+
          case WM_CHAR:
          case WM_CHAR:
-         { 
-           
+         {
+
           hDC = GetDC(hWnd);
           TCHAR text[2];
           text[0] = (TCHAR)wParam;
           text[1] = _T('\0');
           hDC = GetDC(hWnd);
           TCHAR text[2];
           text[0] = (TCHAR)wParam;
           text[1] = _T('\0');
-                  
+
           //Write in window
           if( bolWM_KEYDOWN )
           {
           //Write in window
           if( bolWM_KEYDOWN )
           {
@@ -136,8 +136,8 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
                TextOut(hDC, 400, 10, "WM_CHAR:", strlen("WM_CHAR:"));
                bolWM_KEYDOWN = 1;
           }
                TextOut(hDC, 400, 10, "WM_CHAR:", strlen("WM_CHAR:"));
                bolWM_KEYDOWN = 1;
           }
-          TextOut(hDC, 530, 10, text, strlen(text)); 
-          
+          TextOut(hDC, 530, 10, text, strlen(text));
+
 #if 0
           // Make a line depending on the typed key
           Rect.left = 10;
 #if 0
           // Make a line depending on the typed key
           Rect.left = 10;
@@ -145,11 +145,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           Rect.right = 610;
           Rect.bottom = 85;
           FillRect(hDC, &Rect, hbrWhite);
           Rect.right = 610;
           Rect.bottom = 85;
           FillRect(hDC, &Rect, hbrWhite);
-             
+
           Rect.left=308;
           Rect.right=312;
           FillRect(hDC, &Rect, hbrRed);
           Rect.left=308;
           Rect.right=312;
           FillRect(hDC, &Rect, hbrRed);
-              
+
           Rect.left = 310;
           Rect.top = 75;
           Rect.right = 310 +text[0]*2;
           Rect.left = 310;
           Rect.top = 75;
           Rect.right = 310 +text[0]*2;
@@ -165,15 +165,15 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
         }
 
          case WM_KEYDOWN:
         }
 
          case WM_KEYDOWN:
-         { 
-           
+         {
+
           hDC = GetDC(hWnd);
           RECT Rect;
           TCHAR text[2];
           text[0] = (TCHAR)wParam;
           text[1] = _T('\0');
           hDC = GetDC(hWnd);
           RECT Rect;
           TCHAR text[2];
           text[0] = (TCHAR)wParam;
           text[1] = _T('\0');
-          
-          
+
+
           /* Write in window */
           Rect.left = 400;
           Rect.top = 50;
           /* Write in window */
           Rect.left = 400;
           Rect.top = 50;
@@ -196,14 +196,14 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
         }
 
          case WM_KEYUP:
         }
 
          case WM_KEYUP:
-         { 
-           
+         {
+
           hDC = GetDC(hWnd);
           RECT Rect;
           TCHAR text[2];
           text[0] = (TCHAR)wParam;
           text[1] = _T('\0');
           hDC = GetDC(hWnd);
           RECT Rect;
           TCHAR text[2];
           text[0] = (TCHAR)wParam;
           text[1] = _T('\0');
-          
+
 
           /* Write in window */
           Rect.left = 400;
 
           /* Write in window */
           Rect.left = 400;
@@ -212,7 +212,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           Rect.bottom = 70;
           FillRect(hDC, &Rect, hbrWhite);
           TextOut(hDC, 400, 50, "WM_KEYUP:", strlen("WM_KEYUP:"));
           Rect.bottom = 70;
           FillRect(hDC, &Rect, hbrWhite);
           TextOut(hDC, 400, 50, "WM_KEYUP:", strlen("WM_KEYUP:"));
-          TextOut(hDC, 530, 50, text, strlen(text)); 
+          TextOut(hDC, 530, 50, text, strlen(text));
           ReleaseDC(hWnd, hDC);
           return 0;
         }
           ReleaseDC(hWnd, hDC);
           return 0;
         }
@@ -225,13 +225,13 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
-          
+
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrRed);
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrRed);
-          
+
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
@@ -248,22 +248,22 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
-          
+
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrRed);
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrRed);
-          
+
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrGray);
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrGray);
-          
+
           ReleaseDC(hWnd, hDC);
           break;
           ReleaseDC(hWnd, hDC);
           break;
-        }        
+        }
         case WM_MBUTTONDOWN:
         {
           ULONG x, y;
         case WM_MBUTTONDOWN:
         {
           ULONG x, y;
@@ -271,19 +271,19 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
-          
+
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrBlue);
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrBlue);
-          
+
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrBlack);
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrBlack);
-          
+
           ReleaseDC(hWnd, hDC);
           break;
         }
           ReleaseDC(hWnd, hDC);
           break;
         }
@@ -294,20 +294,20 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
-          
+
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrBlue);
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrBlue);
-                   
+
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrGray);
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrGray);
-          
-          ReleaseDC(hWnd, hDC);            
+
+          ReleaseDC(hWnd, hDC);
           break;
          }
         case WM_RBUTTONDOWN:
           break;
          }
         case WM_RBUTTONDOWN:
@@ -317,19 +317,19 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
-           
+
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrYellow);
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrYellow);
-           
+
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrBlack);
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrBlack);
-          
+
           ReleaseDC(hWnd, hDC);
           break;
         }
           ReleaseDC(hWnd, hDC);
           break;
         }
@@ -340,25 +340,25 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
           hDC = GetDC(hWnd);
           x = LOWORD(lParam);
           y = HIWORD(lParam);
-         
+
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrYellow);
           Rect.left = x - 5;
           Rect.top = y - 5;
           Rect.right = x + 5;
           Rect.bottom = y + 5;
           FillRect(hDC, &Rect, hbrYellow);
-                   
+
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrGray);
           Rect.left = x - 3;
           Rect.top = y - 3;
           Rect.right = x + 3;
           Rect.bottom = y + 3;
           FillRect(hDC, &Rect, hbrGray);
-          
-          ReleaseDC(hWnd, hDC);            
+
+          ReleaseDC(hWnd, hDC);
           break;
         }
           break;
         }
-        
+
        case WM_MOUSEMOVE:
        case WM_MOUSEMOVE:
-         {  
+         {
           int fwKeys;
           int x;
           int y;
           int fwKeys;
           int x;
           int y;
@@ -367,16 +367,16 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          TCHAR text[256];
 
           hDC = GetDC(hWnd);
          TCHAR text[256];
 
           hDC = GetDC(hWnd);
-          fwKeys = wParam;        // key flags 
-          x = LOWORD(lParam);  // horizontal position of cursor 
-          y = HIWORD(lParam);  // vertical position of cursor 
-          
+          fwKeys = wParam;        // key flags
+          x = LOWORD(lParam);  // horizontal position of cursor
+          y = HIWORD(lParam);  // vertical position of cursor
+
           Rect.left = 10;
          Rect.top = 100;
          Rect.right = 160;
          Rect.bottom = 300;
          FillRect(hDC, &Rect, hbrWhite);
           Rect.left = 10;
          Rect.top = 100;
          Rect.right = 160;
          Rect.bottom = 300;
          FillRect(hDC, &Rect, hbrWhite);
-           
+
           temp = _sntprintf ( text, sizeof(text)/sizeof(*text), _T("x: %d"), x );
          TextOut(hDC,10,100,text,strlen(text));
           temp = _sntprintf ( text, sizeof(text)/sizeof(*text), _T("y: %d"), y );
           temp = _sntprintf ( text, sizeof(text)/sizeof(*text), _T("x: %d"), x );
          TextOut(hDC,10,100,text,strlen(text));
           temp = _sntprintf ( text, sizeof(text)/sizeof(*text), _T("y: %d"), y );
@@ -386,32 +386,32 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           Rect.top = y - 2;
           Rect.right = x + 2;
           Rect.bottom = y + 2;
           Rect.top = y - 2;
           Rect.right = x + 2;
           Rect.bottom = y + 2;
-         
+
           switch ( fwKeys )
           {
                 case MK_CONTROL:
           switch ( fwKeys )
           {
                 case MK_CONTROL:
-                       TextOut(hDC,10,140,"Control",strlen("Control"));       
+                       TextOut(hDC,10,140,"Control",strlen("Control"));
                        break;
                 case MK_SHIFT:
                        break;
                 case MK_SHIFT:
-                       TextOut(hDC,10,160,"Shift",strlen("Shift"));                     
+                       TextOut(hDC,10,160,"Shift",strlen("Shift"));
                        break;
                 case MK_LBUTTON:
                        break;
                 case MK_LBUTTON:
-                       TextOut(hDC,10,180,"Left",strlen("Left"));       
-                       FillRect(hDC, &Rect, hbrRed); 
+                       TextOut(hDC,10,180,"Left",strlen("Left"));
+                       FillRect(hDC, &Rect, hbrRed);
                        break;
                 case MK_MBUTTON:
                        break;
                 case MK_MBUTTON:
-                       TextOut(hDC,10,200,"Middle",strlen("Middle"));       
-                      FillRect(hDC, &Rect, hbrBlue); 
+                       TextOut(hDC,10,200,"Middle",strlen("Middle"));
+                      FillRect(hDC, &Rect, hbrBlue);
                        break;
                 case MK_RBUTTON:
                        break;
                 case MK_RBUTTON:
-                       TextOut(hDC,10,220,"Right",strlen("Right"));       
-                      FillRect(hDC, &Rect, hbrYellow); 
+                       TextOut(hDC,10,220,"Right",strlen("Right"));
+                      FillRect(hDC, &Rect, hbrYellow);
                        break;
            }
                        ReleaseDC(hWnd, hDC);
           break;
          }
                        break;
            }
                        ReleaseDC(hWnd, hDC);
           break;
          }
-         
+
        case WM_HSCROLL:
         {
       int nPos;
        case WM_HSCROLL:
         {
       int nPos;
@@ -421,52 +421,52 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          HWND hwndScrollBar;
          TCHAR text[256];
          SCROLLINFO Scrollparameter;
          HWND hwndScrollBar;
          TCHAR text[256];
          SCROLLINFO Scrollparameter;
-         nScrollCode = (int) LOWORD(wParam);  // scroll bar value 
-         nPos = (short int) HIWORD(wParam);   // scroll box position 
-         hwndScrollBar = (HWND) lParam;       // handle to scroll bar 
+         nScrollCode = (int) LOWORD(wParam);  // scroll bar value
+         nPos = (short int) HIWORD(wParam);   // scroll box position
+         hwndScrollBar = (HWND) lParam;       // handle to scroll bar
          hDC = GetDC(hWnd);
          hDC = GetDC(hWnd);
-         
+
           Scrollparameter.cbSize = sizeof(Scrollparameter);
           Scrollparameter.cbSize = sizeof(Scrollparameter);
-          Scrollparameter.fMask = SIF_ALL; 
+          Scrollparameter.fMask = SIF_ALL;
           GetScrollInfo ( hWnd, SB_HORZ, &Scrollparameter );
           GetScrollInfo ( hWnd, SB_HORZ, &Scrollparameter );
-          
+
           Rect.left = 200;
          Rect.top = 100;
          Rect.right = 350;
          Rect.bottom = 300;
          FillRect(hDC, &Rect, hbrWhite);
           Rect.left = 200;
          Rect.top = 100;
          Rect.right = 350;
          Rect.bottom = 300;
          FillRect(hDC, &Rect, hbrWhite);
+
           switch ( nScrollCode )
           {
           switch ( nScrollCode )
           {
-                case SB_ENDSCROLL: //Ends scroll. 
+                case SB_ENDSCROLL: //Ends scroll.
                         TextOut(hDC,200,120,"SB_ENDSCROLL    ",16);
                        Scrollparameter.nPos = Scrollparameter.nPos;
                         break;
                         TextOut(hDC,200,120,"SB_ENDSCROLL    ",16);
                        Scrollparameter.nPos = Scrollparameter.nPos;
                         break;
-                case SB_LEFT: //Scrolls to the upper left. 
+                case SB_LEFT: //Scrolls to the upper left.
                         TextOut(hDC,200,140,"SB_LEFT         ",16);
                        Scrollparameter.nPos = Scrollparameter.nMin;
                         break;
                         TextOut(hDC,200,140,"SB_LEFT         ",16);
                        Scrollparameter.nPos = Scrollparameter.nMin;
                         break;
-                case SB_RIGHT: //Scrolls to the lower right. 
+                case SB_RIGHT: //Scrolls to the lower right.
                         TextOut(hDC,200,160,"SB_RIGHT        ",16);
                        Scrollparameter.nPos = Scrollparameter.nMax;
                         break;
                         TextOut(hDC,200,160,"SB_RIGHT        ",16);
                        Scrollparameter.nPos = Scrollparameter.nMax;
                         break;
-                case SB_LINELEFT: //Scrolls left by one unit. 
+                case SB_LINELEFT: //Scrolls left by one unit.
                         TextOut(hDC,200,180,"SB_LINELEFT     ",16);
                        Scrollparameter.nPos--;
                         break;
                         TextOut(hDC,200,180,"SB_LINELEFT     ",16);
                        Scrollparameter.nPos--;
                         break;
-                case SB_LINERIGHT: //Scrolls right by one unit. 
+                case SB_LINERIGHT: //Scrolls right by one unit.
                         TextOut(hDC,200,200,"SB_LINERIGHT    ",16);
                        Scrollparameter.nPos++;
                         break;
                         TextOut(hDC,200,200,"SB_LINERIGHT    ",16);
                        Scrollparameter.nPos++;
                         break;
-                case SB_PAGELEFT: //Scrolls left by the width of the window. 
+                case SB_PAGELEFT: //Scrolls left by the width of the window.
                         TextOut(hDC,200,220,"SB_PAGELEFT     ",16);
                         Scrollparameter.nPos -= Scrollparameter.nPage;
                         break;
                         TextOut(hDC,200,220,"SB_PAGELEFT     ",16);
                         Scrollparameter.nPos -= Scrollparameter.nPage;
                         break;
-                case SB_PAGERIGHT: //Scrolls right by the width of the window. 
+                case SB_PAGERIGHT: //Scrolls right by the width of the window.
                         TextOut(hDC,200,240,"PAGERIGHT       ",16);
                         Scrollparameter.nPos += Scrollparameter.nPage;
                         break;
                         TextOut(hDC,200,240,"PAGERIGHT       ",16);
                         Scrollparameter.nPos += Scrollparameter.nPage;
                         break;
-                case SB_THUMBPOSITION: //The user has dragged the scroll box (thumb) and released the mouse button. The nPos parameter indicates the position of the scroll box at the end of the drag operation. 
+                case SB_THUMBPOSITION: //The user has dragged the scroll box (thumb) and released the mouse button. The nPos parameter indicates the position of the scroll box at the end of the drag operation.
                         TextOut(hDC,200,260,"SB_THUMBPOSITION",16);
                        Scrollparameter.nPos = Scrollparameter.nTrackPos;
                         break;
                         TextOut(hDC,200,260,"SB_THUMBPOSITION",16);
                        Scrollparameter.nPos = Scrollparameter.nTrackPos;
                         break;
@@ -475,7 +475,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
                        Scrollparameter.nPos = Scrollparameter.nTrackPos;
                         break;
           }
                        Scrollparameter.nPos = Scrollparameter.nTrackPos;
                         break;
           }
-          
+
           SetScrollInfo(
                  hWnd,    // handle to window with scroll bar
                  SB_HORZ,    // scroll bar flag
           SetScrollInfo(
                  hWnd,    // handle to window with scroll bar
                  SB_HORZ,    // scroll bar flag
@@ -487,7 +487,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
           ReleaseDC(hWnd, hDC);
          return 0;
          }
           ReleaseDC(hWnd, hDC);
          return 0;
          }
-       
+
        case WM_VSCROLL:
         {
          int nPos;
        case WM_VSCROLL:
         {
          int nPos;
@@ -497,52 +497,52 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          HWND hwndScrollBar;
          TCHAR text[256];
          SCROLLINFO Scrollparameter;
          HWND hwndScrollBar;
          TCHAR text[256];
          SCROLLINFO Scrollparameter;
-         nScrollCode = (int) LOWORD(wParam);  // scroll bar value 
-         nPos = (short int) HIWORD(wParam);   // scroll box position 
-         hwndScrollBar = (HWND) lParam;       // handle to scroll bar 
+         nScrollCode = (int) LOWORD(wParam);  // scroll bar value
+         nPos = (short int) HIWORD(wParam);   // scroll box position
+         hwndScrollBar = (HWND) lParam;       // handle to scroll bar
          hDC = GetDC(hWnd);
          hDC = GetDC(hWnd);
-         
+
           Scrollparameter.cbSize = sizeof(Scrollparameter);
           Scrollparameter.cbSize = sizeof(Scrollparameter);
-          Scrollparameter.fMask = SIF_ALL; 
+          Scrollparameter.fMask = SIF_ALL;
           GetScrollInfo ( hWnd, SB_VERT, &Scrollparameter );
           GetScrollInfo ( hWnd, SB_VERT, &Scrollparameter );
-          
+
           Rect.left = 400;
          Rect.top = 100;
          Rect.right = 550;
          Rect.bottom = 300;
          FillRect(hDC, &Rect, hbrWhite);
           Rect.left = 400;
          Rect.top = 100;
          Rect.right = 550;
          Rect.bottom = 300;
          FillRect(hDC, &Rect, hbrWhite);
+
           switch ( nScrollCode )
           {
           switch ( nScrollCode )
           {
-                case SB_ENDSCROLL: //Ends scroll. 
+                case SB_ENDSCROLL: //Ends scroll.
                         TextOut(hDC,400,120,"SB_ENDSCROLL    ",16);
                        Scrollparameter.nPos = Scrollparameter.nPos;
                        break;
                         TextOut(hDC,400,120,"SB_ENDSCROLL    ",16);
                        Scrollparameter.nPos = Scrollparameter.nPos;
                        break;
-                case SB_LEFT: //Scrolls to the upper left. 
+                case SB_LEFT: //Scrolls to the upper left.
                         TextOut(hDC,400,140,"SB_LEFT         ",16);
                        Scrollparameter.nPos = Scrollparameter.nMin;
                         break;
                         TextOut(hDC,400,140,"SB_LEFT         ",16);
                        Scrollparameter.nPos = Scrollparameter.nMin;
                         break;
-                case SB_RIGHT: //Scrolls to the lower right. 
+                case SB_RIGHT: //Scrolls to the lower right.
                         TextOut(hDC,400,160,"SB_RIGHT        ",16);
                        Scrollparameter.nPos = Scrollparameter.nMax;
                         break;
                         TextOut(hDC,400,160,"SB_RIGHT        ",16);
                        Scrollparameter.nPos = Scrollparameter.nMax;
                         break;
-                case SB_LINELEFT: //Scrolls left by one unit. 
+                case SB_LINELEFT: //Scrolls left by one unit.
                         TextOut(hDC,400,180,"SB_LINELEFT     ",16);
                        Scrollparameter.nPos--;
                         break;
                         TextOut(hDC,400,180,"SB_LINELEFT     ",16);
                        Scrollparameter.nPos--;
                         break;
-                case SB_LINERIGHT: //Scrolls right by one unit. 
+                case SB_LINERIGHT: //Scrolls right by one unit.
                         TextOut(hDC,400,200,"SB_LINERIGHT    ",16);
                        Scrollparameter.nPos++;
                         break;
                         TextOut(hDC,400,200,"SB_LINERIGHT    ",16);
                        Scrollparameter.nPos++;
                         break;
-                case SB_PAGELEFT: //Scrolls left by the width of the window. 
+                case SB_PAGELEFT: //Scrolls left by the width of the window.
                         TextOut(hDC,400,220,"SB_PAGELEFT     ",16);
                         Scrollparameter.nPos -= Scrollparameter.nPage;
                         break;
                         TextOut(hDC,400,220,"SB_PAGELEFT     ",16);
                         Scrollparameter.nPos -= Scrollparameter.nPage;
                         break;
-                case SB_PAGERIGHT: //Scrolls right by the width of the window. 
+                case SB_PAGERIGHT: //Scrolls right by the width of the window.
                         TextOut(hDC,400,240,"PAGERIGHT       ",16);
                         Scrollparameter.nPos += Scrollparameter.nPage;
                         break;
                         TextOut(hDC,400,240,"PAGERIGHT       ",16);
                         Scrollparameter.nPos += Scrollparameter.nPage;
                         break;
-                case SB_THUMBPOSITION: //The user has dragged the scroll box (thumb) and released the mouse button. The nPos parameter indicates the position of the scroll box at the end of the drag operation. 
+                case SB_THUMBPOSITION: //The user has dragged the scroll box (thumb) and released the mouse button. The nPos parameter indicates the position of the scroll box at the end of the drag operation.
                         TextOut(hDC,400,260,"SB_THUMBPOSITION",16);
                        Scrollparameter.nPos = Scrollparameter.nTrackPos;
                         break;
                         TextOut(hDC,400,260,"SB_THUMBPOSITION",16);
                        Scrollparameter.nPos = Scrollparameter.nTrackPos;
                         break;
@@ -551,7 +551,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
                        Scrollparameter.nPos = Scrollparameter.nTrackPos;
                         break;
           }
                        Scrollparameter.nPos = Scrollparameter.nTrackPos;
                         break;
           }
-          
+
          SetScrollInfo(
                  hWnd,    // handle to window with scroll bar
                  SB_VERT,    // scroll bar flag
          SetScrollInfo(
                  hWnd,    // handle to window with scroll bar
                  SB_VERT,    // scroll bar flag
@@ -604,11 +604,11 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          SCROLLINFO si;
          si.cbSize = sizeof(si);
          si.fMask = SIF_ALL;
          SCROLLINFO si;
          si.cbSize = sizeof(si);
          si.fMask = SIF_ALL;
-          si.nMin = 0; 
-          si.nMax = 100; 
-          si.nPage = 5; 
+          si.nMin = 0;
+          si.nMax = 100;
+          si.nPage = 5;
          si.nPos = 0;
          si.nPos = 0;
-         
+
          SetScrollInfo ( hWnd, SB_HORZ, &si, FALSE );
          SetScrollInfo ( hWnd, SB_VERT, &si, FALSE );
 
          SetScrollInfo ( hWnd, SB_HORZ, &si, FALSE );
          SetScrollInfo ( hWnd, SB_VERT, &si, FALSE );
 
@@ -637,16 +637,16 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
                  ((LPCREATESTRUCT) lParam)->hInstance,
                  NULL
                  );
                  ((LPCREATESTRUCT) lParam)->hInstance,
                  NULL
                  );
-         
+
          return 0;
           break;
         }
 
         case WM_PAINT:
          hDC = BeginPaint(hWnd, &ps);
          return 0;
           break;
         }
 
         case WM_PAINT:
          hDC = BeginPaint(hWnd, &ps);
-         TextOut(hDC, 10, 10, "Hello World from ReactOS!", 
+         TextOut(hDC, 10, 10, "Hello World from ReactOS!",
                        strlen("Hello World from ReactOS!"));
                        strlen("Hello World from ReactOS!"));
-         TextOut(hDC, 10, 80, "Press Ctrl+C or Ctrl+Alt+F1 to test Hotkey support.", 
+         TextOut(hDC, 10, 80, "Press Ctrl+C or Ctrl+Alt+F1 to test Hotkey support.",
                        strlen("Press Ctrl+C or Ctrl+Alt+F1 to test Hotkey support."));
           GetClientRect(hWnd, &clr);
           GetWindowRect(hWnd, &wir);
                        strlen("Press Ctrl+C or Ctrl+Alt+F1 to test Hotkey support."));
           GetClientRect(hWnd, &clr);
           GetWindowRect(hWnd, &wir);
@@ -695,7 +695,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
          }
          return 0;
          break;
          }
          return 0;
          break;
-  
+
        default:
          return DefWindowProc(hWnd, msg, wParam, lParam);
        }
        default:
          return DefWindowProc(hWnd, msg, wParam, lParam);
        }
index 7da173e..a488206 100644 (file)
@@ -6,7 +6,7 @@
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
 // Created by Damon Chandler <dmc27@ee.cornell.edu>
 // Updates can be downloaded at: <www.coriolis.com>
 //
-// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu 
+// Please do not hesistate to e-mail me at dmc27@ee.cornell.edu
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
 // if you have any questions about this code.
 // ------------------------------------------------------------------
 
@@ -18,7 +18,7 @@
 
 
 const char* WndClassName = "GMainWnd";
 
 
 const char* WndClassName = "GMainWnd";
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam);
 
 
    LPARAM LParam);
 
 
@@ -28,7 +28,7 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
    MSG msg;
    WNDCLASS wc;
    memset(&wc, 0, sizeof(WNDCLASS));
    MSG msg;
    WNDCLASS wc;
    memset(&wc, 0, sizeof(WNDCLASS));
-    
+
    wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = HInstance;
    wc.style = CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS;
    wc.lpfnWndProc = MainWndProc;
    wc.hInstance = HInstance;
@@ -38,12 +38,12 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
 
    if (RegisterClass(&wc))
    {
 
    if (RegisterClass(&wc))
    {
-      HWND HWnd = 
+      HWND HWnd =
          CreateWindow(WndClassName, TEXT("WM_PAINT Demo"),
                       WS_OVERLAPPEDWINDOW | WS_CAPTION | WS_VISIBLE,
                       CW_USEDEFAULT, CW_USEDEFAULT, 200, 150,
                       NULL, NULL, HInstance, NULL);
          CreateWindow(WndClassName, TEXT("WM_PAINT Demo"),
                       WS_OVERLAPPEDWINDOW | WS_CAPTION | WS_VISIBLE,
                       CW_USEDEFAULT, CW_USEDEFAULT, 200, 150,
                       NULL, NULL, HInstance, NULL);
-                                 
+
       if (HWnd)
       {
          ShowWindow(HWnd, nCmdShow);
       if (HWnd)
       {
          ShowWindow(HWnd, nCmdShow);
@@ -61,16 +61,16 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance,
 //------------------------------------------------------------------
 
 
 //------------------------------------------------------------------
 
 
-LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, 
+LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
    LPARAM LParam)
 {
    LPARAM LParam)
 {
-  const char* text = "Persistent Text"; 
+  const char* text = "Persistent Text";
 
    switch (Msg)
    {
       case WM_PAINT:
       {
 
    switch (Msg)
    {
       case WM_PAINT:
       {
-         // determine the invalidated area of the window            
+         // determine the invalidated area of the window
          RECT RUpdate;
          HDC Hdc;
          GetUpdateRect(HWnd, &RUpdate, FALSE);
          RECT RUpdate;
          HDC Hdc;
          GetUpdateRect(HWnd, &RUpdate, FALSE);
@@ -86,16 +86,16 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
             GetClientRect(HWnd, &RClient);
 
             // set the clipping region
             GetClientRect(HWnd, &RClient);
 
             // set the clipping region
-            IntersectClipRect(Hdc, RUpdate.left, RUpdate.top, 
+            IntersectClipRect(Hdc, RUpdate.left, RUpdate.top,
                               RUpdate.right, RUpdate.bottom);
 
             // fill the client area with the background brush
                               RUpdate.right, RUpdate.bottom);
 
             // fill the client area with the background brush
-            //HBRUSH HBrush = 
+            //HBRUSH HBrush =
                //reinterpret_cast<HBRUSH>
                   (HBRUSH)(GetClassLong(HWnd, GCL_HBRBACKGROUND)
                   );
             FillRect(Hdc, &RClient, NULL);
                //reinterpret_cast<HBRUSH>
                   (HBRUSH)(GetClassLong(HWnd, GCL_HBRBACKGROUND)
                   );
             FillRect(Hdc, &RClient, NULL);
-            
+
             // render the persistent text
             SetTextColor(Hdc, PALETTERGB(0, 0, 255));
             DrawText(Hdc, text, strlen(text), &RClient,
             // render the persistent text
             SetTextColor(Hdc, PALETTERGB(0, 0, 255));
             DrawText(Hdc, text, strlen(text), &RClient,
@@ -108,13 +108,13 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam,
             // release the device context
             ReleaseDC(HWnd, Hdc);
 
             // release the device context
             ReleaseDC(HWnd, Hdc);
 
-            // validate the update area            
+            // validate the update area
             ValidateRect(HWnd, &RUpdate);
          }
          // release the device context
          ReleaseDC(HWnd, Hdc);
 
             ValidateRect(HWnd, &RUpdate);
          }
          // release the device context
          ReleaseDC(HWnd, Hdc);
 
-         // validate the update area            
+         // validate the update area
          ValidateRect(HWnd, &RUpdate);
 
          break;
          ValidateRect(HWnd, &RUpdate);
 
          break;
index 3cff63e..0b1aeba 100644 (file)
@@ -122,9 +122,9 @@ void check(CONTEXT * actualContext)
   (actualContext->EFlags & ZWC_EFLAGS_BITS) ==
   (continueContext.EFlags & ZWC_EFLAGS_BITS)
  );
   (actualContext->EFlags & ZWC_EFLAGS_BITS) ==
   (continueContext.EFlags & ZWC_EFLAGS_BITS)
  );
+
  assert(actualContext->Esp == continueContext.Esp);
  assert(actualContext->Esp == continueContext.Esp);
+
  assert
  (
   (actualContext->SegSs & ZWC_SEGMENT_BITS) ==
  assert
  (
   (actualContext->SegSs & ZWC_SEGMENT_BITS) ==
index 1fa81cc..6202033 100644 (file)
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: welcome.c,v 1.1 2002/08/23 16:15:09 ekohl Exp $
+/* $Id$
  *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS welcome/autorun application
  *
  * COPYRIGHT:   See COPYING in the top level directory
  * PROJECT:     ReactOS welcome/autorun application
index d8e2f98..5e457df 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <commctrl.h>
 #define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <commctrl.h>
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 #include "about.h"
 
 #include "main.h"
 #include "about.h"
 
index 4dd6e6d..1f94d62 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __ABOUT_H__
 #define __ABOUT_H__
 
 #ifndef __ABOUT_H__
 #define __ABOUT_H__
 
index 2c4892b..8e5e0a1 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include <windowsx.h>
 #include <ctype.h>
 #include <assert.h>
 #include <windowsx.h>
 #include <ctype.h>
 #include <assert.h>
@@ -252,8 +252,8 @@ BOOL OnNotify(HWND hWnd, WPARAM wParam, LPARAM lParam)
     {
         if ((int)wParam == TREE_WINDOW) {
 
     {
         if ((int)wParam == TREE_WINDOW) {
 
-            switch (((LPNMHDR)lParam)->code) { 
-            case TVN_ITEMEXPANDING: 
+            switch (((LPNMHDR)lParam)->code) {
+            case TVN_ITEMEXPANDING:
 //                return !OnTreeExpanding(pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
                 OnTreeExpanding(pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
                                return FALSE;
 //                return !OnTreeExpanding(pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
                 OnTreeExpanding(pChildWnd->hTreeWnd, (NMTREEVIEW*)lParam);
                                return FALSE;
@@ -269,9 +269,9 @@ BOOL OnNotify(HWND hWnd, WPARAM wParam, LPARAM lParam)
 //                                     UpdateStatus(hWnd, pChildWnd->left.cur->down);
 
                 }
 //                                     UpdateStatus(hWnd, pChildWnd->left.cur->down);
 
                 }
-                       case TVN_GETDISPINFO: 
-                OnGetDispInfo((NMTVDISPINFO*)lParam); 
-                break; 
+                       case TVN_GETDISPINFO:
+                OnGetDispInfo((NMTVDISPINFO*)lParam);
+                break;
 /*
                     HKEY hKey;
                     TCHAR keyPath[1000];
 /*
                     HKEY hKey;
                     TCHAR keyPath[1000];
@@ -439,7 +439,7 @@ LRESULT CALLBACK ChildWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
                }
 /*
         {
                }
 /*
         {
-        int idCtrl = (int)wParam; 
+        int idCtrl = (int)wParam;
                //NMHDR* pnmh = (NMHDR*)lParam;
                //return pane_notify(pnmh->idFrom==IDW_HEADER_LEFT? &pChildWnd->left: &pChildWnd->right, pnmh);
         if ((int)wParam == TREE_WINDOW) {
                //NMHDR* pnmh = (NMHDR*)lParam;
                //return pane_notify(pnmh->idFrom==IDW_HEADER_LEFT? &pChildWnd->left: &pChildWnd->right, pnmh);
         if ((int)wParam == TREE_WINDOW) {
index 3a11bd8..1c72ca9 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 #include "debug.h"
 
 #include "main.h"
 #include "debug.h"
 
index 08fcfdc..97e5243 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __DEBUG_H__
 #define __DEBUG_H__
 
 #ifndef __DEBUG_H__
 #define __DEBUG_H__
 
index 167fca2..f0e5197 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include <shellapi.h>
 //#include <winspool.h>
 #include <windowsx.h>
 #include <shellapi.h>
 //#include <winspool.h>
 #include <windowsx.h>
@@ -167,24 +167,24 @@ BOOL CALLBACK ViewFileTypeWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM
 
 ////////////////////////////////////////////////////////////////////////////////
 /*
 
 ////////////////////////////////////////////////////////////////////////////////
 /*
-TotalFileSize           [in] Specifies the total size of the file, in bytes. 
-TotalBytesTransferred   [in] Specifies the total number of bytes transferred from the source file to the destination file since the copy operation began. 
-StreamSize              [in] Specifies the total size of the current file stream, in bytes. 
-StreamBytesTransferred  [in] Specifies the total number of bytes in the current stream that have been transferred from the source file to the destination file since the copy operation began. 
-dwStreamNumber          [in] Handle to the current stream. The stream number is 1 the first time CopyProgressRoutine is called. 
-dwCallbackReason        [in] Specifies the reason that CopyProgressRoutine was called. This parameter can be one of the following values. Value Meaning 
-                             CALLBACK_CHUNK_FINISHED Another part of the data file was copied. 
-                             CALLBACK_STREAM_SWITCH  Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked. 
-hSourceFile             [in] Handle to the source file. 
-hDestinationFile        [in] Handle to the destination file 
-lpData                  [in] The argument passed to CopyProgressRoutine by the CopyFileEx or MoveFileWithProgress function. 
+TotalFileSize           [in] Specifies the total size of the file, in bytes.
+TotalBytesTransferred   [in] Specifies the total number of bytes transferred from the source file to the destination file since the copy operation began.
+StreamSize              [in] Specifies the total size of the current file stream, in bytes.
+StreamBytesTransferred  [in] Specifies the total number of bytes in the current stream that have been transferred from the source file to the destination file since the copy operation began.
+dwStreamNumber          [in] Handle to the current stream. The stream number is 1 the first time CopyProgressRoutine is called.
+dwCallbackReason        [in] Specifies the reason that CopyProgressRoutine was called. This parameter can be one of the following values. Value Meaning
+                             CALLBACK_CHUNK_FINISHED Another part of the data file was copied.
+                             CALLBACK_STREAM_SWITCH  Another stream was created and is about to be copied. This is the callback reason given when the callback routine is first invoked.
+hSourceFile             [in] Handle to the source file.
+hDestinationFile        [in] Handle to the destination file
+lpData                  [in] The argument passed to CopyProgressRoutine by the CopyFileEx or MoveFileWithProgress function.
 
 Return Values           The CopyProgressRoutine function should return one of the following values.
 
 Return Values           The CopyProgressRoutine function should return one of the following values.
-  Value Meaning 
-         PROGRESS_CONTINUE Continue the copy operation. 
-         PROGRESS_CANCEL Cancel the copy operation and delete the destination file. 
-         PROGRESS_STOP Stop the copy operation. It can be restarted at a later time. 
-         PROGRESS_QUIET Continue the copy operation, but stop invoking CopyProgressRoutine to report progress. 
+  Value Meaning
+         PROGRESS_CONTINUE Continue the copy operation.
+         PROGRESS_CANCEL Cancel the copy operation and delete the destination file.
+         PROGRESS_STOP Stop the copy operation. It can be restarted at a later time.
+         PROGRESS_QUIET Continue the copy operation, but stop invoking CopyProgressRoutine to report progress.
  */
 DWORD CALLBACK CopyProgressRoutine(
   LARGE_INTEGER TotalFileSize,          // file size
  */
 DWORD CALLBACK CopyProgressRoutine(
   LARGE_INTEGER TotalFileSize,          // file size
@@ -289,10 +289,10 @@ void ShowFixedFileInfo(HWND hDlg, VS_FIXEDFILEINFO* pFixedFileInfo)
     case VFT_FONT:
         str = _T("The file contains a font. If dwFileType is VFT_FONT, dwFileSubtype contains a more specific description of the font file.");
         switch (pFixedFileInfo->dwFileSubtype) {
     case VFT_FONT:
         str = _T("The file contains a font. If dwFileType is VFT_FONT, dwFileSubtype contains a more specific description of the font file.");
         switch (pFixedFileInfo->dwFileSubtype) {
-        case VFT2_UNKNOWN: str = _T("The font type is unknown the system."); break; 
-        case VFT2_FONT_RASTER: str = _T("The file contains a raster font."); break; 
-        case VFT2_FONT_VECTOR: str = _T("The file contains a vector font."); break; 
-        case VFT2_FONT_TRUETYPE: str = _T("The file contains a TrueType font."); break; 
+        case VFT2_UNKNOWN: str = _T("The font type is unknown the system."); break;
+        case VFT2_FONT_RASTER: str = _T("The file contains a raster font."); break;
+        case VFT2_FONT_VECTOR: str = _T("The file contains a vector font."); break;
+        case VFT2_FONT_TRUETYPE: str = _T("The file contains a TrueType font."); break;
 
         }
         break;
 
         }
         break;
@@ -317,9 +317,9 @@ void AddFileInfoValue(HWND hDlg, void* pVersionData, struct LANGANDCODEPAGE lpTr
     TCHAR* pVal;
     UINT nValLen;
 
     TCHAR* pVal;
     UINT nValLen;
 
-    wsprintf(SubBlock, TEXT("\\StringFileInfo\\%04x%04x\\%s"), 
+    wsprintf(SubBlock, TEXT("\\StringFileInfo\\%04x%04x\\%s"),
              lpTranslate.wLanguage, lpTranslate.wCodePage, info_str);
              lpTranslate.wLanguage, lpTranslate.wCodePage, info_str);
-    // Retrieve file description for language and code page "i". 
+    // Retrieve file description for language and code page "i".
     if (VerQueryValue(pVersionData, SubBlock, (PVOID)&pVal, &nValLen)) {
         ListBox_InsertItemData(GetDlgItem(hDlg, IDC_LIST_PROP_VERSION_TYPES), i, info_str);
 //             ListBox_InsertItemData(pane->hwnd, idx, entry);
     if (VerQueryValue(pVersionData, SubBlock, (PVOID)&pVal, &nValLen)) {
         ListBox_InsertItemData(GetDlgItem(hDlg, IDC_LIST_PROP_VERSION_TYPES), i, info_str);
 //             ListBox_InsertItemData(pane->hwnd, idx, entry);
@@ -327,18 +327,18 @@ void AddFileInfoValue(HWND hDlg, void* pVersionData, struct LANGANDCODEPAGE lpTr
     }
 }
 
     }
 }
 
-static TCHAR* InfoStrings[] = { 
-                TEXT("Comments"), 
-                TEXT("InternalName"), 
-                TEXT("ProductName"), 
-                TEXT("CompanyName"), 
-                TEXT("LegalCopyright"), 
-                TEXT("ProductVersion"), 
-                TEXT("FileDescription"), 
-                TEXT("LegalTrademarks"), 
-                TEXT("PrivateBuild"), 
-                TEXT("FileVersion"), 
-                TEXT("OriginalFilename"), 
+static TCHAR* InfoStrings[] = {
+                TEXT("Comments"),
+                TEXT("InternalName"),
+                TEXT("ProductName"),
+                TEXT("CompanyName"),
+                TEXT("LegalCopyright"),
+                TEXT("ProductVersion"),
+                TEXT("FileDescription"),
+                TEXT("LegalTrademarks"),
+                TEXT("PrivateBuild"),
+                TEXT("FileVersion"),
+                TEXT("OriginalFilename"),
                 TEXT("SpecialBuild"),
                 TEXT(""),
                 NULL
                 TEXT("SpecialBuild"),
                 TEXT(""),
                 NULL
@@ -402,7 +402,7 @@ void CheckForFileInfo(HWND hDlg, TCHAR* strFilename)
 /*
             wsprintf(SubBlock, TEXT("\\StringFileInfo\\%04x%04x\\FileDescription"),
                      lpTranslate[i].wLanguage, lpTranslate[i].wCodePage);
 /*
             wsprintf(SubBlock, TEXT("\\StringFileInfo\\%04x%04x\\FileDescription"),
                      lpTranslate[i].wLanguage, lpTranslate[i].wCodePage);
-            // Retrieve file description for language and code page "i". 
+            // Retrieve file description for language and code page "i".
             if (VerQueryValue(pVersionData, SubBlock, &pVal, &nValLen)) {
                 ListBox_InsertItemData(GetDlgItem(hDlg, IDC_LIST_PROP_VERSION_TYPES), i, _T("FileDescription"));
                 SendMessage(GetDlgItem(hDlg, IDC_LIST_PROP_VERSION_VALUES), WM_SETTEXT, 0, pVal);
             if (VerQueryValue(pVersionData, SubBlock, &pVal, &nValLen)) {
                 ListBox_InsertItemData(GetDlgItem(hDlg, IDC_LIST_PROP_VERSION_TYPES), i, _T("FileDescription"));
                 SendMessage(GetDlgItem(hDlg, IDC_LIST_PROP_VERSION_VALUES), WM_SETTEXT, 0, pVal);
@@ -456,7 +456,7 @@ BOOL CALLBACK PropertiesDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
             //entry->bhfi.nFileSizeHigh;
             //entry->bhfi.ftCreationTime
             wsprintf(buffer, _T("%u"), entry->bhfi.nFileSizeLow);
             //entry->bhfi.nFileSizeHigh;
             //entry->bhfi.ftCreationTime
             wsprintf(buffer, _T("%u"), entry->bhfi.nFileSizeLow);
-            if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, buffer, &numFmt, 
+            if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, buffer, &numFmt,
                     buffer + MAX_PATH/2, MAX_PATH/2)) {
                 SetDlgItemText(hDlg, IDC_STATIC_PROP_SIZE, buffer + MAX_PATH/2);
             } else {
                     buffer + MAX_PATH/2, MAX_PATH/2)) {
                 SetDlgItemText(hDlg, IDC_STATIC_PROP_SIZE, buffer + MAX_PATH/2);
             } else {
index bf522a0..e8025a5 100644 (file)
@@ -33,7 +33,7 @@
 #include <process.h>
 #include <stdio.h>
 #endif
 #include <process.h>
 #include <stdio.h>
 #endif
-    
+
 #include "main.h"
 #include "draw.h"
 
 #include "main.h"
 #include "draw.h"
 
index bfbcf58..38bf1b0 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __DRAW_H__
 #define __DRAW_H__
 
 #ifndef __DRAW_H__
 #define __DRAW_H__
 
index a0cbf9f..5ddf752 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 #include "settings.h"
 #include "framewnd.h"
 #include "main.h"
 #include "settings.h"
 #include "framewnd.h"
@@ -61,8 +61,8 @@ void ConfigureDriveBar(HWND hDriveBar)
         while (count) {
 //                     SendMessage(Globals.hDriveCombo, CB_DELETESTRING, (WPARAM)--count, 0);
         }
         while (count) {
 //                     SendMessage(Globals.hDriveCombo, CB_DELETESTRING, (WPARAM)--count, 0);
         }
-        SendMessage(Globals.hDriveCombo, CB_RESETCONTENT, 0, 0); 
+        SendMessage(Globals.hDriveCombo, CB_RESETCONTENT, 0, 0);
+
         memset(Globals.drives, 0, BUFFER_LEN);
            GetLogicalDriveStrings(BUFFER_LEN, Globals.drives);
        drivebarBtn.fsStyle = TBSTYLE_BUTTON;
         memset(Globals.drives, 0, BUFFER_LEN);
            GetLogicalDriveStrings(BUFFER_LEN, Globals.drives);
        drivebarBtn.fsStyle = TBSTYLE_BUTTON;
@@ -86,9 +86,9 @@ void ConfigureDriveBar(HWND hDriveBar)
             vol[0] = toupper(vol[0]);
             vol[1] = _T(':'); vol[2] = _T('\\'); vol[3] = _T('\0');
             if (drivebarBtn.iBitmap != 1 /*DRIVE_REMOVABLE*/ &&
             vol[0] = toupper(vol[0]);
             vol[1] = _T(':'); vol[2] = _T('\\'); vol[3] = _T('\0');
             if (drivebarBtn.iBitmap != 1 /*DRIVE_REMOVABLE*/ &&
-              GetVolumeInformation(vol, szVolumeNameBuffer, 
-              sizeof(szVolumeNameBuffer)/sizeof(TCHAR), 
-              NULL, NULL, NULL, NULL, 0) && 
+              GetVolumeInformation(vol, szVolumeNameBuffer,
+              sizeof(szVolumeNameBuffer)/sizeof(TCHAR),
+              NULL, NULL, NULL, NULL, 0) &&
               szVolumeNameBuffer[0] != _T('\0')) {
                 vol[2] = _T(' '); vol[3] = _T('['); vol[4] = _T('\0');
                 _tcscat(vol, szVolumeNameBuffer);
               szVolumeNameBuffer[0] != _T('\0')) {
                 vol[2] = _T(' '); vol[3] = _T('['); vol[4] = _T('\0');
                 _tcscat(vol, szVolumeNameBuffer);
@@ -104,7 +104,7 @@ void ConfigureDriveBar(HWND hDriveBar)
             cbei.iImage         = drivebarBtn.iBitmap;
 //            cbei.iSelectedImage = IInf[iCnt].iSelectedImage;
 //            cbei.iIndent        = IInf[iCnt].iIndent;
             cbei.iImage         = drivebarBtn.iBitmap;
 //            cbei.iSelectedImage = IInf[iCnt].iSelectedImage;
 //            cbei.iIndent        = IInf[iCnt].iIndent;
-            SendMessage(Globals.hDriveCombo, CBEM_INSERTITEM, 0, (LPARAM)&cbei); 
+            SendMessage(Globals.hDriveCombo, CBEM_INSERTITEM, 0, (LPARAM)&cbei);
 
                        drivebarBtn.idCommand++;
                        drivebarBtn.iString++;
 
                        drivebarBtn.idCommand++;
                        drivebarBtn.iString++;
@@ -129,7 +129,7 @@ typedef struct {
 } ITEMINFO, *PITEMINFO;
 
 ITEMINFO IInf[] = {
 } ITEMINFO, *PITEMINFO;
 
 ITEMINFO IInf[] = {
-        { 0, 3,  0, _T("A:")}, 
+        { 0, 3,  0, _T("A:")},
         { 1, 4,  1, _T("C: [SYSTEM]")},
         { 2, 5,  2, _T("D:")},
         { 0, 3,  0, _T("E: [SOFT_RAID_1]")},
         { 1, 4,  1, _T("C: [SYSTEM]")},
         { 2, 5,  2, _T("D:")},
         { 0, 3,  0, _T("E: [SOFT_RAID_1]")},
@@ -151,7 +151,7 @@ ITEMINFO IInf[] = {
 //            cbei.iImage         = IInf[iCnt].iImage;
 //            cbei.iSelectedImage = IInf[iCnt].iSelectedImage;
 //            cbei.iIndent        = IInf[iCnt].iIndent;
 //            cbei.iImage         = IInf[iCnt].iImage;
 //            cbei.iSelectedImage = IInf[iCnt].iSelectedImage;
 //            cbei.iIndent        = IInf[iCnt].iIndent;
-            SendMessage(Globals.hDriveCombo, CBEM_INSERTITEM, 0, (LPARAM)&cbei); 
+            SendMessage(Globals.hDriveCombo, CBEM_INSERTITEM, 0, (LPARAM)&cbei);
         }
     }
 }
         }
     }
 }
index 3f70a24..ef5c50c 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __DRIVEBAR_H__
 #define __DRIVEBAR_H__
 
 #ifndef __DRIVEBAR_H__
 #define __DRIVEBAR_H__
 
index e74bea5..b85a949 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include <windowsx.h>
 
 #include "main.h"
 #include <windowsx.h>
 
 #include "main.h"
@@ -74,7 +74,7 @@ Entry* read_tree_win(Root* root, LPCTSTR path, int sortOrder)
 #ifndef _NO_EXTENSIONS
        entry->unix_dir = FALSE;
 #endif
 #ifndef _NO_EXTENSIONS
        entry->unix_dir = FALSE;
 #endif
-       
+
        while(entry) {
                while(*s && *s!=_T('\\') && *s!=_T('/'))
                        *d++ = *s++;
        while(entry) {
                while(*s && *s!=_T('\\') && *s!=_T('/'))
                        *d++ = *s++;
index 9427b1b..71158b7 100644 (file)
          passed on subsequent calls as the fmtID parameter to
          "format the same type you did last time".
 
          passed on subsequent calls as the fmtID parameter to
          "format the same type you did last time".
 
-   *****************************************************************/ 
+   *****************************************************************/
    DWORD WINAPI SHFormatDrive(HWND hWnd,
                               UINT drive,
                               UINT fmtID,
                               UINT options);
 
    DWORD WINAPI SHFormatDrive(HWND hWnd,
                               UINT drive,
                               UINT fmtID,
                               UINT options);
 
-   // 
+   //
    // Special value of fmtID which means "use the defaultformat"
    // Special value of fmtID which means "use the defaultformat"
-   // 
+   //
 
    #define SHFMT_ID_DEFAULT   0xFFFF
 
 
    #define SHFMT_ID_DEFAULT   0xFFFF
 
-   // 
+   //
    // Option bits for options parameter
    // Option bits for options parameter
-   // 
+   //
 
    #define SHFMT_OPT_FULL     0x0001
    #define SHFMT_OPT_SYSONLY  0x0002
 
 
    #define SHFMT_OPT_FULL     0x0001
    #define SHFMT_OPT_SYSONLY  0x0002
 
-   // 
+   //
    // Special return values. PLEASE NOTE that these are DWORD values.
    // Special return values. PLEASE NOTE that these are DWORD values.
-   // 
+   //
 
    #define SHFMT_ERROR     0xFFFFFFFFL    // Error on last format,
                                           // drive may be formatable
 
    #define SHFMT_ERROR     0xFFFFFFFFL    // Error on last format,
                                           // drive may be formatable
index 16ecaed..4fe9e2d 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 //#include <shellapi.h>
 #include <windowsx.h>
 #include <assert.h>
 //#include <shellapi.h>
 #include <windowsx.h>
 #include <assert.h>
@@ -234,7 +234,7 @@ HWND CreateChildWindow(int drv_id)
             szChildClass, path, hInst,
 //            CW_USEDEFAULT, CW_USEDEFAULT,
 //            CW_USEDEFAULT, CW_USEDEFAULT,
             szChildClass, path, hInst,
 //            CW_USEDEFAULT, CW_USEDEFAULT,
 //            CW_USEDEFAULT, CW_USEDEFAULT,
-            20, 20, 200, 200, 
+            20, 20, 200, 200,
             WS_MAXIMIZE, (LPARAM)pChildWnd
 //            0/*style*/, 0/*lParam*/
                };
             WS_MAXIMIZE, (LPARAM)pChildWnd
 //            0/*style*/, 0/*lParam*/
                };
@@ -343,8 +343,8 @@ static BOOL activate_drive_window(LPCTSTR path)
        _tsplitpath(path, drv1, 0, 0, 0);
 
         // search for a already open window for the same drive
        _tsplitpath(path, drv1, 0, 0, 0);
 
         // search for a already open window for the same drive
-       for (child_wnd = GetNextWindow(Globals.hMDIClient,GW_CHILD); 
-            child_wnd; 
+       for (child_wnd = GetNextWindow(Globals.hMDIClient,GW_CHILD);
+            child_wnd;
                 child_wnd = GetNextWindow(child_wnd, GW_HWNDNEXT)) {
                ChildWnd* pChildWnd = (ChildWnd*) GetWindowLong(child_wnd, GWL_USERDATA);
                if (pChildWnd) {
                 child_wnd = GetNextWindow(child_wnd, GW_HWNDNEXT)) {
                ChildWnd* pChildWnd = (ChildWnd*) GetWindowLong(child_wnd, GWL_USERDATA);
                if (pChildWnd) {
@@ -429,7 +429,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
        UINT cmd = LOWORD(wParam);
        HWND hChildWnd;
 //     HWND hwndClient = (HWND)SendMessage(Globals.hMDIClient, WM_MDIGETACTIVE, 0, 0);
        UINT cmd = LOWORD(wParam);
        HWND hChildWnd;
 //     HWND hwndClient = (HWND)SendMessage(Globals.hMDIClient, WM_MDIGETACTIVE, 0, 0);
-//     if (hwndClient) 
+//     if (hwndClient)
 //         if (SendMessage(hwndClient, WM_DISPATCH_COMMAND, wParam, lParam))
 //                     return 0;
 
 //         if (SendMessage(hwndClient, WM_DISPATCH_COMMAND, wParam, lParam))
 //                     return 0;
 
@@ -463,7 +463,7 @@ static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
                                SetErrorMode(OldMode & ~SEM_FAILCRITICALERRORS); // Force O/S to handle
                                // Call SHFormatDrive here.
                                SHFormatDrive(hWnd, 0 /* A: */, SHFMT_ID_DEFAULT, 0);
                                SetErrorMode(OldMode & ~SEM_FAILCRITICALERRORS); // Force O/S to handle
                                // Call SHFormatDrive here.
                                SHFormatDrive(hWnd, 0 /* A: */, SHFMT_ID_DEFAULT, 0);
-                               SetErrorMode(OldMode); // Put it back the way it was.                   
+                               SetErrorMode(OldMode); // Put it back the way it was.
                        }
 #endif
                        break;
                        }
 #endif
                        break;
@@ -600,7 +600,7 @@ static TBBUTTON tbButtonNew[] = {
        {0, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
        {0, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
 };
        {0, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
        {0, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
 };
-        
+
 static LRESULT MsgNotify(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
 {
     LPNMHDR     lpnmhdr;
 static LRESULT MsgNotify(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam)
 {
     LPNMHDR     lpnmhdr;
@@ -610,17 +610,17 @@ static int             nResetCount;
 static LPTBBUTTON      lpSaveButtons;
 //LPARAM                 lParam;
 
 static LPTBBUTTON      lpSaveButtons;
 //LPARAM                 lParam;
 
-    
+
     lpnmhdr = (LPNMHDR)lparam;
 /*
     lpnmhdr = (LPNMHDR)lparam;
 /*
-    // The following code allows the toolbar to be customized. 
+    // The following code allows the toolbar to be customized.
     // If you return FALSE the Customize Toolbar dialog flashes
     // and goes away.
     // If you return FALSE the Customize Toolbar dialog flashes
     // and goes away.
-  
+
     if (lpnmhdr->code == TBN_QUERYINSERT || lpnmhdr->code == TBN_QUERYDELETE) {
         return TRUE;
     }
     if (lpnmhdr->code == TBN_QUERYINSERT || lpnmhdr->code == TBN_QUERYDELETE) {
         return TRUE;
     }
-        
+
     if (lpnmhdr->code == TBN_GETBUTTONINFO) {
         LPTBNOTIFY lpTbNotify = (LPTBNOTIFY)lparam;
         TCHAR szBuffer[20];
     if (lpnmhdr->code == TBN_GETBUTTONINFO) {
         LPTBNOTIFY lpTbNotify = (LPTBNOTIFY)lparam;
         TCHAR szBuffer[20];
@@ -633,7 +633,7 @@ static LPTBBUTTON      lpSaveButtons;
                        {0, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
                        {0, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
                };
                        {0, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
                        {0, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
                };
-        
+
                // 20 = total number of buttons.
                // tbButton and tbButtonNew send information about
                // the other 12 buttons in tbButtonNew.
                // 20 = total number of buttons.
                // tbButton and tbButtonNew send information about
                // the other 12 buttons in tbButtonNew.
@@ -660,13 +660,13 @@ static LPTBBUTTON      lpSaveButtons;
         TCHAR szBuffer[20];
 /*
 typedef struct _TBBUTTON {
         TCHAR szBuffer[20];
 /*
 typedef struct _TBBUTTON {
-    int iBitmap; 
-    int idCommand; 
-    BYTE fsState; 
-    BYTE fsStyle; 
-    DWORD dwData; 
-    INT_PTR iString; 
-} TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON; 
+    int iBitmap;
+    int idCommand;
+    BYTE fsState;
+    BYTE fsStyle;
+    DWORD dwData;
+    INT_PTR iString;
+} TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
  */
                // 20 = total number of buttons.
                // tbButton and tbButtonNew send information about
  */
                // 20 = total number of buttons.
                // tbButton and tbButtonNew send information about
@@ -687,11 +687,11 @@ typedef struct _TBBUTTON {
         {
            LPTBNOTIFY  lpTB = (LPTBNOTIFY)lparam;
         int i;
         {
            LPTBNOTIFY  lpTB = (LPTBNOTIFY)lparam;
         int i;
-          
+
         // Allocate memory to store the button information.
         nResetCount = SendMessage(lpTB->hdr.hwndFrom, TB_BUTTONCOUNT, 0, 0);
         lpSaveButtons = (LPTBBUTTON)GlobalAlloc(GPTR, sizeof(TBBUTTON) * nResetCount);
         // Allocate memory to store the button information.
         nResetCount = SendMessage(lpTB->hdr.hwndFrom, TB_BUTTONCOUNT, 0, 0);
         lpSaveButtons = (LPTBBUTTON)GlobalAlloc(GPTR, sizeof(TBBUTTON) * nResetCount);
-      
+
         // Save the current configuration so if the user presses
         // reset, the original toolbar can be restored.
         for (i = 0; i < nResetCount; i++) {
         // Save the current configuration so if the user presses
         // reset, the original toolbar can be restored.
         for (i = 0; i < nResetCount; i++) {
@@ -699,23 +699,23 @@ typedef struct _TBBUTTON {
         }
         }
         return TRUE;
         }
         }
         return TRUE;
-   
+
     case TBN_RESET:
         {
         LPTBNOTIFY  lpTB = (LPTBNOTIFY)lparam;
         int         nCount, i;
     case TBN_RESET:
         {
         LPTBNOTIFY  lpTB = (LPTBNOTIFY)lparam;
         int         nCount, i;
-       
+
         // Remove all of the existing buttons starting with the last and working down.
         nCount = SendMessage(lpTB->hdr.hwndFrom, TB_BUTTONCOUNT, 0, 0);
         for (i = nCount - 1; i >= 0; i--) {
             SendMessage(lpTB->hdr.hwndFrom, TB_DELETEBUTTON, i, 0);
         }
         // Remove all of the existing buttons starting with the last and working down.
         nCount = SendMessage(lpTB->hdr.hwndFrom, TB_BUTTONCOUNT, 0, 0);
         for (i = nCount - 1; i >= 0; i--) {
             SendMessage(lpTB->hdr.hwndFrom, TB_DELETEBUTTON, i, 0);
         }
-      
+
         // Restore the buttons that were saved.
         SendMessage(lpTB->hdr.hwndFrom, TB_ADDBUTTONS, (WPARAM)nResetCount, (LPARAM)lpSaveButtons);
         }
         return TRUE;
         // Restore the buttons that were saved.
         SendMessage(lpTB->hdr.hwndFrom, TB_ADDBUTTONS, (WPARAM)nResetCount, (LPARAM)lpSaveButtons);
         }
         return TRUE;
-   
+
     case TBN_ENDADJUST:
         // Free the memory allocated during TBN_BEGINADJUST
         GlobalFree((HGLOBAL)lpSaveButtons);
     case TBN_ENDADJUST:
         // Free the memory allocated during TBN_BEGINADJUST
         GlobalFree((HGLOBAL)lpSaveButtons);
@@ -730,8 +730,8 @@ static LRESULT OnDriveBoxNotify(HWND hWnd, WPARAM wParam, LPARAM lParam)
 
 //    if (nmhdr->code == NM_HOVER || nmhdr->code == NM_NCHITTEST) return 0;
 
 
 //    if (nmhdr->code == NM_HOVER || nmhdr->code == NM_NCHITTEST) return 0;
 
-//    switch (((LPNMHDR)lParam)->code) { 
-    switch (nmhdr->code) { 
+//    switch (((LPNMHDR)lParam)->code) {
+    switch (nmhdr->code) {
     case NM_OUTOFMEMORY:
     case NM_CLICK:
     case NM_DBLCLK:
     case NM_OUTOFMEMORY:
     case NM_CLICK:
     case NM_DBLCLK:
@@ -804,23 +804,23 @@ LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
             if (MsgNotify(hWnd, message, wParam, lParam)) return TRUE;
         }
 //        return MsgNotify(hWnd, message, wParam, lParam);
             if (MsgNotify(hWnd, message, wParam, lParam)) return TRUE;
         }
 //        return MsgNotify(hWnd, message, wParam, lParam);
-        switch (((LPNMHDR)lParam)->code) { 
+        switch (((LPNMHDR)lParam)->code) {
 #ifdef _MSC_VER
 #ifdef _MSC_VER
-        case TTN_GETDISPINFO: 
-            { 
-            LPTOOLTIPTEXT lpttt; 
-            lpttt = (LPTOOLTIPTEXT)lParam; 
-            lpttt->hinst = hInst; 
+        case TTN_GETDISPINFO:
+            {
+            LPTOOLTIPTEXT lpttt;
+            lpttt = (LPTOOLTIPTEXT)lParam;
+            lpttt->hinst = hInst;
             // load appropriate string
             // load appropriate string
-            lpttt->lpszText = MAKEINTRESOURCE(lpttt->hdr.idFrom); 
-            } 
-            break; 
+            lpttt->lpszText = MAKEINTRESOURCE(lpttt->hdr.idFrom);
+            }
+            break;
 #endif
         default:
             break;
         }
         break;
 #endif
         default:
             break;
         }
         break;
-   
+
        case WM_COMMAND:
         if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
 //            if (LOWORD(wParam) > ID_CMD_FIRST && LOWORD(wParam) < ID_CMD_LAST) {
        case WM_COMMAND:
         if (!_CmdWndProc(hWnd, message, wParam, lParam)) {
 //            if (LOWORD(wParam) > ID_CMD_FIRST && LOWORD(wParam) < ID_CMD_LAST) {
index 1bff7b2..9e54b0a 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include <windowsx.h>
 #include "main.h"
 #include "listview.h"
 #include <windowsx.h>
 #include "main.h"
 #include "listview.h"
@@ -54,20 +54,20 @@ static int column_alignment[MAX_LIST_COLUMNS] = { LVCFMT_LEFT, LVCFMT_RIGHT, LVC
 //
 
 static void AddEntryToList(HWND hwndLV, int idx, Entry* entry)
 //
 
 static void AddEntryToList(HWND hwndLV, int idx, Entry* entry)
-{ 
+{
     LVITEM item;
 
     LVITEM item;
 
-    item.mask = LVIF_TEXT | LVIF_PARAM; 
-    item.iItem = 0;//idx; 
-    item.iSubItem = 0; 
-    item.state = 0; 
-    item.stateMask = 0; 
-//    item.pszText = entry->data.cFileName; 
-//    item.cchTextMax = strlen(entry->data.cFileName); 
-    item.pszText = LPSTR_TEXTCALLBACK; 
-    item.cchTextMax = 0; 
-    item.iImage = 0; 
-//    item.iImage = I_IMAGECALLBACK; 
+    item.mask = LVIF_TEXT | LVIF_PARAM;
+    item.iItem = 0;//idx;
+    item.iSubItem = 0;
+    item.state = 0;
+    item.stateMask = 0;
+//    item.pszText = entry->data.cFileName;
+//    item.cchTextMax = strlen(entry->data.cFileName);
+    item.pszText = LPSTR_TEXTCALLBACK;
+    item.cchTextMax = 0;
+    item.iImage = 0;
+//    item.iImage = I_IMAGECALLBACK;
     item.lParam = (LPARAM)entry;
 #if (_WIN32_IE >= 0x0300)
     item.iIndent = 0;
     item.lParam = (LPARAM)entry;
 #if (_WIN32_IE >= 0x0300)
     item.iIndent = 0;
@@ -89,7 +89,7 @@ static void InsertListEntries(HWND hWnd, Entry* entry, int idx)
        if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
                continue;
 #endif
        if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
                continue;
 #endif
-        AddEntryToList(hWnd, idx, entry); 
+        AddEntryToList(hWnd, idx, entry);
         ++idx;
     }
     ShowWindow(hWnd, SW_SHOW);
         ++idx;
     }
     ShowWindow(hWnd, SW_SHOW);
@@ -100,7 +100,7 @@ static void CreateListColumns(HWND hWndListView)
     TCHAR szText[50];
     int index;
     LV_COLUMN lvC;
     TCHAR szText[50];
     int index;
     LV_COLUMN lvC;
+
     // Create columns.
     lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
     lvC.pszText = szText;
     // Create columns.
     lvC.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
     lvC.pszText = szText;
@@ -118,7 +118,7 @@ static void CreateListColumns(HWND hWndListView)
     }
 }
 
     }
 }
 
-// OnGetDispInfo - processes the LVN_GETDISPINFO notification message. 
+// OnGetDispInfo - processes the LVN_GETDISPINFO notification message.
 static void OnGetDispInfo(NMLVDISPINFO* plvdi)
 {
     SYSTEMTIME SystemTime;
 static void OnGetDispInfo(NMLVDISPINFO* plvdi)
 {
     SYSTEMTIME SystemTime;
@@ -130,8 +130,8 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
     plvdi->item.pszText = NULL;
     switch (plvdi->item.iSubItem) {
     case 0:
     plvdi->item.pszText = NULL;
     switch (plvdi->item.iSubItem) {
     case 0:
-        plvdi->item.pszText = entry->data.cFileName; 
-//    item.cchTextMax = strlen(entry->data.cFileName); 
+        plvdi->item.pszText = entry->data.cFileName;
+//    item.cchTextMax = strlen(entry->data.cFileName);
 //        plvdi->item.pszText = rgPetInfo[plvdi->item.iItem].szKind;
         break;
     case 1:
 //        plvdi->item.pszText = rgPetInfo[plvdi->item.iItem].szKind;
         break;
     case 1:
@@ -149,7 +149,7 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
             //entry->bhfi.nFileSizeHigh;
             //entry->bhfi.ftCreationTime
             wsprintf(buffer, _T("%u"), entry->bhfi.nFileSizeLow);
             //entry->bhfi.nFileSizeHigh;
             //entry->bhfi.ftCreationTime
             wsprintf(buffer, _T("%u"), entry->bhfi.nFileSizeLow);
-            if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, buffer, &numFmt, 
+            if (GetNumberFormat(LOCALE_USER_DEFAULT, 0, buffer, &numFmt,
                     buffer + sizeof(buffer)/2, sizeof(buffer)/2)) {
                 plvdi->item.pszText = buffer + sizeof(buffer)/2;
             } else {
                     buffer + sizeof(buffer)/2, sizeof(buffer)/2)) {
                 plvdi->item.pszText = buffer + sizeof(buffer)/2;
             } else {
@@ -203,40 +203,40 @@ static void OnGetDispInfo(NMLVDISPINFO* plvdi)
         plvdi->item.pszText = buffer;
         break;
     }
         plvdi->item.pszText = buffer;
         break;
     }
-} 
+}
 /*
 /*
-FILE_ATTRIBUTE_ARCHIVE The file or directory is an archive file. Applications use this attribute to mark files for backup or removal. 
-FILE_ATTRIBUTE_COMPRESSED The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories. 
-FILE_ATTRIBUTE_DIRECTORY The handle identifies a directory. 
-FILE_ATTRIBUTE_ENCRYPTED The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories. 
-FILE_ATTRIBUTE_HIDDEN The file or directory is hidden. It is not included in an ordinary directory listing. 
-FILE_ATTRIBUTE_NORMAL The file has no other attributes. This attribute is valid only if used alone. 
-FILE_ATTRIBUTE_OFFLINE The file data is not immediately available. This attribute indicates that the file data has been physically moved to offline storage. This attribute is used by Remote Storage, the hierarchical storage management software in Windows 2000. Applications should not arbitrarily change this attribute. 
-FILE_ATTRIBUTE_READONLY The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it. 
-FILE_ATTRIBUTE_REPARSE_POINT The file has an associated reparse point. 
-FILE_ATTRIBUTE_SPARSE_FILE The file is a sparse file. 
-FILE_ATTRIBUTE_SYSTEM The file or directory is part of the operating system or is used exclusively by the operating system. 
+FILE_ATTRIBUTE_ARCHIVE The file or directory is an archive file. Applications use this attribute to mark files for backup or removal.
+FILE_ATTRIBUTE_COMPRESSED The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories.
+FILE_ATTRIBUTE_DIRECTORY The handle identifies a directory.
+FILE_ATTRIBUTE_ENCRYPTED The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories.
+FILE_ATTRIBUTE_HIDDEN The file or directory is hidden. It is not included in an ordinary directory listing.
+FILE_ATTRIBUTE_NORMAL The file has no other attributes. This attribute is valid only if used alone.
+FILE_ATTRIBUTE_OFFLINE The file data is not immediately available. This attribute indicates that the file data has been physically moved to offline storage. This attribute is used by Remote Storage, the hierarchical storage management software in Windows 2000. Applications should not arbitrarily change this attribute.
+FILE_ATTRIBUTE_READONLY The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it.
+FILE_ATTRIBUTE_REPARSE_POINT The file has an associated reparse point.
+FILE_ATTRIBUTE_SPARSE_FILE The file is a sparse file.
+FILE_ATTRIBUTE_SYSTEM The file or directory is part of the operating system or is used exclusively by the operating system.
 FILE_ATTRIBUTE_TEMPORARY The file is being used for temporary storage. File systems attempt to keep all the data in memory for quicker access, rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.
  */
 
 
 FILE_ATTRIBUTE_TEMPORARY The file is being used for temporary storage. File systems attempt to keep all the data in memory for quicker access, rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.
  */
 
 
- // OnEndLabelEdit - processes the LVN_ENDLABELEDIT 
- // notification message. 
- // Returns TRUE if the label is changed, or FALSE otherwise. 
+ // OnEndLabelEdit - processes the LVN_ENDLABELEDIT
+ // notification message.
+ // Returns TRUE if the label is changed, or FALSE otherwise.
 
 static BOOL OnEndLabelEdit(NMLVDISPINFO* plvdi)
 
 static BOOL OnEndLabelEdit(NMLVDISPINFO* plvdi)
-{ 
-    if (plvdi->item.iItem == -1) 
-        return FALSE; 
-    // Copy the new label text to the application-defined structure. 
+{
+    if (plvdi->item.iItem == -1)
+        return FALSE;
+
+    // Copy the new label text to the application-defined structure.
 //    lstrcpyn(rgPetInfo[plvdi->item.iItem].szKind, plvdi->item.pszText, 10);
 //    lstrcpyn(rgPetInfo[plvdi->item.iItem].szKind, plvdi->item.pszText, 10);
-    
+
     return TRUE;
     // To make a more robust application you should send an EM_LIMITTEXT
     // message to the edit control to prevent the user from entering too
     return TRUE;
     // To make a more robust application you should send an EM_LIMITTEXT
     // message to the edit control to prevent the user from entering too
-    // many characters in the field. 
-} 
+    // many characters in the field.
+}
 
 static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
 {
 
 static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
 {
@@ -368,27 +368,27 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
        case WM_DISPATCH_COMMAND:
                return _CmdWndProc(hWnd, message, wParam, lParam);
     case WM_NOTIFY:
        case WM_DISPATCH_COMMAND:
                return _CmdWndProc(hWnd, message, wParam, lParam);
     case WM_NOTIFY:
-        switch (((LPNMHDR)lParam)->code) { 
-        case LVN_GETDISPINFO: 
-            OnGetDispInfo((NMLVDISPINFO*)lParam); 
+        switch (((LPNMHDR)lParam)->code) {
+        case LVN_GETDISPINFO:
+            OnGetDispInfo((NMLVDISPINFO*)lParam);
             return 0;
         case NM_DBLCLK:
             {
             NMITEMACTIVATE* nmitem = (LPNMITEMACTIVATE)lParam;
             LVHITTESTINFO info;
 
             return 0;
         case NM_DBLCLK:
             {
             NMITEMACTIVATE* nmitem = (LPNMITEMACTIVATE)lParam;
             LVHITTESTINFO info;
 
-            if (nmitem->hdr.hwndFrom != hWnd) break; 
-//            if (nmitem->hdr.idFrom != IDW_LISTVIEW) break; 
-//            if (nmitem->hdr.code != ???) break; 
+            if (nmitem->hdr.hwndFrom != hWnd) break;
+//            if (nmitem->hdr.idFrom != IDW_LISTVIEW) break;
+//            if (nmitem->hdr.code != ???) break;
 #ifdef _MSC_VER
             switch (nmitem->uKeyFlags) {
 #ifdef _MSC_VER
             switch (nmitem->uKeyFlags) {
-            case LVKF_ALT:     //  The ALT key is pressed.  
+            case LVKF_ALT:     //  The ALT key is pressed.
                 // properties dialog box ?
                 break;
             case LVKF_CONTROL: //  The CTRL key is pressed.
                 // run dialog box for providing parameters...
                 break;
                 // properties dialog box ?
                 break;
             case LVKF_CONTROL: //  The CTRL key is pressed.
                 // run dialog box for providing parameters...
                 break;
-            case LVKF_SHIFT:   //  The SHIFT key is pressed.   
+            case LVKF_SHIFT:   //  The SHIFT key is pressed.
                 break;
             }
 #endif
                 break;
             }
 #endif
@@ -405,7 +405,7 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
             }
             }
             return 0;
             }
             }
             return 0;
-        case LVN_ENDLABELEDIT: 
+        case LVN_ENDLABELEDIT:
             return OnEndLabelEdit((NMLVDISPINFO*)lParam);
         }
                break;
             return OnEndLabelEdit((NMLVDISPINFO*)lParam);
         }
                break;
@@ -428,23 +428,23 @@ static LRESULT CALLBACK ListWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
 
 void CreateListWnd(HWND parent, Pane* pane, int id, LPTSTR lpszPathName)
 {
 
 void CreateListWnd(HWND parent, Pane* pane, int id, LPTSTR lpszPathName)
 {
-    RECT rcClient;  // dimensions of client area 
+    RECT rcClient;  // dimensions of client area
        Entry* entry = pane->root;
 
 //     pane->treePane = 0;
 
        Entry* entry = pane->root;
 
 //     pane->treePane = 0;
 
-    GetClientRect(parent, &rcClient); 
-    pane->hWnd = CreateWindowEx(0, WC_LISTVIEW, _T("List View"), 
-        WS_VISIBLE | WS_CHILD | WS_BORDER | LVS_REPORT/* | LVS_NOCOLUMNHEADER*/, 
-        0, 0, rcClient.right, rcClient.bottom, 
-        parent, (HMENU)id, hInst, NULL); 
-    // Initialize the image list, and add items to the control. 
+    GetClientRect(parent, &rcClient);
+    pane->hWnd = CreateWindowEx(0, WC_LISTVIEW, _T("List View"),
+        WS_VISIBLE | WS_CHILD | WS_BORDER | LVS_REPORT/* | LVS_NOCOLUMNHEADER*/,
+        0, 0, rcClient.right, rcClient.bottom,
+        parent, (HMENU)id, hInst, NULL);
+    // Initialize the image list, and add items to the control.
 /*
 /*
-    if (!InitListViewImageLists(pane->hWnd) || 
-            !InitListViewItems(pane->hWnd, lpszPathName)) { 
-        DestroyWindow(pane->hWnd); 
-        return FALSE; 
-    } 
+    if (!InitListViewImageLists(pane->hWnd) ||
+            !InitListViewItems(pane->hWnd, lpszPathName)) {
+        DestroyWindow(pane->hWnd);
+        return FALSE;
+    }
  */
     ListView_SetExtendedListViewStyle(pane->hWnd,  LVS_EX_FULLROWSELECT);
     CreateListColumns(pane->hWnd);
  */
     ListView_SetExtendedListViewStyle(pane->hWnd,  LVS_EX_FULLROWSELECT);
     CreateListColumns(pane->hWnd);
@@ -460,28 +460,28 @@ void CreateListWnd(HWND parent, Pane* pane, int id, LPTSTR lpszPathName)
 }
 
 HWND CreateListView(HWND hwndParent, ChildWnd* pChildWnd, int id)
 }
 
 HWND CreateListView(HWND hwndParent, ChildWnd* pChildWnd, int id)
-{ 
+{
     RECT rcClient;
     HWND hwndLV;
     RECT rcClient;
     HWND hwndLV;
-    // Get the dimensions of the parent window's client area, and create the list view control. 
-    GetClientRect(hwndParent, &rcClient); 
-    hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, _T("List View"), 
-        WS_VISIBLE | WS_CHILD | LVS_REPORT, 
-        0, 0, rcClient.right, rcClient.bottom, 
-        hwndParent, (HMENU)id, hInst, NULL); 
+
+    // Get the dimensions of the parent window's client area, and create the list view control.
+    GetClientRect(hwndParent, &rcClient);
+    hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, _T("List View"),
+        WS_VISIBLE | WS_CHILD | LVS_REPORT,
+        0, 0, rcClient.right, rcClient.bottom,
+        hwndParent, (HMENU)id, hInst, NULL);
     ListView_SetExtendedListViewStyle(hwndLV,  LVS_EX_FULLROWSELECT);
     ListView_SetExtendedListViewStyle(hwndLV,  LVS_EX_FULLROWSELECT);
-    // Initialize the image list, and add items to the control. 
+
+    // Initialize the image list, and add items to the control.
 /*
 /*
-    if (!InitListViewImageLists(hwndLV) || 
-            !InitListViewItems(hwndLV, szName)) { 
-        DestroyWindow(hwndLV); 
-        return FALSE; 
-    } 
+    if (!InitListViewImageLists(hwndLV) ||
+            !InitListViewItems(hwndLV, szName)) {
+        DestroyWindow(hwndLV);
+        return FALSE;
+    }
  */
     CreateListColumns(hwndLV);
        g_orgListWndProc = SubclassWindow(hwndLV, ListWndProc);
     return hwndLV;
  */
     CreateListColumns(hwndLV);
        g_orgListWndProc = SubclassWindow(hwndLV, ListWndProc);
     return hwndLV;
-} 
+}
 
 
index 6bf47c4..727928d 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 #include "settings.h"
 #include "framewnd.h"
 #include "main.h"
 #include "settings.h"
 #include "framewnd.h"
@@ -172,81 +172,81 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
 #define DRIVEBOX_HEIGHT 8
 /*
 typedef struct _TBBUTTON {
 #define DRIVEBOX_HEIGHT 8
 /*
 typedef struct _TBBUTTON {
-    int iBitmap; 
-    int idCommand; 
-    BYTE fsState; 
-    BYTE fsStyle; 
-    DWORD dwData; 
-    INT_PTR iString; 
-} TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON; 
+    int iBitmap;
+    int idCommand;
+    BYTE fsState;
+    BYTE fsStyle;
+    DWORD dwData;
+    INT_PTR iString;
+} TBBUTTON, NEAR* PTBBUTTON, FAR* LPTBBUTTON;
  */
                TBBUTTON toolbarBtns[] = {
                        {DRIVEBOX_WIDTH+10, 0, 0, TBSTYLE_SEP},
                        {0, 0, 0, TBSTYLE_SEP},
 
  */
                TBBUTTON toolbarBtns[] = {
                        {DRIVEBOX_WIDTH+10, 0, 0, TBSTYLE_SEP},
                        {0, 0, 0, TBSTYLE_SEP},
 
-//                     {1, ID_FILE_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ID_FILE_OPEN }, 
-//                     {2, ID_FILE_MOVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ID_FILE_MOVE}, 
-//                     {3, ID_FILE_COPY, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ID_FILE_COPY}, 
-//                     {4, ID_FILE_COPY_CLIPBOARD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ID_FILE_COPY_CLIPBOARD}, 
-                       {5, ID_FILE_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {6, ID_FILE_RENAME, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {7, ID_FILE_PROPERTIES, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {8, ID_FILE_COMPRESS, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {9, ID_FILE_UNCOMPRESS, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {10, ID_FILE_RUN, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {10, ID_FILE_PRINT, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {11, ID_FILE_ASSOCIATE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {12, ID_FILE_CREATE_DIRECTORY, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {13, ID_FILE_SEARCH, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {14, ID_FILE_SELECT_FILES, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {16, ID_FILE_EXIT, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {15, ID_DISK_COPY_DISK, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {16, ID_DISK_LABEL_DISK, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {17, ID_DISK_FORMAT_DISK, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {18, ID_DISK_CONNECT_NETWORK_DRIVE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {19, ID_DISK_DISCONNECT_NETWORK_DRIVE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {20, ID_DISK_SHARE_AS, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {21, ID_DISK_STOP_SHARING, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {24, ID_DISK_SELECT_DRIVE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {25, ID_TREE_EXPAND_ONE_LEVEL, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {26, ID_TREE_EXPAND_BRANCH, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {27, ID_TREE_EXPAND_ALL, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {28, ID_TREE_COLLAPSE_BRANCH, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {22, ID_TREE_INDICATE_EXPANDABLE_BRANCHES, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {30, ID_VIEW_TREE_DIRECTORY, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {31, ID_VIEW_TREE_ONLY, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {32, ID_VIEW_DIRECTORY_ONLY, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {33, ID_VIEW_SPLIT, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {23, ID_VIEW_NAME, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {24, ID_VIEW_ALL_FILE_DETAILS, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {25, ID_VIEW_PARTIAL_DETAILS, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {37, ID_VIEW_SORT_BY_NAME, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {38, ID_VIEW_SORT_BY_TYPE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {39, ID_VIEW_SORT_BY_SIZE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {40, ID_VIEW_SORT_BY_DATE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {26, ID_VIEW_BY_FILE_TYPE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {27, ID_OPTIONS_CONFIRMATION, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {28, ID_OPTIONS_FONT, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {29, ID_OPTIONS_CUSTOMISE_TOOLBAR, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {45, ID_OPTIONS_TOOLBAR, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {46, ID_OPTIONS_DRIVEBAR, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {47, ID_OPTIONS_STATUSBAR, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {30, ID_OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {31, ID_OPTIONS_MINIMISE_ON_USE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {32, ID_OPTIONS_SAVE_ON_EXIT, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {33, ID_SECURITY_PERMISSIONS, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {34, ID_SECURITY_AUDITING, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {35, ID_SECURITY_OWNER, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {36, ID_WINDOW_NEW_WINDOW, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {37, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {38, ID_WINDOW_TILE_HORZ, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {39, ID_WINDOW_TILE_VERT, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {40, ID_WINDOW_ARRANGE_ICONS, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {41, ID_WINDOW_REFRESH, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-                       {42, ID_HELP_CONTENTS, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {61, ID_HELP_SEARCH_HELP, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {62, ID_HELP_HOW_TO_USE_HELP, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
-//                     {63, ID_HELP_ABOUT, TBSTATE_ENABLED, TBSTYLE_BUTTON}, 
+//                     {1, ID_FILE_OPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ID_FILE_OPEN },
+//                     {2, ID_FILE_MOVE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ID_FILE_MOVE},
+//                     {3, ID_FILE_COPY, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ID_FILE_COPY},
+//                     {4, ID_FILE_COPY_CLIPBOARD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, ID_FILE_COPY_CLIPBOARD},
+                       {5, ID_FILE_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {6, ID_FILE_RENAME, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {7, ID_FILE_PROPERTIES, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {8, ID_FILE_COMPRESS, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {9, ID_FILE_UNCOMPRESS, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {10, ID_FILE_RUN, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {10, ID_FILE_PRINT, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {11, ID_FILE_ASSOCIATE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {12, ID_FILE_CREATE_DIRECTORY, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {13, ID_FILE_SEARCH, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {14, ID_FILE_SELECT_FILES, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {16, ID_FILE_EXIT, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {15, ID_DISK_COPY_DISK, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {16, ID_DISK_LABEL_DISK, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {17, ID_DISK_FORMAT_DISK, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {18, ID_DISK_CONNECT_NETWORK_DRIVE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {19, ID_DISK_DISCONNECT_NETWORK_DRIVE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {20, ID_DISK_SHARE_AS, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {21, ID_DISK_STOP_SHARING, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {24, ID_DISK_SELECT_DRIVE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {25, ID_TREE_EXPAND_ONE_LEVEL, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {26, ID_TREE_EXPAND_BRANCH, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {27, ID_TREE_EXPAND_ALL, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {28, ID_TREE_COLLAPSE_BRANCH, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {22, ID_TREE_INDICATE_EXPANDABLE_BRANCHES, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {30, ID_VIEW_TREE_DIRECTORY, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {31, ID_VIEW_TREE_ONLY, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {32, ID_VIEW_DIRECTORY_ONLY, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {33, ID_VIEW_SPLIT, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {23, ID_VIEW_NAME, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {24, ID_VIEW_ALL_FILE_DETAILS, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {25, ID_VIEW_PARTIAL_DETAILS, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {37, ID_VIEW_SORT_BY_NAME, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {38, ID_VIEW_SORT_BY_TYPE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {39, ID_VIEW_SORT_BY_SIZE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {40, ID_VIEW_SORT_BY_DATE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {26, ID_VIEW_BY_FILE_TYPE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {27, ID_OPTIONS_CONFIRMATION, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {28, ID_OPTIONS_FONT, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {29, ID_OPTIONS_CUSTOMISE_TOOLBAR, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {45, ID_OPTIONS_TOOLBAR, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {46, ID_OPTIONS_DRIVEBAR, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {47, ID_OPTIONS_STATUSBAR, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {30, ID_OPTIONS_OPEN_NEW_WINDOW_ON_CONNECT, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {31, ID_OPTIONS_MINIMISE_ON_USE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {32, ID_OPTIONS_SAVE_ON_EXIT, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {33, ID_SECURITY_PERMISSIONS, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {34, ID_SECURITY_AUDITING, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {35, ID_SECURITY_OWNER, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {36, ID_WINDOW_NEW_WINDOW, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {37, ID_WINDOW_CASCADE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {38, ID_WINDOW_TILE_HORZ, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {39, ID_WINDOW_TILE_VERT, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {40, ID_WINDOW_ARRANGE_ICONS, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {41, ID_WINDOW_REFRESH, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+                       {42, ID_HELP_CONTENTS, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {61, ID_HELP_SEARCH_HELP, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {62, ID_HELP_HOW_TO_USE_HELP, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+//                     {63, ID_HELP_ABOUT, TBSTATE_ENABLED, TBSTYLE_BUTTON},
 
 
 //                     {0, ID_WINDOW_NEW_WINDOW, TBSTATE_ENABLED, TBSTYLE_BUTTON},
 
 
 //                     {0, ID_WINDOW_NEW_WINDOW, TBSTATE_ENABLED, TBSTYLE_BUTTON},
@@ -265,11 +265,11 @@ typedef struct _TBBUTTON {
 
         {
             // Create the edit control. Notice that the parent of
 
         {
             // Create the edit control. Notice that the parent of
-            // the toolbar, is used as the parent of the edit control.    
-            //hWndEdit = CreateWindowEx(0L, WC_COMBOBOXEX, NULL, WS_CHILD | WS_BORDER | WS_VISIBLE 
+            // the toolbar, is used as the parent of the edit control.
+            //hWndEdit = CreateWindowEx(0L, WC_COMBOBOXEX, NULL, WS_CHILD | WS_BORDER | WS_VISIBLE
 #if 0
 #if 0
-            Globals.hDriveCombo = CreateWindowEx(0L, _T("ComboBox"), NULL, 
-                WS_CHILD | WS_BORDER | WS_VISIBLE | CBS_DROPDOWNLIST | ES_LEFT | ES_AUTOVSCROLL | ES_MULTILINE, 
+            Globals.hDriveCombo = CreateWindowEx(0L, _T("ComboBox"), NULL,
+                WS_CHILD | WS_BORDER | WS_VISIBLE | CBS_DROPDOWNLIST | ES_LEFT | ES_AUTOVSCROLL | ES_MULTILINE,
                 10, 0, DRIVEBOX_WIDTH, DRIVEBOX_HEIGHT, Globals.hMainWnd, (HMENU)IDW_DRIVEBOX, hInstance, 0);
 #else
 #ifndef __GNUC__
                 10, 0, DRIVEBOX_WIDTH, DRIVEBOX_HEIGHT, Globals.hMainWnd, (HMENU)IDW_DRIVEBOX, hInstance, 0);
 #else
 #ifndef __GNUC__
@@ -289,25 +289,25 @@ typedef struct _TBBUTTON {
             // Set the toolbar window as the parent of the edit control
             // window. You must set the toolbar as the parent of the edit
             // control for it to appear embedded in the toolbar.
             // Set the toolbar window as the parent of the edit control
             // window. You must set the toolbar as the parent of the edit
             // control for it to appear embedded in the toolbar.
-            SetParent(Globals.hDriveCombo, Globals.hToolBar);    
+            SetParent(Globals.hDriveCombo, Globals.hToolBar);
         }
                }
 
     // Create the drive bar
         }
                }
 
     // Create the drive bar
-        Globals.hDriveBar = CreateToolbarEx(Globals.hMainWnd, 
+        Globals.hDriveBar = CreateToolbarEx(Globals.hMainWnd,
                                WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_FLAT|TBSTYLE_LIST|TBSTYLE_WRAPABLE,
 //                    WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST|TBSTYLE_TRANSPARENT|TBSTYLE_WRAPABLE,
                                WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_FLAT|TBSTYLE_LIST|TBSTYLE_WRAPABLE,
 //                    WS_CHILD|WS_VISIBLE|CCS_NOMOVEY|TBSTYLE_LIST|TBSTYLE_TRANSPARENT|TBSTYLE_WRAPABLE,
-                                       IDW_DRIVEBAR, 2, hInstance, IDB_DRIVEBAR, 
-                                       &drivebarBtn, 1/*iNumButtons*/, 
-                                       25/*dxButton*/, 16/*dyButton*/, 
+                                       IDW_DRIVEBAR, 2, hInstance, IDB_DRIVEBAR,
+                                       &drivebarBtn, 1/*iNumButtons*/,
+                                       25/*dxButton*/, 16/*dyButton*/,
                                        0/*dxBitmap*/, 0/*dyBitmap*/, sizeof(TBBUTTON));
                                        0/*dxBitmap*/, 0/*dyBitmap*/, sizeof(TBBUTTON));
-//                                     16/*dxButton*/, 13/*dyButton*/, 
+//                                     16/*dxButton*/, 13/*dyButton*/,
 //                                     16/*dxBitmap*/, 13/*dyBitmap*/, sizeof(TBBUTTON));
                CheckMenuItem(Globals.hMenuOptions, ID_OPTIONS_DRIVEBAR, MF_BYCOMMAND|MF_CHECKED);
         ConfigureDriveBar(Globals.hDriveBar);
 
         // Create the status bar
 //                                     16/*dxBitmap*/, 13/*dyBitmap*/, sizeof(TBBUTTON));
                CheckMenuItem(Globals.hMenuOptions, ID_OPTIONS_DRIVEBAR, MF_BYCOMMAND|MF_CHECKED);
         ConfigureDriveBar(Globals.hDriveBar);
 
         // Create the status bar
-        Globals.hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS, 
+        Globals.hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBT_NOBORDERS,
                                     _T(""), Globals.hMainWnd, IDW_STATUS_WINDOW);
         if (!Globals.hStatusBar)
             return FALSE;
                                     _T(""), Globals.hMainWnd, IDW_STATUS_WINDOW);
         if (!Globals.hStatusBar)
             return FALSE;
@@ -344,7 +344,7 @@ typedef struct _TBBUTTON {
        UpdateStatusBar();
     return TRUE;
 }
        UpdateStatusBar();
     return TRUE;
 }
-        
+
 ////////////////////////////////////////////////////////////////////////////////
 
 void SetupStatusBar(BOOL bResize)
 ////////////////////////////////////////////////////////////////////////////////
 
 void SetupStatusBar(BOOL bResize)
@@ -403,11 +403,11 @@ void ExitInstance(void)
 }
 
 /*
 }
 
 /*
-struct _cpinfo { 
-  UINT MaxCharSize; 
-  BYTE DefaultChar[MAX_DEFAULTCHAR]; 
-  BYTE LeadByte[MAX_LEADBYTES]; 
-} CPINFO, *LPCPINFO; 
+struct _cpinfo {
+  UINT MaxCharSize;
+  BYTE DefaultChar[MAX_DEFAULTCHAR];
+  BYTE LeadByte[MAX_LEADBYTES];
+} CPINFO, *LPCPINFO;
  */
 
 int APIENTRY WinMain(HINSTANCE hInstance,
  */
 
 int APIENTRY WinMain(HINSTANCE hInstance,
@@ -451,17 +451,17 @@ int APIENTRY WinMain(HINSTANCE hInstance,
 
 //    hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDC_WINFILE);
     hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDR_ACCELERATOR1);
 
 //    hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDC_WINFILE);
     hAccel = LoadAccelerators(hInstance, (LPCTSTR)IDR_ACCELERATOR1);
-    
+
     hMDIClient = GetWindow(Globals.hMainWnd, GW_CHILD);
 
     // Main message loop:
     hMDIClient = GetWindow(Globals.hMainWnd, GW_CHILD);
 
     // Main message loop:
-       while (GetMessage(&msg, (HWND)NULL, 0, 0)) { 
-        if (!TranslateMDISysAccel(hMDIClient, &msg) && 
-            !TranslateAccelerator(Globals.hMainWnd/*hwndFrame*/, hAccel, &msg)) { 
-            TranslateMessage(&msg); 
-            DispatchMessage(&msg); 
-               } 
-       } 
+       while (GetMessage(&msg, (HWND)NULL, 0, 0)) {
+        if (!TranslateMDISysAccel(hMDIClient, &msg) &&
+            !TranslateAccelerator(Globals.hMainWnd/*hwndFrame*/, hAccel, &msg)) {
+            TranslateMessage(&msg);
+            DispatchMessage(&msg);
+               }
+       }
 
     SaveSettings();
        ExitInstance();
 
     SaveSettings();
        ExitInstance();
index 6c1d728..b859825 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 #include "network.h"
 
 #include "main.h"
 #include "network.h"
 
@@ -118,14 +118,14 @@ DWORD MapNetworkDrives(HWND hWnd, BOOL connect)
         NETRESOURCE netResouce;
         CONNECTDLGSTRUCT connectDlg;
 
         NETRESOURCE netResouce;
         CONNECTDLGSTRUCT connectDlg;
 
-        //netResouce.dwScope; 
-        //netResouce.dwType; 
+        //netResouce.dwScope;
+        //netResouce.dwType;
         netResouce.dwDisplayType = 0;
         netResouce.dwDisplayType = 0;
-        //netResouce.dwUsage; 
-        //netResouce.lpLocalName; 
-        //netResouce.lpRemoteName; 
-        //netResouce.lpComment; 
-        //netResouce.lpProvider; 
+        //netResouce.dwUsage;
+        //netResouce.lpLocalName;
+        //netResouce.lpRemoteName;
+        //netResouce.lpComment;
+        //netResouce.lpProvider;
 
         //connectDlg.cbStructure;
         connectDlg.hwndOwner = hWnd;
 
         //connectDlg.cbStructure;
         connectDlg.hwndOwner = hWnd;
@@ -195,7 +195,7 @@ static void DisplayStruct(HDC hdc, LPNETRESOURCE lpnrLocal)
 ////////////////////////////////////
 
 static BOOL WINAPI EnumerateFunc(HWND hwnd, HDC hdc, LPNETRESOURCE lpnr)
 ////////////////////////////////////
 
 static BOOL WINAPI EnumerateFunc(HWND hwnd, HDC hdc, LPNETRESOURCE lpnr)
-{ 
+{
   DWORD dwResult;
   DWORD dwResultEnum;
   HANDLE hEnum;
   DWORD dwResult;
   DWORD dwResultEnum;
   HANDLE hEnum;
@@ -214,7 +214,7 @@ static BOOL WINAPI EnumerateFunc(HWND hwnd, HDC hdc, LPNETRESOURCE lpnr)
                           lpnr,     // NULL first time the function is called
                           &hEnum);  // handle to the resource
 
                           lpnr,     // NULL first time the function is called
                           &hEnum);  // handle to the resource
 
-  if (dwResult != NO_ERROR) {  
+  if (dwResult != NO_ERROR) {
     // Process errors with an application-defined error handler.
     NetErrorHandler(hwnd, dwResult, (LPTSTR)_T("WNetOpenEnum"));
     return FALSE;
     // Process errors with an application-defined error handler.
     NetErrorHandler(hwnd, dwResult, (LPTSTR)_T("WNetOpenEnum"));
     return FALSE;
@@ -222,8 +222,8 @@ static BOOL WINAPI EnumerateFunc(HWND hwnd, HDC hdc, LPNETRESOURCE lpnr)
 
   // Call the GlobalAlloc function to allocate resources.
   lpnrLocal = (LPNETRESOURCE)GlobalAlloc(GPTR, cbBuffer);
 
   // Call the GlobalAlloc function to allocate resources.
   lpnrLocal = (LPNETRESOURCE)GlobalAlloc(GPTR, cbBuffer);
-  do {  
+
+  do {
     // Initialize the buffer.
     ZeroMemory(lpnrLocal, cbBuffer);
 
     // Initialize the buffer.
     ZeroMemory(lpnrLocal, cbBuffer);
 
@@ -262,8 +262,8 @@ static BOOL WINAPI EnumerateFunc(HWND hwnd, HDC hdc, LPNETRESOURCE lpnr)
 
   // Call WNetCloseEnum to end the enumeration.
   dwResult = pWNetCloseEnum(hEnum);
 
   // Call WNetCloseEnum to end the enumeration.
   dwResult = pWNetCloseEnum(hEnum);
-  
-  if (dwResult != NO_ERROR) { 
+
+  if (dwResult != NO_ERROR) {
     // Process errors.
     NetErrorHandler(hwnd, dwResult, (LPTSTR)_T("WNetCloseEnum"));
     return FALSE;
     // Process errors.
     NetErrorHandler(hwnd, dwResult, (LPTSTR)_T("WNetCloseEnum"));
     return FALSE;
index 3d81f6e..6fc540c 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __NETWORK_H__
 #define __NETWORK_H__
 
 #ifndef __NETWORK_H__
 #define __NETWORK_H__
 
index 9b2665f..faad6cb 100644 (file)
 #define IDC_STATIC                      -1
 
 // Next default values for new objects
 #define IDC_STATIC                      -1
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        149
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        149
index d101139..0dc1254 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-       
+
 #define WIN32_LEAN_AND_MEAN            // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <commctrl.h>
 #define WIN32_LEAN_AND_MEAN            // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <commctrl.h>
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-       
+
 #include <shellapi.h>
 
 #include "main.h"
 #include <shellapi.h>
 
 #include "main.h"
 
 
 typedef        void (WINAPI *RUNFILEDLG)(
 
 
 typedef        void (WINAPI *RUNFILEDLG)(
-                                               HWND    hwndOwner, 
-                                               HICON   hIcon, 
-                                               LPCSTR  lpstrDirectory, 
-                                               LPCSTR  lpstrTitle, 
+                                               HWND    hwndOwner,
+                                               HICON   hIcon,
+                                               LPCSTR  lpstrDirectory,
+                                               LPCSTR  lpstrTitle,
                                                LPCSTR  lpstrDescription,
                                                LPCSTR  lpstrDescription,
-                                               UINT    uFlags); 
+                                               UINT    uFlags);
 
 //
 // Flags for RunFileDlg
 //
 
 
 //
 // Flags for RunFileDlg
 //
 
-#define        RFF_NOBROWSE            0x01    // Removes the browse button. 
-#define        RFF_NODEFAULT           0x02    // No default item selected. 
+#define        RFF_NOBROWSE            0x01    // Removes the browse button.
+#define        RFF_NODEFAULT           0x02    // No default item selected.
 #define        RFF_CALCDIRECTORY       0x04    // Calculates the working directory from the file name.
 #define        RFF_CALCDIRECTORY       0x04    // Calculates the working directory from the file name.
-#define        RFF_NOLABEL                     0x08    // Removes the edit box label. 
+#define        RFF_NOLABEL                     0x08    // Removes the edit box label.
 #define        RFF_NOSEPARATEMEM       0x20    // Removes the Separate Memory Space check box (Windows NT only).
 
 
 #define        RFF_NOSEPARATEMEM       0x20    // Removes the Separate Memory Space check box (Windows NT only).
 
 
@@ -85,27 +85,27 @@ void OnFileRun(void)
 
 /*
 typedef struct _SHELLEXECUTEINFO{
 
 /*
 typedef struct _SHELLEXECUTEINFO{
-    DWORD cbSize; 
-    ULONG fMask; 
-    HWND hwnd; 
-    LPCTSTR lpVerb; 
-    LPCTSTR lpFile; 
-    LPCTSTR lpParameters; 
-    LPCTSTR lpDirectory; 
-    int nShow; 
-    HINSTANCE hInstApp; 
-    // Optional members 
-    LPVOID lpIDList; 
-    LPCSTR lpClass; 
-    HKEY hkeyClass; 
-    DWORD dwHotKey; 
+    DWORD cbSize;
+    ULONG fMask;
+    HWND hwnd;
+    LPCTSTR lpVerb;
+    LPCTSTR lpFile;
+    LPCTSTR lpParameters;
+    LPCTSTR lpDirectory;
+    int nShow;
+    HINSTANCE hInstApp;
+
+    // Optional members
+    LPVOID lpIDList;
+    LPCSTR lpClass;
+    HKEY hkeyClass;
+    DWORD dwHotKey;
        union {
                HANDLE hIcon;
                HANDLE hMonitor;
        };
        union {
                HANDLE hIcon;
                HANDLE hMonitor;
        };
-    HANDLE hProcess; 
-} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO; 
+    HANDLE hProcess;
+} SHELLEXECUTEINFO, *LPSHELLEXECUTEINFO;
  */
 
 BOOL OpenTarget(HWND hWnd, TCHAR* target)
  */
 
 BOOL OpenTarget(HWND hWnd, TCHAR* target)
index 83a045e..ccea1be 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-       
+
 // run.h - definitions necessary to use Microsoft's "Run" dialog
 // Undocumented Windows call
 // use the type below to declare a function pointer
 // run.h - definitions necessary to use Microsoft's "Run" dialog
 // Undocumented Windows call
 // use the type below to declare a function pointer
index 8f50be2..0c27c98 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 #include "settings.h"
 
 #include "main.h"
 #include "settings.h"
 
index 3534a41..756275d 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 #include "shell.h"
 #include "format.h"
 #include "main.h"
 #include "shell.h"
 #include "format.h"
@@ -69,7 +69,7 @@ void FormatDisk(HWND hWnd)
                    UINT OldMode = SetErrorMode(0); // Get the current Error Mode settings.
                    SetErrorMode(OldMode & ~SEM_FAILCRITICALERRORS); // Force O/S to handle
             pSHFormatDrive(0/*hWnd*/, 0 /* A: */, SHFMT_ID_DEFAULT, 0);
                    UINT OldMode = SetErrorMode(0); // Get the current Error Mode settings.
                    SetErrorMode(OldMode & ~SEM_FAILCRITICALERRORS); // Force O/S to handle
             pSHFormatDrive(0/*hWnd*/, 0 /* A: */, SHFMT_ID_DEFAULT, 0);
-                   SetErrorMode(OldMode); // Put it back the way it was.                       
+                   SetErrorMode(OldMode); // Put it back the way it was.
         }
         FreeLibrary(hShell32);
        }
         }
         FreeLibrary(hShell32);
        }
index 9769deb..08e371f 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __SHELL_H__
 #define __SHELL_H__
 
 #ifndef __SHELL_H__
 #define __SHELL_H__
 
index 0c77582..f731c1e 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include <windowsx.h>
 #include <shellapi.h>
 #include <ctype.h>
 #include <windowsx.h>
 #include <shellapi.h>
 #include <ctype.h>
index a40e82a..200a1e8 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include "main.h"
 
 
 #include "main.h"
 
 
index 3af5629..3d6a42d 100644 (file)
@@ -1,7 +1,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // Diagnostic Trace
 //
 /////////////////////////////////////////////////////////////////////////////
 // Diagnostic Trace
 //
-#include <stdio.h> 
+#include <stdio.h>
 #include <stdarg.h>
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <stdarg.h>
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
index 8a8c2a8..99e24b6 100644 (file)
 #include "trace.h"
 
 
 #include "trace.h"
 
 
-// Global variables and constants 
-// Image_Open, Image_Closed, and Image_Root - integer variables for indexes of the images. 
-// CX_BITMAP and CY_BITMAP - width and height of an icon. 
-// NUM_BITMAPS - number of bitmaps to add to the image list. 
-int Image_Open; 
-int Image_Closed; 
-int Image_Root; 
+// Global variables and constants
+// Image_Open, Image_Closed, and Image_Root - integer variables for indexes of the images.
+// CX_BITMAP and CY_BITMAP - width and height of an icon.
+// NUM_BITMAPS - number of bitmaps to add to the image list.
+int Image_Open;
+int Image_Closed;
+int Image_Root;
 
 static int s_init = 0;
 
 
 static int s_init = 0;
 
@@ -114,66 +114,66 @@ static void init_output(HWND hWnd)
 #if 0
 
 HTREEITEM AddEntryToTree(HWND hwndTV, Entry* entry)
 #if 0
 
 HTREEITEM AddEntryToTree(HWND hwndTV, Entry* entry)
-{ 
+{
     HTREEITEM hItem = 0;
     HTREEITEM hItem = 0;
-    TVITEM tvi; 
-    TVINSERTSTRUCT tvins; 
-    static HTREEITEM hPrev = (HTREEITEM)TVI_FIRST; 
-    static HTREEITEM hPrevRootItem = NULL; 
-    static HTREEITEM hPrevLev2Item = NULL; 
-
-    //TRACE("AddEntryToTree(level:%u - %s)\n", entry->level, entry->data.cFileName); 
-    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM; 
+    TVITEM tvi;
+    TVINSERTSTRUCT tvins;
+    static HTREEITEM hPrev = (HTREEITEM)TVI_FIRST;
+    static HTREEITEM hPrevRootItem = NULL;
+    static HTREEITEM hPrevLev2Item = NULL;
+
+    //TRACE("AddEntryToTree(level:%u - %s)\n", entry->level, entry->data.cFileName);
+    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
     tvi.pszText = LPSTR_TEXTCALLBACK;
     tvi.cchTextMax = 0;
     tvi.iImage = I_IMAGECALLBACK;
     tvi.iSelectedImage = I_IMAGECALLBACK;
     tvi.cChildren = I_CHILDRENCALLBACK;
     tvi.pszText = LPSTR_TEXTCALLBACK;
     tvi.cchTextMax = 0;
     tvi.iImage = I_IMAGECALLBACK;
     tvi.iSelectedImage = I_IMAGECALLBACK;
     tvi.cChildren = I_CHILDRENCALLBACK;
-    // Save the entry pointer in the item's application-defined data area. 
-    tvi.lParam = (LPARAM)entry; 
-    tvins.item = tvi; 
-    tvins.hInsertAfter = hPrev; 
-    // Set the parent item based on the specified level. 
+    // Save the entry pointer in the item's application-defined data area.
+    tvi.lParam = (LPARAM)entry;
+    tvins.item = tvi;
+    tvins.hInsertAfter = hPrev;
+    // Set the parent item based on the specified level.
     if (entry->level == 0) {
     if (entry->level == 0) {
-        tvins.hParent = TVI_ROOT; 
+        tvins.hParent = TVI_ROOT;
     } else if (entry->level == 1) {
     } else if (entry->level == 1) {
-        tvins.hParent = hPrevRootItem; 
+        tvins.hParent = hPrevRootItem;
     } else {
     } else {
-        tvins.hParent = hPrevLev2Item; 
+        tvins.hParent = hPrevLev2Item;
         if (hPrevLev2Item) {
         if (hPrevLev2Item) {
-            tvins.hParent = entry->up->hTreeItem; 
+            tvins.hParent = entry->up->hTreeItem;
         }
     }
         }
     }
-    // Add the item to the tree view control. 
-    hPrev = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins); 
-    // Save the handle to the item. 
-    if (entry->level == 0) 
-        hPrevRootItem = hPrev; 
-    else if (entry->level == 1) 
-        hPrevLev2Item = hPrev; 
-    hItem = hPrev; 
+    // Add the item to the tree view control.
+    hPrev = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins);
+    // Save the handle to the item.
+    if (entry->level == 0)
+        hPrevRootItem = hPrev;
+    else if (entry->level == 1)
+        hPrevLev2Item = hPrev;
+    hItem = hPrev;
     return hItem;
 }
 
 #else
 
 static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPTSTR label, Root* entry, DWORD dwChildren)
     return hItem;
 }
 
 #else
 
 static HTREEITEM AddEntryToTree(HWND hwndTV, HTREEITEM hParent, LPTSTR label, Root* entry, DWORD dwChildren)
-{ 
+{
     HTREEITEM hItem = 0;
     HTREEITEM hItem = 0;
-    TVITEM tvi; 
-    TVINSERTSTRUCT tvins; 
-
-    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM; 
-    tvi.pszText = label; 
-    tvi.cchTextMax = lstrlen(tvi.pszText); 
-    tvi.iImage = Image_Closed; 
-    tvi.iSelectedImage = Image_Open; 
-    tvi.cChildren = dwChildren; 
+    TVITEM tvi;
+    TVINSERTSTRUCT tvins;
+
+    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
+    tvi.pszText = label;
+    tvi.cchTextMax = lstrlen(tvi.pszText);
+    tvi.iImage = Image_Closed;
+    tvi.iSelectedImage = Image_Open;
+    tvi.cChildren = dwChildren;
     tvi.lParam = (LPARAM)entry;
     tvi.lParam = (LPARAM)entry;
-    tvins.item = tvi; 
-    if (entry) tvins.hInsertAfter = (HTREEITEM)TVI_LAST; 
-    else       tvins.hInsertAfter = (HTREEITEM)TVI_SORT; 
-    tvins.hParent = hParent; 
+    tvins.item = tvi;
+    if (entry) tvins.hInsertAfter = (HTREEITEM)TVI_LAST;
+    else       tvins.hInsertAfter = (HTREEITEM)TVI_SORT;
+    tvins.hParent = hParent;
     hItem = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins);
     return hItem;
 }
     hItem = (HTREEITEM)SendMessage(hwndTV, TVM_INSERTITEM, 0, (LPARAM)(LPTVINSERTSTRUCT)&tvins);
     return hItem;
 }
@@ -198,19 +198,19 @@ static void insert_tree_entries(HWND hWnd, Entry* entry/*Root* pRoot*/, int idx)
                // don't display entries "." and ".." in the left pane
         if ((entry->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && entry->data.cFileName[0]==_T('.')) {
                        if (entry->data.cFileName[1] == _T('\0') ||
                // don't display entries "." and ".." in the left pane
         if ((entry->data.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && entry->data.cFileName[0]==_T('.')) {
                        if (entry->data.cFileName[1] == _T('\0') ||
-               (entry->data.cFileName[1] == _T('.')  && 
+               (entry->data.cFileName[1] == _T('.')  &&
                 entry->data.cFileName[2] == _T('\0'))) {
                                continue;
             }
         }
         if (entry->hTreeItem) continue;
                 entry->data.cFileName[2] == _T('\0'))) {
                                continue;
             }
         }
         if (entry->hTreeItem) continue;
-//        entry->hTreeItem = AddEntryToTree(hWnd, entry); 
+//        entry->hTreeItem = AddEntryToTree(hWnd, entry);
 
                if (entry->up && entry->up->hTreeItem) {
 
                if (entry->up && entry->up->hTreeItem) {
-//            entry->hTreeItem = AddEntryToTree(hWnd, entry->up->hTreeItem, entry->data.cFileName, entry, 0); 
-            entry->hTreeItem = AddEntryToTree(hWnd, entry->up->hTreeItem, entry->data.cFileName, NULL, 1); 
+//            entry->hTreeItem = AddEntryToTree(hWnd, entry->up->hTreeItem, entry->data.cFileName, entry, 0);
+            entry->hTreeItem = AddEntryToTree(hWnd, entry->up->hTreeItem, entry->data.cFileName, NULL, 1);
                } else {
                } else {
-            entry->hTreeItem = AddEntryToTree(hWnd, TVI_ROOT, entry->data.cFileName, NULL, 0); 
+            entry->hTreeItem = AddEntryToTree(hWnd, TVI_ROOT, entry->data.cFileName, NULL, 0);
 //                AddEntryToTree(hwndTV, pnmtv->itemNew.hItem, Name, NULL, dwCount);
                }
         if (entry->expanded) {
 //                AddEntryToTree(hwndTV, pnmtv->itemNew.hItem, Name, NULL, dwCount);
                }
         if (entry->expanded) {
@@ -229,15 +229,15 @@ static void insert_tree_entries(HWND hWnd, Entry* entry/*Root* pRoot*/, int idx)
        ShowWindow(hWnd, SW_SHOW);
 }
 
        ShowWindow(hWnd, SW_SHOW);
 }
 
-static BOOL InitTreeViewItems(HWND hwndTV, ChildWnd* pChildWnd) 
-{ 
+static BOOL InitTreeViewItems(HWND hwndTV, ChildWnd* pChildWnd)
+{
     TVITEM tvi;
     TVINSERTSTRUCT tvins;
     HTREEITEM hRoot;
        TCHAR buffer[MAX_PATH];
 
        wsprintf(buffer, _T("%s - [%s]"), pChildWnd->pRoot->path, pChildWnd->pRoot->fs);
     TVITEM tvi;
     TVINSERTSTRUCT tvins;
     HTREEITEM hRoot;
        TCHAR buffer[MAX_PATH];
 
        wsprintf(buffer, _T("%s - [%s]"), pChildWnd->pRoot->path, pChildWnd->pRoot->fs);
-    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM; 
+    tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN | TVIF_PARAM;
     tvi.pszText = buffer;
     tvi.cchTextMax = lstrlen(tvi.pszText);
     tvi.iImage = Image_Root;
     tvi.pszText = buffer;
     tvi.cchTextMax = lstrlen(tvi.pszText);
     tvi.iImage = Image_Root;
@@ -264,50 +264,50 @@ static BOOL InitTreeViewItems(HWND hwndTV, ChildWnd* pChildWnd)
                s_init = 1;
                init_output(hwndTV);
        }
                s_init = 1;
                init_output(hwndTV);
        }
-    return TRUE; 
-} 
+    return TRUE;
+}
 
 
 
 
-// InitTreeViewImageLists - creates an image list, adds three bitmaps 
-// to it, and associates the image list with a tree view control. 
-// Returns TRUE if successful, or FALSE otherwise. 
-// hwndTV - handle to the tree view control. 
+// InitTreeViewImageLists - creates an image list, adds three bitmaps
+// to it, and associates the image list with a tree view control.
+// Returns TRUE if successful, or FALSE otherwise.
+// hwndTV - handle to the tree view control.
 
 
-static BOOL InitTreeViewImageLists(HWND hwndTV) 
-{ 
-    HIMAGELIST himl;  // handle to image list 
-    HBITMAP hbmp;     // handle to bitmap 
+static BOOL InitTreeViewImageLists(HWND hwndTV)
+{
+    HIMAGELIST himl;  // handle to image list
+    HBITMAP hbmp;     // handle to bitmap
 
 
-    // Create the image list. 
-    if ((himl = ImageList_Create(CX_BITMAP, CY_BITMAP, 
-        FALSE, NUM_BITMAPS, 0)) == NULL) 
-        return FALSE; 
+    // Create the image list.
+    if ((himl = ImageList_Create(CX_BITMAP, CY_BITMAP,
+        FALSE, NUM_BITMAPS, 0)) == NULL)
+        return FALSE;
 
 
-    // Add the open file, closed file, and document bitmaps. 
-    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FOLDER_RED)); 
-    Image_Open = ImageList_Add(himl, hbmp, (HBITMAP) NULL); 
-    DeleteObject(hbmp); 
+    // Add the open file, closed file, and document bitmaps.
+    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FOLDER_RED));
+    Image_Open = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
+    DeleteObject(hbmp);
 
 
-    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FOLDER_OPEN)); 
-    Image_Closed = ImageList_Add(himl, hbmp, (HBITMAP) NULL); 
-    DeleteObject(hbmp); 
+    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FOLDER_OPEN));
+    Image_Closed = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
+    DeleteObject(hbmp);
 
 
-    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FOLDER)); 
-    Image_Root = ImageList_Add(himl, hbmp, (HBITMAP) NULL); 
-    DeleteObject(hbmp); 
+    hbmp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_FOLDER));
+    Image_Root = ImageList_Add(himl, hbmp, (HBITMAP) NULL);
+    DeleteObject(hbmp);
 
 
-    // Fail if not all of the images were added. 
-    if (ImageList_GetImageCount(himl) < 3) 
-        return FALSE; 
+    // Fail if not all of the images were added.
+    if (ImageList_GetImageCount(himl) < 3)
+        return FALSE;
 
 
-    // Associate the image list with the tree view control. 
-    TreeView_SetImageList(hwndTV, himl, TVSIL_NORMAL); 
+    // Associate the image list with the tree view control.
+    TreeView_SetImageList(hwndTV, himl, TVSIL_NORMAL);
 
 
-    return TRUE; 
-} 
+    return TRUE;
+}
 
 BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
 
 BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
-{ 
+{
        Root* pRoot = NULL;
     TCHAR szPath[1000];
     int keyPathLen = 0;
        Root* pRoot = NULL;
     TCHAR szPath[1000];
     int keyPathLen = 0;
@@ -332,7 +332,7 @@ BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
 
         insert_tree_entries(hwndTV, pRoot->entry.down, 0);
 
 
         insert_tree_entries(hwndTV, pRoot->entry.down, 0);
 
-//             entry->hTreeItem = AddEntryToTree(hWnd, entry->up->hTreeItem, entry->data.cFileName, NULL, 1); 
+//             entry->hTreeItem = AddEntryToTree(hWnd, entry->up->hTreeItem, entry->data.cFileName, NULL, 1);
 
 /*
                HKEY hNewKey;
 
 /*
                HKEY hNewKey;
@@ -366,7 +366,7 @@ BOOL OnTreeExpanding(HWND hwndTV, NMTREEVIEW* pnmtv)
     }
     expanding = FALSE;
     return TRUE;
     }
     expanding = FALSE;
     return TRUE;
-} 
+}
 /*
 static void read_directory_win(Entry* parent, LPCTSTR path)
 {
 /*
 static void read_directory_win(Entry* parent, LPCTSTR path)
 {
@@ -479,16 +479,16 @@ void OnGetDispInfo(NMTVDISPINFO* ptvdi)
         ptvdi->item.cChildren = 5;
     }
     if (ptvdi->item.mask & TVIF_IMAGE) {
         ptvdi->item.cChildren = 5;
     }
     if (ptvdi->item.mask & TVIF_IMAGE) {
-        ptvdi->item.iImage = Image_Root; 
+        ptvdi->item.iImage = Image_Root;
     }
     if (ptvdi->item.mask & TVIF_SELECTEDIMAGE) {
     }
     if (ptvdi->item.mask & TVIF_SELECTEDIMAGE) {
-        ptvdi->item.iSelectedImage = Image_Closed; 
+        ptvdi->item.iSelectedImage = Image_Closed;
     }
     if (ptvdi->item.mask & TVIF_TEXT) {
     }
     if (ptvdi->item.mask & TVIF_TEXT) {
-//        ptvdi->item.pszText = entry->data.cFileName; 
-//        ptvdi->item.cchTextMax = lstrlen(entry->data.cFileName); 
+//        ptvdi->item.pszText = entry->data.cFileName;
+//        ptvdi->item.cchTextMax = lstrlen(entry->data.cFileName);
     }
     }
-} 
+}
 
 void UpdateStatus(HWND hWnd, Entry* pEntry)
 {
 
 void UpdateStatus(HWND hWnd, Entry* pEntry)
 {
@@ -527,29 +527,29 @@ void UpdateStatus(HWND hWnd, Entry* pEntry)
     }
 }
 
     }
 }
 
-// CreateTreeView - creates a tree view control. 
-// Returns the handle to the new control if successful, or NULL otherwise. 
-// hwndParent - handle to the control's parent window. 
+// CreateTreeView - creates a tree view control.
+// Returns the handle to the new control if successful, or NULL otherwise.
+// hwndParent - handle to the control's parent window.
 
 
-HWND CreateTreeView(HWND hwndParent, ChildWnd* pChildWnd, int id) 
-{ 
+HWND CreateTreeView(HWND hwndParent, ChildWnd* pChildWnd, int id)
+{
     RECT rcClient;
     HWND hwndTV;
     RECT rcClient;
     HWND hwndTV;
-    // Get the dimensions of the parent window's client area, and create the tree view control. 
-    GetClientRect(hwndParent, &rcClient); 
-    hwndTV = CreateWindowEx(0, WC_TREEVIEW, _T("Tree View"), 
+
+    // Get the dimensions of the parent window's client area, and create the tree view control.
+    GetClientRect(hwndParent, &rcClient);
+    hwndTV = CreateWindowEx(0, WC_TREEVIEW, _T("Tree View"),
         WS_VISIBLE | WS_CHILD | WS_BORDER | WS_EX_CLIENTEDGE | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
         WS_VISIBLE | WS_CHILD | WS_BORDER | WS_EX_CLIENTEDGE | TVS_HASLINES | TVS_HASBUTTONS | TVS_LINESATROOT,
-        0, 0, rcClient.right, rcClient.bottom, 
-        hwndParent, (HMENU)id, hInst, NULL); 
-    // Initialize the image list, and add items to the control. 
-    if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pChildWnd)) { 
-        DestroyWindow(hwndTV); 
-        return NULL; 
-    } 
+        0, 0, rcClient.right, rcClient.bottom,
+        hwndParent, (HMENU)id, hInst, NULL);
+    // Initialize the image list, and add items to the control.
+    if (!InitTreeViewImageLists(hwndTV) || !InitTreeViewItems(hwndTV, pChildWnd)) {
+        DestroyWindow(hwndTV);
+        return NULL;
+    }
        SendMessage(hwndTV, WM_SETFONT, (WPARAM)Globals.hFont, FALSE);
     return hwndTV;
        SendMessage(hwndTV, WM_SETFONT, (WPARAM)Globals.hFont, FALSE);
     return hwndTV;
-} 
+}
 
 ////////////////////////////////////////////////////////////////////////////////
 
 
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -557,22 +557,22 @@ HWND CreateTreeView(HWND hwndParent, ChildWnd* pChildWnd, int id)
 
 static WNDPROC g_orgTreeWndProc;
 
 
 static WNDPROC g_orgTreeWndProc;
 
-// OnEndLabelEdit - processes the LVN_ENDLABELEDIT notification message. 
-// Returns TRUE if the label is changed, or FALSE otherwise. 
+// OnEndLabelEdit - processes the LVN_ENDLABELEDIT notification message.
+// Returns TRUE if the label is changed, or FALSE otherwise.
 
 static BOOL OnEndLabelEdit(NMTVDISPINFO* ptvdi)
 
 static BOOL OnEndLabelEdit(NMTVDISPINFO* ptvdi)
-{ 
-//    if (ptvdi->item.iItem == -1) 
-//        return FALSE; 
-    // Copy the new label text to the application-defined structure. 
+{
+//    if (ptvdi->item.iItem == -1)
+//        return FALSE;
+
+    // Copy the new label text to the application-defined structure.
 //    lstrcpyn(rgPetInfo[ptvdi->item.iItem].szKind, ptvdi->item.pszText, 10);
 //    lstrcpyn(rgPetInfo[ptvdi->item.iItem].szKind, ptvdi->item.pszText, 10);
-    
+
     return TRUE;
     // To make a more robust application you should send an EM_LIMITTEXT
     // message to the edit control to prevent the user from entering too
     return TRUE;
     // To make a more robust application you should send an EM_LIMITTEXT
     // message to the edit control to prevent the user from entering too
-    // many characters in the field. 
-} 
+    // many characters in the field.
+}
 
 static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
 
 static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
@@ -587,14 +587,14 @@ static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
                break;
 #endif
     case WM_NOTIFY:
                break;
 #endif
     case WM_NOTIFY:
-        switch (((LPNMHDR)lParam)->code) { 
-//        case TVM_EXPAND: 
+        switch (((LPNMHDR)lParam)->code) {
+//        case TVM_EXPAND:
 //            OnTreeExpand((int)wParam, (HTREEITEM*)lParam);
 //            break;
 //            OnTreeExpand((int)wParam, (HTREEITEM*)lParam);
 //            break;
-        case TVN_GETDISPINFO: 
-            OnGetDispInfo((NMTVDISPINFO*)lParam); 
-            break; 
-        case TVN_ITEMEXPANDING: 
+        case TVN_GETDISPINFO:
+            OnGetDispInfo((NMTVDISPINFO*)lParam);
+            break;
+        case TVN_ITEMEXPANDING:
             return OnTreeExpanding(hWnd, (NMTREEVIEW*)lParam);
             break;
         case TVN_SELCHANGED:
             return OnTreeExpanding(hWnd, (NMTREEVIEW*)lParam);
             break;
         case TVN_SELCHANGED:
@@ -608,11 +608,11 @@ static LRESULT CALLBACK TreeWndProc(HWND hWnd, UINT message, WPARAM wParam, LPAR
             TRACE("TreeWndProc(...) TVN_SINGLEEXPAND\n");
             //lpnmtv = (LPNMTREEVIEW)lParam;
             //return TVNRET_DEFAULT;
             TRACE("TreeWndProc(...) TVN_SINGLEEXPAND\n");
             //lpnmtv = (LPNMTREEVIEW)lParam;
             //return TVNRET_DEFAULT;
-//            return TVNRET_SKIPOLD; // Skip default processing of the item being unselected. 
-//            return TVNRET_SKIPNEW; // Skip default processing of the item being selected. 
+//            return TVNRET_SKIPOLD; // Skip default processing of the item being unselected.
+//            return TVNRET_SKIPNEW; // Skip default processing of the item being selected.
             break;
 #endif
             break;
 #endif
-        case TVN_ENDLABELEDIT: 
+        case TVN_ENDLABELEDIT:
             return OnEndLabelEdit((NMTVDISPINFO*)lParam);
             break;
         }
             return OnEndLabelEdit((NMTVDISPINFO*)lParam);
             break;
         }
index 9f2a26f..f794cbf 100644 (file)
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include <windowsx.h>
 #include <ctype.h>
 
 #include <windowsx.h>
 #include <ctype.h>
 
@@ -253,7 +253,7 @@ void frame_get_clientspace(HWND hWnd, PRECT prect)
                prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
                                                2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
                                                GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
                prect->bottom = wp.rcNormalPosition.bottom-wp.rcNormalPosition.top-
                                                2*(GetSystemMetrics(SM_CYSIZEFRAME)+GetSystemMetrics(SM_CYEDGE))-
                                                GetSystemMetrics(SM_CYCAPTION)-GetSystemMetrics(SM_CYMENUSIZE);
-       }   
+       }
        if (IsWindowVisible(Globals.hToolBar)) {
                GetClientRect(Globals.hToolBar, &rt);
                prect->top += rt.bottom+2;
        if (IsWindowVisible(Globals.hToolBar)) {
                GetClientRect(Globals.hToolBar, &rt);
                prect->top += rt.bottom+2;
index 7eb31d1..cd32240 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <commctrl.h>
 #define WIN32_LEAN_AND_MEAN     // Exclude rarely-used stuff from Windows headers
 #include <windows.h>
 #include <commctrl.h>
@@ -29,7 +29,7 @@
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
 #include <tchar.h>
 #include <process.h>
 #include <stdio.h>
-    
+
 #include <windowsx.h>
 #include <process.h>
 #include <assert.h>
 #include <windowsx.h>
 #include <process.h>
 #include <assert.h>
index 4d6c08d..98de0b3 100644 (file)
@@ -19,7 +19,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-    
+
 #ifndef __WORKER_H__
 #define __WORKER_H__
 
 #ifndef __WORKER_H__
 #define __WORKER_H__