/***************************************************************** * sthp.h this header file contains macros and * prototypes functions for String Type * Handle Protocol * * Copyright (C) 2009 Andrey Y. Rjavskov(aka rjaan) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * *****************************************************************/ #ifndef __STHP_H #define __STHP_H 1 #include #ifdef __cplusplus extern "C" { #endif typedef enum _StringTypeId StringTypeId; enum _StringTypeId { STI_DEC = 0, STI_CHARS, STI_EMPTY }; #define STHP_UNIXSERVER_PATH "/tmp/sthpd.unixsocket" #define STRING_TYPE_NAME(t) ( t == STI_DEC ? "DEC" :\ t == STI_CHARS ? "CHARS" : t == STI_EMPTY ? "EMPTY" : "UNKNOWN" ) #define EMPETY_STRING (char*)("") #define STDERRMSG_HAVE_BYTE_DEFAULT 0 #define STHP_OK_REPLY "OK REPLY" #define STHP_OK_REPLY_SIZE sizeof(STHP_OK_REPLY) #define STHP_MAXLINE 1024 extern char* sthp_puts( void ); extern void sthp_free( char *s ); extern void print_stderr ( int nchars, const char* format, ... ); extern StringTypeId sthp_is_string_type_from( const char *str ); extern void sthp_set_signal ( int *sockfd_ptr ); extern int sthp_send ( int sockfd, char* string ); extern int sthp_recv ( int sockfd, char** string ); #ifdef __cplusplus } #endif #endif /*__STHP_UTILS_H*/ /*eof*/