"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libisofs/util.c" between
xorriso-1.5.2.tar.gz and xorriso-1.5.4.tar.gz

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.

util.c  (xorriso-1.5.2):util.c  (xorriso-1.5.4)
skipping to change at line 1478 skipping to change at line 1478
} }
void iso_lsb(uint8_t *buf, uint32_t num, int bytes) void iso_lsb(uint8_t *buf, uint32_t num, int bytes)
{ {
int i; int i;
for (i = 0; i < bytes; ++i) for (i = 0; i < bytes; ++i)
buf[i] = (num >> (8 * i)) & 0xff; buf[i] = (num >> (8 * i)) & 0xff;
} }
void iso_lsb64(uint8_t *buf, uint64_t num)
{
int i;
for (i = 0; i < 8; ++i)
buf[i] = (num >> (8 * i)) & 0xff;
}
void iso_msb(uint8_t *buf, uint32_t num, int bytes) void iso_msb(uint8_t *buf, uint32_t num, int bytes)
{ {
int i; int i;
for (i = 0; i < bytes; ++i) for (i = 0; i < bytes; ++i)
buf[bytes - 1 - i] = (num >> (8 * i)) & 0xff; buf[bytes - 1 - i] = (num >> (8 * i)) & 0xff;
} }
void iso_bb(uint8_t *buf, uint32_t num, int bytes) void iso_bb(uint8_t *buf, uint32_t num, int bytes)
{ {
skipping to change at line 1592 skipping to change at line 1600
always_gmt = 1; always_gmt = 1;
#endif #endif
tzoffset = ( - Libburnia_timezonE / 60 / 15 ) + 4 * tm.tm_isdst; tzoffset = ( - Libburnia_timezonE / 60 / 15 ) + 4 * tm.tm_isdst;
#endif /* ! HAVE_TM_GMTOFF */ #endif /* ! HAVE_TM_GMTOFF */
if (tzoffset > 52 || tzoffset < -48 || always_gmt) { if (tzoffset > 52 || tzoffset < -48 || always_gmt) {
/* absurd timezone offset, represent time in GMT */ /* absurd timezone offset, represent time in GMT */
gmtime_r(&t, &tm); gmtime_r(&t, &tm);
tzoffset = 0; tzoffset = 0;
} }
if (tm.tm_year < 0) {
tm.tm_year = 0;
tm.tm_mon = 0;
tm.tm_mday = 1;
tm.tm_hour = 0;
tm.tm_min = 0;
tm.tm_sec = 0;
} else if (tm.tm_year > 255) {
tm.tm_year = 255;
tm.tm_mon = 11;
tm.tm_mday = 31;
tm.tm_hour = 23;
tm.tm_min = 59;
tm.tm_sec = 59;
}
buf[0] = tm.tm_year; buf[0] = tm.tm_year;
buf[1] = tm.tm_mon + 1; buf[1] = tm.tm_mon + 1;
buf[2] = tm.tm_mday; buf[2] = tm.tm_mday;
buf[3] = tm.tm_hour; buf[3] = tm.tm_hour;
buf[4] = tm.tm_min; buf[4] = tm.tm_min;
buf[5] = tm.tm_sec; buf[5] = tm.tm_sec;
buf[6] = tzoffset; buf[6] = tzoffset;
} }
void iso_datetime_17(unsigned char *buf, time_t t, int always_gmt) void iso_datetime_17(unsigned char *buf, time_t t, int always_gmt)
skipping to change at line 1645 skipping to change at line 1669
#endif #endif
tzoffset = ( - Libburnia_timezonE / 60 / 15 ) + 4 * tm.tm_isdst; tzoffset = ( - Libburnia_timezonE / 60 / 15 ) + 4 * tm.tm_isdst;
#endif /* ! HAVE_TM_GMTOFF */ #endif /* ! HAVE_TM_GMTOFF */
if (tzoffset > 52 || tzoffset < -48 || always_gmt) { if (tzoffset > 52 || tzoffset < -48 || always_gmt) {
/* absurd timezone offset, represent time in GMT */ /* absurd timezone offset, represent time in GMT */
gmtime_r(&t, &tm); gmtime_r(&t, &tm);
tzoffset = 0; tzoffset = 0;
} }
sprintf((char*)&buf[0], "%04d", tm.tm_year + 1900); if (tm.tm_year <= -1900) {
sprintf((char*)&buf[4], "%02d", tm.tm_mon + 1); strcpy((char *) buf, "00010101000000");
sprintf((char*)&buf[6], "%02d", tm.tm_mday); } else if (tm.tm_year >= 8100) {
sprintf((char*)&buf[8], "%02d", tm.tm_hour); strcpy((char *) buf, "99991231235959");
sprintf((char*)&buf[10], "%02d", tm.tm_min); } else {
sprintf((char*)&buf[12], "%02d", MIN(59, tm.tm_sec)); sprintf((char*)&buf[0], "%04d", tm.tm_year + 1900);
sprintf((char*)&buf[4], "%02d", tm.tm_mon + 1);
sprintf((char*)&buf[6], "%02d", tm.tm_mday);
sprintf((char*)&buf[8], "%02d", tm.tm_hour);
sprintf((char*)&buf[10], "%02d", tm.tm_min);
sprintf((char*)&buf[12], "%02d", MIN(59, tm.tm_sec));
}
memcpy(&buf[14], "00", 2); memcpy(&buf[14], "00", 2);
buf[16] = tzoffset; buf[16] = tzoffset;
} }
#ifndef HAVE_TIMEGM #ifndef HAVE_TIMEGM
/* putenv is SVr4, POSIX.1-2001, 4.3BSD , setenv is 4.3BSD, POSIX.1-2001. /* putenv is SVr4, POSIX.1-2001, 4.3BSD , setenv is 4.3BSD, POSIX.1-2001.
So putenv is more widely available. So putenv is more widely available.
Also, setenv spoils eventual putenv expectation of applications because Also, setenv spoils eventual putenv expectation of applications because
skipping to change at line 1935 skipping to change at line 1965
size_t outbytes, inbytes; size_t outbytes, inbytes;
char *str, *src, *out = NULL, *retval = NULL; char *str, *src, *out = NULL, *retval = NULL;
struct iso_iconv_handle conv; struct iso_iconv_handle conv;
int conv_ret; int conv_ret;
size_t n; size_t n;
inbytes = len; inbytes = len;
outbytes = (inbytes+1) * MB_LEN_MAX; outbytes = (inbytes+1) * MB_LEN_MAX;
/* ensure enought space */ /* ensure enough space */
out = calloc(outbytes, 1); out = calloc(outbytes, 1);
if (out == NULL) if (out == NULL)
return NULL; return NULL;
/* convert to local charset */ /* convert to local charset */
conv_ret = iso_iconv_open(&conv, iso_get_local_charset(0), "UCS-2BE", 0); conv_ret = iso_iconv_open(&conv, iso_get_local_charset(0), "UCS-2BE", 0);
if (conv_ret <= 0) { if (conv_ret <= 0) {
goto ex; goto ex;
} }
src = (char *)buf; src = (char *)buf;
skipping to change at line 1988 skipping to change at line 2018
*major = LIBISOFS_MAJOR_VERSION; *major = LIBISOFS_MAJOR_VERSION;
*minor = LIBISOFS_MINOR_VERSION; *minor = LIBISOFS_MINOR_VERSION;
*micro = LIBISOFS_MICRO_VERSION; *micro = LIBISOFS_MICRO_VERSION;
*/ */
} }
int iso_lib_is_compatible(int major, int minor, int micro) int iso_lib_is_compatible(int major, int minor, int micro)
{ {
int cmajor, cminor, cmicro; int cmajor, cminor, cmicro;
/* for now, the rule is that library is compitable if requested /* for now, the rule is that library is compatible if requested
* version is lower */ * version is lower */
iso_lib_version(&cmajor, &cminor, &cmicro); iso_lib_version(&cmajor, &cminor, &cmicro);
return cmajor > major return cmajor > major
|| (cmajor == major || (cmajor == major
&& (cminor > minor && (cminor > minor
|| (cminor == minor && cmicro >= micro))); || (cminor == minor && cmicro >= micro)));
} }
int iso_init_locale(int flag) int iso_init_locale(int flag)
skipping to change at line 2311 skipping to change at line 2341
if (*out != NULL) if (*out != NULL)
free(*out); free(*out);
return iso_clone_mem(in, out, size); return iso_clone_mem(in, out, size);
} }
/** Convert a text into a number of type double and multiply it by unit code /** Convert a text into a number of type double and multiply it by unit code
[kmgt] (2^10 to 2^40) or [s] (2048) or [d] (512). [kmgt] (2^10 to 2^40) or [s] (2048) or [d] (512).
(Also accepts capital letters.) (Also accepts capital letters.)
@param text Input like "42", "223062s", "3m" or "-1g" @param text Input like "42", "223062s", "3m" or "-1g"
@param flag Bitfield for control purposes: @param flag Bitfield for control purposes:
bit0= return -1 rathern than 0 on failure bit0= return -1 rather than 0 on failure
bit1= if scaled then compute the last byte of the last unit bit1= if scaled then compute the last byte of the last unit
@return The derived value @return The derived value
*/ */
off_t iso_scanf_io_size(char *text, int flag) off_t iso_scanf_io_size(char *text, int flag)
{ {
int c; int c;
off_t ret = 0, fac = 1; off_t ret = 0, fac = 1;
char *rpt; char *rpt;
for (rpt = text; *rpt >= '0' && *rpt <= '9'; rpt++) for (rpt = text; *rpt >= '0' && *rpt <= '9'; rpt++)
 End of changes. 6 change blocks. 
9 lines changed or deleted 39 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)