00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __UT_SysSpecific_h__
00023 #define __UT_SysSpecific_h__
00024
00025 #include "UT_API.h"
00026 #include "UT_Defines.h"
00027 #include <SYS/SYS_Platform.h>
00028 #include <stdlib.h>
00029 #include <stdarg.h>
00030 #include <stdio.h>
00031 #include <string>
00032
00033 #ifdef GCC3
00034 #include <cxxabi.h>
00035 #endif
00036
00037 class UT_String;
00038
00039
00040
00041
00042
00043
00044 UT_API extern const char *UTgetTextEditor(bool &is_graphical);
00045
00046 UT_API extern void UTinvokeTextEditor(const char *fileToEdit, UT_Bool blocking, const char *title);
00047
00048 UT_API extern UT_Bool UTopenShell(UT_Bool blocking, const char *title);
00049
00050 UT_API extern UT_Bool UTrunTextProgram(const char *commandLine, UT_Bool blocking, const char *title);
00051
00052 UT_API extern UT_Bool UTrunGraphicalProgram(const char *commandLine, UT_Bool blocking, const char *title);
00053
00054
00055
00056
00057 UT_API extern int UTsystem(const char *commandLine, bool in_shell = false);
00058
00059
00060 UT_API extern void UTopenURLInWebBrowser( const char * url );
00061
00062 UT_API extern void UTgetProcessor(int &majortype, int &flags);
00063
00064
00065 static inline const char *UTgetOsProc() { return SYSgetOsProc(); }
00066
00067
00068
00069
00070 UT_API extern void UTgetUserName(UT_String &name, int alphaonly = 1);
00071
00072
00073 UT_API extern void UTdisplayMessageWindow(const char *message_text,
00074 const char *message_title = "Houdini Error");
00075 UT_API extern void UTdisplayMessageWindowWithHelpURL(const char *message_text,
00076 const char *help_url,
00077 const char *message_title = "Houdini Error");
00078 UT_API extern bool UTdisplayConfirmationWindow(const char *message_text,
00079 const char *message_title = "Houdini");
00080
00081 static inline int
00082 UTvsnprintf(char *str, size_t size, const char *format, va_list ap)
00083 {
00084
00085 #ifdef WIN32
00086 return _vsnprintf(str, size, format, ap);
00087 #else
00088 int result;
00089 va_list ap_copy;
00090
00091
00092
00093
00094
00095
00096
00097 va_copy(ap_copy, ap);
00098 result = vsnprintf(str, size, format, ap_copy);
00099 va_end(ap_copy);
00100 return result;
00101 #endif
00102 }
00103
00104 static inline std::string
00105 UTunmangleClassNameFromTypeIdName(const std::string &name)
00106 {
00107 #ifdef GCC3
00108
00109
00110 int status;
00111 char *unmangled_name = abi::__cxa_demangle(
00112 name.c_str(), NULL, NULL, &status);
00113
00114 if (status != 0)
00115 return name;
00116
00117 std::string result(unmangled_name);
00118 free(unmangled_name);
00119 return result;
00120 #else
00121 return name;
00122 #endif
00123 }
00124
00125 #if defined(IRIX6)
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136 #define UTstatic_cast(Type, Data) ((Type)(Data))
00137 #else
00138 #define UTstatic_cast(Type, Data) static_cast<Type>(Data)
00139 #endif
00140
00141 #endif // __UT_SysSpecific_h__