You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celix.apache.org by pn...@apache.org on 2018/05/27 18:52:55 UTC
[47/60] [abbrv] [partial] celix git commit: CELIX-424: Cleans up the
directory structure. Moves all libraries to the libs subdir and all bundles
to the bundles subdir
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/bundles/deployment_admin/src/log_store.h
----------------------------------------------------------------------
diff --git a/bundles/deployment_admin/src/log_store.h b/bundles/deployment_admin/src/log_store.h
new file mode 100644
index 0000000..84299b3
--- /dev/null
+++ b/bundles/deployment_admin/src/log_store.h
@@ -0,0 +1,45 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements. See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership. The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
+/*
+ * log_store.h
+ *
+ * \date Apr 18, 2012
+ * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ * \copyright Apache License, Version 2.0
+ */
+
+#ifndef LOG_STORE_H_
+#define LOG_STORE_H_
+
+#include "log_event.h"
+
+#include "properties.h"
+#include "array_list.h"
+
+typedef struct log_store *log_store_pt;
+
+celix_status_t logStore_create(log_store_pt *store);
+celix_status_t logStore_put(log_store_pt store, unsigned int type, properties_pt properties, log_event_pt *event);
+
+celix_status_t logStore_getLogId(log_store_pt store, unsigned long *id);
+celix_status_t logStore_getEvents(log_store_pt store, array_list_pt *events);
+
+celix_status_t logStore_getHighestId(log_store_pt store, long *id);
+
+#endif /* LOG_STORE_H_ */
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/bundles/deployment_admin/src/log_sync.c
----------------------------------------------------------------------
diff --git a/bundles/deployment_admin/src/log_sync.c b/bundles/deployment_admin/src/log_sync.c
new file mode 100644
index 0000000..242beea
--- /dev/null
+++ b/bundles/deployment_admin/src/log_sync.c
@@ -0,0 +1,209 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements. See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership. The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
+/*
+ * log_sync.c
+ *
+ * \date Apr 19, 2012
+ * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ * \copyright Apache License, Version 2.0
+ */
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <curl/curl.h>
+#include <curl/easy.h>
+
+#include "celix_errno.h"
+#include "celix_log.h"
+#include "celixbool.h"
+
+#include "celix_threads.h"
+
+#include "log_sync.h"
+#include "log_event.h"
+
+struct log_sync {
+ log_store_pt logStore;
+
+ char *targetId;
+ bool running;
+
+ celix_thread_t syncTask;
+};
+
+struct log_descriptor {
+ char *targetId;
+ unsigned long logId;
+ unsigned long low;
+ unsigned long high;
+};
+
+typedef struct log_descriptor *log_descriptor_pt;
+
+celix_status_t logSync_queryLog(log_sync_pt logSync, char *targetId, long logId, char **queryReply);
+static size_t logSync_readQeury(void *contents, size_t size, size_t nmemb, void *userp);
+static void *logSync_synchronize(void *logSyncP);
+
+celix_status_t logSync_create(char *targetId, log_store_pt store, log_sync_pt *logSync) {
+ celix_status_t status = CELIX_SUCCESS;
+
+ *logSync = calloc(1, sizeof(**logSync));
+ if (!*logSync) {
+ status = CELIX_ENOMEM;
+ } else {
+ (*logSync)->logStore = store;
+ (*logSync)->targetId = targetId;
+ (*logSync)->syncTask = celix_thread_default;
+ (*logSync)->running = true;
+
+ celixThread_create(&(*logSync)->syncTask, NULL, logSync_synchronize, *logSync);
+ }
+
+ return status;
+}
+
+celix_status_t logSync_parseLogDescriptor(log_sync_pt logSync, char *descriptorString, log_descriptor_pt *descriptor) {
+ celix_status_t status = CELIX_SUCCESS;
+
+ fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "Descriptor: %s", descriptorString);
+ char *last = NULL;
+ char *targetId = strtok_r(descriptorString, ",", &last);
+ char *logIdStr = strtok_r(NULL, ",", &last);
+ long logId = 0;
+ if (logIdStr != NULL) {
+ logId = atol(logIdStr);
+ }
+ char *range = strtok_r(NULL, ",", &last);
+ fw_log(logger, OSGI_FRAMEWORK_LOG_DEBUG, "Range: %s", range);
+
+ long low = 0;
+ long high = 0;
+ if (range != NULL) {
+ char *rangeToken = NULL;
+ low = atol(strtok_r(range, "-", &rangeToken));
+ high = atol(strtok_r(NULL, "-", &rangeToken));
+ }
+
+ *descriptor = calloc(1, sizeof(**descriptor));
+ if (!*descriptor) {
+ status = CELIX_ENOMEM;
+ } else {
+ (*descriptor)->targetId = targetId;
+ (*descriptor)->logId = logId;
+ (*descriptor)->low = low;
+ (*descriptor)->high = high;
+ }
+
+ return status;
+}
+
+static void *logSync_synchronize(void *logSyncP) {
+ log_sync_pt logSync = logSyncP;
+
+ while (logSync->running) {
+
+ //query current log
+ // http://localhost:8080/auditlog/query?tid=targetid&logid=logid
+ char *logDescriptorString = NULL;
+ unsigned long id = 0;
+ logStore_getLogId(logSync->logStore, &id);
+ logSync_queryLog(logSync, logSync->targetId, id, &logDescriptorString);
+ log_descriptor_pt descriptor = NULL;
+ logSync_parseLogDescriptor(logSync, logDescriptorString, &descriptor);
+
+ long highest = 0;
+ logStore_getHighestId(logSync->logStore, &highest);
+
+ if (highest >= 0) {
+ int i;
+ for (i = descriptor->high + 1; i <= highest; i++) {
+ array_list_pt events = NULL;
+ logStore_getEvents(logSync->logStore, &events);
+ }
+ }
+
+ if(descriptor!=NULL){
+ free(descriptor);
+ }
+
+ sleep(10);
+ }
+
+
+ celixThread_exit(NULL);
+ return NULL;
+}
+
+struct MemoryStruct {
+ char *memory;
+ size_t size;
+};
+
+celix_status_t logSync_queryLog(log_sync_pt logSync, char *targetId, long logId, char **queryReply) {
+ // http://localhost:8080/auditlog/query?tid=targetid&logid=logid
+ celix_status_t status = CELIX_SUCCESS;
+ int length = strlen(targetId) + 60;
+ char query[length];
+ snprintf(query, length, "http://localhost:8080/auditlog/query?tid=%s&logid=1", targetId);
+
+ CURL *curl;
+ CURLcode res;
+ curl = curl_easy_init();
+ struct MemoryStruct chunk;
+ chunk.memory = calloc(1, sizeof(char));
+ chunk.size = 0;
+ if (curl) {
+ curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
+ curl_easy_setopt(curl, CURLOPT_URL, query);
+ curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, logSync_readQeury);
+ curl_easy_setopt(curl, CURLOPT_WRITEDATA, &chunk);
+ curl_easy_setopt(curl, CURLOPT_FAILONERROR, true);
+ res = curl_easy_perform(curl);
+ if (res != CURLE_OK) {
+ status = CELIX_BUNDLE_EXCEPTION;
+ }
+ fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "Error: %d", res);
+ /* always cleanup */
+ curl_easy_cleanup(curl);
+
+ *queryReply = strdup(chunk.memory);
+ }
+
+ return status;
+}
+
+static size_t logSync_readQeury(void *contents, size_t size, size_t nmemb, void *userp) {
+ size_t realsize = size * nmemb;
+ struct MemoryStruct *mem = (struct MemoryStruct *)userp;
+
+ mem->memory = realloc(mem->memory, mem->size + realsize + 1);
+ if (mem->memory == NULL) {
+ /* out of memory! */
+ fw_log(logger, OSGI_FRAMEWORK_LOG_ERROR, "not enough memory (realloc returned NULL)");
+ exit(EXIT_FAILURE);
+ }
+
+ memcpy(&(mem->memory[mem->size]), contents, realsize);
+ mem->size += realsize;
+ mem->memory[mem->size] = 0;
+
+ return realsize;
+}
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/bundles/deployment_admin/src/log_sync.h
----------------------------------------------------------------------
diff --git a/bundles/deployment_admin/src/log_sync.h b/bundles/deployment_admin/src/log_sync.h
new file mode 100644
index 0000000..7cd10d9
--- /dev/null
+++ b/bundles/deployment_admin/src/log_sync.h
@@ -0,0 +1,36 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements. See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership. The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
+/*
+ * log_sync.h
+ *
+ * \date Apr 19, 2012
+ * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ * \copyright Apache License, Version 2.0
+ */
+
+#ifndef LOG_SYNC_H_
+#define LOG_SYNC_H_
+
+#include "log_store.h"
+
+typedef struct log_sync *log_sync_pt;
+
+celix_status_t logSync_create(char *targetId, log_store_pt store, log_sync_pt *logSync);
+
+#endif /* LOG_SYNC_H_ */
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/bundles/deployment_admin/src/miniunz.c
----------------------------------------------------------------------
diff --git a/bundles/deployment_admin/src/miniunz.c b/bundles/deployment_admin/src/miniunz.c
new file mode 100644
index 0000000..e543c3b
--- /dev/null
+++ b/bundles/deployment_admin/src/miniunz.c
@@ -0,0 +1,402 @@
+/** License
+ * ----------------------------------------------------------
+ * Condition of use and distribution are the same than zlib :
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ * 3. This notice may not be removed or altered from any source distribution.
+ *
+ * ----------------------------------------------------------
+ */
+/*
+ miniunz.c
+ Version 1.1, February 14h, 2010
+ sample part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
+
+ Modifications of Unzip for Zip64
+ Copyright (C) 2007-2008 Even Rouault
+
+ Modifications for Zip64 support on both zip and unzip
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+
+ Changes made to the original source specific for Apache Celix:
+ * Updated several parts to use output directory fitting Celix.
+ * Removed several parts not needed (main function etc).
+ * Added some checks for OSX/Apple
+*/
+
+#ifndef _WIN32
+ #ifndef __USE_FILE_OFFSET64
+ #define __USE_FILE_OFFSET64
+ #endif
+ #ifndef __USE_LARGEFILE64
+ #define __USE_LARGEFILE64
+ #endif
+ #ifndef _LARGEFILE64_SOURCE
+ #define _LARGEFILE64_SOURCE
+ #endif
+ #ifndef _FILE_OFFSET_BIT
+ #define _FILE_OFFSET_BIT 64
+ #endif
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <errno.h>
+#include <fcntl.h>
+
+#include <unistd.h>
+#include <utime.h>
+#include <sys/stat.h>
+
+#include "unzip.h"
+#include "archive.h"
+
+#define CASESENSITIVITY (0)
+#define WRITEBUFFERSIZE (8192)
+#define MAXFILENAME (256)
+
+#ifdef _WIN32
+#define USEWIN32IOAPI
+#include "iowin32.h"
+#endif
+/*
+ mini unzip, demo of unzip package
+
+ usage :
+ Usage : miniunz [-exvlo] file.zip [file_to_extract] [-d extractdir]
+
+ list the file in the zipfile, and print the content of FILE_ID.ZIP or README.TXT
+ if it exists
+*/
+
+
+/* change_file_date : change the date/time of a file
+ filename : the filename of the file where date/time must be modified
+ dosdate : the new date at the MSDos format (4 bytes)
+ tmu_date : the SAME new date at the tm_unz format */
+void change_file_date(filename,dosdate,tmu_date)
+ const char *filename;
+ uLong dosdate;
+ tm_unz tmu_date;
+{
+#ifdef _WIN32
+ HANDLE hFile;
+ FILETIME ftm,ftLocal,ftCreate,ftLastAcc,ftLastWrite;
+
+ hFile = CreateFileA(filename,GENERIC_READ | GENERIC_WRITE,
+ 0,NULL,OPEN_EXISTING,0,NULL);
+ GetFileTime(hFile,&ftCreate,&ftLastAcc,&ftLastWrite);
+ DosDateTimeToFileTime((WORD)(dosdate>>16),(WORD)dosdate,&ftLocal);
+ LocalFileTimeToFileTime(&ftLocal,&ftm);
+ SetFileTime(hFile,&ftm,&ftLastAcc,&ftm);
+ CloseHandle(hFile);
+#else
+#if defined(unix) || defined(__APPLE__)
+ struct utimbuf ut;
+ struct tm newdate;
+ newdate.tm_sec = tmu_date.tm_sec;
+ newdate.tm_min=tmu_date.tm_min;
+ newdate.tm_hour=tmu_date.tm_hour;
+ newdate.tm_mday=tmu_date.tm_mday;
+ newdate.tm_mon=tmu_date.tm_mon;
+ if (tmu_date.tm_year > 1900)
+ newdate.tm_year=tmu_date.tm_year - 1900;
+ else
+ newdate.tm_year=tmu_date.tm_year ;
+ newdate.tm_isdst=-1;
+
+ ut.actime=ut.modtime=mktime(&newdate);
+ utime(filename,&ut);
+#endif
+#endif
+}
+
+
+/* mymkdir and change_file_date are not 100 % portable
+ As I don't know well Unix, I wait feedback for the unix portion */
+
+int mymkdir(dirname)
+ const char* dirname;
+{
+ int ret=0;
+#ifdef _WIN32
+ ret = _mkdir(dirname);
+#else
+#if defined unix || defined __APPLE__
+ ret = mkdir(dirname,0775);
+#endif
+#endif
+ return ret;
+}
+
+int makedir (newdir)
+ char *newdir;
+{
+ char *buffer ;
+ char *p;
+ int len = (int)strlen(newdir);
+
+ if (len <= 0)
+ return 0;
+
+ buffer = (char*)malloc(len+1);
+ if (buffer==NULL)
+ {
+ printf("Error allocating memory\n");
+ return UNZ_INTERNALERROR;
+ }
+ strcpy(buffer,newdir);
+
+ if (buffer[len-1] == '/') {
+ buffer[len-1] = '\0';
+ }
+ if (mymkdir(buffer) == 0)
+ {
+ free(buffer);
+ return 1;
+ }
+
+ p = buffer+1;
+ while (1)
+ {
+ char hold;
+
+ while(*p && *p != '\\' && *p != '/')
+ p++;
+ hold = *p;
+ *p = 0;
+ if ((mymkdir(buffer) == -1) && (errno == ENOENT))
+ {
+ printf("couldn't create directory %s\n",buffer);
+ free(buffer);
+ return 0;
+ }
+ if (hold == 0)
+ break;
+ *p++ = hold;
+ }
+ free(buffer);
+ return 1;
+}
+
+int do_extract_currentfile(unzFile uf, char * revisionRoot) {
+ char filename_inzip[256];
+ char* filename_withoutpath;
+ char* p;
+ int err=UNZ_OK;
+ FILE *fout=NULL;
+ void* buf;
+ uInt size_buf;
+
+ unz_file_info64 file_info;
+ err = unzGetCurrentFileInfo64(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
+
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
+ return err;
+ }
+
+ size_buf = WRITEBUFFERSIZE;
+ buf = (void*)malloc(size_buf);
+ if (buf==NULL)
+ {
+ printf("Error allocating memory\n");
+ return UNZ_INTERNALERROR;
+ }
+
+ p = filename_withoutpath = filename_inzip;
+ while ((*p) != '\0')
+ {
+ if (((*p)=='/') || ((*p)=='\\'))
+ filename_withoutpath = p+1;
+ p++;
+ }
+
+ if ((*filename_withoutpath)=='\0') {
+ char dir[strlen(revisionRoot) + strlen(filename_inzip) + 2];
+ strcpy(dir, revisionRoot);
+ strcat(dir, "/");
+ strcat(dir, filename_inzip);
+ mymkdir(dir);
+ }
+ else
+ {
+ const char* write_filename;
+ int skip=0;
+ write_filename = filename_inzip;
+
+ int length = strlen(write_filename) + strlen(revisionRoot) + 2;
+ char fWFN[length];
+ strcpy(fWFN, revisionRoot);
+ strcat(fWFN, "/");
+ strcat(fWFN, write_filename);
+
+ err = unzOpenCurrentFile(uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzOpenCurrentFilePassword\n",err);
+ }
+
+ if ((skip==0) && (err==UNZ_OK))
+ {
+ fout=fopen64(fWFN,"wb");
+
+ /* some zipfile don't contain directory alone before file */
+ if ((fout==NULL) && (filename_withoutpath!=(char*)filename_inzip))
+ {
+ char c=*(filename_withoutpath-1);
+ *(filename_withoutpath-1)='\0';
+ int length = strlen(write_filename) + strlen(revisionRoot) + 2;
+ char dir[length];
+ strcpy(dir, revisionRoot);
+ strcat(dir, "/");
+ strcat(dir, write_filename);
+ makedir(dir);
+ *(filename_withoutpath-1)=c;
+
+ fout=fopen64(fWFN,"wb");
+ }
+
+ if (fout==NULL)
+ {
+ printf("error opening %s\n",write_filename);
+ }
+ }
+
+ if (fout!=NULL)
+ {
+ do
+ {
+ err = unzReadCurrentFile(uf,buf,size_buf);
+ if (err<0)
+ {
+ printf("error %d with zipfile in unzReadCurrentFile\n",err);
+ break;
+ }
+ if (err>0)
+ if (fwrite(buf,err,1,fout)!=1)
+ {
+ printf("error in writing extracted file\n");
+ err=UNZ_ERRNO;
+ break;
+ }
+ }
+ while (err>0);
+ if (fout)
+ fclose(fout);
+
+ if (err==0)
+ change_file_date(fWFN,file_info.dosDate,
+ file_info.tmu_date);
+ }
+
+ if (err==UNZ_OK)
+ {
+ err = unzCloseCurrentFile (uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzCloseCurrentFile\n",err);
+ }
+ }
+ else
+ unzCloseCurrentFile(uf); /* don't lose the error */
+ }
+
+ free(buf);
+ return err;
+}
+
+
+int do_extract(unzFile uf, char * revisionRoot) {
+ uLong i;
+ unz_global_info64 gi;
+ int err;
+
+ err = unzGetGlobalInfo64(uf,&gi);
+ if (err!=UNZ_OK)
+ printf("error %d with zipfile in unzGetGlobalInfo \n",err);
+
+ for (i=0;i<gi.number_entry;i++)
+ {
+ if (do_extract_currentfile(uf, revisionRoot) != UNZ_OK)
+ break;
+
+ if ((i+1)<gi.number_entry)
+ {
+ err = unzGoToNextFile(uf);
+ if (err!=UNZ_OK)
+ {
+ printf("error %d with zipfile in unzGoToNextFile\n",err);
+ break;
+ }
+ }
+ }
+
+ return 0;
+}
+
+celix_status_t unzip_extractDeploymentPackage(char * packageName, char * destination) {
+ celix_status_t status = CELIX_SUCCESS;
+ char filename_try[MAXFILENAME+16] = "";
+ unzFile uf=NULL;
+
+ if (packageName!=NULL)
+ {
+
+# ifdef USEWIN32IOAPI
+ zlib_filefunc64_def ffunc;
+# endif
+
+ strncpy(filename_try, packageName,MAXFILENAME-1);
+ /* strncpy doesnt append the trailing NULL, of the string is too long. */
+ filename_try[ MAXFILENAME ] = '\0';
+
+# ifdef USEWIN32IOAPI
+ fill_win32_filefunc64A(&ffunc);
+ uf = unzOpen2_64(bundleName,&ffunc);
+# else
+ uf = unzOpen64(packageName);
+# endif
+ if (uf==NULL)
+ {
+ strcat(filename_try,".zip");
+# ifdef USEWIN32IOAPI
+ uf = unzOpen2_64(filename_try,&ffunc);
+# else
+ uf = unzOpen64(filename_try);
+# endif
+ }
+ }
+
+ if (uf==NULL)
+ {
+ printf("Cannot open %s or %s.zip\n",packageName,packageName);
+ status = CELIX_FILE_IO_EXCEPTION;
+ } else {
+ if (do_extract(uf, destination) != 0) {
+ status = CELIX_FILE_IO_EXCEPTION;
+ }
+
+ unzClose(uf);
+ }
+
+ return status;
+}
http://git-wip-us.apache.org/repos/asf/celix/blob/3bce889b/bundles/deployment_admin/src/miniunz.h
----------------------------------------------------------------------
diff --git a/bundles/deployment_admin/src/miniunz.h b/bundles/deployment_admin/src/miniunz.h
new file mode 100644
index 0000000..f54b1fa
--- /dev/null
+++ b/bundles/deployment_admin/src/miniunz.h
@@ -0,0 +1,34 @@
+/**
+ *Licensed to the Apache Software Foundation (ASF) under one
+ *or more contributor license agreements. See the NOTICE file
+ *distributed with this work for additional information
+ *regarding copyright ownership. The ASF licenses this file
+ *to you under the Apache License, Version 2.0 (the
+ *"License"); you may not use this file except in compliance
+ *with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *Unless required by applicable law or agreed to in writing,
+ *software distributed under the License is distributed on an
+ *"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ *specific language governing permissions and limitations
+ *under the License.
+ */
+/*
+ * miniunz.h
+ *
+ * \date Aug 8, 2012
+ * \author <a href="mailto:dev@celix.apache.org">Apache Celix Project Team</a>
+ * \copyright Apache License, Version 2.0
+ */
+
+#ifndef MINIUNZ_H_
+#define MINIUNZ_H_
+
+#include "celix_errno.h"
+
+celix_status_t unzip_extractDeploymentPackage(char * packageName, char * destination);
+
+#endif /* MINIUNZ_H_ */