xorriso  1.5.4.pl02
About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.
  Fossies Dox: xorriso-1.5.4.pl02.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

jte.c File Reference
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include "jte.h"
#include "checksum.h"
#include "endianconv.h"
#include "rsync.h"
#include "libjte_private.h"
#include "libjte.h"
Include dependency graph for jte.c:

Go to the source code of this file.

Macros

#define JTET_FILE_MATCH   1
 
#define JTET_NOMATCH   2
 
#define JTE_VER_MAJOR   0x0002
 
#define JTE_VER_MINOR   0x0000
 
#define JTE_NAME   "JTE"
 
#define JTE_COMMENT   "JTE at https://www.einval.com/~steve/software/JTE/ ; Jigdo at https://www.einval.com/~steve/software/jigdo/"
 
#define JIGDO_TEMPLATE_VERSION_MD5   "1.1"
 
#define JIGDO_TEMPLATE_VERSION_SHA256   "2.0"
 
#define JTE_MAX_ERROR_LIST_LENGTH   20
 

Enumerations

enum  _jigdo_desc_type {
  JDT_OBSOLETE_IMAGE_INFO = 1 , JDT_UNMATCHED_DATA = 2 , JDT_OBSOLETE_MATCHED_FILE = 3 , JDT_OBSOLETE_WRITTEN_FILE = 4 ,
  JDT_IMAGE_INFO_MD5 = 5 , JDT_MATCHED_FILE_MD5 = 6 , JDT_WRITTEN_FILE_MD5 = 7 , JDT_IMAGE_INFO_SHA256 = 8 ,
  JDT_MATCHED_FILE_SHA256 = 9 , JDT_WRITTEN_FILE_SHA256 = 10
}
 

Functions

static char * file_base_name (char *path)
 
static void exit_if_enabled (struct libjte_env *o, int value)
 
int libjte_report_no_mem (struct libjte_env *o, size_t size, int flag)
 
static int jte_add_path_match (struct libjte_env *o, char *pattern, int flag)
 
int libjte_destroy_path_match_list (struct libjte_env *o, int flag)
 
int jte_add_exclude (struct libjte_env *o, char *pattern)
 
static int check_exclude_by_name (struct libjte_env *o, char *filename, char **matched)
 
int jte_add_include (struct libjte_env *o, char *pattern)
 
int libjte_destroy_entry_list (struct libjte_env *o, int flag)
 
static int check_checksum_file_match (struct libjte_env *o, char *filename)
 
int list_file_in_jigdo (struct libjte_env *o, char *filename, off_t size, char **realname, unsigned char *checksum)
 
int jte_add_mapping (struct libjte_env *o, char *arg)
 
int libjte_destroy_path_mapping (struct libjte_env *o, int flag)
 
static char * remap_filename (struct libjte_env *o, char *filename)
 
static int template_fwrite (struct libjte_env *o, const void *ptr, size_t size, size_t nmemb, FILE *stream)
 
static int write_template_header (struct libjte_env *o)
 
static int add_checksum_entry (struct libjte_env *o, unsigned char *checksum, uint64_t size, char *filename)
 
int libjte_destroy_checksum_list (struct libjte_env *o, int flag)
 
static uint64_t parse_number (unsigned char in[12])
 
static int parse_checksum_list (struct libjte_env *o)
 
int write_jt_header (struct libjte_env *o, FILE *template_file, FILE *jigdo_file)
 
static int flush_gzip_chunk (struct libjte_env *o, void *buffer, off_t size)
 
static int flush_bz2_chunk (struct libjte_env *o, void *buffer, off_t size)
 
static int flush_compressed_chunk (struct libjte_env *o, void *buffer, off_t size)
 
static int write_compressed_chunk (struct libjte_env *o, unsigned char *buffer, size_t size)
 
static int write_template_desc_entries (struct libjte_env *o, off_t image_len)
 
static char * base64_dump (struct libjte_env *o, unsigned char *buf, size_t buf_size)
 
