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)  

aux_objects.c File Reference
#include <ctype.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <utime.h>
#include <dirent.h>
#include <errno.h>
#include "xorriso.h"
#include "xorriso_private.h"
Include dependency graph for aux_objects.c:

Go to the source code of this file.

Data Structures

struct  SplitparT
 
struct  DirseQ
 
struct  ExclusionS
 
struct  LinkiteM
 
struct  PermiteM
 

Functions

int Splitparts_new (struct SplitparT **o, int count, int flag)
 
int Splitparts_destroy (struct SplitparT **o, int count, int flag)
 
int Splitparts_set (struct SplitparT *o, int idx, char *name, int partno, int total_parts, off_t offset, off_t bytes, off_t total_bytes, int flag)
 
int Splitparts_get (struct SplitparT *o, int idx, char **name, int *partno, int *total_parts, off_t *offset, off_t *bytes, off_t *total_bytes, int flag)
 
int Splitpart__read_next_num (char *base_pt, char **next_pt, off_t *num, int flag)
 
int Splitpart__parse (char *name, int *partno, int *total_parts, off_t *offset, off_t *bytes, off_t *total_bytes, int flag)
 
int Splitpart__is_part_path (char *path, int flag)
 
int Splitpart__compose (char *adr, int partno, int total_parts, off_t offset, off_t bytes, off_t total_bytes, int flag)
 
int Splitparts_cmp (const void *v1, const void *v2)
 
int Splitparts_sort (struct SplitparT *o, int count, int flag)
 
int Dirseq_destroy (struct DirseQ **o, int flag)
 
int Dirseq_next_adrblock (struct DirseQ *o, char *replies[], int *reply_count, int max_replies, int flag)
 
int Dirseq_new (struct DirseQ **o, char *adr, int flag)
 
int Dirseq_set_next (struct DirseQ *o, struct DirseQ *next, int flag)
 
int Dirseq_get_next (struct DirseQ *o, struct DirseQ **next, int flag)
 
int Dirseq_get_adr (struct DirseQ *o, char **adrpt, int flag)
 
int Dirseq_rewind (struct DirseQ *o, int flag)
 
int Dirseq_next_adr (struct DirseQ *o, char reply[4096], int flag)
 
int Xorriso_lst_new_binary (struct Xorriso_lsT **lstring, char *data, int data_len, struct Xorriso_lsT *link, int flag)
 
int Xorriso_lst_new (struct Xorriso_lsT **lstring, char *text, struct Xorriso_lsT *link, int flag)
 
int Xorriso_lst_destroy (struct Xorriso_lsT **lstring, int flag)
 
int Xorriso_lst_destroy_all (struct Xorriso_lsT **lstring, int flag)
 
int Xorriso_lst_append_binary (struct Xorriso_lsT **entry, char *data, int data_len, int flag)
 
struct Xorriso_lsTXorriso_lst_get_next (struct Xorriso_lsT *entry, int flag)
 
struct Xorriso_lsTXorriso_lst_get_prev (struct Xorriso_lsT *entry, int flag)
 
char * Xorriso_lst_get_text (struct Xorriso_lsT *entry, int flag)
 
int Xorriso_lst_detach_text (struct Xorriso_lsT *entry, int flag)
 
int Xorriso_lst_get_last (struct Xorriso_lsT *entry, struct Xorriso_lsT **last, int flag)
 
int Xorriso_lst_concat (struct Xorriso_lsT *first, struct Xorriso_lsT *second, int flag)
 
int Exclusions_new (struct ExclusionS **o, int flag)
 
int Exclusions_destroy (struct ExclusionS **o, int flag)
 
int Exclusions_add_not_paths (struct ExclusionS *o, int descrc, char **descrs, int pathc, char **paths, int flag)
 
int Exclusions_add_not_leafs (struct ExclusionS *o, char *not_leafs_descr, regex_t *re, int flag)
 
int Exclusions_match (struct ExclusionS *o, char *abs_path, int flag)
 
int Exclusions_get_descrs (struct ExclusionS *o, struct Xorriso_lsT **not_paths_descr, struct Xorriso_lsT **not_leafs_descr, int flag)
 
int Linkitem_new (struct LinkiteM **o, char *link_path, dev_t target_dev, ino_t target_ino, struct LinkiteM *next, int flag)
 
int Linkitem_destroy (struct LinkiteM **o, int flag)
 
int Linkitem_reset_stack (struct LinkiteM **o, struct LinkiteM *to, int flag)
 
int Linkitem_find (struct LinkiteM *stack, dev_t target_dev, ino_t target_ino, struct LinkiteM **result, int flag)
 
int Linkitem_get_link_count (struct LinkiteM *item, int flag)
 
int Permstack_push (struct PermiteM **o, char *disk_path, struct stat *stbuf, int flag)
 
int Permstack_pop (struct PermiteM **o, struct PermiteM *stopper, struct XorrisO *xorriso, int flag)
 

Variables

static char Splitpart_wordS [][16] = {"part_", "_of_", "_at_", "_with_", "_of_"}
 
static int Dirseq_buffer_sizE = 100
 

Function Documentation

◆ Dirseq_destroy()

int Dirseq_destroy ( struct DirseQ **  o,
int  flag 
)

◆ Dirseq_get_adr()

int Dirseq_get_adr ( struct DirseQ o,
char **  adrpt,
int  flag 
)

Definition at line 370 of file aux_objects.c.

References DirseQ::adr.

◆ Dirseq_get_next()

int Dirseq_get_next ( struct DirseQ o,
struct DirseQ **  next,
int  flag 
)

Definition at line 363 of file aux_objects.c.

References DirseQ::next.

◆ Dirseq_new()

◆ Dirseq_next_adr()

◆ Dirseq_next_adrblock()

int Dirseq_next_adrblock ( struct DirseQ o,
char *  replies[],
int *  reply_count,
int  max_replies,
int  flag 
)

Definition at line 450 of file aux_objects.c.

References Dirseq_next_adr(), SfileadrL, Sort_argv(), Sregex_string(), and TSOB_FELD.

Referenced by Dirseq_next_adr().

◆ Dirseq_rewind()

int Dirseq_rewind ( struct DirseQ o,
int  flag 
)

Definition at line 377 of file aux_objects.c.

References DirseQ::dirpt.

Referenced by Xorriso_show_dux_subs().

◆ Dirseq_set_next()

int Dirseq_set_next ( struct DirseQ o,
struct DirseQ next,
int  flag 
)

Definition at line 356 of file aux_objects.c.

References DirseQ::next.

◆ Exclusions_add_not_leafs()

int Exclusions_add_not_leafs ( struct ExclusionS o,
char *  not_leafs_descr,
regex_t *  re,
int  flag 
)

◆ Exclusions_add_not_paths()

int Exclusions_add_not_paths ( struct ExclusionS o,
int  descrc,
char **  descrs,
int  pathc,
char **  paths,
int  flag 
)

◆ Exclusions_destroy()

int Exclusions_destroy ( struct ExclusionS **  o,
int  flag 
)

◆ Exclusions_get_descrs()

int Exclusions_get_descrs ( struct ExclusionS o,
struct Xorriso_lsT **  not_paths_descr,
struct Xorriso_lsT **  not_leafs_descr,
int  flag 
)

Definition at line 836 of file aux_objects.c.

References ExclusionS::not_leafs_descr, and ExclusionS::not_paths_descr.

Referenced by Xorriso_status().

◆ Exclusions_match()

int Exclusions_match ( struct ExclusionS o,
char *  abs_path,
int  flag 
)

◆ Exclusions_new()

int Exclusions_new ( struct ExclusionS **  o,
int  flag 
)

◆ Linkitem_destroy()

int Linkitem_destroy ( struct LinkiteM **  o,
int  flag 
)

Definition at line 883 of file aux_objects.c.

Referenced by Linkitem_new(), and Linkitem_reset_stack().

◆ Linkitem_find()

int Linkitem_find ( struct LinkiteM stack,
dev_t  target_dev,
ino_t  target_ino,
struct LinkiteM **  result,
int  flag 
)

Definition at line 915 of file aux_objects.c.

References LinkiteM::next, LinkiteM::target_dev, and LinkiteM::target_ino.

Referenced by Xorriso_hop_link().

