LibreOffice Module onlineupdate (master) 1
|
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <onlineupdate/mar_private.h>
#include <onlineupdate/mar_cmdline.h>
#include <onlineupdate/mar.h>
#include <netinet/in.h>
#include <unistd.h>
Go to the source code of this file.
Classes | |
struct | MarItemStack |
Functions | |
static int | mar_push (struct MarItemStack *stack, uint32_t length, uint32_t flags, const char *name) |
Push a new item onto the stack of items. More... | |
static int | mar_concat_file (FILE *fp, const char *path) |
static int | mar_concat_product_info_block (FILE *fp, struct MarItemStack *stack, struct ProductInformationBlock *infoBlock) |
Writes out the product information block to the specified file. More... | |
int | refresh_product_info_block (const char *path, struct ProductInformationBlock *infoBlock) |
Refreshes the product information block with the new information. More... | |
int | mar_create (const char *dest, int num_files, char **files, struct ProductInformationBlock *infoBlock) |
Create a MAR file from a set of files. More... | |
|
static |
Definition at line 75 of file mar_create.c.
References BLOCKSIZE, FILE, and in.
Referenced by mar_create().
|
static |
Writes out the product information block to the specified file.
fp | The opened MAR file being created. |
stack | A pointer to the MAR item stack being used to create the MAR |
infoBlock | The product info block to store in the file. |
Definition at line 109 of file mar_create.c.
References htonl(), MarItemStack::last_offset, ProductInformationBlock::MARChannelID, ntohl(), PIB_MAX_MAR_CHANNEL_ID_SIZE, PIB_MAX_PRODUCT_VERSION_SIZE, and ProductInformationBlock::productVersion.
Referenced by mar_create(), and refresh_product_info_block().
int mar_create | ( | const char * | dest, |
int | num_files, | ||
char ** | files, | ||
struct ProductInformationBlock * | infoBlock | ||
) |
Create a MAR file from a set of files.
dest | The path to the file to create. This path must be compatible with fopen. |
numfiles | The number of files to store in the archive. |
files | The list of null-terminated file paths. Each file path must be compatible with fopen. |
infoBlock | The information to store in the product information block. |
Definition at line 293 of file mar_create.c.
References FILE, MarItemStack::head, HOST_TO_NETWORK64, htonl(), i, MarItemStack::last_offset, mar_concat_file(), mar_concat_product_info_block(), MAR_ID, MAR_ID_SIZE, mar_push(), MAX_SIZE_OF_MAR_FILE, NETWORK_TO_HOST64, ntohl(), remove(), and MarItemStack::size_used.
Referenced by main().
|
static |
Push a new item onto the stack of items.
The stack is a single block of memory.
Definition at line 34 of file mar_create.c.
References BLOCKSIZE, MarItemStack::head, htonl(), MarItemStack::last_offset, length, MAR_ITEM_SIZE, name, ROUND_UP, size, MarItemStack::size_allocated, and MarItemStack::size_used.
Referenced by mar_create().
int refresh_product_info_block | ( | const char * | path, |
struct ProductInformationBlock * | infoBlock | ||
) |
Refreshes the product information block with the new information.
The input MAR must not be signed or the function call will fail.
path | The path to the MAR file whose product info block should be refreshed. |
infoBlock | Out parameter for where to store the result to |
Definition at line 193 of file mar_create.c.
References FILE, get_mar_file_info(), i, mar_concat_product_info_block(), ntohl(), NULL, and PRODUCT_INFO_BLOCK_ID.
Referenced by main().