Created
March 16, 2015 19:19
-
-
Save jaytaph/b95fbf21c571209992d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SAFFIRE_MODULE_METHOD(file, write) { | |
t_file_object *file_obj = (t_file_object *)self; | |
t_string_object *str_obj; | |
if (! object_parse_arguments(SAFFIRE_METHOD_ARGS, "s", &str_obj)) { | |
return NULL; | |
} | |
long bytes_written = fwrite(str_obj->data.value->val, 1, str_obj->data.value->len, file_obj->data.fp); | |
file_obj->data.bytes_out += bytes_written; | |
RETURN_NUMERICAL(bytes_written); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment