summaryrefslogtreecommitdiffstats
path: root/generic/tclOO.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclOO.h')
-rw-r--r--generic/tclOO.h64
1 files changed, 41 insertions, 23 deletions
diff --git a/generic/tclOO.h b/generic/tclOO.h
index 7bcb4a7..a6e8a22 100644
--- a/generic/tclOO.h
+++ b/generic/tclOO.h
@@ -4,33 +4,47 @@
* This file contains the public API definitions and some of the function
* declarations for the object-system (NB: not Tcl_Obj, but ::oo).
*
- * Copyright (c) 2006-2008 by Donal K. Fellows
+ * Copyright (c) 2006-2010 by Donal K. Fellows
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tclOO.h,v 1.7 2008/11/01 08:05:49 dkf Exp $
*/
#ifndef TCLOO_H_INCLUDED
#define TCLOO_H_INCLUDED
-#include "tcl.h"
-
-#if defined(BUILD_tcloo)
-# define TCLOOAPI DLLEXPORT
-# undef USE_TCLOO_STUBS
-#else
-# define TCLOOAPI DLLIMPORT
-#endif
/*
* Be careful when it comes to versioning; need to make sure that the
- * standalone TclOO version matches...
+ * standalone TclOO version matches. Also make sure that this matches the
+ * version in the files:
+ *
+ * tests/oo.test
+ * tests/ooNext2.test
+ * unix/tclooConfig.sh
+ * win/tclooConfig.sh
*/
-#define TCLOO_VERSION "0.6.1"
+#define TCLOO_VERSION "1.0.1"
#define TCLOO_PATCHLEVEL TCLOO_VERSION
+#include "tcl.h"
+
+/*
+ * For C++ compilers, use extern "C"
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const char *TclOOInitializeStubs(
+ Tcl_Interp *, const char *version);
+#define Tcl_OOInitStubs(interp) \
+ TclOOInitializeStubs((interp), TCLOO_VERSION)
+#ifndef USE_TCL_STUBS
+# define TclOOInitializeStubs(interp, version) (TCLOO_PATCHLEVEL)
+#endif
+
/*
* These are opaque types.
*/
@@ -46,13 +60,13 @@ typedef struct Tcl_ObjectContext_ *Tcl_ObjectContext;
* and to allow the attachment of arbitrary data to objects and classes.
*/
-typedef int (*Tcl_MethodCallProc)(ClientData clientData, Tcl_Interp *interp,
+typedef int (Tcl_MethodCallProc)(ClientData clientData, Tcl_Interp *interp,
Tcl_ObjectContext objectContext, int objc, Tcl_Obj *const *objv);
-typedef void (*Tcl_MethodDeleteProc)(ClientData clientData);
-typedef int (*Tcl_CloneProc)(Tcl_Interp *interp, ClientData oldClientData,
+typedef void (Tcl_MethodDeleteProc)(ClientData clientData);
+typedef int (Tcl_CloneProc)(Tcl_Interp *interp, ClientData oldClientData,
ClientData *newClientData);
-typedef void (*Tcl_ObjectMetadataDeleteProc)(ClientData clientData);
-typedef int (*Tcl_ObjectMapMethodNameProc)(Tcl_Interp *interp,
+typedef void (Tcl_ObjectMetadataDeleteProc)(ClientData clientData);
+typedef int (Tcl_ObjectMapMethodNameProc)(Tcl_Interp *interp,
Tcl_Object object, Tcl_Class *startClsPtr, Tcl_Obj *methodNameObj);
/*
@@ -67,12 +81,13 @@ typedef struct {
* declarations. */
const char *name; /* Name of this type of method, mostly for
* debugging purposes. */
- Tcl_MethodCallProc callProc;/* How to invoke this method. */
- Tcl_MethodDeleteProc deleteProc;
+ Tcl_MethodCallProc *callProc;
+ /* How to invoke this method. */
+ Tcl_MethodDeleteProc *deleteProc;
/* How to delete this method's type-specific
* data, or NULL if the type-specific data
* does not need deleting. */
- Tcl_CloneProc cloneProc; /* How to copy this method's type-specific
+ Tcl_CloneProc *cloneProc; /* How to copy this method's type-specific
* data, or NULL if the type-specific data can
* be copied directly. */
} Tcl_MethodType;
@@ -96,10 +111,10 @@ typedef struct {
* to TCL_OO_METADATA_VERSION_CURRENT in
* declarations. */
const char *name;
- Tcl_ObjectMetadataDeleteProc deleteProc;
+ Tcl_ObjectMetadataDeleteProc *deleteProc;
/* How to delete the metadata. This must not
* be NULL. */
- Tcl_CloneProc cloneProc; /* How to copy the metadata, or NULL if the
+ Tcl_CloneProc *cloneProc; /* How to copy the metadata, or NULL if the
* type-specific data can be copied
* directly. */
} Tcl_ObjectMetadataType;
@@ -118,6 +133,9 @@ typedef struct {
#include "tclOODecls.h"
+#ifdef __cplusplus
+}
+#endif
#endif
/*