From 102af95bddca6f3bb95d8fadbaf013d452555cd5 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Sun, 9 Feb 2003 01:56:05 +0000 Subject: [PATCH] Track changes to DataSource API in NufxLib. --- nulib2/ChangeLog.txt | 13 +++++++++++++ nulib2/MiscUtils.c | 11 +++++++++++ nulib2/Nulib2.h | 1 + nulib2/SysUtils.c | 4 ++-- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/nulib2/ChangeLog.txt b/nulib2/ChangeLog.txt index e46331b..7df973c 100644 --- a/nulib2/ChangeLog.txt +++ b/nulib2/ChangeLog.txt @@ -1,3 +1,16 @@ +2003/02/08 fadden + - Upped version to v2.0.0. + - Many fixes to pathname handling: + - Correctly handle '%' when preservation is OFF. + - Accept 4-char extensions in '-ee' without risk of buffer overflow. + - Fixed broken assert when converting long %xx names. + - Store "AUX" as "%00AUX" when preserving Win32 names (vs. "_AUX"). + - Always store files with ':' as path separator. + - Recognize that some Win32 variants (Win2K and later at the least) + will accept both '/' and '\' as pathname separators. + - Correctly convert ".//foo" to "foo" instead of "/foo". + - Tracked changes to NufxLib DataSource API. + 2003/01/10 fadden - Check NufxLib "compiled" version against "linked" version. diff --git a/nulib2/MiscUtils.c b/nulib2/MiscUtils.c index d046937..c9390d3 100644 --- a/nulib2/MiscUtils.c +++ b/nulib2/MiscUtils.c @@ -108,3 +108,14 @@ Free(void* ptr) } #endif +/* + * This gets called when a buffer DataSource is no longer needed. + */ +NuResult +FreeCallback(NuArchive* pArchive, void* args) +{ + DBUG(("+++ free callback 0x%08lx\n", (long) args)); + Free(args); + return kNuOK; +} + diff --git a/nulib2/Nulib2.h b/nulib2/Nulib2.h index e2a4dcc..e9c4461 100644 --- a/nulib2/Nulib2.h +++ b/nulib2/Nulib2.h @@ -97,6 +97,7 @@ void* Calloc(size_t size); void* Realloc(void* ptr, size_t size); void Free(void* ptr); #endif +NuResult FreeCallback(NuArchive* pArchive, void* args); /* SysUtils.c */ NuError NormalizeFileName(NulibState* pState, const char* srcp, long srcLen, diff --git a/nulib2/SysUtils.c b/nulib2/SysUtils.c index 96d63c8..a64e921 100644 --- a/nulib2/SysUtils.c +++ b/nulib2/SysUtils.c @@ -660,8 +660,8 @@ DoAddFile(NulibState* pState, NuArchive* pArchive, const char* pathname, NuDataSource* pDataSource; err = NuCreateDataSourceForBuffer(kNuThreadFormatUncompressed, - true, kDefaultCommentLen, (unsigned char*)comment, 0, - strlen(comment), &pDataSource); + kDefaultCommentLen, (unsigned char*)comment, 0, + strlen(comment), FreeCallback, &pDataSource); if (err != kNuErrNone) { ReportError(err, "comment buffer create failed"); Free(comment);