define type Tcl_FreeProc

This commit is contained in:
Joachim Schoeberl 2022-05-07 19:40:16 +02:00
parent 81f5ed5415
commit 03332c1146
3 changed files with 7 additions and 5 deletions

View File

@ -13,7 +13,7 @@ void Ng_Redraw (bool blocking) { if(Ptr_Ng_Redraw) Ptr_Ng_Redraw(blocking); }
namespace netgen namespace netgen
{ {
void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, const int freeProc) = nullptr; void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc) = nullptr;
void (*Ptr_Ng_Tcl_CreateCommand)(Tcl_Interp *interp, void (*Ptr_Ng_Tcl_CreateCommand)(Tcl_Interp *interp,
const char *cmdName, Tcl_CmdProc *proc) = nullptr; const char *cmdName, Tcl_CmdProc *proc) = nullptr;
void (*Ptr_Render)(bool) = nullptr; void (*Ptr_Render)(bool) = nullptr;

View File

@ -18,6 +18,8 @@ DLL_HEADER extern void (*Ptr_Ng_Redraw) (bool blocking);
class Tcl_Interp; class Tcl_Interp;
typedef int (Tcl_CmdProc) (void * clientData, Tcl_Interp *interp, typedef int (Tcl_CmdProc) (void * clientData, Tcl_Interp *interp,
int argc, const char *argv[]); int argc, const char *argv[]);
typedef void (Tcl_FreeProc) (char *blockPtr);
namespace netgen { namespace netgen {
inline constexpr int NG_TCL_VOLATILE = 1; inline constexpr int NG_TCL_VOLATILE = 1;
@ -29,7 +31,7 @@ namespace netgen {
inline constexpr int NG_TCL_RETURN = 2; inline constexpr int NG_TCL_RETURN = 2;
inline constexpr int NG_TCL_BREAK = 3; inline constexpr int NG_TCL_BREAK = 3;
inline constexpr int NG_TCL_CONTINUE = 4; inline constexpr int NG_TCL_CONTINUE = 4;
DLL_HEADER extern void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, const int freeProc); DLL_HEADER extern void (*Ptr_Ng_Tcl_SetResult)(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc);
DLL_HEADER extern void (*Ptr_Ng_Tcl_CreateCommand)(Tcl_Interp *interp, DLL_HEADER extern void (*Ptr_Ng_Tcl_CreateCommand)(Tcl_Interp *interp,
const char *cmdName, Tcl_CmdProc *proc); const char *cmdName, Tcl_CmdProc *proc);
@ -49,7 +51,7 @@ namespace netgen {
if(Ptr_UpdateVisSurfaceMeshData) Ptr_UpdateVisSurfaceMeshData(oldnl, locpointsptr, loclinesptr, plainpointsptr); if(Ptr_UpdateVisSurfaceMeshData) Ptr_UpdateVisSurfaceMeshData(oldnl, locpointsptr, loclinesptr, plainpointsptr);
} }
inline void Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, const int freeProc) inline void Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc)
{ {
if(Ptr_Ng_Tcl_SetResult) if(Ptr_Ng_Tcl_SetResult)
Ptr_Ng_Tcl_SetResult(interp, result, freeProc); Ptr_Ng_Tcl_SetResult(interp, result, freeProc);

View File

@ -2,9 +2,9 @@
#include "../libsrc/meshing/visual_interface.hpp" #include "../libsrc/meshing/visual_interface.hpp"
static void Impl_Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, const int freeProc) static void Impl_Ng_Tcl_SetResult(Tcl_Interp *interp, char *result, Tcl_FreeProc *freeProc)
{ {
Tcl_SetResult(interp, result, (Tcl_FreeProc*)freeProc); Tcl_SetResult(interp, result, freeProc);
} }
static void Impl_Ng_Tcl_CreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc) static void Impl_Ng_Tcl_CreateCommand(Tcl_Interp *interp, const char *cmdName, Tcl_CmdProc *proc)