00001 /* 00002 * Copyright (c) 2005, 2006 by KoanLogic s.r.l. <http://www.koanlogic.com> 00003 * All rights reserved. 00004 * 00005 * This file is part of KLone, and as such it is subject to the license stated 00006 * in the LICENSE file which you have received as part of this distribution. 00007 * 00008 * $Id: translat.h,v 1.8 2006/01/09 12:38:38 tat Exp $ 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 key[CODEC_CIPHER_KEY_SIZE]; 00029 char emsg[EMSG_BUFSZ]; 00030 int comp; 00031 int encrypt; 00032 size_t file_size; 00033 time_t mtime; 00034 } trans_info_t; 00035 00036 int translate(trans_info_t*); 00037 00038 int translate_script_to_c(io_t *in, io_t *out, trans_info_t* ti); 00039 int translate_opaque_to_c(io_t *in, io_t *out, trans_info_t* ti); 00040 00041 #ifdef __cplusplus 00042 } 00043 #endif 00044 00045 #endif