HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CMD_Manager.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Command library (C++)
7  *
8  * COMMENTS: Handle command parsing for expansion.
9  * The command manager class also contains the interface to the
10  * long operation interrupt mechanism.
11  *
12  */
13 
14 #ifndef __CMD_Manager_H__
15 #define __CMD_Manager_H__
16 
17 #include "CMD_API.h"
18 #include "CMD_Command.h"
19 #include "CMD_Source.h"
20 #include "CMD_Variable.h"
21 
22 #include <CH/CH_Manager.h>
24 
25 #include <UT/UT_Assert.h>
26 #include <UT/UT_NonCopyable.h>
27 #include <UT/UT_Spawn.h>
28 #include <UT/UT_String.h>
29 #include <UT/UT_StringArray.h>
30 #include <UT/UT_StringSet.h>
31 #include <UT/UT_SymbolTable.h>
32 #include <UT/UT_ValArray.h>
33 
34 #include <iosfwd>
35 
36 
37 class UT_WorkArgs;
39 class CMD_Args;
40 class CMD_Loop;
41 class CMD_AliasTable;
42 class CMD_Manager;
43 class CMD_Command;
45 class cmd_FalseCallback;
46 
47 extern "C" {
48  SYS_VISIBILITY_EXPORT extern void CMDextendLibrary(CMD_Manager *theManager);
49 }
50 
51 typedef void (*CMD_PostCmdCallback)(void *userdata);
52 typedef void (*CMD_CommandEchoCallback)(const char *echo_line,void *userdata);
53 
57 
58 #define CMD_STATUS_VARIABLE "status"
59 
60 
61 /// This class to keeps track of the hscript context, installed commands,
62 /// variables, aliases, command buffer, and the prompt.
63 class CMD_API CMD_Manager : public CH_Manager {
64 public:
65  CMD_Manager(const UT_StringHolder &appname);
66  ~CMD_Manager() override;
67 
68  /// @private
69  /// Called just before the CMD_Manger will be deleted
70  void aboutToDelete() override final;
71 
72  void setContext() override;
73  // this command won't assert
74  static bool getContextExists() { return theManager != NULL; }
75 
76  /// retrieves the global CMD_Manager
78  {
79  UT_ASSERT( theManager );
80  return theManager;
81  }
82 
83  /// Return the name of the application
84  const UT_StringHolder &appName() const { return myAppName; }
85 
86  /// Send input to the command manager. If the command is complete,
87  /// the command will be executed, otherwise there will be input pending
88  /// with the remainder of the input sitting in a buffer until there's
89  /// a full command.
90  void sendInput(const char *input, bool create_block = true);
91 
92  /// This version splits the input into lines and sends them to the single
93  /// line sendInput. We need a non-const char * so we can avoid copying the
94  /// data. The components of the string are modified, and then restored, so
95  /// you don't actually have to worry about the string being modified.
96  void sendMultiLineInput(const char *input,
97  bool create_block = true);
98 
99  /// Force execution of a command
100  void execute(const char *cmd, bool add_to_history = false,
101  std::ostream *out=0, std::ostream *err=0,
102  bool do_alias_expansion = true,
103  bool create_block = true);
104 
105  /// Non-threadsafe versions of sendInput()/sendMultiLineInput()/execute().
106  /// These methods cannot be called on the same CMD_Manager object from
107  /// multiple threads.
108  /// @{
109  void sendInputNoLock(
110  const char *input,
111  bool create_block = true);
112  void sendMultiLineInputNoLock(
113  const char *input,
114  bool create_block = true);
115  void executeNoLock(
116  const char *cmd,
117  bool add_to_history = false,
118  std::ostream *out = 0,
119  std::ostream *err = 0,
120  bool do_alias_expansion = true,
121  bool create_block = true);
122  /// @}
123 
124  /// Try to complete the given command prefix to the longest common string.
125  /// If an exact match is found, append a " ".
126  void completeCommand(const char *prefix,
127  UT_String &command) const;
128 
129  /// Return a list of all commands that start with the given prefix.
130  void matchCommands(const char *prefix,
131  UT_StringArray &matches) const;
132 
133  /// Install a command into the command list.
134  void installCommand(const char *name, const char *options,
135  CMD_Callback cb, bool is_safe = true);
136 
137  /// Uninstall a command from the command list - this replaces it with the
138  /// previous version of the command. The method returns @c false if there
139  /// was no such command.
140  bool uninstallCommand(const char *name);
141 
142  /// Mark a command as having a special callback when inside a "false" if
143  /// block. That is, usually commands are skipped when they are inside an
144  /// if block which has evaluated as false. If this method is called, the
145  /// command will have the given callback invoked in false if statements.
146  bool markCommandForFalseIfStatements(const char *name,
147  CMD_Callback cb);
148 
149  /// Install a callback that gets executed after every command.
150  /// 'userdata' is passed on each call to the callback.
151  /// Returns the previous installed post command callback.
152  CMD_PostCmdCallback setPostCmdCallback(
153  CMD_PostCmdCallback callback, void *userdata);
154  /// Return the userdata set in setPostCmdCallback().
155  void * getPostCmdCallbackData() const
156  { return myPostCmdCallbackData; }
157 
158  /// Install a callback that gets run after every command is echoed,
159  /// if echoing is turned on. Your callback may never keep a pointer to
160  /// the data that is passed in.
161  void setCommandEchoCallback(
162  CMD_CommandEchoCallback callback,
163  void *userdata);
164  /// Return the userdata set in setCommandEchoCallback().
166  { return myCommandEchoCallbackData; }
167 
168  /// Displays a list of all commands.
169  void commandDump(std::ostream &os, const char *pattern=0,
170  const char *prefix=0) const;
171  /// Displays help documentation for the given command. Returns \c true
172  /// if a single command matched, \c false if multiple commands matched
173  /// and a help message or a dump is printed out.
174  void commandHelp(std::ostream &os, const char *cmd,
175  bool full_match_only = false) const;
176 
177  void saveAliases(std::ostream &os);
178  void saveVariables(std::ostream &os, bool level0_locals);
179 
180  /// Toggle to enable/disable recording of commands in the history buffer.
181  /// The previous value of the toggle is returned.
182  int setHistoryCapture(int onOff)
183  {
184  int prev = myHistoryCapture;
185  myHistoryCapture = onOff;
186  return prev;
187  }
188  CMD_Source *pushSource(const char *filename, int verbose=0);
189  CMD_Source *popSource(int checkLoop = 1);
191  {
192  UT_ASSERT(mySourceStack.entries());
193  return mySourceStack(mySourceStack.entries()-1);
194  }
195  int getSourceLevel() { return mySourceStack.entries()-1; }
196 
197  void pushOutputStreams(std::ostream &out, std::ostream &err);
198  void popOutputStreams();
199 
200  /// Removes the named variable
201  void unsetVariable(const char *name);
202  /// Resets all variables to their defaults.
203  void resetVariables();
204  /// Sets a value for the named variable, creating it if necessary. Set
205  /// 'local' to 0 if the value should be exported.
206  void setVariable(const char *name, const char *value,
207  int local, int uplevel=0);
208 
209  /// Returns true if the named variable exists.
210  bool hasVariable(const char *name) const;
211  /// Returns the value of the named variable.
212  bool getVariable(const char *name, UT_String &value)
213  { return getVariableValueByName(name, value); }
214  /// Returns the value of the named variable as a fpreal64.
215  bool getVariable(const char *name, fpreal64 &value)
216  { return getVariableValueByName(name, value); }
217  /// Returns the value of the named variable as a float.
218  bool getVariable(const char *name, fpreal32 &value)
219  { return getVariableValueByName(name, value); }
220  /// Returns the value of the named variable as an int.
221  bool getVariable(const char *name, int32 &value)
222  { return getVariableValueByName(name, value); }
223  /// Returns the value of the named variable as an int.
224  bool getVariable(const char *name, int64 &value)
225  { return getVariableValueByName(name, value); }
226 
227  bool hasEnv(const char *name) const;
228  bool getEnv(const char *name, UT_String &value);
229  /// Returns a list of all defined variables.
230  void getVariableNames(UT_StringArray &names, int dirty=0);
231  int clearDirtyVariables();
232  int clearDirtyVariables(const UT_StringArray &names);
233  /// Returns true if the name is legal and no variable with the name is
234  /// currently defined.
235  int isVariableNameOk(const char *name);
236 
237  /// Sets the current hip file name, which also sets the HIP and HIPFILE
238  /// variables. Returns true if HIP was changed by this call.
239  bool setMotName(const char *path, bool dovarchange);
240  /// Convenience method to set the JOB variable.
241  void setJob(const char *path);
242 
243  /// Return the number of commands run. It's possible for this to overflow
244  unsigned getCommandsRun() const { return myCommandCount; }
245 
246  std::ostream &getError(int printMessage = 1);
247 
248  /// These two return pointers to their previous streams so that
249  /// you can restore them if you need to:
250  std::ostream *setStandardOut(std::ostream &os);
251  std::ostream *setStandardErr(std::ostream &os);
252  /// Call this if you are deleting a stream that was previously used
253  /// in a call to setStandard[Out|Err].
254  void streamDeleted(std::ostream &os);
255 
256  void setPrompt(const char *prompt);
257  const char *getPrompt(int level = -1) const
258  {
259  if (level < 0 || level >= myPromptStack.entries())
260  level = myPromptStack.entries()-1;
261  return myPromptStack(level);
262  }
263  void pushPrompt(const char *prompt);
264  void popPrompt();
265 
266  int isLoopCommand(const char *str);
267 
268  int evaluateCondition(const char *expr);
269  int evaluateCondition(int argc, const char *argv[]);
270 
271  /// These two functions are inverses of each other. If the string is
272  /// written out using saveProtectedString(), then you MUST use
273  /// expandControlSequences() when loading the string back in.
274  static void saveProtectedString(std::ostream &os, const char *s);
275  static void expandControlSequences(UT_String &str);
276 
277  // buildQuotedCommandLineStringForBinaryData creates a single-quoted string
278  // that can be used when building an hscript command string. The data
279  // encoded into the string may be arbitrary binary data that may contain
280  // nulls. The hscript command that receives this argument (after the
281  // single-quoted string has been parsed by the hscript command-line engine)
282  // can retrieve the original data with retrieveBinaryDataFromInsideCommand.
283  static void buildQuotedCommandLineStringForBinaryData(
285  static void retrieveBinaryDataFromInsideCommand(
286  const char *encoded_data, UT_WorkBuffer &result);
287 
288  /// Displays the contents of the history buffer.
289  void dumpHistory(std::ostream &os) const;
290  /// Clears the history buffer.
291  void clearHistory();
292 
293  /// Returns an entry from the history buffer. Index 0 being the most
294  /// recent command.
295  const char *getHistoryCommand(int n) const;
296  /// Returns the number of entries in the history buffer.
297  unsigned int getHistoryCount() const;
298 
299  CMD_VariableTable *getGlobalVariables() { return myGlobals; }
300  CMD_AliasTable *getAliases() { return myAliases; }
301  /// Returns the replacement for the named alias. Returns false if the
302  /// alias is not found.
303  bool getAlias(const char *name, UT_String &value);
304  /// Create a new alias or override an existing alias.
305  void setAlias(const char *name, const char *value);
306  /// Removes the named alias.
307  void destroyAlias(const char *name);
308  /// Removes all aliases.
309  void destroyAliases();
310 
311 
312  /// Specify whether a global hscript variable may be overwritten by an
313  /// environment variable's value when loading the hip file, instead of
314  /// just using the value saved in the hip file.
315  void allowEnvironmentToOverwriteVariable(
316  const char *name, bool onoff);
317  /// Should we use the environment variable value when loading this variable
318  /// from the hip file?
319  bool isEnvironmentAllowedToOverwriteVariable(
320  const char *name);
321  /// Say that we're loading the global variables from a hip file or that
322  /// we're done loading them.
324  { myIsLoadingGlobalVariables = onoff; }
325  /// Are we loading global variables from the hip file?
327  { return myIsLoadingGlobalVariables; }
328 
329 
330  /// Register a variable change notification center object.
332  CMD_VariableChangeNotifier * notifier )
333  { myVariableChangeNotifier = notifier; }
334  /// Returns a variable change notification center object.
336  { return myVariableChangeNotifier; }
337 
338  void saveCommandString(std::ostream &os, const UT_String &str);
339 
340  /// Now, here, we provide some nice functions to handle getting arguments
341  void getFrameRange(CMD_Args &args,
342  int &fstart, int &fend, int &finc,
343  char oframe = 'f', char ofinc = 'i');
344 
345  void setContinueLevel(int level) { myContinueLevel=level; }
346  int getContinueLevel() const { return myContinueLevel; }
347  void bumpBreakLevel(int dir) { myBreakLevel += dir; }
348  int getBreakLevel() const { return myBreakLevel; }
349  void bumpLoopNestLevel(int dir)
350  {
351  myLoopNestLevel += dir;
352  if (!myLoopNestLevel)
353  {
354  myBreakLevel = 0;
355  }
356  }
357  int getLoopNestLevel() const { return myLoopNestLevel; }
358  CMD_Loop *buildLoop(const char *text);
359  void doPrompt();
360  void getPrompt(UT_String &str);
361 
362  void setVerbose(int on_off);
363  int getVerbose() const;
364 
365  void setCommandEcho(bool on_off)
366  { myCommandEchoFlag = on_off; }
367  bool getCommandEcho() const { return myCommandEchoFlag; }
368 
369  void setIORedirection(int on_off);
370  int getIORedirection() const;
371 
372  /// Returns the getopts-style options for the given command.
373  const char *getOptions(const char *cmdName);
374 
375  /// Returns true if the command is defined.
376  int isCommandDefined(const char *name)
377  {
378  return findCommand(name, 1) >= 0;
379  }
380  void getDSOCommands(CMD_CommandList &list);
381 
382  bool isLoading() const { return (myInLoadCount > 0); }
383  void beginLoading() { myInLoadCount++; }
384  void endLoading() { myInLoadCount--; }
385 
386  void setSafeMode(int safe_mode);
387  int isInSafeMode() const;
388  void setBrowserMode(int browser_mode);
389  int isInBrowserMode() const;
390 
391  /// Sets the status code. Use a non-zero value to indicate the last
392  /// command failed.
393  void setStatusCode( int status_code )
394  { myStatusCode = status_code; }
395  /// Returns non-zero if the last command failed.
396  int getStatusCode() const
397  { return myStatusCode; }
398 
399  /// The following versions of openPort vary slightly from one another.
400  /// Some versions take CMD_Args for error output while some take
401  /// an ostream. Some versions take a const char * for the command to
402  /// execute, while others take a "const char *const*" array of arguments
403  /// for the command.
404  ///
405  /// Note that if we're told to execute a program, the port will be closed
406  /// when the program exits.
407  /// @{
408  bool openPort(int port, bool safe, bool quiet,
409  bool wait, CMD_Args &args,
410  const char *execute, pid_t *pid,
411  bool separateerrors, bool suppress = true,
412  const char *ip_mask = 0,
414  child_exited_callback = 0,
415  bool detach_console_for_execute=false,
416  bool drain_queue_when_waiting_for_exec=true);
417  bool openPort(int port, bool safe, bool quiet,
418  bool wait, std::ostream &error_output,
419  const char *execute, pid_t *pid,
420  bool separateerrors, bool suppress = true,
421  const char *ip_mask = 0,
423  child_exited_callback = 0,
424  bool detach_console_for_execute=false,
425  bool drain_queue_when_waiting_for_exec=true);
426  bool openPort(int port, bool safe, bool quiet,
427  bool wait, CMD_Args &args,
428  const char *const*execute_argv, pid_t *pid,
429  bool separateerrors, bool suppress = true,
430  const char *ip_mask = 0,
432  child_exited_callback = 0,
433  bool detach_console_for_execute=false,
434  bool drain_queue_when_waiting_for_exec=true);
435  bool openPort(int port, bool safe, bool quiet,
436  bool wait, std::ostream &error_output,
437  const char *const*execute_argv, pid_t *pid,
438  bool separateerrors, bool suppress = true,
439  const char *ip_mask = 0,
441  child_exited_callback = 0,
442  bool detach_console_for_execute=false,
443  bool drain_queue_when_waiting_for_exec=true);
444  /// @}
445 
446  /// Closes a port opened with openPort().
447  void closePort(int port);
448  void closeAutoPort();
449 
450  bool beginChannelBlock();
451  bool endChannelBlock();
452 
453  void echoOff();
454  void echoOn();
455 
456  // Resolve channel labels and node path without exposing OP_Node*
457  bool getChRefLabelForUI(const CH_ChannelRef &r,
458  UT_String &ret) const override;
459  bool getChRefAlias(const CH_ChannelRef &r,
460  UT_String &ret) const override;
461  bool getChRefNodePath(const CH_ChannelRef &r,
462  UT_String &ret) const override;
463 
464  /// Retrieve an automatically-generated port via openport -a
465  /// Will be the same from call to call unless the port is closed
466  static int getHScriptPort();
467 
468  /// Command for handling python command. This is a static public function
469  /// so that the overridden version can call this default
470  /// implementation depending on the command format.
471  static void cmd_python(CMD_Args &args);
472 
473  /// Prevent python os.environ from being update when setting Houdini
474  /// global variables.
475  static void setUpdatePythonEnvironmentVariables(bool b);
476  static bool getUpdatePythonEnvironmentVariables();
477 
478 protected:
479  bool getVariableString(const char *name, UT_String &value,
480  int &timeDepend, int thread) override;
481 
482 private:
483  void destroyContents();
484 
485  template <typename T> bool
486  getVariableValueByName(const char *name, T &value);
487 
488  friend class cmd_SendInput;
489  friend class cmd_SendMultiLineInput;
490  friend class cmd_Execute;
491 
492  void internalSendInput(const char *input,
493  bool run_pushed_source=false);
494  // Commands for handling if statements
495  static void cmd_if (CMD_Args &args);
496  static void cmd_else (CMD_Args &args);
497  static void cmd_endif(CMD_Args &args);
498  static void cmd_read (CMD_Args &args);
499 
500  // This version of openPort() is called by the public versions.
501  bool openPort(int port, bool safe, bool quiet,
502  bool wait, CMD_Args *args,
503  std::ostream *error_output,
504  const char *const*execute_argv, pid_t *pid,
505  bool separateerrors, bool suppress,
506  const char *ip_mask,
508  child_exited_callback,
509  bool detach_console_for_execute,
510  bool drain_queue_when_waiting_for_exec=true);
511  // Find a cmd for me, if exact is specified, the command has to match
512  // exactly.
513  void processInput(CMD_Source *top, const char *line);
514  void internalExecute(const char *str);
515  void runCommand(char *str);
516  void initLibraryGlue();
517  int findCommand(const char *name, int exact = 0);
518  void sortCommands();
519  void installBaseCommands();
520  void addPortExtension();
521  CMD_CommandList *getCommandList(const UT_StringHolder &list_name);
522  void installBuiltInVariables();
523  void installObsoleteCommands();
524  int aliasExpand(UT_String &str);
525  void setReadVariables(const char *str);
526  void breakAllSources();
527  void updateNoAliasVariable();
528  void pushStandardOut(std::ostream *os);
529  void popStandardOut();
530  void pushStandardErr(std::ostream *os);
531  void popStandardErr();
532  void updateStatusVariable();
533 
534  // Process the options for the command, stripping them out and returning
535  // the new argc.
536  void stripOptions(const CMD_Command *cmd, CMD_Args &args);
537 
538  // Used by setMotName to update the HIP, HIPNAME, and HIPFILE variables.
539  bool setHipVars(const char *hipfile,
540  const char *hipname,
541  const char *hip,
542  bool setpwd,
543  bool dovarchange);
544 
545 private: // data
546  CMD_CommandList *myCmdList;
547  CMD_PromptStack myPromptStack;
548  UT_String myPendingCommands;
549  UT_String myReadVariables;
550  int myReadVariablesLocal;
551  UT_SymbolMap<CMD_Command *> myExactList;
552  UT_SymbolMap<cmd_FalseCallback *> *myFalseMarkedCommands;
553  CMD_SourceStack mySourceStack;
554  CMD_VariableTable *myGlobals;
555  UT_StringSet myEnvironmentOverridableGlobals;
556  bool myIsLoadingGlobalVariables;
557  CMD_VariableChangeNotifier *myVariableChangeNotifier;
558  CMD_AliasTable *myAliases;
559  UT_ValArray<std::ostream *> myStandardOuts;
560  UT_ValArray<std::ostream *> myStandardErrs;
561  unsigned myCommandCount;
562  int myAliasProtect; // No alias expansion
563  int myFlags;
564  int myBreakLevel;
565  int myContinueLevel;
566  int myLoopNestLevel;
567  int myLocalSetLevel;
568  int myExecuteCommandStack;
569  int myStatusCode;
570  unsigned myAliasExpand:1,
571  myHistoryExpand:1,
572  myHistoryCapture:1,
573  myIsInSafeMode:1,
574  myIsInBrowserMode:1;
575  UT_StringHolder myAppName;
576  UT_String myUnfinishedInput;
577 
578  int myInLoadCount;
579  int myEchoOff;
580 
581  CMD_PostCmdCallback myPostCmdCallback;
582  void *myPostCmdCallbackData;
583 
584  // Support for command echoing
585  CMD_CommandEchoCallback myCommandEchoCallback;
586  void *myCommandEchoCallbackData;
587 
588  // The command echo flag tells us whether or not to echo every command
589  // back out to the stdout. The myOldCommandEchoFlag is used to remember
590  // our state so that we can turn off command echoing during a source.
591  bool myCommandEchoFlag;
592 
593  // A set of commands that no longer do anything, but we keep them around
594  // to prevent scripts and hip files from erroring out.
595  UT_StringSet myObsoleteCommands;
596 
597  static bool theUpdatePythonEnvironmentVariables;
598 
599  static CH_AutoEventHandler *theCHEventHandler;
600  static int theChannelBlockCount;
601  static CMD_Manager *theManager;
602 };
603 
604 inline
606 {
607  return CMD_Manager::getContext();
608 }
609 
610 // Disable the updating of Python Env variables.
612 {
613 public:
615  {
618  }
620  {
622  }
624 private:
625  bool myPrevious;
626 };
627 
628 
629 //////////////////////////////////////////////////////////////////////////////
630 //
631 // Inline definitions
632 //
633 
634 template <typename T> bool
635 CMD_Manager::getVariableValueByName(const char *name, T &value)
636 {
637  CMD_Source *src;
639  int i;
640 
641  for (i = mySourceStack.entries()-1; i >= 0; i--)
642  {
643  src = mySourceStack(i);
644  table = src->getLocalVariables();
645  if (table->getVariable(name, value))
646  return true;
647  }
648  return myGlobals->getVariable(name, value);
649 }
650 
651 #endif
void setStatusCode(int status_code)
Definition: CMD_Manager.h:393
void(* CMD_PostCmdCallback)(void *userdata)
Definition: CMD_Manager.h:51
int getStatusCode() const
Returns non-zero if the last command failed.
Definition: CMD_Manager.h:396
CMD_VariableTable * getGlobalVariables()
Definition: CMD_Manager.h:299
void bumpLoopNestLevel(int dir)
Definition: CMD_Manager.h:349
bool getVariable(const char *name, fpreal32 &value)
Returns the value of the named variable as a float.
Definition: CMD_Manager.h:218
GT_API const UT_StringHolder filename
int int32
Definition: SYS_Types.h:39
virtual bool getVariableString(const char *name, UT_String &value, int &time_depend, int thread)
void * getCommandEchoCallbackData() const
Return the userdata set in setCommandEchoCallback().
Definition: CMD_Manager.h:165
bool isLoading() const
Definition: CMD_Manager.h:382
static bool getContextExists()
Definition: CMD_Manager.h:74
#define SYS_VISIBILITY_EXPORT
void
Definition: png.h:1083
bool getVariable(const char *name, int32 &value)
Returns the value of the named variable as an int.
Definition: CMD_Manager.h:221
virtual bool getChRefLabelForUI(const CH_ChannelRef &r, UT_String &ret) const
void setCommandEcho(bool on_off)
Definition: CMD_Manager.h:365
void(* CMD_CommandEchoCallback)(const char *echo_line, void *userdata)
Definition: CMD_Manager.h:52
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
int getSourceLevel()
Definition: CMD_Manager.h:195
bool getVariable(const char *name, int64 &value)
Returns the value of the named variable as an int.
Definition: CMD_Manager.h:224
bool getVariable(const char *name, UT_String &value)
Returns the value of the named variable.
Definition: CMD_Manager.h:212
int getContinueLevel() const
Definition: CMD_Manager.h:346
GLint level
Definition: glcorearb.h:108
GLdouble s
Definition: glad.h:3009
UT_Array< CMD_Source * > CMD_SourceStack
Definition: CMD_Manager.h:55
virtual void setContext()
void * getPostCmdCallbackData() const
Return the userdata set in setPostCmdCallback().
Definition: CMD_Manager.h:155
void initLibraryGlue()
**But if you need a result
Definition: thread.h:613
void(* CMD_Callback)(CMD_Args &args)
Definition: CMD_Command.h:24
SYS_VISIBILITY_EXPORT void CMDextendLibrary(CMD_Manager *theManager)
Definition: channel.C:85
float fpreal32
Definition: SYS_Types.h:200
CMD_Source * getSource()
Definition: CMD_Manager.h:190
int getLoopNestLevel() const
Definition: CMD_Manager.h:357
virtual bool getChRefAlias(const CH_ChannelRef &r, UT_String &ret) const
unsigned getCommandsRun() const
Return the number of commands run. It's possible for this to overflow.
Definition: CMD_Manager.h:244
static CMD_Manager * getContext()
retrieves the global CMD_Manager
Definition: CMD_Manager.h:77
void setIsLoadingGlobalVariables(bool onoff)
Definition: CMD_Manager.h:323
CMD_VariableChangeNotifier * getVariableChangeNotifier() const
Returns a variable change notification center object.
Definition: CMD_Manager.h:335
double fpreal64
Definition: SYS_Types.h:201
bool getVariable(const char *name, fpreal64 &value)
Returns the value of the named variable as a fpreal64.
Definition: CMD_Manager.h:215
GLdouble n
Definition: glcorearb.h:2008
static bool getUpdatePythonEnvironmentVariables()
void setContinueLevel(int level)
Definition: CMD_Manager.h:345
CMD_AliasTable * getAliases()
Definition: CMD_Manager.h:300
bool getCommandEcho() const
Definition: CMD_Manager.h:367
int setHistoryCapture(int onOff)
Definition: CMD_Manager.h:182
bool isLoadingGlobalVariables()
Are we loading global variables from the hip file?
Definition: CMD_Manager.h:326
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
int isCommandDefined(const char *name)
Returns true if the command is defined.
Definition: CMD_Manager.h:376
bool getVariable(const char *name, UT_String &value)
Definition: CMD_Variable.h:30
long long int64
Definition: SYS_Types.h:116
GLuint const GLchar * name
Definition: glcorearb.h:786
void endLoading()
Definition: CMD_Manager.h:384
GLushort pattern
Definition: glad.h:2583
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
void beginLoading()
Definition: CMD_Manager.h:383
int getBreakLevel() const
Definition: CMD_Manager.h:348
GLenum GLenum GLsizei void * table
Definition: glad.h:5129
void(* ChildExitedCallback)(FS_ServerSocketListener &, void *callback_data, bool listener_forced_to_close)
UT_Array< char * > CMD_PromptStack
Definition: CMD_Manager.h:56
CMD_Manager * CMDgetManager()
Definition: CMD_Manager.h:605
*tasks wait()
const UT_StringHolder & appName() const
Return the name of the application.
Definition: CMD_Manager.h:84
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
#define CMD_API
Definition: CMD_API.h:10
void bumpBreakLevel(int dir)
Definition: CMD_Manager.h:347
static void setUpdatePythonEnvironmentVariables(bool b)
**If you just want to fire and args
Definition: thread.h:609
GLdouble GLdouble GLdouble top
Definition: glad.h:2817
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
const char * getPrompt(int level=-1) const
Definition: CMD_Manager.h:257
GLboolean r
Definition: glcorearb.h:1222
CMD_VariableTable * getLocalVariables()
Definition: CMD_Source.h:47
#define const
Definition: zconf.h:214
UT_StringArray JOINTS hip
void setVariableChangeNotifier(CMD_VariableChangeNotifier *notifier)
Register a variable change notification center object.
Definition: CMD_Manager.h:331
Definition: format.h:895
UT_ValArray< CMD_Command * > CMD_CommandList
Definition: CMD_Manager.h:54
virtual bool getChRefNodePath(const CH_ChannelRef &r, UT_String &ret) const
GLenum src
Definition: glcorearb.h:1793