◆ Linkitem_get_link_count()

int Linkitem_get_link_count ( struct LinkiteM item,
int  flag 
)

Definition at line 930 of file aux_objects.c.

References LinkiteM::link_count.

Referenced by Xorriso_hop_link().

◆ Linkitem_new()

int Linkitem_new ( struct LinkiteM **  o,
char *  link_path,
dev_t  target_dev,
ino_t  target_ino,
struct LinkiteM next,
int  flag 
)

◆ Linkitem_reset_stack()

int Linkitem_reset_stack ( struct LinkiteM **  o,
struct LinkiteM to,
int  flag 
)

◆ Permstack_pop()

◆ Permstack_push()

int Permstack_push ( struct PermiteM **  o,
char *  disk_path,
struct stat *  stbuf,
int  flag 
)

◆ Splitpart__compose()

int Splitpart__compose ( char *  adr,
int  partno,
int  total_parts,
off_t  offset,
off_t  bytes,
off_t  total_bytes,
int  flag 
)

Definition at line 218 of file aux_objects.c.

References Sfile_off_t_text(), and Splitpart_wordS.

Referenced by Xorriso_graft_split(), and Xorriso_update_interpreter().

◆ Splitpart__is_part_path()

int Splitpart__is_part_path ( char *  path,
int  flag 
)

Definition at line 199 of file aux_objects.c.

References Splitpart__parse().

◆ Splitpart__parse()

int Splitpart__parse ( char *  name,
int *  partno,
int *  total_parts,
off_t *  offset,
off_t *  bytes,
off_t *  total_bytes,
int  flag 
)

Definition at line 153 of file aux_objects.c.

References Splitpart__read_next_num(), and Splitpart_wordS.

Referenced by Splitpart__is_part_path(), and Xorriso_identify_split().

◆ Splitpart__read_next_num()

int Splitpart__read_next_num ( char *  base_pt,
char **  next_pt,
off_t *  num,
int  flag 
)

Definition at line 129 of file aux_objects.c.

References Scanf_io_size().

Referenced by Splitpart__parse().

◆ Splitparts_cmp()

int Splitparts_cmp ( const void *  v1,
const void *  v2 
)

Definition at line 240 of file aux_objects.c.

References SplitparT::offset, and SplitparT::partno.

Referenced by Splitparts_sort().

◆ Splitparts_destroy()

int Splitparts_destroy ( struct SplitparT **  o,
int  count,
int  flag 
)

◆ Splitparts_get()

int Splitparts_get ( struct SplitparT o,
int  idx,
char **  name,
int *  partno,
int *  total_parts,
off_t *  offset,
off_t *  bytes,
off_t *  total_bytes,
int  flag 
)

◆ Splitparts_new()

int Splitparts_new ( struct SplitparT **  o,
int  count,
int  flag 
)

Definition at line 62 of file aux_objects.c.

References TSOB_FELD.

Referenced by Xorriso_identify_split().

◆ Splitparts_set()

int Splitparts_set ( struct SplitparT o,
int  idx,
char *  name,
int  partno,
int  total_parts,
off_t  offset,
off_t  bytes,
off_t  total_bytes,
int  flag 
)

◆ Splitparts_sort()

int Splitparts_sort ( struct SplitparT o,
int  count,
int  flag 
)

Definition at line 259 of file aux_objects.c.

References Splitparts_cmp().

Referenced by Xorriso_identify_split().

◆ Xorriso_lst_append_binary()

int Xorriso_lst_append_binary ( struct Xorriso_lsT **  entry,
char *  data,
int  data_len,
int  flag 
)

Create a new list item at the end of a given list.

Parameters
entryContains as input a pointer to a pointer to any existing list item. As output this list item pointer may be changed to the address of the new list item: if ((*entry == 0) || (flag & 1))
dataAn array of bytes to be copied into the new object
data_lenNumber of bytes to be copied
flagBitfield for control purposes bit0= Return new object address in *entry bit1= do not copy data (e.g. because *data is invalid) bit2= attach data directly by pointer rather than by copying
Returns
<=0 error, 1 ok

Definition at line 609 of file aux_objects.c.

