|
From: <cre...@us...> - 2007-02-19 00:44:32
|
Revision: 1608
http://svn.sourceforge.net/frontierkernel/?rev=1608&view=rev
Author: creecode
Date: 2007-02-18 16:44:32 -0800 (Sun, 18 Feb 2007)
Log Message:
-----------
in function cmdiconhit, removed unused oldthreads ifndef code
Modified Paths:
--------------
Frontier/branches/Frontier_Long_File_Paths/Common/source/command.c
Modified: Frontier/branches/Frontier_Long_File_Paths/Common/source/command.c
===================================================================
--- Frontier/branches/Frontier_Long_File_Paths/Common/source/command.c 2007-02-19 00:27:12 UTC (rev 1607)
+++ Frontier/branches/Frontier_Long_File_Paths/Common/source/command.c 2007-02-19 00:44:32 UTC (rev 1608)
@@ -43,18 +43,16 @@
#include "command.h"
-
#define cmdtextitem 1
-
static hdlprocessrecord quickscriptprocess = nil;
-
static boolean cmdsavestring (short stringnumber, Handle htext) {
-#pragma unused(stringnumber)
+ #pragma unused(stringnumber)
+
/*
the cmd dialog only has one string, so we ignore the stringnumber param.
@@ -77,22 +75,28 @@
if (!equalhandles (htext, (**hc).hscriptstring)) {
if ((**hc).hscriptstring == nil) { /* 2004-12-03 creedon, aradke */
+
copyhandle (htext, &h);
+
(**hc).hscriptstring = h;
+
}
else
copyhandlecontents (htext, (**hc).hscriptstring);
(**hc).fldirty = true;
+
}
return (true);
+
} /*cmdsavestring*/
static boolean cmdloadstring (short stringnumber, Handle *h) {
-#pragma unused(stringnumber)
+ #pragma unused(stringnumber)
+
/*
1/21/93 dmb: don't set superglobals manually anymore
@@ -102,6 +106,7 @@
assert (cancoonglobals != nil);
return (copyhandle ((**cancoonglobals).hscriptstring, h));
+
} /*cmdloadstring*/
@@ -151,8 +156,9 @@
static boolean cmdtexthit (Point pt) {
-#pragma unused (pt)
+ #pragma unused (pt)
+
/*
2.1b6 dmb: use debugging context for zooming, if available
*/
@@ -174,18 +180,21 @@
pophashtable ();
scriptunlockdebuggingcontext ();
+
}
}
return (true);
+
} /*cmdtexthit*/
static boolean cmdprocesscallback (void) {
-
+
miniinvalicon (idcommandconfig);
return (true);
+
} /*cmdprocesscallback*/
@@ -252,34 +261,42 @@
static boolean cmdiconhit (void) {
+
+ //
+ // 2007-02-17 creedon: removed unused oldthreads ifndef code
+ //
+ // 5.0b17 dmb: minigetstring result is ours to consume
+ //
+ // 5.0d14 dmb: minidialog now uses full text handles, not bigstrings
+ //
+ // 2.1b2 dmb: pass -1 for errorrefcon instead of zero to prevent top level
+ // lexical scope from being transparent (i.e. visible to
+ // subroutines)
+ //
+ // 2.1a6 dmb: reworked threading for thread mgr 1.1
+ //
+ // 1991-12-12 dmb: extract the text handle from the dialog record's TE
+ // record to overcome the miniwindow's string-oriented
+ // architecture. Unfortunately, the text also saved in the
+ // database as a string, to this is just a band-aid, not a
+ // real fix.
+ //
+ // 1991-10-27 dmb: don't dispose result value if processruncode returns
+ // false
+ //
+ // 1991-10-25 dmb: check new process's disposewhenidleflag before running
+ // it.
+ //
+ // 1991-08-20 dmb: when the process completes, we're in another thread and
+ // can't assume that the window is around anymore, let
+ // alone that its globals are set. to handle this
+ // (crashing) situation, use new minisetwindowmessage to
+ // display the result.
+ //
+ // 1991-05021 dmb: run the string as a process so we can handle errors
+ // nicely.
+ //
- /*
- 5/21/91 dmb: run the string as a process so we can handle errors nicely.
-
- 8/20/91 dmb: when the process completes, we're in another thread and can't
- assume that the window is around anymore, let alone that its globals are
- set. to handle this (crashing) situation, use new minisetwindowmessage
- to display the result.
-
- 10/25/91 dmb: check new process's disposewhenidleflag before running it.
-
- 10/27/91 dmb: don't dispose result value if processruncode returns false
-
- 12/12/91 dmb: extract the text handle from the dialog record's TE record to
- overcome the miniwindow's string-oriented architecture. Unfortunately, the
- text also saved in the database as a string, to this is just a band-aid, not
- a real fix.
-
- 2.1a6 dmb: reworked threading for thread mgr 1.1
-
- 2.1b2 dmb: pass -1 for errorrefcon instead of zero to prevent top level
- lexical scope from being transparent (i.e. visible to subroutines)
-
- 5.0d14 dmb: minidialog now uses full text handles, not bigstrings
-
- 5.0b17 dmb: minigetstring result is ours to consume
- */
-
Handle hscript;
hdltreenode hcode;
boolean fl;
@@ -292,11 +309,12 @@
sysbeep ();
return (false);
+
}
-
+
if ( ! langpusherrorcallback ( &cmderrorroutine, ( long ) -1 ) )
return (false);
-
+
minigetstring (0, &hscript);
fl = langbuildtree (hscript, false, &hcode); /*consumes htext*/
@@ -305,7 +323,7 @@
if (!fl) /*syntax error*/
return (false);
-
+
langerrorclear (); /*compilation produced no error, be sure error window is empty*/
if ( ! newprocess ( hcode, true, &cmderrorroutine, ( long ) -1, &hprocess ) ) {
@@ -313,62 +331,32 @@
langdisposetree (hcode);
return (false);
+
}
-
+
hp = hprocess; /*copy into register*/
(**hp).processstartedroutine = &cmdprocesscallback;
(**hp).processkilledroutine = &cmdprocesscallback;
- #ifndef oldthreads
-
if (!newprocessthread (&cmdthreadmain, (tythreadmainparams) hp, &hthread)) {
disposeprocess (hp);
return (false);
+
}
-
+
quickscriptprocess = hp; /*can only run one of these at a time*/
return (true);
- #else
-
- quickscriptprocess = hp; /*can only run one of these at a time*/
-
- if (!innewprocessthread (&hthread)) /*not in new thread -- we're done with synchonous stuff*/
- return (true);
-
- if ((hthread == nil) || (**hp).fldisposewhenidle)
- fl = false;
- else
- fl = processruncode (hp, &val);
-
- disposeprocess (hp);
-
- if (!fl)
- setbooleanvalue (false, &val);
-
- hashgetvaluestring (val, bsresult);
-
- disposetmpvalue (val);
-
- minisetwindowmessage (idcommandconfig, bsresult); /*can't assume miniwindow is around anymore*/
-
- quickscriptprocess = nil; /*clear "semaphore"*/
-
- endprocessthread (hthread);
-
- return (false); /*if we got here, hthread was nil*/
-
- #endif
} /*cmdiconhit*/
static boolean cmdgettargetdata (short id) {
-
+
/*
we don't want our script to operate on our window
@@ -382,11 +370,12 @@
return (false);
return (id == -1) || (id == idwordprocessor);
+
} /*cmdgettargetdata*/
static void cmdcheckrunbutton (void) {
-
+
/*
boolean fl = debuggingcurrentprocess () || !processisoneshot (false);
*/
@@ -394,11 +383,12 @@
boolean fl = (quickscriptprocess == nil) /*&& !processbusy ()*/ ;
(**minidata).fliconenabled = fl;
+
} /*cmdcheckrunbutton*/
static boolean cmdsetfields (void) {
-
+
register hdlminirecord hm = minidata;
bigstring bs;
@@ -436,14 +426,14 @@
boolean startcmddialog (void) {
-
+
return (startminidialog (idcommandconfig, &cmdsetfields));
} /*startcmddialog*/
boolean cmdstart (void) {
-
+
return (ministart (idcommandconfig));
} /*cmdstart*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|