(API Change) Unsquish libobs/util

Changed:                      To:
-----------------------------------------------------------
dstr_isempty                  dstr_is_empty
cf_lexer_gettokens            cf_lexer_get_tokens
cf_preprocessor_gettokens     cf_preprocessor_get_tokens
This commit is contained in:
jp9000
2014-08-05 13:38:24 -07:00
parent 04712b5fe9
commit 9d300685ca
12 changed files with 22 additions and 21 deletions

View File

@@ -1165,7 +1165,7 @@ static void ep_write_main_params(struct effect_parser *ep,
struct ep_func *func)
{
size_t i;
bool empty_params = dstr_isempty(param_str);
bool empty_params = dstr_is_empty(param_str);
for (i = 0; i < func->param_vars.num; i++) {
struct ep_var *var = func->param_vars.array+i;
@@ -1188,7 +1188,7 @@ static void ep_write_main_params(struct effect_parser *ep,
dstr_cat(shader, var->mapping);
}
if (!dstr_isempty(param_str))
if (!dstr_is_empty(param_str))
dstr_cat(param_str, ", ");
dstr_cat(param_str, var->name);
}

View File

@@ -134,7 +134,7 @@ char *obs_find_module_file(obs_module_t module, const char *file)
return NULL;
dstr_copy(&output, module->data_path);
if (!dstr_isempty(&output) && dstr_end(&output) != '/')
if (!dstr_is_empty(&output) && dstr_end(&output) != '/')
dstr_cat_ch(&output, '/');
dstr_cat(&output, file);
@@ -292,7 +292,7 @@ static void find_modules_in_path(struct obs_module_path *omp,
search_directories = true;
}
if (!dstr_isempty(&search_path) && dstr_end(&search_path) != '/')
if (!dstr_is_empty(&search_path) && dstr_end(&search_path) != '/')
dstr_cat_ch(&search_path, '/');
dstr_cat_ch(&search_path, '*');

View File

@@ -621,7 +621,7 @@ static void cf_include_file(struct cf_preprocessor *pp,
struct cf_lexer *dep = pp->dependencies.array+i;
if (strcmp(dep->file, str_file.array) == 0) {
tokens = cf_lexer_gettokens(dep);
tokens = cf_lexer_get_tokens(dep);
cf_preprocess_tokens(pp, false, &tokens);
goto exit;
}
@@ -639,7 +639,7 @@ static void cf_include_file(struct cf_preprocessor *pp,
cf_lexer_init(&new_lex);
cf_lexer_lex(&new_lex, file_data, str_file.array);
tokens = cf_lexer_gettokens(&new_lex);
tokens = cf_lexer_get_tokens(&new_lex);
cf_preprocess_tokens(pp, false, &tokens);
bfree(file_data);
@@ -1267,7 +1267,7 @@ void cf_preprocessor_free(struct cf_preprocessor *pp)
bool cf_preprocess(struct cf_preprocessor *pp, struct cf_lexer *lex,
struct error_data *ed)
{
struct cf_token *token = cf_lexer_gettokens(lex);
struct cf_token *token = cf_lexer_get_tokens(lex);
if (!token)
return false;

View File

@@ -93,7 +93,7 @@ struct cf_lexer {
EXPORT void cf_lexer_init(struct cf_lexer *lex);
EXPORT void cf_lexer_free(struct cf_lexer *lex);
static inline struct cf_token *cf_lexer_gettokens(struct cf_lexer *lex)
static inline struct cf_token *cf_lexer_get_tokens(struct cf_lexer *lex)
{
return lex->tokens.array;
}
@@ -195,7 +195,7 @@ EXPORT void cf_preprocessor_add_def(struct cf_preprocessor *pp,
EXPORT void cf_preprocessor_remove_def(struct cf_preprocessor *pp,
const char *def_name);
static inline struct cf_token *cf_preprocessor_gettokens(
static inline struct cf_token *cf_preprocessor_get_tokens(
struct cf_preprocessor *pp)
{
return pp->tokens.array;

View File

@@ -72,7 +72,7 @@ static inline bool cf_parser_parse(struct cf_parser *parser,
if (!cf_preprocess(&parser->pp, &parser->lex, &parser->error_list))
return false;
parser->cur_token = cf_preprocessor_gettokens(&parser->pp);
parser->cur_token = cf_preprocessor_get_tokens(&parser->pp);
return true;
}

View File

@@ -528,7 +528,7 @@ void dstr_replace(struct dstr *str, const char *find,
size_t find_len, replace_len;
char *temp;
if (dstr_isempty(str))
if (dstr_is_empty(str))
return;
if (!replace)

View File

@@ -80,7 +80,7 @@ EXPORT void dstr_ncopy_dstr(struct dstr *dst, const struct dstr *src,
static inline void dstr_resize(struct dstr *dst, const size_t num);
static inline void dstr_reserve(struct dstr *dst, const size_t num);
static inline bool dstr_isempty(const struct dstr *str);
static inline bool dstr_is_empty(const struct dstr *str);
static inline void dstr_cat(struct dstr *dst, const char *array);
EXPORT void dstr_cat_dstr(struct dstr *dst, const struct dstr *str);
@@ -249,7 +249,7 @@ static inline void dstr_resize(struct dstr *dst, const size_t num)
dst->len = num;
}
static inline bool dstr_isempty(const struct dstr *str)
static inline bool dstr_is_empty(const struct dstr *str)
{
if (!str->array || !str->len)
return true;
@@ -310,7 +310,7 @@ static inline int dstr_ncmpi(const struct dstr *str1, const char *str2,
static inline char dstr_end(const struct dstr *str)
{
if (dstr_isempty(str))
if (dstr_is_empty(str))
return 0;
return str->array[str->len - 1];

View File

@@ -70,7 +70,8 @@ static struct text_node *text_node_bychar(struct text_node *node, char ch)
struct text_node *subnode = node->first_subnode;
while (subnode) {
if (!dstr_isempty(&subnode->str) && subnode->str.array[0] == ch)
if (!dstr_is_empty(&subnode->str) &&
subnode->str.array[0] == ch)
return subnode;
subnode = subnode->next;