1 // Copyright 2022 Google LLC 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // https://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef CONTRIB_LIBZIP_WRAPPER_WRAPPER_ZIP_H_ 16 #define CONTRIB_LIBZIP_WRAPPER_WRAPPER_ZIP_H_ 17 18 #include <zip.h> 19 #include <zipconf.h> 20 21 extern "C" { 22 23 // TODO(cblichmann): zip_source_t used as return value is converted to int. 24 void* zip_source_filefd(zip_t* archive, int fd, const char* flags, 25 zip_uint64_t start, zip_int64_t len); 26 void* zip_source_filefd_create(int fd, const char* flags, zip_uint64_t start, 27 zip_int64_t len, zip_error_t* ze); 28 void* zip_read_fd_to_source(int fd, zip_error_t* ze); 29 bool zip_source_to_fd(zip_source_t* src, int fd); 30 } 31 32 #endif // CONTRIB_ZIP_WRAPPER_WRAPPER_ZIP_H_ 33