File: iob_init.c

package info (click to toggle)
libowfat 0.34-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,288 kB
  • sloc: ansic: 20,181; makefile: 16
file content (13 lines) | stat: -rw-r--r-- 290 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdlib.h>
#include "byte.h"
#include "iob_internal.h"

int iob_init(io_batch* b,size_t hint_entries) {
  byte_zero(b,sizeof(io_batch));
  if (hint_entries) {
    if (!array_allocate(&b->b,sizeof(iob_entry),hint_entries))
      return -1;
    array_trunc(&b->b);
  }
  return 0;
}