static char * uint64_to_dec (uint64_t num, char dec[40])
 
static int write_jigdo_file (struct libjte_env *o)
 
int write_jt_footer (struct libjte_env *o)
 
static void add_unmatched_entry (struct libjte_env *o, int uncompressed_length)
 
static void add_file_entry (struct libjte_env *o, char *filename, off_t size, unsigned char *checksum, uint64_t rsyncsum)
 
int jtwrite (struct libjte_env *o, void *buffer, int size, int count)
 
int write_jt_match_record (struct libjte_env *o, char *filename, char *mirror_name, int sector_size, off_t size, unsigned char *checksum)
 
int libjte_add_msg_entry (struct libjte_env *o, char *message, int flag)
 

Macro Definition Documentation

◆ JIGDO_TEMPLATE_VERSION_MD5

#define JIGDO_TEMPLATE_VERSION_MD5   "1.1"

Definition at line 64 of file jte.c.

◆ JIGDO_TEMPLATE_VERSION_SHA256

#define JIGDO_TEMPLATE_VERSION_SHA256   "2.0"

Definition at line 65 of file jte.c.

◆ JTE_COMMENT

#define JTE_COMMENT   "JTE at https://www.einval.com/~steve/software/JTE/ ; Jigdo at https://www.einval.com/~steve/software/jigdo/"

Definition at line 62 of file jte.c.

◆ JTE_MAX_ERROR_LIST_LENGTH

#define JTE_MAX_ERROR_LIST_LENGTH   20

Definition at line 67 of file jte.c.

◆ JTE_NAME

#define JTE_NAME   "JTE"

Definition at line 61 of file jte.c.

◆ JTE_VER_MAJOR

#define JTE_VER_MAJOR   0x0002

Definition at line 59 of file jte.c.

◆ JTE_VER_MINOR

#define JTE_VER_MINOR   0x0000

Definition at line 60 of file jte.c.

◆ JTET_FILE_MATCH

#define JTET_FILE_MATCH   1

Definition at line 56 of file jte.c.

◆ JTET_NOMATCH

#define JTET_NOMATCH   2

Definition at line 57 of file jte.c.

Enumeration Type Documentation

◆ _jigdo_desc_type

Enumerator
JDT_OBSOLETE_IMAGE_INFO 
JDT_UNMATCHED_DATA 
JDT_OBSOLETE_MATCHED_FILE 
JDT_OBSOLETE_WRITTEN_FILE 
JDT_IMAGE_INFO_MD5 
JDT_MATCHED_FILE_MD5 
JDT_WRITTEN_FILE_MD5 
JDT_IMAGE_INFO_SHA256 
JDT_MATCHED_FILE_SHA256 
JDT_WRITTEN_FILE_SHA256 

Definition at line 70 of file jte.c.

Function Documentation

◆ add_checksum_entry()

static int add_checksum_entry ( struct libjte_env o,
unsigned char *  checksum,
uint64_t  size,
char *  filename 
)
static

◆ add_file_entry()

static void add_file_entry ( struct libjte_env o,
char *  filename,
off_t  size,
unsigned char *  checksum,
uint64_t  rsyncsum 
)
static

◆ add_unmatched_entry()

static void add_unmatched_entry ( struct libjte_env o,
int  uncompressed_length 
)
static

◆ base64_dump()

static char* base64_dump ( struct libjte_env o,
unsigned char *  buf,
size_t  buf_size 
)
static

Definition at line 1124 of file jte.c.

References exit_if_enabled(), libjte_add_msg_entry(), and libjte_env::message_buffer.

Referenced by write_jigdo_file().

◆ check_checksum_file_match()

static int check_checksum_file_match ( struct libjte_env o,
char *  filename 
)
static

◆ check_exclude_by_name()

static int check_exclude_by_name ( struct libjte_env o,
char *  filename,
char **  matched 
)
static

