boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

dirstream.h (1706B)


      1 /* -*-comment-start: "//";comment-end:""-*-
      2  * GNU Mes --- Maxwell Equations of Software
      3  *Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
      4  * Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
      5  *
      6  * This file is part of GNU Mes.
      7  *
      8  * GNU Mes is free software; you can redistribute it and/or modify it
      9  * under the terms of the GNU General Public License as published by
     10  * the Free Software Foundation; either version 3 of the License, or (at
     11  * your option) any later version.
     12  *
     13  * GNU Mes is distributed in the hope that it will be useful, but
     14  * WITHOUT ANY WARRANTY; without even the implied warranty of
     15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     16  * GNU General Public License for more details.
     17  *
     18  * You should have received a copy of the GNU General Public License
     19  * along with GNU Mes.  If not, see <http://www.gnu.org/licenses/>.
     20  */
     21 
     22 #ifndef __MES_DIRSTREAM_H
     23 #define __MES_DIRSTREAM_H 1
     24 
     25 #if SYSTEM_LIBC && HAVE_DIRSTREAM_H
     26 #ifndef _GNU_SOURCE
     27 #define _GNU_SOURCE
     28 #endif
     29 #undef __MES_DIRSTREAM_H
     30 #include_next <dirstream.h>
     31 
     32 #else // ! SYSTEM_LIBC
     33 
     34 #include <sys/types.h>
     35 
     36 // Taken from GNU C Library 2.2.5
     37 
     38 /* Directory stream type.  */
     39 struct __dirstream
     40 {
     41   int fd;                       /* File descriptor.  */
     42 
     43   char *data;                   /* Directory block.  */
     44   size_t allocation;            /* Space allocated for the block.  */
     45   size_t size;                  /* Total valid data in the block.  */
     46   size_t offset;                /* Current offset into the block.  */
     47 
     48   off_t filepos;                /* Position of next entry to read.  */
     49 };
     50 
     51 typedef struct __dirstream DIR;
     52 
     53 #endif // ! SYSTEM_LIBC
     54 
     55 #endif // __MES_DIRSTREAM_H