diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-27 18:55:10 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-27 18:55:10 +0400 |
commit | 0c6a01ca0072d8444309ec094bdc87d10695fc0d (patch) | |
tree | 5b2940ba9ed9d99cbd8d74c744803852408fda2c /source/blender | |
parent | 5aa006bc1c9b99bcbc1a5190d34a70fcaaa0d2da (diff) |
Use includes for blenderplayer stubs
exposes many incorrect and redundant stubs
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_text.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 56 | ||||
-rw-r--r-- | source/blender/collada/collada.h | 4 | ||||
-rw-r--r-- | source/blender/editors/include/ED_clip.h | 4 | ||||
-rw-r--r-- | source/blender/editors/include/ED_node.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 59 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_text.c | 4 |
7 files changed, 66 insertions, 65 deletions
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h index 67c1b6834dd..eb89216d360 100644 --- a/source/blender/blenkernel/BKE_text.h +++ b/source/blender/blenkernel/BKE_text.h @@ -55,6 +55,8 @@ struct Text *BKE_text_copy (struct Text *ta); void BKE_text_unlink (struct Main *bmain, struct Text *text); void BKE_text_clear (struct Text *text); void BKE_text_write (struct Text *text, const char *str); +int BKE_text_file_modified_check(struct Text *text); +void BKE_text_file_modified_ignore(struct Text *text); char *txt_to_buf (struct Text *text); void txt_clean_text (struct Text *text); diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index efe3e98b2b3..145f832063a 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -659,6 +659,62 @@ void BKE_text_write(Text *text, const char *str) /* called directly from rna */ txt_make_dirty(text); } + +/* returns 0 if file on disk is the same or Text is in memory only + * returns 1 if file has been modified on disk since last local edit + * returns 2 if file on disk has been deleted + * -1 is returned if an error occurs */ + +int BKE_text_file_modified_check(Text *text) +{ + struct stat st; + int result; + char file[FILE_MAX]; + + if (!text || !text->name) + return 0; + + BLI_strncpy(file, text->name, FILE_MAX); + BLI_path_abs(file, G.main->name); + + if (!BLI_exists(file)) + return 2; + + result = BLI_stat(file, &st); + + if (result == -1) + return -1; + + if ((st.st_mode & S_IFMT) != S_IFREG) + return -1; + + if (st.st_mtime > text->mtime) + return 1; + + return 0; +} + +void BKE_text_file_modified_ignore(Text *text) +{ + struct stat st; + int result; + char file[FILE_MAX]; + + if (!text || !text->name) return; + + BLI_strncpy(file, text->name, FILE_MAX); + BLI_path_abs(file, G.main->name); + + if (!BLI_exists(file)) return; + + result = BLI_stat(file, &st); + + if (result == -1 || (st.st_mode & S_IFMT) != S_IFREG) + return; + + text->mtime = st.st_mtime; +} + /*****************************/ /* Editing utility functions */ /*****************************/ diff --git a/source/blender/collada/collada.h b/source/blender/collada/collada.h index e96bc2ea8a4..524c704cdee 100644 --- a/source/blender/collada/collada.h +++ b/source/blender/collada/collada.h @@ -53,11 +53,11 @@ struct Scene; /* * both return 1 on success, 0 on error */ -int collada_import(bContext *C, +int collada_import(struct bContext *C, const char *filepath, int import_units); -int collada_export(Scene *sce, +int collada_export(struct Scene *sce, const char *filepath, int apply_modifiers, BC_export_mesh_type export_mesh_type, diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h index 27e62928f1b..91f8b39f7b9 100644 --- a/source/blender/editors/include/ED_clip.h +++ b/source/blender/editors/include/ED_clip.h @@ -50,7 +50,7 @@ int ED_space_clip_view_clip_poll(struct bContext *C); int ED_space_clip_tracking_poll(struct bContext *C); int ED_space_clip_maskedit_poll(struct bContext *C); -int ED_space_clip_maskedit_mask_poll(bContext *C); +int ED_space_clip_maskedit_mask_poll(struct bContext *C); void ED_space_clip_get_size(struct SpaceClip *sc, int *width, int *height); void ED_space_clip_get_size_fl(struct SpaceClip *sc, float size[2]); @@ -85,4 +85,4 @@ void ED_space_clip_set_mask(struct bContext *C, struct SpaceClip *sc, struct Mas /* ** clip_ops.c ** */ void ED_operatormacros_clip(void); -#endif /* ED_CLIP_H */ +#endif /* __ED_CLIP_H__ */ diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 2f4528c2c7f..5fe2dd6c96b 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -102,7 +102,7 @@ bool ED_node_select_check(ListBase *lb); void ED_node_post_apply_transform(struct bContext *C, struct bNodeTree *ntree); void ED_node_set_active(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node); -void ED_node_composite_job(const bContext *C, struct bNodeTree *nodetree, struct Scene *scene_owner); +void ED_node_composite_job(const struct bContext *C, struct bNodeTree *nodetree, struct Scene *scene_owner); /* node_ops.c */ void ED_operatormacros_node(void); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 752cda8faf8..24cb03d62e5 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -3107,61 +3107,6 @@ static EnumPropertyItem resolution_items[] = { {0, NULL, 0, NULL, NULL} }; -/* returns 0 if file on disk is the same or Text is in memory only - * returns 1 if file has been modified on disk since last local edit - * returns 2 if file on disk has been deleted - * -1 is returned if an error occurs */ - -int text_file_modified(Text *text) -{ - struct stat st; - int result; - char file[FILE_MAX]; - - if (!text || !text->name) - return 0; - - BLI_strncpy(file, text->name, FILE_MAX); - BLI_path_abs(file, G.main->name); - - if (!BLI_exists(file)) - return 2; - - result = BLI_stat(file, &st); - - if (result == -1) - return -1; - - if ((st.st_mode & S_IFMT) != S_IFREG) - return -1; - - if (st.st_mtime > text->mtime) - return 1; - - return 0; -} - -static void text_ignore_modified(Text *text) -{ - struct stat st; - int result; - char file[FILE_MAX]; - - if (!text || !text->name) return; - - BLI_strncpy(file, text->name, FILE_MAX); - BLI_path_abs(file, G.main->name); - - if (!BLI_exists(file)) return; - - result = BLI_stat(file, &st); - - if (result == -1 || (st.st_mode & S_IFMT) != S_IFREG) - return; - - text->mtime = st.st_mtime; -} - static int text_resolve_conflict_exec(bContext *C, wmOperator *op) { Text *text = CTX_data_edit_text(C); @@ -3175,7 +3120,7 @@ static int text_resolve_conflict_exec(bContext *C, wmOperator *op) case RESOLVE_MAKE_INTERNAL: return text_make_internal_exec(C, op); case RESOLVE_IGNORE: - text_ignore_modified(text); + BKE_text_file_modified_ignore(text); return OPERATOR_FINISHED; } @@ -3188,7 +3133,7 @@ static int text_resolve_conflict_invoke(bContext *C, wmOperator *op, const wmEve uiPopupMenu *pup; uiLayout *layout; - switch (text_file_modified(text)) { + switch (BKE_text_file_modified_check(text)) { case 1: if (text->flags & TXT_ISDIRTY) { /* modified locally and externally, ahhh. offer more possibilites. */ diff --git a/source/blender/makesrna/intern/rna_text.c b/source/blender/makesrna/intern/rna_text.c index b1672da2e3c..46477007962 100644 --- a/source/blender/makesrna/intern/rna_text.c +++ b/source/blender/makesrna/intern/rna_text.c @@ -44,8 +44,6 @@ #ifdef RNA_RUNTIME -int text_file_modified(Text *text); /* XXX bad level call */ - static void rna_Text_filename_get(PointerRNA *ptr, char *value) { Text *text = (Text *)ptr->data; @@ -78,7 +76,7 @@ static void rna_Text_filename_set(PointerRNA *ptr, const char *value) static int rna_Text_modified_get(PointerRNA *ptr) { Text *text = (Text *)ptr->data; - return text_file_modified(text); + return BKE_text_file_modified_check(text) != 0; } static int rna_Text_current_line_index_get(PointerRNA *ptr) |