"Fossies" - the Fresh Open Source Software Archive

Member "xorriso-1.5.4/libburn/null.c" (30 Jan 2021, 734 Bytes) of package /linux/misc/xorriso-1.5.4.pl02.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "null.c" see the Fossies "Dox" file reference documentation.

    1 /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
    2 
    3 /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
    4    Provided under GPL version 2 or later.
    5 */
    6 
    7 
    8 #ifdef HAVE_CONFIG_H
    9 #include "../config.h"
   10 #endif
   11 
   12 #include "null.h"
   13 #include "libburn.h"
   14 #include <stdlib.h>
   15 
   16 #include <string.h>
   17 int null_read(struct burn_source *source, unsigned char *buffer, int size)
   18 {
   19     memset(buffer, 0, size);
   20     return size;
   21 }
   22 
   23 struct burn_source *burn_null_source_new(void)
   24 {
   25     struct burn_source *src;
   26 
   27     src = calloc(1, sizeof(struct burn_source));
   28     src->refcount = 1;
   29     src->read = null_read;
   30     src->read_sub = NULL;
   31 
   32     src->get_size = 0;
   33 
   34     /* ts A70126 */
   35     src->set_size = NULL;
   36 
   37     src->free_data = NULL;
   38     src->data = NULL;
   39     return src;
   40 }