HTP  0.3
utf8_decoder.h
Go to the documentation of this file.
00001 /***************************************************************************
00002  * Copyright 2009-2010 Open Information Security Foundation
00003  * Copyright 2010-2011 Qualys, Inc.
00004  *
00005  * Licensed to You under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  ***************************************************************************/
00017 
00023 #ifndef _UTF8_DECODER_H
00024 #define _UTF8_DECODER_H
00025 
00026 /* HTP changes:
00027  * 
00028  *     - Changed the name of the function from "decode" to "utf8_decode"
00029  *     - Created a separate header file
00030  *     - Copied the license from the web page
00031  *     - Created a copy of the data and function "utf8_decode_allow_overlong", which
00032  *       does not treat overlong characters as invalid.
00033  */
00034 
00035 /*
00036 Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann.de>
00037 
00038 Permission is hereby granted, free of charge, to any person obtaining a copy of this software
00039 and associated documentation files (the "Software"), to deal in the Software without restriction,
00040 including without limitation the rights to use, copy, modify, merge, publish, distribute,
00041 sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
00042 furnished to do so, subject to the following conditions:
00043 
00044 The above copyright notice and this permission notice shall be included in all copies or
00045 substantial portions of the Software.
00046 
00047 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
00048 NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00049 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
00050 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00051 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00052 */
00053 
00054 #include <stdint.h>
00055 
00056 #define HTP_UTF8_ACCEPT 0
00057 #define HTP_UTF8_REJECT 1
00058 
00059 #ifdef __cplusplus
00060 extern "C" {
00061 #endif
00062 
00063 uint32_t htp_utf8_decode(uint32_t* state, uint32_t* codep, uint32_t byte);
00064 uint32_t htp_utf8_decode_allow_overlong(uint32_t* state, uint32_t* codep, uint32_t byte);
00065 
00066 #ifdef __cplusplus
00067 }
00068 #endif
00069 
00070 #endif  /* _UTF8_DECODER_H */
00071