Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
373 B

  1. #include <stdlib.h>
  2. #include "byte.h"
  3. #include "iob_internal.h"
  4. io_batch* iob_new(int hint_entries) {
  5. io_batch* b=(io_batch*)malloc(sizeof(io_batch));
  6. if (!b) return 0;
  7. byte_zero(b,sizeof(io_batch));
  8. if (hint_entries) {
  9. if (!array_allocate(&b->b,sizeof(iob_entry),hint_entries)) {
  10. free(b);
  11. return 0;
  12. }
  13. array_trunc(&b->b);
  14. }
  15. return b;
  16. }