Open Chinese Convert
0.4.3
A project for conversion between Traditional and Simplified Chinese
|
00001 /* 00002 * Open Chinese Convert 00003 * 00004 * Copyright 2010-2013 BYVoid <byvoid@byvoid.com> 00005 * 00006 * Licensed under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 00019 #ifndef __OPENCC_UTILS_H_ 00020 #define __OPENCC_UTILS_H_ 00021 00022 #include "common.h" 00023 00024 #define debug_should_not_be_here() \ 00025 do { \ 00026 fprintf(stderr, "Should not be here %s: %d\n", __FILE__, __LINE__); \ 00027 assert(0); \ 00028 } while (0) \ 00029 00030 void perr(const char* str); 00031 00032 int qsort_int_cmp(const void* a, const void* b); 00033 00034 char* mstrcpy(const char* str); 00035 00036 char* mstrncpy(const char* str, size_t n); 00037 00038 void skip_utf8_bom(FILE* fp); 00039 00040 const char* executable_path(void); 00041 00042 char* try_open_file(const char* path); 00043 00044 char* get_file_path(const char* filename); 00045 00046 int is_absolute_path(const char* path); 00047 00048 #endif /* __OPENCC_UTILS_H_ */