summaryrefslogtreecommitdiff
path: root/fluid/code.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2010-02-15 16:43:51 +0000
committerMatthias Melcher <fltk@matthiasm.com>2010-02-15 16:43:51 +0000
commitfb1b0fab0a422e9ff8807bed12ae09abb4f0d975 (patch)
tree483bbe851b8b5f9c6134ebfd7decda1f530062d1 /fluid/code.cxx
parentea31edb2410308b4f610a027086c7b6f5ee72e1a (diff)
Added new type 'Binary Data' to Fluid. Use this to include an arbitrary file as a byte array into your source code. Changes to load jpegs etc. from program memory will follow.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7084 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/code.cxx')
-rw-r--r--fluid/code.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/fluid/code.cxx b/fluid/code.cxx
index 5354fe5cf..a96bbd720 100644
--- a/fluid/code.cxx
+++ b/fluid/code.cxx
@@ -235,6 +235,17 @@ void write_cdata(const char *s, int length) {
varused = 1;
return;
}
+ if (write_sourceview) {
+ if (length>=0)
+ fprintf(code_file, "{ /* ... %d bytes of binary data... */ }", length);
+ else
+ fprintf(code_file, "{ /* ... binary data... */ }");
+ return;
+ }
+ if (length==-1) {
+ fprintf(code_file, "{ /* ... undefined size binary data... */ }");
+ return;
+ }
const unsigned char *w = (const unsigned char *)s;
const unsigned char *e = w+length;
int linelength = 1;