awtk/tools/common/utils.h

58 lines
1.8 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
*
2020-01-01 11:27:36 +08:00
* Copyright (c) 2018 - 2020 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
#include "tkc/str.h"
#include "tkc/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);
2019-09-05 10:05:29 +08:00
void exit_if_need_not_update_for_infiles(const char* out, int infiles_number, ...);
2018-11-02 11:51:14 +08:00
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);
ret_t output_res_c_source_ex(const char* filename, uint16_t type, uint16_t subtype, uint8_t* buff,
uint32_t size, const char* name);
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);
wchar_t** argvw_create(int argc, char* argv[]);
ret_t argvw_destroy(wchar_t** argvw);
2018-02-21 19:36:38 +08:00
END_C_DECLS
2018-03-19 07:19:25 +08:00
#endif // UTILS_H