References Xorriso_lsT::next, and Xorriso_lst_new_binary().

Referenced by Exclusions_add_not_leafs(), Xorriso_external_filter(), Xorriso_option_map_l(), Xorriso_restore(), and Xorriso_write_to_msglist().

◆ Xorriso_lst_concat()

int Xorriso_lst_concat ( struct Xorriso_lsT first,
struct Xorriso_lsT second,
int  flag 
)

Definition at line 659 of file aux_objects.c.

References Xorriso_lsT::next, Xorriso_lsT::prev, and Xorriso_lst_get_last().

Referenced by Xorriso_pull_outlists().

◆ Xorriso_lst_destroy()

int Xorriso_lst_destroy ( struct Xorriso_lsT **  lstring,
int  flag 
)

Destroy a single list item and connect its eventual list neighbors.

Parameters
lstringpointer to the pointer to be freed and set to NULL
flagunused yet, submit 0
Returns
0= *lstring was already NULL, 1= ok

Definition at line 571 of file aux_objects.c.

References Xorriso_lsT::next, Xorriso_lsT::prev, Smem_freE, and Xorriso_lsT::text.

Referenced by Exclusions_destroy(), Xorriso_destroy_all_extf(), Xorriso_dialog_input(), Xorriso_external_filter(), Xorriso_lst_destroy_all(), Xorriso_lst_new_binary(), and Xorriso_sieve_filter_msg().

◆ Xorriso_lst_destroy_all()

int Xorriso_lst_destroy_all ( struct Xorriso_lsT **  lstring,
int  flag 
)

Destroy all list items which are directly or indirectly connected to the given link item. All pointers obtained by Xorriso_lst_get_text() become invalid by this. Apply this to each of the two list handles obtained by Xorriso_pull_outlists() when the lists are no longer needed.

Parameters
lstring*lstring will be freed and set to NULL. It is not dangerous to submit a pointer to a NULL-pointer.
flagunused yet, submit 0
Returns
-1= lstring was NULL (i.e. wrong use of this call), 0= *lstring was already NULL, 1= item actually disposed

Definition at line 591 of file aux_objects.c.

References Xorriso_lsT::next, Xorriso_lsT::prev, and Xorriso_lst_destroy().

Referenced by Exclusions_destroy(), Xorriso_destroy(), Xorriso_destroy_di_array(), Xorriso_destroy_node_array(), Xorriso_jigdo_interpreter(), Xorriso_msg_filter_destroy(), Xorriso_msg_op_parse_bulk(), Xorriso_msg_watcher(), Xorriso_named_pipe_loop(), Xorriso_option_drive_class(), Xorriso_option_setfattr_listi(), Xorriso_sieve_clear_results(), Xorriso_start_msg_watcher(), Xorriso_stop_msg_watcher(), and Xorriso_toc_to_string().

◆ Xorriso_lst_detach_text()

int Xorriso_lst_detach_text ( struct Xorriso_lsT entry,
int  flag 
)

Definition at line 642 of file aux_objects.c.

References Xorriso_lsT::text.

Referenced by Xorriso_destroy_all_extf(), and Xorriso_external_filter().

◆ Xorriso_lst_get_last()

int Xorriso_lst_get_last ( struct Xorriso_lsT entry,
struct Xorriso_lsT **  last,
int  flag 
)

Definition at line 649 of file aux_objects.c.

References Xorriso_lsT::next.

Referenced by Xorriso_lst_concat(), and Xorriso_status().

◆ Xorriso_lst_get_next()

struct Xorriso_lsT* Xorriso_lst_get_next ( struct Xorriso_lsT entry,
int  flag 
)

Obtain the address of the next item in the chain of messages. An iteration over the output of Xorriso_pull_outlists() starts at the returned result_list or info_list and ends when this function returns NULL.

Parameters
entryThe current list item
flagunused yet, submit 0
Returns
Pointer to the next list item or NULL if end of list. This pointer does not have to be freed.

Definition at line 624 of file aux_objects.c.

References Xorriso_lsT::next.

