#include <stdio.h>
-int main(int argc, char** argv){
- if(argc < 2){
+int main(int argc, char** argv) {
+ if(argc < 2) {
fprintf(stderr, "Usage: %s filename\n", argv[0]);
return 1;
}
Tcl_Interp* interp = Tcl_CreateInterp();
Tcl_FindExecutable(argv[0]);
- if(Tcl_Init(interp) == TCL_ERROR){
+ if(Tcl_Init(interp) == TCL_ERROR) {
const char* errmsg = Tcl_GetStringResult(interp);
fprintf(stderr, "Tcl error: %s\n", errmsg);
return -1;
}
- if(W3_Init(interp) == TCL_ERROR){
+ if(W3_Init(interp) == TCL_ERROR) {
const char* errmsg = Tcl_GetStringResult(interp);
fprintf(stderr, "LibW3 error: %s\n", errmsg);
return -1;
}
- if(Tcl_EvalFile(interp, argv[1]) == TCL_ERROR){
+ if(Tcl_EvalFile(interp, argv[1]) == TCL_ERROR) {
const char* errmsg = Tcl_GetStringResult(interp);
fprintf(stderr, "Tcl error: %s\n", errmsg);
return -1;
return TCL_ERROR;
}
char* name = Tcl_GetString(objv[2]);
- if(__dictionary != NULL){
+ if(__dictionary != NULL) {
int i;
- for(i = 0; __dictionary[i] != NULL; i += 2){
- if(strcasecmp(__dictionary[i], name) == 0){
+ for(i = 0; __dictionary[i] != NULL; i += 2) {
+ if(strcasecmp(__dictionary[i], name) == 0) {
const char* errmsg = "argument error: a client named that already exists";
Tcl_SetObjResult(interp, Tcl_NewStringObj(errmsg, strlen(errmsg)));
return TCL_ERROR;