/* Copyright (c) 1994, 2002 Alex Leigh, All Rights Reserved
 *
 * THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ALEX LEIGH
 * The copyright notice above does not evidence any
 * actual or intended publication of such source code.
 *
 * Disclosure, copying, distribution, or transmission of
 * this code without express permission is prohibited.
 */

#ifndef MODTCL_H
#define MODTCL_H

#ifndef __GNUC__
#pragma ident "$Header: /san01/cvs/ashpool/csrc/modtcl/src/Attic/modtcl.h,v 1.3 2004/03/11 00:52:02 eric Exp $"
#endif

#include <tcl.h>
#include <sys/stat.h>
#include "../continuity/continuity.h"
#include "../modhttp/http.h"

struct tclSthr_data {
  Tcl_Interp *interp;
  int delete;
};
typedef struct tclSthr_data tclTthr_data;

struct tclScmd {
  char *name;
  Tcl_CmdProc *proc;
  ClientData clientData;
};
typedef struct tclScmd tclTcmd;

void tclFdata_free(void *p);
int tclFinit(void *p, lstTset * opts);
tclTthr_data *tclFdata_get(void);
Tcl_Interp *tclFinterp_get(char *server);
void tclFeval(char *server, char *script);
int tclFinterp_cleanup(tclTthr_data *data);
void tclFerror(Tcl_Interp *interp);

/* cmds.c */
void tclFsetup_cmds(Tcl_Interp *interp);
void tclFcmds_register(Tcl_Interp *interp, tclTcmd *cmd);
int tclFta_log(ClientData ignored, Tcl_Interp *interp, int argc, const char **argv);
int tclFta_write(ClientData ignored, Tcl_Interp *interp, int argc, const char **argv);
int tclFta_startresponse(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFta_setstatus(ClientData ignored, Tcl_Interp *interp, int argc, const char **argv);
void tclFbind_dyn_command(char *name, Tcl_CmdProc *proc);
int tclFta_http_vars_get(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFta_http_res_get(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFta_http_req_get(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFta_pwd(ClientData ignored, Tcl_Interp *interp, int argc, const char **argv);
int tclFta_http_req_set(ClientData ignored, Tcl_Interp *interp, int argc, const char **argv);
int tclFta_http_res_set(ClientData ignored, Tcl_Interp *interp, int argc, const char **argv);
int tclFta_http_var_set(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFhttp_query_value(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFlist_get(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFhttp_query_parse(ClientData ignored, Tcl_Interp *interp, int argc, const char **argv);
int tclFdb_open(ClientData ignored, Tcl_Interp *interp, int argc, const char **argv);
int tclFdb_select(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFdb_getrow(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFjpg_getsize(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFurl_encode(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFurl_decode(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFdb_close(ClientData ignored, Tcl_Interp *interp, int argc,const  char **argv);
int tclFtav_set(ClientData ignored, Tcl_Interp * interp, int argc,const  char **argv);
int tclFtav_get(ClientData ignored, Tcl_Interp * interp, int argc,const  char **argv);
int tclFtav_exists(ClientData ignored, Tcl_Interp * interp, int argc, const char **argv);
int tclFhttp_query_get(ClientData ignored, Tcl_Interp * interp, int argc,const  char **argv);
#endif