Referenced by Xorriso_destroy_all_extf(), Xorriso_dialog_input(), Xorriso_external_filter(), Xorriso_finish_hl_update(), Xorriso_get_pattern(), Xorriso_is_in_patternlist(), Xorriso_lookup_extf(), Xorriso_make_restore_path(), Xorriso_msg_op_parse_bulk(), Xorriso_perform_attr_from_list(), Xorriso_sieve_get_result(), Xorriso_status(), Xorriso_status_extf(), and Xorriso_toc_to_string().

◆ Xorriso_lst_get_prev()

struct Xorriso_lsT* Xorriso_lst_get_prev ( struct Xorriso_lsT entry,
int  flag 
)

Obtain the address of the previous item in the chain of messages.

Parameters
entryThe current list item
flagunused yet, submit 0
Returns
Pointer to the previous list item or NULL if start of list. This pointer does not have to be freed.

Definition at line 630 of file aux_objects.c.

References Xorriso_lsT::prev.

Referenced by Xorriso_status().

◆ Xorriso_lst_get_text()

char* Xorriso_lst_get_text ( struct Xorriso_lsT entry,
int  flag 
)

Obtain the text message from the current list item.

Parameters
entryThe current list item
flagunused yet, submit 0
Returns
Pointer to the text content of the list item. This pointer does not have to be freed.

Definition at line 636 of file aux_objects.c.

References Xorriso_lsT::text.

Referenced by Xorriso_destroy_all_extf(), Xorriso_dialog_input(), Xorriso_external_filter(), Xorriso_finish_hl_update(), Xorriso_get_pattern(), Xorriso_is_in_patternlist(), Xorriso_lookup_extf(), Xorriso_make_restore_path(), Xorriso_msg_op_parse_bulk(), Xorriso_perform_attr_from_list(), Xorriso_process_msg_lists(), Xorriso_set_filter(), Xorriso_sieve_get_result(), Xorriso_status(), Xorriso_status_extf(), and Xorriso_toc_to_string().

◆ Xorriso_lst_new()

int Xorriso_lst_new ( struct Xorriso_lsT **  lstring,
char *  text,
struct Xorriso_lsT link,
int  flag 
)

Create a new list item with a 0-terminated text as content.

Parameters
lstringThe newly created object or NULL on failure
textA 0-terminated array of bytes
linkXorriso_lsT object to which the new object shall be linked
flagsee Xorriso_lst_new_binary
Returns
<=0 error, 1 ok

Definition at line 557 of file aux_objects.c.

References Xorriso_lsT::text, and Xorriso_lst_new_binary().

Referenced by Exclusions_add_not_paths(), Xorriso_jigdo_interpreter(), Xorriso_msg_op_parse_bulk(), Xorriso_named_pipe_loop(), Xorriso_new(), Xorriso_option_drive_class(), Xorriso_option_setfattr_listi(), Xorriso_option_update(), and Xorriso_sieve_filter_msg().

◆ Xorriso_lst_new_binary()

int Xorriso_lst_new_binary ( struct Xorriso_lsT **  lstring,
char *  data,
int  data_len,
struct Xorriso_lsT link,
int  flag 
)

Create a new list item with arbitrary byte content.

Parameters
lstringThe newly created object or NULL on failure
dataAn array of bytes to be copied into the new object
data_lenNumber of bytes to be copied
linkXorriso_lsT object to which the new object shall be linked
flagBitfield for control purposes bit0= insert before link rather than after it bit1= do not copy data (e.g. because *data is invalid) bit2= attach data directly by pointer rather than by copying
Returns
<=0 error, 1 ok

Definition at line 506 of file aux_objects.c.

References Xorriso_lsT::next, Xorriso_lsT::prev, Smem_malloC, Xorriso_lsT::text, TSOB_FELD, and Xorriso_lst_destroy().

Referenced by Xorriso_lst_append_binary(), and Xorriso_lst_new().

Variable Documentation

◆ Dirseq_buffer_sizE

int Dirseq_buffer_sizE = 100
static

Definition at line 272 of file aux_objects.c.

Referenced by Dirseq_new().

◆ Splitpart_wordS

char Splitpart_wordS[][16] = {"part_", "_of_", "_at_", "_with_", "_of_"}
static

Definition at line 59 of file aux_objects.c.

Referenced by Splitpart__compose(), and Splitpart__parse().