libisoburn  1.5.4
About: libisoburn is a frontend for the libraries libburn and libisofs which enables creation and expansion of ISO-9660 filesystems on all media and file types supported by libburn. It implements the API and command interpreter of program xorriso, and installs this program as small dynamically linked binary. xorriso is suitable for incremental data backup and for production of bootable ISO 9660 images. A statically linked version is available as GNU xorriso.
  Fossies Dox: libisoburn-1.5.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

base_obj.c
Go to the documentation of this file.
1 
2 
3 
4 /* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
5 
6  Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
7 
8  Provided under GPL version 2 or later.
9 
10  This file contains functions which are needed to read data
11  from ISO image.
12 */
13 
14 #ifdef HAVE_CONFIG_H
15 #include "../config.h"
16 #endif
17 
18 #include <ctype.h>
19 #include <sys/types.h>
20 #include <unistd.h>
21 #include <stdlib.h>
22 #include <stdio.h>
23 #include <string.h>
24 #include <sys/stat.h>
25 #include <sys/time.h>
26 #include <time.h>
27 #include <errno.h>
28 #include <pthread.h>
29 
30 #ifdef HAVE_STDINT_H
31 #include <stdint.h>
32 #else
33 #ifdef HAVE_INTTYPES_H
34 #include <inttypes.h>
35 #endif
36 #endif
37 
38 #ifdef Xorriso_standalonE
39 
40 #ifdef Xorriso_with_libjtE
41 #include "../libjte/libjte.h"
42 #endif
43 
44 #else
45 
46 #ifdef Xorriso_with_libjtE
47 #include <libjte/libjte.h>
48 #endif
49 
50 #endif /* ! Xorriso_standalonE */
51 
52 #include "xorriso.h"
53 #include "xorriso_private.h"
54 
55 #include "base_obj.h"
56 #include "lib_mgt.h"
57 
58 
59 
60 /* See Xorriso__preset_signal_behavior() */
62 
63 
64 void Xorriso__version(int *major, int *minor, int *micro)
65 {
69 }
70 
71 
72 int Xorriso__is_compatible(int major, int minor, int micro, int flag)
73 {
74  int own_major, own_minor, own_micro;
75 
76  Xorriso__version(&own_major, &own_minor, &own_micro);
77  return(own_major > major ||
78  (own_major == major && (own_minor > minor ||
79  (own_minor == minor && own_micro >= micro))));
80 }
81 
82 
84 {
86 }
87 
88 
89 /** The list of startup file names */
90 #define Xorriso_rc_nuM 4
91 
93  "/etc/default/xorriso",
94  "/etc/opt/xorriso/rc",
95  "/etc/xorriso/xorriso.conf",
96  "placeholder for $HOME/.xorrisorc"
97 };
98 
99 
100 int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
101 {
102  int i, ret;
103  struct XorrisO *m;
104  char *leafname= NULL;
105 
106  leafname= TSOB_FELD(char, SfileadrL);
107  if(leafname == NULL)
108  return(-1);
109  *xorriso= m= TSOB_FELD(struct XorrisO,1);
110  if(m==NULL) {
111  free(leafname);
112  return(-1);
113  }
114 
115  /* Base initialization by actions which must not fail */
116 
117  m->libs_are_started= 0;
118  strncpy(m->progname,progname,sizeof(m->progname)-1);
119  m->progname[sizeof(m->progname)-1]= 0;
120  if(getcwd(m->initial_wdx,sizeof(m->initial_wdx)-1)==NULL)
121  m->initial_wdx[0]= 0;
122  m->no_rc= 0;
123  m->argument_emulation= 0;
124 
126  for(i=0;i<m->rc_filename_count-1;i++)
127  strcpy(m->rc_filenames[i],Xorriso_sys_rc_nameS[i]);
128  m->rc_filenames[m->rc_filename_count-1][0]= 0;
129  m->arrange_args= 0;
130  m->mkisofsrc_done= 0;
131 
132  m->wdi[0]= 0;
133  strcpy(m->wdx, m->initial_wdx);
134  m->did_something_useful= 0;
135  m->add_plainly= 0;
136  m->split_size= 0;
137  strcpy(m->list_delimiter, "--");
138  m->ino_behavior= 1 | 2 | 4 | 32; /* off:no_lsl_count */
139  m->iso_level= 3;
140  m->iso_level_is_default= 1;
141  m->do_joliet= 0;
142  m->do_hfsplus= 0;
143  m->do_fat= 0;
144  m->do_rockridge= 1;
145  m->do_iso1999= 0;
146  m->ecma119_map= 1;
147  m->joliet_map= 1;
148  m->do_aaip= 0;
149  m->do_md5= 64;
150  m->no_emul_toc= 0;
151  m->do_old_empty= 0;
152  m->scdbackup_tag_name[0]= 0;
153  m->scdbackup_tag_time[0]= 0;
154  m->scdbackup_tag_written[0]= 0;
155  m->scdbackup_tag_listname[0]= 0;
156  m->relax_compliance= 0;
157  m->allow_dir_id_ext_dflt= 1;
158  m->rr_reloc_dir[0]= 0;
159  m->rr_reloc_flags= 1;
160  m->untranslated_name_len= 0;
161  m->do_follow_pattern= 1;
162  m->do_follow_param= 0;
163  m->do_follow_links= 0;
164  m->follow_link_limit= 100;
166  m->resolve_link_rec_limit= 100;
167  m->do_follow_concat= 0;
168  m->do_follow_mount= 1;
169  m->do_global_uid= 0;
170  m->global_uid= 0;
171  m->isofs_size= 0;
172  m->isofs_has_what= 0;
173  m->tree_loaded= 0;
174  m->rr_loaded= 0;
175  strcpy(m->volid, "ISOIMAGE");
176  m->volid_default= 1;
177  m->loaded_volid[0]= 0;
178  m->assert_volid[0]= 0;
179  m->assert_volid_sev[0]= 0;
180  m->preparer_id[0]= 0;
181  m->publisher[0]= 0;
182  m->application_id[0]= 0;
183  m->system_id[0]= 0;
184  m->volset_id[0]= 0;
185  m->copyright_file[0]= 0;
186  m->biblio_file[0]= 0;
187  m->abstract_file[0]= 0;
188  strcpy(m->application_use, " ");
189  m->session_logfile[0]= 0;
190  m->session_lba= -1;
191  m->session_blocks= 0;
192  m->do_global_gid= 0;
193  m->global_gid= 0;
194  m->do_global_mode= 0;
195  m->global_dir_mode= 0555;
196  m->global_file_mode= 0444;
197  m->do_tao= 0;
198  m->filters= NULL;
199  m->filter_list_closed= 0;
200  m->zlib_level_default= m->zlib_level= 6;
202  m->zisofs_by_magic= 0;
203  m->zisofs_v2_enabled= 0;
210  -1.0;
212  m->do_overwrite= 2;
213  m->do_reassure= 0;
214  m->drive_blacklist= NULL;
215  m->drive_greylist= NULL;
216  m->drive_whitelist= NULL;
217  m->toc_emulation_flag= 0;
218  m->image_start_mode= 0;
219  m->image_start_value[0]= 0;
220  m->displacement= 0;
221  m->displacement_sign= 0;
222  m->read_fs= 0;
223  m->drives_exclusive= 1;
224  m->drives_access= 1;
225  m->linux_scsi_dev_family= 0;
226  m->early_stdio_test= 0;
227  m->cache_num_tiles= 0;
228  m->cache_tile_blocks= 0;
229  m->cache_default= 1 | 2;
230  m->do_calm_drive= 1;
231  m->indev[0]= 0;
232  m->in_drive_handle= NULL;
233  m->in_volset_handle= NULL;
234  m->in_charset= NULL;
235  m->isofs_st_out= time(0) - 1;
236  m->indev_is_exclusive= 1;
237  m->indev_access= 1;
238  m->indev_off_adr[0]= 0;
239  m->isofs_st_in= 0;
240  m->volset_change_pending= 0;
241  m->no_volset_present= 0;
242  m->in_sector_map= NULL;
243  m->check_media_default= NULL;
245  m->outdev[0]= 0;
246  m->out_drive_handle= NULL;
247  m->out_charset= NULL;
248  m->dev_fd_1= -1;
249  m->outdev_is_exclusive= 1;
250  m->outdev_access= 1;
251  m->outdev_off_adr[0]= 0;
252  m->grow_blindly_msc2= -1;
253  m->ban_stdio_write= 0;
254  m->do_dummy= 0;
255  m->do_close= 0;
256  m->auto_close= 0;
257  m->write_speed= 0; /* max */
258  m->read_speed= -2; /* do not set */
259  m->read_speed_force= 0;
260  m->read_speed_corr= 250000; /* look back at most 0.25 seconds with _force */
261  m->fs= 4*512; /* 4 MiB */
262  m->padding= 300*1024;
264  m->alignment= 0;
265  m->do_stream_recording= 0;
266  m->dvd_obs= 0;
267  m->modesty_on_drive= 0;
268  m->min_buffer_usec= 5000;
269  m->max_buffer_usec= 25000;
270  m->buffer_timeout_sec= 120;
271  m->min_buffer_percent= 90;
272  m->max_buffer_percent= 95;
273  m->use_immed_bit= 0;
274  m->use_immed_bit_default= 0;
275  m->stdio_sync= 0;
276  m->stdio_sync_is_default= 1;
277  m->keep_boot_image= 0;
278  m->boot_image_cat_path[0]= 0;
279  m->boot_image_cat_hidden= 0;
280  m->boot_count= 0;
281  m->boot_platform_id= 0x00; /* El Torito Boot Catalog Platform ID: 0 = 80x86 */
282  m->patch_isolinux_image= 0;
283  m->boot_image_bin_path[0]= 0;
284  m->boot_image_bin_form[0]= 0;
285  m->boot_image_emul= 0;
286  m->boot_emul_default= 1;
287  m->boot_image_load_size= 4 * 512; /* hearsay out of libisofs/demo/iso.c */
288  m->boot_img_size_default= 1;
289  m->boot_img_full_size= 0;
290  memset(m->boot_id_string, 0, sizeof(m->boot_id_string));
291  memset(m->boot_selection_crit, 0, sizeof(m->boot_selection_crit));
292 
293 #ifdef Xorriso_with_isohybriD
294  m->boot_image_isohybrid= 1;
295 #else
296  m->boot_image_isohybrid= 0;
297 #endif
298 
299  m->boot_efi_default= 0;
300  m->system_area_disk_path[0]= 0;
302  m->system_area_options= 0;
303  m->patch_system_area= 0;
304  m->partition_offset= 0;
307  m->prep_partition[0]= 0;
308  m->efi_boot_partition[0]= 0;
309  for(i= 0; i < Xorriso_max_appended_partitionS; i++) {
310  m->appended_partitions[i]= NULL;
311  m->appended_part_types[i]= 0;
312  memset(m->appended_part_type_guids[i], 0, 16);
313  m->appended_part_gpt_flags[i]= 0;
314  }
315  m->appended_as_gpt= 0;
316  m->appended_as_apm= 0;
317  m->part_like_isohybrid= 0;
318  m->iso_mbr_part_type= -1;
319  memset(m->iso_gpt_type_guid, 0, 16);
320  m->iso_mbr_part_flag= 0;
321  memset(m->gpt_guid, 0, 16);
322  m->gpt_guid_mode= 0;
323  m->ascii_disc_label[0]= 0;
324  m->grub2_sparc_core[0]= 0;
325  memset(m->hfsp_serial_number, 0, 8);
326  m->hfsp_block_size= 0;
327  m->apm_block_size= 0;
328  m->vol_creation_time= 0;
329  m->vol_modification_time= 0;
330  m->vol_expiration_time= 0;
331  m->vol_effective_time= 0;
332  m->vol_uuid[0]= 0;
333  m->all_file_dates[0]= 0;
334  m->do_override_now_time= 0;
335  m->now_time_override= 0;
336 
337 #ifdef Xorriso_with_libjtE
338  m->libjte_handle= NULL;
339 #endif
340 
341  m->jigdo_params= NULL;
342  m->jigdo_values= NULL;
343  m->libjte_params_given= 0;
344  m->loaded_boot_bin_lba= 0;
345  m->loaded_boot_cat_path[0]= 0;
346  m->allow_graft_points= 0;
347  m->allow_restore= 0;
348  m->do_concat_split= 1;
349  m->do_auto_chmod= 0;
350  m->do_restore_sort_lba= 0;
351  m->do_strict_acl= 0;
352  m->dialog= 0;
353  m->buffered_dialog= NULL;
354  m->bsl_interpretation= 0;
355  m->sh_style_result= 0;
356  m->search_mode= 0;
357  m->structured_search= 1;
358  m->do_iso_rr_pattern= 1;
359  m->do_disk_pattern= 2;
360  m->temp_mem_limit= 16*1024*1024;
362  m->file_name_limit= 255;
363  m->disk_exclusions= NULL;
364  m->iso_rr_hidings= NULL;
365  m->joliet_hidings= NULL;
366  m->hfsplus_hidings= NULL;
367  m->disk_excl_mode= 1;
368  m->use_stdin= 0;
369  m->tolerate_stdin_eof= 0;
370  m->result_page_length= 0;
371  m->result_page_width= 80;
372  m->mark_text[0]= 0;
373  m->packet_output= 0;
374  for(i=0; i<4; i++) {
375  m->logfile[i][0]= 0;
376  m->logfile_fp[i]= NULL;
377  }
378  m->pktlog_fp= NULL;
379  m->stderr_fp= NULL;
380  for(i= 0; i < Xorriso_max_outlist_stacK; i++) {
381  m->result_msglists[i]= NULL;
382  m->info_msglists[i]= NULL;
383  m->msglist_flags[i]= 0;
384  }
388  m->msg_watcher_lock_ini= 0;
389  m->msg_watcher_state= 0;
390  m->msgw_result_handler= NULL;
391  m->msgw_result_handle= NULL;
392  m->msgw_info_handler= NULL;
393  m->msgw_info_handle= NULL;
394  m->msgw_stack_handle= -1;
395  m->msgw_msg_pending= 0;
396  m->msgw_fetch_lock_ini= 0;
397  m->msg_sieve= NULL;
398  m->msg_sieve_disabled= 0;
399  m->msglist_stackfill= 0;
401  m->scsi_log= 0;
402  strcpy(m->report_about_text, "UPDATE");
405  strcpy(m->abort_on_text,"FAILURE");
407  m->abort_on_is_default= 1;
408  m->problem_status= 0;
410  m->problem_status_text[0]= 0;
411  m->errfile_log[0]= 0;
412  m->errfile_mode= 0;
413  m->errfile_fp= NULL;
414 
415  m->img_read_error_mode= 1; /* abort faulty image reading with FAILURE */
416  m->extract_error_mode= 1; /* keep extracted files after read error */
417  strcpy(m->return_with_text, "SORRY");
419  m->return_with_value= 32;
422  m->re= NULL;
423  /* >>> ??? how to initialize m->match[0] ? */
424  m->re_constants= NULL;
425  m->re_count= 0;
426  m->re_fill= 0;
427  m->reg_expr[0]= 0;
428  m->run_state= 0;
429  m->is_dialog= 0;
430  m->bar_is_fresh= 0;
431  m->pending_option[0]= 0;
432  m->request_to_abort= 0;
433  m->request_not_to_ask= 0;
434  m->idle_time= 0.0;
435  m->re_failed_at= -1;
436  m->prepended_wd= 0;
437  m->insert_count= 0;
438  m->insert_bytes= 0;
439  m->error_count= 0;
441  m->pacifier_style= 0;
442  m->pacifier_interval= 1.0;
443  m->pacifier_count= 0;
444  m->pacifier_prev_count= 0;
445  m->pacifier_total= 0;
446  m->pacifier_byte_count= 0;
447  m->pacifier_fifo= NULL;
448  m->start_time= 0.0;
449  m->last_update_time= 0.0;
450  m->find_compare_result= 1;
451  m->find_check_md5_result= 0;
452  m->last_abort_file_time= 0.0;
453 
454  m->node_counter= 0;
455  m->node_array_size= 0;
456  m->node_array= NULL;
457  m->node_disk_prefixes= NULL;
458  m->node_img_prefixes= NULL;
459 
460  m->hln_count= 0;
461  m->hln_array= NULL;
462  m->hln_targets= NULL;
463  m->hln_change_pending= 0;
464  m->di_do_widen= NULL;
465  m->di_disk_paths= NULL;
466  m->di_iso_paths= NULL;
467 
468  m->node_targets_availmem= 0;
469 
470  m->di_count= 0;
471  m->di_array= NULL;
472 
473  m->perm_stack= NULL;
474 
475  m->update_flags= 0;
476 
477  m->show_hfs_cmd_flag= 0;
478  m->show_hfs_cmd_count= 0;
479  m->show_hfs_cmds= NULL;
480 
481  m->sparse_min_gap= 0;
482 
483  m->result_line[0]= 0;
484  m->result_line_counter= 0;
485  m->result_page_counter= 0;
486  m->result_open_line_len= 0;
487 
488  m->info_text[0]= 0;
489 
490 
491  /* Here begin actions which might fail */
492 
493  ret= Sfile_leafname(progname, leafname, 0);
494  if(ret<=0)
495  goto failure;
496  if(strcmp(leafname, "osirrox")==0) {
497  m->allow_restore= 1;
498  m->drives_exclusive= 0;
499  m->drives_access= 0;
500  } else if(strcmp(leafname, "xorrisofs")==0 || strcmp(leafname, "genisofs")==0 ||
501  strcmp(leafname, "mkisofs")==0 || strcmp(leafname, "genisoimage")==0) {
502  m->argument_emulation= 1;
503  m->pacifier_style= 1;
504  Xorriso_protect_stdout(*xorriso, 0);
505  } else if(strcmp(leafname, "xorrecord")==0 || strcmp(leafname, "wodim")==0 ||
506  strcmp(leafname, "cdrecord")==0 || strcmp(leafname, "cdrskin")==0) {
507  m->argument_emulation= 2;
508  m->pacifier_style= 2;
509  }
510  ret= Exclusions_new(&(m->disk_exclusions), 0);
511  if(ret<=0)
512  goto failure;
513  ret= Exclusions_new(&(m->iso_rr_hidings), 0);
514  if(ret<=0)
515  goto failure;
516  ret= Exclusions_new(&(m->joliet_hidings), 0);
517  if(ret<=0)
518  goto failure;
519  ret= Exclusions_new(&(m->hfsplus_hidings), 0);
520  if(ret<=0)
521  goto failure;
522  Xorriso_relax_compliance(m, "default", 0);
523  ret= Xorriso_lst_new(&(m->drive_greylist), "/dev", m->drive_greylist, 1);
524  if(ret <= 0)
525  goto failure;
526  Xorriso_preparer_string(m, m->preparer_id, 1); /* avoids library calls */
527  ret= pthread_mutex_init(&(m->lib_msg_queue_lock), NULL);
528  if(ret != 0)
529  goto failure;
531  ret= pthread_mutex_init(&(m->result_msglists_lock), NULL);
532  if(ret != 0)
533  goto failure;
535  ret= pthread_mutex_init(&(m->write_to_channel_lock), NULL);
536  if(ret != 0)
537  goto failure;
539  ret= pthread_mutex_init(&(m->problem_status_lock), NULL);
540  if(ret != 0)
541  goto failure;
543  ret= pthread_mutex_init(&(m->msg_watcher_lock), NULL);
544  if(ret != 0)
545  goto failure;
546  m->msg_watcher_lock_ini= 1;
547  ret= pthread_mutex_init(&(m->msgw_fetch_lock), NULL);
548  if(ret != 0)
549  goto failure;
550  m->msgw_fetch_lock_ini= 1;
551 
552  if(leafname != NULL)
553  free(leafname);
554  return(1);
555 failure:;
556  Xorriso_destroy(xorriso, 0);
557  if(leafname != NULL)
558  free(leafname);
559  return(-1);
560 }
561 
562 
563 int Xorriso_destroy_re(struct XorrisO *m, int flag)
564 {
565  int i;
566 
567  if(m->re!=NULL) {
568  for(i=0;i<m->re_fill;i++) {
569  if(m->re_constants!=NULL)
570  if(m->re_constants[i]!=NULL)
571  continue; /* ,->re[i] was never subject to regcomp() */
572  regfree(&(m->re[i]));
573  }
574  free((char *) m->re);
575  m->re= NULL;
576  }
577 
578  if(m->re_constants!=NULL) {
579  for(i=0;i<m->re_fill;i++)
580  if(m->re_constants[i]!=NULL)
581  free(m->re_constants[i]);
582  free((char *) m->re_constants);
583  m->re_constants= NULL;
584  }
585  m->re_count= 0;
586  m->re_fill= 0;
587  return(1);
588 }
589 
590 
591 /* @param flag bit0= global shutdown of libraries */
592 int Xorriso_destroy(struct XorrisO **xorriso, int flag)
593 {
594  struct XorrisO *m;
595  int i;
596 
597  m= *xorriso;
598  if(m==NULL)
599  return(0);
600 
601  /* Give up drives and image to unref all connected xorriso objects */
602  Xorriso_give_up_drive(m, 3);
603 
604  if(m->in_charset!=NULL)
605  free(m->in_charset);
606  if(m->out_charset!=NULL)
607  free(m->out_charset);
610  Xorriso_destroy_re(m,0);
622 
623 #ifdef Xorriso_with_libjtE
624  if(m->libjte_handle)
625  libjte_destroy(&(m->libjte_handle));
626 #endif
627 
630  for(i= 0; i < Xorriso_max_appended_partitionS; i++)
631  if(m->appended_partitions[i] != NULL)
632  free(m->appended_partitions[i]);
633 
634  Xorriso_detach_libraries(m, flag&1);
635 
637  pthread_mutex_destroy(&(m->lib_msg_queue_lock));
639  pthread_mutex_destroy(&(m->result_msglists_lock));
641  pthread_mutex_destroy(&(m->write_to_channel_lock));
643  pthread_mutex_destroy(&(m->problem_status_lock));
644  if(m->msg_watcher_lock_ini)
645  pthread_mutex_destroy(&(m->msg_watcher_lock));
646  if(m->msgw_fetch_lock_ini)
647  pthread_mutex_destroy(&(m->msgw_fetch_lock));
648  Xorriso_sieve_dispose(m, 0);
649 
650  free((char *) m);
651  *xorriso= NULL;
652  return(1);
653 }
654 
655 
656 int Xorriso_destroy_node_array(struct XorrisO *xorriso, int flag)
657 {
658  int i;
659 
660  if(xorriso->node_array != NULL) {
661  for(i= 0; i < xorriso->node_counter; i++)
662  iso_node_unref((IsoNode *) xorriso->node_array[i]);
663  free(xorriso->node_array);
664  }
665  xorriso->node_array= NULL;
666  xorriso->node_counter= xorriso->node_array_size= 0;
669  return(1);
670 }
671 
672 
673 /* @param flag bit0= do not destroy hln_array but only hln_targets
674 */
675 int Xorriso_destroy_hln_array(struct XorrisO *xorriso, int flag)
676 {
677  int i;
678 
679 
680  if(xorriso->hln_array != NULL && !(flag & 1)) {
681  for(i= 0; i < xorriso->hln_count; i++)
682  iso_node_unref((IsoNode *) xorriso->hln_array[i]);
683  free(xorriso->hln_array);
684  xorriso->hln_array= NULL;
685  xorriso->hln_count= 0;
686  }
687  if(xorriso->hln_targets != NULL) {
688  for(i= 0; i < xorriso->hln_count; i++)
689  if(xorriso->hln_targets[i] != NULL)
690  free(xorriso->hln_targets[i]);
691  free(xorriso->hln_targets);
692  xorriso->hln_targets= NULL;
693  }
694  xorriso->node_targets_availmem= 0;
695  return(1);
696 }
697 
698 
699 int Xorriso_destroy_di_array(struct XorrisO *xorriso, int flag)
700 {
701  int i;
702 
703  if(xorriso->di_array != NULL) {
704  for(i= 0; i < xorriso->di_count; i++)
705  if(xorriso->di_array[i] != NULL)
706  iso_node_unref((IsoNode *) xorriso->di_array[i]);
707  free(xorriso->di_array);
708  xorriso->di_array= NULL;
709  }
710  if(xorriso->di_do_widen != NULL) {
711  free(xorriso->di_do_widen);
712  xorriso->di_do_widen= NULL;
713  }
714  Xorriso_lst_destroy_all(&(xorriso->di_disk_paths), 0);
715  Xorriso_lst_destroy_all(&(xorriso->di_iso_paths), 0);
716  xorriso->di_count= 0;
717 
718 #ifdef NIX
719  /* <<< */
720  fprintf(stderr, "xorriso_DEBUG: get_di_count= %lu\n",
721  Xorriso_get_di_counteR);
722 #endif /* NIX */
723 
724  return(1);
725 }
726 
727 
728 int Xorriso_new_node_array(struct XorrisO *xorriso, off_t mem_limit,
729  int addon_nodes, int flag)
730 {
731  int i;
732 
733  if(xorriso->node_counter <= 0)
734  return(1);
735 
736  xorriso->node_array= calloc(xorriso->node_counter + addon_nodes,
737  sizeof(IsoNode *));
738  if(xorriso->node_array == NULL) {
739  Xorriso_no_malloc_memory(xorriso, NULL, 0);
740  return(-1);
741  }
742  for(i= 0; i < xorriso->node_counter + addon_nodes; i++)
743  xorriso->node_array[i]= NULL;
744  xorriso->node_array_size= xorriso->node_counter + addon_nodes;
745  xorriso->node_counter= 0;
746  return(1);
747 }
748 
749 
750 /* @param flag bit0= do not allocate hln_array but only hln_targets
751 */
752 int Xorriso_new_hln_array(struct XorrisO *xorriso, off_t mem_limit, int flag)
753 {
754  int i;
755 
756  Xorriso_destroy_hln_array(xorriso, flag & 1);
757  if(xorriso->hln_count <= 0)
758  return(1);
759 
760  if(!(flag & 1)) {
761  xorriso->hln_array= calloc(xorriso->hln_count, sizeof(char *));
762  if(xorriso->hln_array == NULL) {
763  Xorriso_no_malloc_memory(xorriso, NULL, 0);
764  return(-1);
765  }
766  for(i= 0; i < xorriso->hln_count; i++)
767  xorriso->hln_array[i]= NULL;
768  }
769 
770  xorriso->hln_targets= calloc(xorriso->hln_count, sizeof(char *));
771  if(xorriso->hln_targets == NULL) {
772  if(!(flag & 1)) {
773  free(xorriso->hln_array);
774  xorriso->hln_array= NULL;
775  }
776  Xorriso_no_malloc_memory(xorriso, NULL, 0);
777  return(-1);
778  }
779  for(i= 0; i < xorriso->hln_count; i++)
780  xorriso->hln_targets[i]= NULL;
781  xorriso->node_targets_availmem= mem_limit
782  - xorriso->hln_count * sizeof(void *)
783  - xorriso->hln_count * sizeof(char *);
784  if(xorriso->node_targets_availmem < 0)
785  xorriso->node_targets_availmem= 0;
786  return(1);
787 }
788 
789 
790 int Xorriso__preset_signal_behavior(int behavior, int flag)
791 {
792  if(behavior < 0 || behavior > 3)
793  return(0);
794  Xorriso_signal_behavioR= behavior;
795  return(1);
796 }
797 
798 
800 {
801  return(Xorriso_signal_behavioR);
802 }
803 
int Exclusions_destroy(struct ExclusionS **o, int flag)
Definition: aux_objects.c:710
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.
Definition: aux_objects.c:557
int Exclusions_new(struct ExclusionS **o, int flag)
Definition: aux_objects.c:695
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.
Definition: aux_objects.c:591
int Xorriso_destroy_node_array(struct XorrisO *xorriso, int flag)
Definition: base_obj.c:656
int Xorriso_destroy_re(struct XorrisO *m, int flag)
Definition: base_obj.c:563
int Xorriso__get_signal_behavior(int flag)
Definition: base_obj.c:799
int Xorriso_new_node_array(struct XorrisO *xorriso, off_t mem_limit, int addon_nodes, int flag)
Definition: base_obj.c:728
int Xorriso__preset_signal_behavior(int behavior, int flag)
Definition: base_obj.c:790
static char Xorriso_sys_rc_nameS[4][80]
Definition: base_obj.c:92
int Xorriso_destroy_di_array(struct XorrisO *xorriso, int flag)
Definition: base_obj.c:699
int Xorriso_new(struct XorrisO **xorriso, char *progname, int flag)
Definition: base_obj.c:100
static int Xorriso_signal_behavioR
Definition: base_obj.c:61
void Xorriso__version(int *major, int *minor, int *micro)
Obtain the three release version numbers of the library.
Definition: base_obj.c:64
int Xorriso_new_hln_array(struct XorrisO *xorriso, off_t mem_limit, int flag)
Definition: base_obj.c:752
#define Xorriso_rc_nuM
The list of startup file names.
Definition: base_obj.c:90
int Xorriso_destroy(struct XorrisO **xorriso, int flag)
Definition: base_obj.c:592
int Xorriso__is_compatible(int major, int minor, int micro, int flag)
Check whether all features of header file xorriso.h from the given major.minor.micro revision triple ...
Definition: base_obj.c:72
char * Xorriso__get_patch_level_text(int flag)
Definition: base_obj.c:83
int Xorriso_destroy_hln_array(struct XorrisO *xorriso, int flag)
Definition: base_obj.c:675
int Checkmediajob_destroy(struct CheckmediajoB **o, int flag)
Definition: check_media.c:604
int Sectorbitmap_destroy(struct SectorbitmaP **o, int flag)
Definition: check_media.c:276
#define Xorriso_read_quality_invaliD
Definition: check_media.h:89
int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
Definition: drive_mgt.c:762
int Xorriso_destroy_all_extf(struct XorrisO *xorriso, int flag)
Definition: filters.c:158
#define SfileadrL
int Xorriso__text_to_sev(char *severity_name, int *severity_number, int flag)
Definition: lib_mgt.c:387
int Xorriso_preparer_string(struct XorrisO *xorriso, char xorriso_id[129], int flag)
Definition: lib_mgt.c:683
int Xorriso_detach_libraries(struct XorrisO *xorriso, int flag)
Definition: lib_mgt.c:258
int Sfile_leafname(char *path, char leafname[4096], int flag)
Definition: sfile.c:116
#define TSOB_FELD(typ, count)
Definition: sfile.h:15
double insert_bytes
int iso_mbr_part_type
int system_area_options
char publisher[129]
unsigned char boot_id_string[29]
char volset_id[129]
int do_strict_acl
int part_like_isohybrid
int apm_block_size
char list_delimiter[81]
int zisofs_v2_enabled
off_t pacifier_count
int do_follow_mount
int zisofs_by_magic
int libs_are_started
int do_old_empty
struct ExclusionS * joliet_hidings
void ** hln_array
int do_iso_rr_pattern
int msglist_stackfill
pthread_mutex_t result_msglists_lock
uid_t global_uid
int boot_image_cat_hidden
int do_disk_pattern
off_t file_size_limit
pthread_mutex_t msg_watcher_lock
FILE * errfile_fp
int pacifier_style
int64_t zisofs_block_number_target
char boot_image_bin_form[16]
int result_msglists_lock_ini
int result_page_width
uint8_t appended_part_gpt_flags[8]
int do_global_mode
struct Xorriso_lsT * node_img_prefixes
int linux_scsi_dev_family
int outdev_is_exclusive
FILE * pktlog_fp
mode_t global_file_mode
regex_t * re
time_t now_time_override
void * pacifier_fifo
int mkisofsrc_done
double start_time
struct Xorriso_msg_sievE * msg_sieve
struct ExclusionS * disk_exclusions
int displacement_sign
int do_padding_by_libisofs
char preparer_id[129]
int do_rockridge
int session_blocks
mode_t global_dir_mode
int modesty_on_drive
char boot_image_cat_path[4096]
int zisofs_block_size_default
int read_speed_force
int allow_graft_points
int bsl_interpretation
struct Xorriso_lsT * di_disk_paths
int resolve_link_rec_count
double error_count
int errfile_mode
int partition_heads_per_cyl
int allow_restore
char efi_boot_partition[4096]
int keep_boot_image
int structured_search
uint32_t isofs_size
off_t sparse_min_gap
char errfile_log[4096]
char progname[4096]
struct PermiteM * perm_stack
char problem_status_text[20]
struct Xorriso_lsT * node_disk_prefixes
char abstract_file[38]
int library_msg_direct_print
int zisofs_v2_block_size_default
char indev_off_adr[4096]
struct Xorriso_lsT * filters
int do_follow_pattern
off_t split_size
uint8_t gpt_guid[16]
int boot_platform_id
time_t isofs_st_out
struct Xorriso_lsT * di_iso_paths
char indev[4096]
int arrange_args
int show_hfs_cmd_count
uint64_t zisofs_max_file_blocks
void ** di_array
int boot_image_emul
off_t pacifier_byte_count
int problem_status_lock_ini
int early_stdio_test
int do_follow_links
int do_calm_drive
int appended_as_gpt
int isofs_has_what
int img_read_error_mode
int appended_as_apm
time_t vol_effective_time
int rr_reloc_flags
int re_failed_at
int cache_tile_blocks
int untranslated_name_len
int boot_efi_default
char scdbackup_tag_listname[4096]
int find_check_md5_result
char * out_charset
char * di_do_widen
char eternal_problem_status_text[20]
int use_immed_bit
char system_id[33]
int ban_stdio_write
int ino_behavior
uint64_t zisofs_max_total_blocks
char all_file_dates[80]
int status_history_max
int lib_msg_queue_lock_ini
int do_overwrite
time_t vol_creation_time
char reg_expr[2 *4096]
int stdio_sync_is_default
int image_start_mode
int zisofs_block_size
int cache_num_tiles
int drives_access
int min_buffer_percent
int prepended_wd
char volid[33]
int boot_img_full_size
char result_line[10 *4096]
int result_page_counter
int volset_change_pending
int sh_style_result
int msg_watcher_lock_ini
struct ExclusionS * iso_rr_hidings
char loaded_boot_cat_path[4096]
int boot_emul_default
int abort_on_severity
int no_volset_present
char scdbackup_tag_written[512]
FILE * stderr_fp
int filter_list_closed
uint8_t hfsp_serial_number[8]
char prep_partition[4096]
struct SectorbitmaP * in_sector_map
gid_t global_gid
struct Xorriso_lsT * info_msglists[Xorriso_max_outlist_stacK]
unsigned char boot_selection_crit[21]
int do_auto_chmod
char * appended_partitions[8]
int drives_exclusive
int bar_is_fresh
int cache_default
int do_restore_sort_lba
char info_text[10 *4096]
uint8_t appended_part_type_guids[8][16]
int do_follow_concat
void ** hln_targets
int max_buffer_usec
char ascii_disc_label[129]
int rc_filename_count
double insert_count
char system_area_disk_path[4096]
uint32_t partition_offset
struct ExclusionS * hfsplus_hidings
int msgw_msg_pending
int grow_blindly_msc2
int do_concat_split
char vol_uuid[17]
int iso_mbr_part_flag
int result_page_length
uint32_t displacement
int boot_img_size_default
char logfile[4][4096]
int min_buffer_usec
int write_to_channel_lock_ini
double zisofs_bpt_discard_free_ratio
uint8_t iso_gpt_type_guid[16]
int file_name_limit
char abort_on_text[20]
int show_hfs_cmd_flag
int buffer_timeout_sec
int patch_system_area
char rr_reloc_dir[256]
double pacifier_interval
int do_override_now_time
int do_global_gid
int request_to_abort
void ** node_array
pthread_mutex_t problem_status_lock
int follow_link_limit
int(* msgw_result_handler)(void *handle, char *text)
int libjte_params_given
int eternal_problem_status
int tolerate_stdin_eof
char scdbackup_tag_name[81]
char ** show_hfs_cmds
int hfsp_block_size
int volid_default
int argument_emulation
off_t pacifier_prev_count
struct Xorriso_lsT * buffered_dialog
int request_not_to_ask
void * in_volset_handle
char * in_charset
int partition_secs_per_head
int msgw_fetch_lock_ini
void * msgw_info_handle
int iso_level_is_default
char image_start_value[81]
int update_flags
int system_area_clear_loaded
off_t node_targets_availmem
int do_global_uid
char scdbackup_tag_time[19]
pthread_mutex_t lib_msg_queue_lock
int msg_watcher_state
time_t vol_modification_time
int launch_frontend_banned
int outdev_access
char return_with_text[20]
int hln_change_pending
int max_buffer_percent
char boot_image_bin_path[4096]
int node_counter
struct Xorriso_lsT * drive_blacklist
int extract_error_mode
char ** re_constants
void * out_drive_handle
char session_logfile[4096]
uint64_t zisofs_max_total_blocks_default
time_t isofs_st_in
char loaded_volid[33]
int return_with_value
int zlib_level_default
off_t boot_image_load_size
int return_with_severity
char assert_volid[4096]
char initial_wdx[4096]
int check_media_bad_limit
int disk_excl_mode
int resolve_link_rec_limit
int report_about_severity
char wdx[4096]
int zisofs_susp_z2
void * in_drive_handle
int packet_output
char outdev[4096]
pthread_mutex_t write_to_channel_lock
char copyright_file[38]
int find_compare_result
int indev_access
int node_array_size
struct Xorriso_lsT * result_msglists[Xorriso_max_outlist_stacK]
char application_use[4096]
char application_id[129]
char mark_text[4096]
double last_update_time
char report_about_text[20]
int result_line_counter
int do_follow_param
int temp_mem_limit
int zisofs_v2_block_size
int relax_compliance
char assert_volid_sev[80]
void * msgw_result_handle
char grub2_sparc_core[4096]
char rc_filenames[4][4096]
List of startupfiles.
int msglist_flags[Xorriso_max_outlist_stacK]
int abort_on_is_default
int allow_dir_id_ext_dflt
int patch_isolinux_image
uint64_t zisofs_max_file_blocks_default
char outdev_off_adr[4096]
double idle_time
int zisofs_susp_z2_default
int result_open_line_len
off_t pacifier_total
int gpt_guid_mode
struct Xorriso_lsT * jigdo_values
int use_immed_bit_default
int toc_emulation_flag
int do_stream_recording
struct Xorriso_lsT * jigdo_params
int(* msgw_info_handler)(void *handle, char *text)
struct Xorriso_lsT * drive_whitelist
int loaded_boot_bin_lba
char biblio_file[38]
struct CheckmediajoB * check_media_default
int msgw_stack_handle
time_t vol_expiration_time
int indev_is_exclusive
uint8_t appended_part_types[8]
int msg_sieve_disabled
double last_abort_file_time
struct Xorriso_lsT * drive_greylist
int boot_image_isohybrid
char wdi[4096]
int read_speed_corr
FILE * logfile_fp[4]
pthread_mutex_t msgw_fetch_lock
double zisofs_bpt_discard_free_ratio_default
int problem_status
char pending_option[4096]
int did_something_useful
int Xorriso_no_malloc_memory(struct XorrisO *xorriso, char **to_free, int flag)
Definition: text_io.c:4077
int Xorriso_protect_stdout(struct XorrisO *xorriso, int flag)
Definition: text_io.c:63
int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag)
Dispose all filter rules.
Definition: text_io.c:1892
int Xorriso_relax_compliance(struct XorrisO *xorriso, char *mode, int flag)
Definition: write_run.c:2473
#define Xorriso_header_version_minoR
Definition: xorriso.h:76
#define Xorriso_max_outlist_stacK
Maximum number of stacked redirections.
Definition: xorriso.h:998
#define Xorriso_header_version_micrO
Definition: xorriso.h:77
#define Xorriso_header_version_majoR
These three release version numbers tell the revision of this header file and of the API which it des...
Definition: xorriso.h:75
#define Xorriso_program_patch_leveL
If needed: Something like ".pl01" to indicate a bug fix.
Definition: xorriso.h:83
#define Xorriso_default_file_size_limiT
#define Xorriso_max_appended_partitionS
#define Xorriso_status_history_maX