00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _KLONE_TRANSLAT_H_
00012 #define _KLONE_TRANSLAT_H_
00013
00014 #include <u/libu.h>
00015 #include <klone/io.h>
00016 #include <klone/codecs.h>
00017
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021
00022 enum { URI_BUFSZ = 1024, MIME_BUFSZ = 256, EMSG_BUFSZ = 512 };
00023
00024 typedef struct trans_info_s
00025 {
00026 char file_in[U_FILENAME_MAX], file_out[U_FILENAME_MAX];
00027 char uri[URI_BUFSZ], mime_type[MIME_BUFSZ];
00028 char dfun[URI_BUFSZ];
00029 char key[CODEC_CIPHER_KEY_SIZE];
00030 char emsg[EMSG_BUFSZ];
00031 int comp;
00032 int encrypt;
00033 size_t file_size;
00034 time_t mtime;
00035 } trans_info_t;
00036
00037 int translate(trans_info_t*);
00038
00039 int translate_script_to_c(io_t *in, io_t *out, trans_info_t* ti);
00040 int translate_opaque_to_c(io_t *in, io_t *out, trans_info_t* ti);
00041
00042 #ifdef __cplusplus
00043 }
00044 #endif
00045
00046 #endif