5 "@(#)joliet.c 1.68 15/12/30 joerg";
157 size_t fromsize = *fromsizep;
158 size_t tosize = *tosizep;
161 if (fromsize == 0 || tosize == 0)
174#ifdef HAVE_ICONV_CONST
175#define __IC_CONST const
180 char *
obuf = (
char *)ob;
185 &
obuf, &osize) == -1) {
189 *fromsizep == fromsize) {
190 ob[0] = 0; ob[1] =
'_';
194 unichar = ob[0] * 256 + ob[1];
198 unsigned char c = *
from;
206 ob[0] = unichar >> 8 & 0xFF;
207 ob[1] = unichar & 0xFF;
212 char *ibuf = (
char *)ob;
216 (
char **)&to, tosizep) == -1) {
220 *tosizep == tosize) {
253 unsigned char *tmpbuf;
276 for (
i = 0; (
i + 1) <
size;
i += 2,
j++) {
292 __IC_CONST
char *
inbuf = (
char *)&tmpbuf[
j];
294 char *
obuf = (
char *)ob;
304 &
obuf, &osize) == -1) {
313 unichar = ob[0] * 256 + ob[1];
327 if (unichar <= 0x1f || unichar == 0x7f)
349 buffer[
i] = unichar >> 8 & 0xFF;
350 buffer[
i + 1] = unichar & 0xFF;
386 while (
string[
j] !=
'\0') {
388 __IC_CONST
char *
inbuf = (
char *)&
string[
j];
390 char *
obuf = (
char *)ob;
400 &
obuf, &osize) == -1) {
420 if (
rtn > 2*maxlen) {
553 unsigned char rtmp[2],
564 rparent = rr->
parent->jpath_index;
565 lparent =
ll->parent->jpath_index;
567 rparent = rr->
self->parent_rec->filedir->jpath_index;
570 lparent =
ll->self->parent_rec->filedir->jpath_index;
572 if (rparent < lparent) {
575 if (rparent > lparent) {
583 if (USE_MAC_NAME(rr->
self)) {
584 rpnt = rr->
self->hfs_ent->name;
587 rpnt = rr->
self->name;
591 if (USE_MAC_NAME(
ll->self)) {
592 lpnt =
ll->self->hfs_ent->name;
595 lpnt =
ll->self->name;
599 rpnt = rr->
self->name;
600 lpnt =
ll->self->name;
606 while (*rpnt && *lpnt) {
639 unsigned int jpindex;
687 _(
"Fatal Joliet goof - directory has amnesia\n"));
690 if (USE_MAC_NAME(de))
712 dpnt->
parent->jpath_index);
714 dpnt->
parent->jpath_index);
715 jpindex = dpnt->
parent->jpath_index;
718 dpnt->
self->parent_rec->filedir->jpath_index);
720 dpnt->
self->parent_rec->filedir->jpath_index);
721 jpindex = dpnt->
self->parent_rec->filedir->jpath_index;
724 if (jpindex > 0xffff) {
725 static int warned = 0;
730 _(
"Unable to generate sane Joliet path tables - too many directories (%u)\n"),
734 _(
"Try to use the option -no-limit-pathtables\n"));
757 if (USE_MAC_NAME(de)) {
787 _(
"Joliet path table lengths do not match %d expected: %d\n"),
799 unsigned int dir_index;
800 char *directory_buffer;
805 unsigned int total_size;
810 directory_buffer = (
char *)
e_malloc(total_size);
811 memset(directory_buffer, 0, total_size);
817 s_entry = s_entry->
jnext;
828 for (s_entry1 =
reloc_dir->contents; s_entry1;
829 s_entry1 = s_entry1->
next) {
834 if (s_entry1 ==
NULL) {
837 _(
"Unable to locate relocated directory\n"));
848 new_reclen = s_entry1->
jreclen;
856 if (USE_MAC_NAME(s_entry1))
878 }
else if (
strcmp(s_entry1->
name,
"..") == 0) {
893 while (finddir && finddir->
self != s_entry1) {
894 finddir = finddir->
next;
898 _(
"Fatal goof - unable to find directory location\n"));
905 memcpy(directory_buffer + dir_index, &jrec,
916 directory_buffer[dir_index++] = 0;
919 directory_buffer[dir_index++] = 1;
922 if (USE_MAC_NAME(s_entry1)) {
925 (
Uchar *) directory_buffer+dir_index,
932 (
Uchar *) directory_buffer+dir_index,
936 dir_index += cvt_len;
940 directory_buffer[dir_index++] = 0;
942 s_entry = s_entry->
jnext;
945 if (dpnt->
jsize != dir_index) {
947 _(
"Unexpected joliet directory length %d expected: %d '%s'\n"),
953 free(directory_buffer);
971 for (s_entry = this_dir->
contents; s_entry; s_entry = s_entry->
next) {
990 if (USE_MAC_NAME(s_entry))
1004 if (this_dir ==
root &&
1016 if (USE_MAC_NAME(s_entry))
1056 for (s_entry = this_dir->
jcontents; s_entry;
1057 s_entry = s_entry->
jnext) {
1088 unsigned char rtmp[2],
1100 if (USE_MAC_NAME(*
r)) {
1101 rpnt = (*r)->hfs_ent->name;
1108 if (USE_MAC_NAME(*
l)) {
1109 lpnt = (*l)->hfs_ent->name;
1128#ifdef USE_LARGEFILES
1129 if ((*r)->mxpart == (*l)->mxpart)
1133 _(
"Error: %s and %s have the same Joliet name\n"),
1134 (*r)->whole_name, (*l)->whole_name);
1141 for (; *p1 == *p2; p1++, p2++,
len++) {
1155 if (
strcmp(rpnt,
".") == 0)
1157 if (
strcmp(lpnt,
".") == 0)
1160 if (
strcmp(rpnt,
"..") == 0)
1162 if (
strcmp(lpnt,
"..") == 0)
1179 if (
strcmp(rpnt,
"VIDEO_TS.IFO") == 0)
1181 if (
strcmp(lpnt,
"VIDEO_TS.IFO") == 0)
1186 while (*rpnt && *lpnt) {
1187 if (*rpnt ==
';' && *lpnt !=
';')
1189 if (*rpnt !=
';' && *lpnt ==
';')
1192 if (*rpnt ==
';' && *lpnt ==
';')
1201 if (*rpnt ==
'.' && *lpnt !=
'.')
1203 if (*rpnt !=
'.' && *lpnt ==
'.')
1222#ifdef USE_LARGEFILES
1226 if ((*r)->mxpart < (*l)->mxpart)
1228 else if ((*r)->mxpart > (*l)->mxpart)
1252 s_entry = *sort_dir;
1260 s_entry = s_entry->
next;
1268 s_entry = *sort_dir;
1275 sortlist[dcount] = s_entry;
1278 s_entry = s_entry->
next;
1293 _(
"Joliet file names differ after %d chars\n"),
1297 _(
"Cannot use Joliet, please remove -J from the option list.\n"));
1300 _(
"Try to use the option -joliet-long\n"));
1305 for (
i = 0;
i < dcount - 1;
i++) {
1306 sortlist[
i]->
jnext = sortlist[
i + 1];
1310 *sort_dir = sortlist[0];
1390 UInt32_t starting_extent;
1443 UInt32_t starting_extent;
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
EXPORT void comerrno(int err, char *msg, va_alist)
EXPORT int errmsgno(int err, char *msg, va_alist)
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
GLdouble GLdouble GLdouble r
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define ISO_VD_SUPPLEMENTARY
EXPORT void set_723(void *vp, UInt32_t i)
EXPORT void set_731(void *vp, UInt32_t i)
EXPORT void set_722(void *vp, UInt32_t i)
EXPORT void set_721(void *vp, UInt32_t i)
EXPORT void set_732(void *vp, UInt32_t i)
EXPORT void set_733(void *vp, UInt32_t i)
LOCAL int generate_joliet_path_tables()
struct output_fragment jpathtable_desc
LOCAL int jpathtab_size(UInt32_t starting_extent)
LOCAL int jdirtree_size(UInt32_t starting_extent)
LOCAL int joliet_compare_dirs(void *rr, const void *ll) const
struct output_fragment joliet_desc
EXPORT int joliet_sort_tree(struct directory *node)
LOCAL void generate_one_joliet_directory(struct directory *dpnt, FILE *outfile)
static UConst char sccsid[]
LOCAL int next_jpath_index
LOCAL void get_joliet_vol_desc(struct iso_primary_descriptor *jvol_desc)
LOCAL void build_jpathlist(struct directory *node)
LOCAL Uint jpath_table_index
LOCAL struct directory ** jpathlist
LOCAL int joliet_sort_n_finish(struct directory *this_dir)
LOCAL void generate_joliet_directories(struct directory *node, FILE *outfile)
LOCAL int joliet_strlen(char *string, size_t maxlen, siconvt_t *inls) const
struct output_fragment jdirtree_desc
LOCAL int jdirtree_write(FILE *outfile)
LOCAL int jpathtab_write(FILE *outfile)
LOCAL int jvd_write(FILE *outfile)
LOCAL int joliet_sort_directory(struct directory_entry **sort_dir)
LOCAL void assign_joliet_directory_addresses(struct directory *node)
LOCAL int joliet_compare_paths(void const *r, void const *l)
EXPORT void conv_charset(unsigned char *to, size_t *tosizep, unsigned char *from, size_t *fromsizep, siconvt_t *inls, siconvt_t *onls)
LOCAL void convert_to_unicode(unsigned char *buffer, int size, char *source, siconvt_t *inls)
size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
EXPORT int iso9660_date(char *result, time_t crtime)
int volume_sequence_number
struct iso_directory_record jroot_record
unsigned int jpath_table_size
unsigned int jpath_table[4]
EXPORT void * e_malloc(size_t size)
unsigned int jpath_blocks
#define memcpy(s1, s2, n)
#define INHIBIT_JOLIET_ENTRY
#define RELOCATED_DIRECTORY
struct directory * reloc_dir
#define INHIBIT_UDF_ENTRY
UInt32_t last_extent_written
struct iso_primary_descriptor vol_desc
#define sprintf(buf, format,...)
#define offsetof(TYPE, MEMBER)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
struct directory_entry * next
struct iso_directory_record isorec
struct directory_entry * parent_rec
struct directory_entry * jnext
struct directory * parent
struct directory_entry * jcontents
struct directory * subdir
struct directory_entry * self
struct directory_entry * contents
unsigned char name_len[ISODCL(33, 33)]
char extent[ISODCL(3, 10)]
unsigned char flags[ISODCL(26, 26)]
char size[ISODCL(11, 18)]
unsigned char length[ISODCL(1, 1)]
char type_m_path_table[ISODCL(149, 152)]
char system_id[ISODCL(9, 40)]
char path_table_size[ISODCL(133, 140)]
char abstract_file_id[ISODCL(740, 776)]
char escape_sequences[ISODCL(89, 120)]
char publisher_id[ISODCL(319, 446)]
char root_directory_record[ISODCL(157, 190)]
char volume_id[ISODCL(41, 72)]
char application_id[ISODCL(575, 702)]
char volume_set_id[ISODCL(191, 318)]
char opt_type_l_path_table[ISODCL(145, 148)]
char copyright_file_id[ISODCL(703, 739)]
char preparer_id[ISODCL(447, 574)]
char bibliographic_file_id[ISODCL(777, 813)]
char opt_type_m_path_table[ISODCL(153, 156)]
char version[ISODCL(7, 7)]
char file_structure_version[ISODCL(882, 882)]
char type_l_path_table[ISODCL(141, 144)]
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList