comparison lib/lib.h @ 1043:acf7bb2b99e2 draft

Introduce libbuf analogous to toybuf but for use by lib/*.c. Change readfile() semantics to be able to read into an existing buffer, or malloc its own if that's NULL.
author Rob Landley <rob@landley.net>
date Tue, 03 Sep 2013 17:56:28 -0500
parents cbc467592b2e
children f8824260d057
comparison
equal deleted inserted replaced
1042:cbc467592b2e 1043:acf7bb2b99e2
133 void perror_exit(char *msg, ...) noreturn; 133 void perror_exit(char *msg, ...) noreturn;
134 ssize_t readall(int fd, void *buf, size_t len); 134 ssize_t readall(int fd, void *buf, size_t len);
135 ssize_t writeall(int fd, void *buf, size_t len); 135 ssize_t writeall(int fd, void *buf, size_t len);
136 off_t lskip(int fd, off_t offset); 136 off_t lskip(int fd, off_t offset);
137 struct string_list **splitpath(char *path, struct string_list **list); 137 struct string_list **splitpath(char *path, struct string_list **list);
138 char *readfile(char *name); 138 char *readfile(char *name, char *buf, off_t len);
139 void msleep(long miliseconds); 139 void msleep(long miliseconds);
140 int64_t peek(void *ptr, int size); 140 int64_t peek(void *ptr, int size);
141 void poke(void *ptr, uint64_t val, int size); 141 void poke(void *ptr, uint64_t val, int size);
142 struct string_list *find_in_path(char *path, char *filename); 142 struct string_list *find_in_path(char *path, char *filename);
143 long atolx(char *c); 143 long atolx(char *c);