diff options
author | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-02 15:22:22 +0400 |
---|---|---|
committer | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-06-02 15:22:22 +0400 |
commit | a40e1302ae68ff4a5ce3078bdacb43653ba5e1af (patch) | |
tree | e48fd29988ec9e7fd2a9df320219ccc97c30f5ec /source/blender/blenlib/intern/fileops.c | |
parent | b0cc5b9d4c47625864272654197c4c6ff3f50976 (diff) |
Almost complete the i18n system, including:
Copy unifont..ttf.gz from source tree to target datafile path( now ONLY works with cmake );
Set the locale the same with system's setting;
If need unicode font, unzip and load unifont when init ui styles;
Apply gettext() to labels in space_info.py, who are the main menu items.
Each of these should have been commit one by one. As they work well according to my tests, so I just lazily send a long list.
Diffstat (limited to 'source/blender/blenlib/intern/fileops.c')
-rw-r--r-- | source/blender/blenlib/intern/fileops.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 2e0f4b483b1..b72f31dd128 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -102,6 +102,24 @@ int BLI_gzip(const char *from, const char *to) { return rval; } +/* gzip the file in from_file and write it to memery to_mem, at most size bytes. + return the unziped size + */ +int BLI_ungzip_to_mem(const char *from_file, char *to_mem, const int size) +{ + gzFile gzfile; + int readsize; + + gzfile = gzopen( from_file, "rb" ); + readsize = gzread( gzfile, to_mem, size); + + if (readsize < 0) + readsize = EOF; + + return readsize; +} + + /* return 1 when file can be written */ int BLI_is_writable(const char *filename) { |