modules_k/msilo/msfuncs.h

00001 /*
00002  * $Id$
00003  *
00004  * Copyright (C) 2001-2003 FhG Fokus
00005  *
00006  * This file is part of Kamailio, a free SIP server.
00007  *
00008  * Kamailio is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version
00012  *
00013  * Kamailio is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  */
00022 
00023 #ifndef _MSFUNCS_H_
00024 #define _MSFUNCS_H_
00025 
00026 #include <time.h>
00027 #include "../../str.h"
00028 
00029 #define CT_TYPE         1
00030 #define CT_CHARSET      2
00031 #define CT_MSGR         4
00032 
00033 #ifdef MSILO_TAG
00034 #undef MSILO_TAG
00035 #endif
00036 #define MSILO_TAG       "msilo-HI4U-Ah0X-bZ98-"
00037 
00038 typedef struct _content_type
00039 {
00040         str type;
00041         str charset;
00042         str msgr;
00043 } content_type_t;
00044 
00046 int m_apo_escape(char*, int, char*, int);
00047 
00049 int m_extract_content_type(char*, int, content_type_t*, int);
00050 
00052 int m_build_headers(str *buf, str ctype, str contact, time_t date, str extra);
00053 
00055 int m_build_body(str *body, time_t date, str msg, time_t sdate);
00056 
00057 int ms_extract_time(str *time_str, int *time_val);
00058 
00059 #endif
00060