◆ exit_if_enabled()

◆ file_base_name()

static char* file_base_name ( char *  path)
static

Definition at line 84 of file jte.c.

Referenced by list_file_in_jigdo(), and write_jigdo_file().

◆ flush_bz2_chunk()

static int flush_bz2_chunk ( struct libjte_env o,
void *  buffer,
off_t  size 
)
static

Definition at line 940 of file jte.c.

Referenced by flush_compressed_chunk().

◆ flush_compressed_chunk()

static int flush_compressed_chunk ( struct libjte_env o,
void *  buffer,
off_t  size 
)
static

◆ flush_gzip_chunk()

static int flush_gzip_chunk ( struct libjte_env o,
void *  buffer,
off_t  size 
)
static

Definition at line 772 of file jte.c.

References libjte_env::t_file, template_fwrite(), and write_le48().

Referenced by flush_compressed_chunk().

◆ jte_add_exclude()

int jte_add_exclude ( struct libjte_env o,
char *  pattern 
)

Definition at line 171 of file jte.c.

References jte_add_path_match().

Referenced by libjte_add_exclude().

◆ jte_add_include()

int jte_add_include ( struct libjte_env o,
char *  pattern 
)

Definition at line 202 of file jte.c.

References jte_add_path_match().

Referenced by libjte_add_checksum_demand(), and libjte_add_md5_demand().

◆ jte_add_mapping()

int jte_add_mapping ( struct libjte_env o,
char *  arg 
)

◆ jte_add_path_match()

static int jte_add_path_match ( struct libjte_env o,
char *  pattern,
int  flag 
)
static

◆ jtwrite()

int jtwrite ( struct libjte_env o,
void *  buffer,
int  size,
int  count 
)

◆ libjte_add_msg_entry()

◆ libjte_destroy_checksum_list()

int libjte_destroy_checksum_list ( struct libjte_env o,
int  flag 
)

◆ libjte_destroy_entry_list()

int libjte_destroy_entry_list ( struct libjte_env o,
int  flag 
)

◆ libjte_destroy_path_mapping()

int libjte_destroy_path_mapping ( struct libjte_env o,
int  flag 
)

Definition at line 414 of file jte.c.

References path_mapping::from, libjte_env::map_list, path_mapping::next, and path_mapping::to.

Referenced by libjte_destroy().

◆ libjte_destroy_path_match_list()

int libjte_destroy_path_match_list ( struct libjte_env o,
int  flag 
)

◆ libjte_report_no_mem()

int libjte_report_no_mem ( struct libjte_env o,
size_t  size,
int  flag 
)

Definition at line 107 of file jte.c.

References libjte_add_msg_entry(), and libjte_env::message_buffer.

Referenced by jte_add_path_match(), and libjte_decide_file_jigdo2().

◆ list_file_in_jigdo()

◆ parse_checksum_list()

◆ parse_number()

static uint64_t parse_number ( unsigned char  in[12])
static

Definition at line 581 of file jte.c.

Referenced by parse_checksum_list().

◆ remap_filename()

static char* remap_filename ( struct libjte_env o,
char *  filename 
)
static

◆ template_fwrite()

static int template_fwrite ( struct libjte_env o,
const void *  ptr,
size_t  size,
size_t  nmemb,
FILE *  stream 
)
static

◆ uint64_to_dec()

static char* uint64_to_dec ( uint64_t  num,
char  dec[40] 
)
static

Definition at line 1167 of file jte.c.

Referenced by write_jigdo_file().

◆ write_compressed_chunk()

◆ write_jigdo_file()

◆ write_jt_footer()

int write_jt_footer ( struct libjte_env o)

◆ write_jt_header()

◆ write_jt_match_record()

int write_jt_match_record ( struct libjte_env o,
char *  filename,
char *  mirror_name,
int  sector_size,
off_t  size,
unsigned char *  checksum 
)

◆ write_template_desc_entries()

◆ write_template_header()