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