Index: src/utils.h |
=================================================================== |
--- src/utils.h (revision 1142) |
+++ src/utils.h (working copy) |
@@ -224,10 +224,10 @@ |
char* ReadLine(const char* prompt); |
-// Read and return the raw chars in a file. the size of the buffer is returned |
+// Read and return the raw bytes in a file. the size of the buffer is returned |
// in size. |
-// The returned buffer is not 0-terminated. It must be freed by the caller. |
-char* ReadChars(const char* filename, int* size, bool verbose = true); |
+// The returned buffer must be freed by the caller. |
+byte* ReadBytes(const char* filename, int* size, bool verbose = true); |
// Write size chars from str to the file given by filename. |
@@ -238,6 +238,14 @@ |
bool verbose = true); |
+// Write size bytes to the file given by filename. |
+// The file is overwritten. Returns the number of bytes written. |
+int WriteBytes(const char* filename, |
+ const byte* bytes, |
+ int size, |
+ bool verbose = true); |
+ |
+ |
// Write the C code |
// const char* <varname> = "<str>"; |
// const int <varname>_len = <len>; |