Home | History | Annotate | Download | only in filesystems
      1 // Copyright 2014 The Android Open Source Project
      2 //
      3 // This software is licensed under the terms of the GNU General Public
      4 // License version 2, as published by the Free Software Foundation, and
      5 // may be copied, distributed, and modified under those terms.
      6 //
      7 // This program is distributed in the hope that it will be useful,
      8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
      9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     10 // GNU General Public License for more details.
     11 
     12 #ifndef ANDROID_FILESYSTEMS_RAMDISK_EXTRACTOR_H
     13 #define ANDROID_FILESYSTEMS_RAMDISK_EXTRACTOR_H
     14 
     15 #include "android/utils/compiler.h"
     16 
     17 #include <stddef.h>
     18 
     19 
     20 ANDROID_BEGIN_HEADER
     21 
     22 // Extract the content of a given file from a ramdisk image.
     23 // |ramdisk_path| is the path to the ramdisk.img file.
     24 // |file_path| is the path of the file within the ramdisk.
     25 // On success, returns true and sets |*out| to point to a heap allocated
     26 // block containing the extracted content, of size |*out_size| bytes.
     27 // On failure, return false.
     28 bool android_extractRamdiskFile(const char* ramdisk_path,
     29                                 const char* file_path,
     30                                 char** out,
     31                                 size_t* out_size);
     32 
     33 ANDROID_END_HEADER
     34 
     35 #endif  // ANDROID_FILESYSTEMS_RAMDISK_EXTRACTOR_H
     36