read and write access a chunk of data at a time. Only accesses within the bounds of the image are allowed.
clear_range fills an interval with null bytes, fill with any byte value.
size returns the image size.
get and set work like read and write but pass the data using a bytes_t instead, and can be used from Python.
flush_writable writes out all unwritten changes to a writable backing file if one exists; otherwise, does nothing.
Other methods are not currently for public use.
SIM_INTERFACE(image) {
#if !defined(PYWRAP)
void (*read)(conf_object_t *img, void *NOTNULL to_buf, uint64 start,
size_t length);
void (*write)(conf_object_t *img, const void *NOTNULL from_buf,
uint64 start, size_t length);
int (*for_all_spages)(conf_object_t *img,
int (*NOTNULL f)(image_spage_t *NOTNULL p,
uint64 ofs, void *arg),
void *arg);
#endif /* not PYWRAP */
void (*set_persistent)(conf_object_t *obj);
void (*save_to_file)(conf_object_t *NOTNULL obj,
const char *NOTNULL file,
uint64 start, uint64 length, save_flags_t flags);
void (*save_diff)(conf_object_t *NOTNULL obj,
const char *NOTNULL file, save_flags_t flags);
void (*clear_range)(conf_object_t *NOTNULL obj,
uint64 start, uint64 length);
void (*fill)(conf_object_t *NOTNULL obj,
uint64 start, uint64 length, uint8 value);
uint64 (*size)(conf_object_t *NOTNULL obj);
void (*set)(conf_object_t *NOTNULL obj, uint64 ofs, bytes_t b);
bytes_t (*get)(conf_object_t *NOTNULL obj, uint64 ofs, size_t size);
void (*flush_writable)(conf_object_t *NOTNULL obj);
};
#define IMAGE_INTERFACE "image"
| read | Cell Context |
| write | Cell Context |
| for_all_spages | Cell Context |
| set_persistent | Cell Context |
| save_to_file | Cell Context |
| save_diff | Cell Context |
| clear_range | Cell Context |
| fill | Cell Context |
| size | Cell Context |
| set | Cell Context |
| get | Cell Context |
| flush_writable | Cell Context |