summaryrefslogtreecommitdiffstats
path: root/doc/html/bits.html
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 17:43:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-24 17:43:19 +0000
commit0292059f4a16434600564cfa3f0ad2309a508a54 (patch)
treed95953cd53011917c4df679b96aedca39401b54f /doc/html/bits.html
downloadlibksquirrel-0292059f4a16434600564cfa3f0ad2309a508a54.tar.gz
libksquirrel-0292059f4a16434600564cfa3f0ad2309a508a54.zip
Added libksquirrel for KDE3
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/libraries/libksquirrel@1095624 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'doc/html/bits.html')
-rw-r--r--doc/html/bits.html44
1 files changed, 44 insertions, 0 deletions
diff --git a/doc/html/bits.html b/doc/html/bits.html
new file mode 100644
index 0000000..d889727
--- /dev/null
+++ b/doc/html/bits.html
@@ -0,0 +1,44 @@
+<pre>
+#include &#60;stdio.h&#62;
+#include &#60;sys/types.h&#62;
+#include &#60;sys/stat.h&#62;
+#include &#60;unistd.h&#62;
+
+int main(int argc, char **argv)
+{
+ int i;
+ for(i = 1;i &#60; argc;i++)
+ {
+ FILE *f = fopen(argv[i], "rb");
+ char c;
+ struct stat buf;
+
+ if(!f)
+ {
+ fprintf(stderr, "Can't open file.\n");
+ return 255;
+ }
+
+ int s = 0, sz;
+ stat(argv[i], &buf);
+
+ sz = buf.st_size;
+
+ printf("%s\nstd::string fmt_codec::fmt_pixmap()\n{\n\treturn std::string(\"", argv[i]);
+
+ while(s++ &#60; sz-1)
+ {
+ fread(&c, 1, 1, f);
+ printf("%u,", (unsigned char)c);
+ }
+
+ fread(&c, 1, 1, f);
+ printf("%u", (unsigned char)c);
+
+ printf("\");\n}\n\n");
+ fclose(f);
+ }
+
+ return 0;
+}
+</pre> \ No newline at end of file