awtk/tools/common/utils.h

52 lines
1.5 KiB
C
Raw Normal View History

2018-02-21 19:36:38 +08:00
/**
* File: utils.h
2018-05-15 09:31:58 +08:00
* Author: AWTK Develop Team
2018-02-21 19:36:38 +08:00
* Brief: utils function
*
2018-05-08 10:22:32 +08:00
* Copyright (c) 2018 - 2018 Guangzhou ZHIYUAN Electronics Co.,Ltd.
2018-02-21 19:36:38 +08:00
*
* 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
* License file for more details.
*
*/
/**
* History:
* ================================================================
* 2018-01-21 Li XianJing <xianjimli@hotmail.com> created
*
*/
#ifndef UTILS_H
#define UTILS_H
2018-08-29 11:27:38 +08:00
#include "base/str.h"
2018-06-16 09:11:12 +08:00
#include "base/utils.h"
2018-02-21 19:36:38 +08:00
BEGIN_C_DECLS
2018-11-02 11:51:14 +08:00
void exit_if_need_not_update(const char* in, const char* out);
2018-02-21 19:36:38 +08:00
int unique(wchar_t* str, int size);
char* read_file(const char* file_name, uint32_t* length);
ret_t write_file(const char* file_name, const void* buff, uint32_t length);
2018-03-19 07:19:25 +08:00
ret_t output_c_source(const char* filename, const char* prefix, const char* name, uint8_t* buff,
uint32_t size);
2018-02-21 19:36:38 +08:00
2018-03-19 07:19:25 +08:00
ret_t output_res_c_source(const char* filename, uint16_t type, uint16_t subtype, uint8_t* buff,
uint32_t size);
2018-03-09 21:54:46 +08:00
2018-03-16 18:27:27 +08:00
const char* to_lower(char* str);
const char* skip_to(const char* p, char c);
const char* skip_char(const char* p, char c);
const char* skip_to_next(const char* p, char c);
bool_t start_with(const char* p, const char* str);
2018-04-01 08:12:52 +08:00
bool_t end_with(const char* p, const char* str);
2018-03-16 18:27:27 +08:00
const char* get_next_token(const char* p, char* token, char c);
2018-02-21 19:36:38 +08:00
END_C_DECLS
2018-03-19 07:19:25 +08:00
#endif // UTILS_H