SharkSSL C/C++ Reference
TLS, cryptography, certificates, and PSA integration
Minnow Server ZIP File System Plugin

Detailed Description

Optional Minnow Server adapter for an external ZIP reader.

The optional ZipFileSystem plugin for the Minnow Server lets you store the web presentation logic compressed in the device. The compressed web pages are not uncompressed on the device. The web pages are extracted from within the ZIP file and sent "as is" to the browser. All modern browsers uncompress "compressed" data received from the servers.

This checkout supplies ZipFileSystem.c and ZipFileSystem.h. Building the adapter also requires the separately supplied ZipFileIterator.h and its implementation, including ZipReader, ZipContainer, CentralDirIterator, and ZipFileInfo. Those external APIs and their build instructions belong to the ZIP reader package's documentation.

Data Structures

struct  ZipFileSystem
 The ZipFileSystem handle. More...
 

Functions

MSFetchPage msInitZipFileSystem (ZipFileSystem *zfs, ZipReader *zipReader)
 Initializes the ZIP File System and returns an MSFetchPage callback function. More...
 

Function Documentation

◆ msInitZipFileSystem()

MSFetchPage msInitZipFileSystem ( ZipFileSystem *  zfs,
ZipReader *  zipReader 
)

Initializes the ZIP File System and returns an MSFetchPage callback function.

Parameters
zfsZipFileSystem *; required caller-owned filesystem context retained while its page handler is installed.
zipReaderZipReader *; required caller-owned initialized reader retained with zfs and its ZIP data.

The reader connects the adapter to stored ZIP bytes. Supply an initialized reader using the external ZIP reader package's documented construction and storage interface.

Example code:

extern ZipReader* getZipReader(void);
.
.
wph.fetchPage = msInitZipFileSystem(&zfs, getZipReader());
wph.fetchPageHndl=&zfs;
MSFetchPage msInitZipFileSystem(ZipFileSystem *zfs, ZipReader *zipReader)
Initializes the ZIP File System and returns an MSFetchPage callback function.
The WssProtocolHandshake structure keeps state information for the web server function MS_ebServer.
Definition: MSLib.h:141
MSFetchPage fetchPage
In param: set the page fetch callback function if you plan on storing the web application in the devi...
Definition: MSLib.h:175
void * fetchPageHndl
In param: The MSFetchPage handle, if any.
Definition: MSLib.h:178
The ZipFileSystem handle.
Definition: ZipFileSystem.h:69
Returns
MSFetchPage; ZIP page-handler callback. Set it as fetchPage and use zfs as fetchPageHndl. Initialization does not return ZIP-validation status; subsequent fetch operations report ZIP errors.