src/dirbuf.h
changeset 26 61668c57f4bb
parent 7 3a603d755bcb
child 27 461be4cd34a3
equal deleted inserted replaced
25:99a41f48e29b 26:61668c57f4bb
    14     char *buf;
    14     char *buf;
    15     size_t len;
    15     size_t len;
    16     size_t off;
    16     size_t off;
    17 };
    17 };
    18 
    18 
       
    19 // maximum length for a dirbuf name, including NUL byte
       
    20 #define DIRBUF_NAME_MAX 256
       
    21 
       
    22 /*
       
    23  * Estimate how many dir entries will, at most, fit into a difbuf of the given size, based on a minimum filename size.
       
    24  */
       
    25 size_t difbuf_estimate (size_t req_size, size_t min_namelen);
    19 
    26 
    20 /*
    27 /*
    21  * Initialize a dirbuf for a request. The dirbuf will be filled with at most req_size bytes of dir entries.
    28  * Initialize a dirbuf for a request. The dirbuf will be filled with at most req_size bytes of dir entries.
    22  */
    29  */
    23 int dirbuf_init (struct dirbuf *buf, size_t req_size);
    30 int dirbuf_init (struct dirbuf *buf, size_t req_size);