00001 /* 00002 * $Id$ 00003 * 00004 * Copyright (C) 2001-2003 FhG Fokus 00005 * 00006 * This file is part of ser, a free SIP server. 00007 * 00008 * ser 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 * For a license to use the ser software under conditions 00014 * other than those described here, or to purchase support for this 00015 * software, please contact iptel.org by e-mail at the following addresses: 00016 * info@iptel.org 00017 * 00018 * ser is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program; if not, write to the Free Software 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00026 */ 00027 00028 00029 00030 #ifndef _FLAGS_H 00031 #define _FLAGS_H 00032 00033 enum { FL_WHITE=1, FL_YELLOW, FL_GREEN, FL_RED, FL_BLUE, FL_MAGENTA, 00034 FL_BROWN, FL_BLACK, FL_ACC, FL_MAX }; 00035 00036 typedef unsigned int flag_t; 00037 00038 #define MAX_FLAG ((unsigned int)( sizeof(flag_t) * CHAR_BIT - 1 )) 00039 00040 struct sip_msg; 00041 00042 int setflag( struct sip_msg* msg, flag_t flag ); 00043 int resetflag( struct sip_msg* msg, flag_t flag ); 00044 int isflagset( struct sip_msg* msg, flag_t flag ); 00045 00046 00047 /* Script flag functions. Script flags are global flags that keep their 00048 * value regardless of the SIP message being processed. 00049 */ 00050 00051 /* Set the value of all the global flags */ 00052 int setsflagsval(flag_t val); 00053 00054 /* Set the given flag to 1. Parameter flag contains the index of the flag */ 00055 int setsflag(flag_t flag); 00056 00057 /* Reset the given flag to 0. Parameter flag contains the index of the flag */ 00058 int resetsflag(flag_t flag); 00059 00060 /* Returns 1 if the given flag is set and -1 otherwise */ 00061 int issflagset(flag_t flag); 00062 00063 /* Get the value of all the script flags combined */ 00064 flag_t getsflags(void); 00065 00066 int flag_in_range( flag_t flag ); 00067 00068 int register_flag(char* name, int pos); 00069 int get_flag_no(char* name, int len); 00070 int check_flag(int pos); 00071 void init_named_flags(void); 00072 00073 #endif
1.7.1