Check-in [c3c642f5c8]
Overview
Comment:Updated to hide commands which are not used and may cause slow-ness
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c3c642f5c872193e758970e5bec162856f4b7091
User & Date: rkeene on 2014-11-05 18:39:06
Other Links: manifest | tags
Context
2014-11-05
18:39
Cleanup and updated to use a random filename check-in: 83a6196bd7 user: rkeene tags: trunk
18:39
Updated to hide commands which are not used and may cause slow-ness check-in: c3c642f5c8 user: rkeene tags: trunk
2014-11-04
01:16
Added basic pure-Tcl sha1 fallback implementation check-in: 5c9ce56320 user: rkeene tags: trunk
Changes

Modified appfsd.c from [e3ba0e89d2] to [7ccc07ce2d].

79
80
81
82
83
84
85


86
87
88
89
90
91
92
93
94
95


96
97
98
99
100
101
102
103
104
105
106


107
108
109
110
111


112
113
114
115
116
117
118
119
120


121
122







123
124
125
126
127
128
129
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146







+
+










+
+











+
+





+
+









+
+


+
+
+
+
+
+
+







	const char *fmt;
};

static Tcl_Interp *appfs_create_TclInterp(const char *cachedir) {
	Tcl_Interp *interp;
	int tcl_ret;

	APPFS_DEBUG("Creating new Tcl interpreter for TID = 0x%llx", (unsigned long long) pthread_self());

	interp = Tcl_CreateInterp();
	if (interp == NULL) {
		fprintf(stderr, "Unable to create Tcl Interpreter.  Aborting.\n");

		return(NULL);
	}

	tcl_ret = Tcl_Init(interp);
	if (tcl_ret != TCL_OK) {
		fprintf(stderr, "Unable to initialize Tcl.  Aborting.\n");

		Tcl_DeleteInterp(interp);

		return(NULL);
	}

	tcl_ret = Tcl_Eval(interp, ""
#include "appfsd.tcl.h"
	"");
	if (tcl_ret != TCL_OK) {
		fprintf(stderr, "Unable to initialize Tcl AppFS script.  Aborting.\n");
		fprintf(stderr, "Tcl Error is: %s\n", Tcl_GetStringResult(interp));

		Tcl_DeleteInterp(interp);

		return(NULL);
	}

	if (Tcl_SetVar(interp, "::appfs::cachedir", cachedir, TCL_GLOBAL_ONLY) == NULL) {
		fprintf(stderr, "Unable to set cache directory.  This should never fail.\n");

		Tcl_DeleteInterp(interp);

		return(NULL);
	}

	tcl_ret = Tcl_Eval(interp, "::appfs::init");
	if (tcl_ret != TCL_OK) {
		fprintf(stderr, "Unable to initialize Tcl AppFS script (::appfs::init).  Aborting.\n");
		fprintf(stderr, "Tcl Error is: %s\n", Tcl_GetStringResult(interp));

		Tcl_DeleteInterp(interp);

		return(NULL);
	}

	Tcl_HideCommand(interp, "package", "package");
	Tcl_HideCommand(interp, "glob", "glob");
	Tcl_HideCommand(interp, "exec", "exec");
	Tcl_HideCommand(interp, "pid", "pid");
	Tcl_HideCommand(interp, "auto_load_index", "auto_load_index");
	Tcl_HideCommand(interp, "unknown", "unknown");

	return(interp);
}

static int appfs_Tcl_Eval(Tcl_Interp *interp, int objc, const char *cmd, ...) {
	Tcl_Obj **objv;
	const char *arg;