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