summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2004-08-23 22:35:21 +0000
committerStef Walter <stef@thewalter.net>2004-08-23 22:35:21 +0000
commitff26b4137c6dc3d622336e725bd6f5630b301027 (patch)
tree536fa628fb74422adcd7486c5e483e6a6c5e354d
parent8396a35831f126f9b7281746b90f6b00effd6da2 (diff)
Fixes and changes due to RTF converter not working properly.
-rw-r--r--.cvsignore1
-rw-r--r--rep.dsw3
-rw-r--r--src/rep.c8
-rw-r--r--win32/droplet/droplet.rc10
-rw-r--r--win32/droplet/progressdlg.cpp7
-rw-r--r--win32/droplet/replace.cpp15
-rw-r--r--win32/droplet/rliberr.h136
-rw-r--r--win32/droplet/rliberr.rc2
-rw-r--r--win32/droplet/temp.cmpbin186 -> 0 bytes
-rw-r--r--win32/makedrop/MSG00001.binbin512 -> 292 bytes
-rw-r--r--win32/makedrop/makedrop.rc11
11 files changed, 41 insertions, 152 deletions
diff --git a/.cvsignore b/.cvsignore
index 3b98380..347bcd9 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -19,3 +19,4 @@ config.log
config.status
stamp*
config.h.in
+rep.opt \ No newline at end of file
diff --git a/rep.dsw b/rep.dsw
index 952638d..717d44c 100644
--- a/rep.dsw
+++ b/rep.dsw
@@ -14,6 +14,9 @@ Package=<4>
Begin Project Dependency
Project_Dep_Name rlib
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name repc
+ End Project Dependency
}}}
###############################################################################
diff --git a/src/rep.c b/src/rep.c
index 5eda279..4a7fbb5 100644
--- a/src/rep.c
+++ b/src/rep.c
@@ -89,7 +89,10 @@ int replaceSingleFile(r_context* ctx, const char* szIn);
/* Error stuff */
int usage();
-
+void blah(void)
+{
+ printf("exiting\n");
+}
/* ------------------------------------------------------------------------ */
@@ -101,7 +104,7 @@ int main(int argc, char* argv[])
int ch = 0;
- /*
+ /*
* Function return values throughout program are a bit different
*
* 0 = normal operation
@@ -111,6 +114,7 @@ int main(int argc, char* argv[])
int ret = 0;
int r = R_OK;
+ atexit(blah);
/* Enough params? */
if(argc < 2)
diff --git a/win32/droplet/droplet.rc b/win32/droplet/droplet.rc
index f0254d7..d18c0e5 100644
--- a/win32/droplet/droplet.rc
+++ b/win32/droplet/droplet.rc
@@ -75,8 +75,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,3,0,1
- PRODUCTVERSION 2,3,0,1
+ FILEVERSION 2,3,2,1
+ PRODUCTVERSION 2,3,2,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -94,7 +94,7 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Nate Nielsen\0"
VALUE "FileDescription", "rep droplet\0"
- VALUE "FileVersion", "2, 3, 0, 1\0"
+ VALUE "FileVersion", "2, 3, 2, 1\0"
VALUE "InternalName", "droplet\0"
VALUE "LegalCopyright", "Copyright 2002, Nate Nielsen \0"
VALUE "LegalTrademarks", "\0"
@@ -102,7 +102,7 @@ BEGIN
VALUE "OriginalFilename", "droplet.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "rep\0"
- VALUE "ProductVersion", "2, 3, 0, 1\0"
+ VALUE "ProductVersion", "2, 3, 2, 1\0"
VALUE "SpecialBuild", "\0"
END
END
@@ -158,7 +158,7 @@ END
// 11
//
-1 11 DISCARDABLE "MSG00001.bin"
+1 11 DISCARDABLE "rliberr.rc"
/////////////////////////////////////////////////////////////////////////////
diff --git a/win32/droplet/progressdlg.cpp b/win32/droplet/progressdlg.cpp
index 53f5e14..acba362 100644
--- a/win32/droplet/progressdlg.cpp
+++ b/win32/droplet/progressdlg.cpp
@@ -30,6 +30,7 @@ ProgressDlg::ProgressDlg()
m_flip = false;
m_hThread = NULL;
m_hEvent = NULL;
+ m_isCancelled = false;
InitializeCriticalSection(&m_sec);
}
@@ -192,9 +193,13 @@ LRESULT ProgressDlg::onInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
// Dialog was closed
LRESULT ProgressDlg::onClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
+ EnterCriticalSection(&m_sec);
+ m_isCancelled = true;
+ LeaveCriticalSection(&m_sec);
+
// TODO: will this get called by NC area?
EndDialog(IDOK);
- return 0;
+ return 1;
}
// onCancel: ------------------------------------------------------------------
diff --git a/win32/droplet/replace.cpp b/win32/droplet/replace.cpp
index 8a7b51b..624695d 100644
--- a/win32/droplet/replace.cpp
+++ b/win32/droplet/replace.cpp
@@ -131,7 +131,7 @@ int Replace::matchStatus(r_stream* stream, r_replace* repl)
ASSERT_PTR(replace);
replace->m_dlg.onReplaced();
- return replace->m_dlg.isCancelled() ? 1 : 0;
+ return replace->m_dlg.isCancelled() ? 0 : 1;
}
@@ -174,8 +174,14 @@ HRESULT Replace::replaceFolder(LPCTSTR folder)
if(FAILED(r))
RETURN(r);
+
+ // Check and see if we've been cancelled
+ if(m_dlg.isCancelled())
+ RETURN(ret);
+
if(r == S_OK)
ret = r;
+
}
while(FindNextFile(hFindFile, &findData));
}
@@ -421,6 +427,13 @@ HRESULT Replace::replaceBuffer(byte* data, size_t size, HANDLE out)
// Increment last batch
data += (batchSize - ctx.stream.availIn);
size -= (batchSize - ctx.stream.availIn);
+
+ // Check and see if we've been cancelled
+ if(m_dlg.isCancelled())
+ {
+ dirty = false;
+ RETURN(S_FALSE);
+ }
}
// Clears and prepares for next file
diff --git a/win32/droplet/rliberr.h b/win32/droplet/rliberr.h
deleted file mode 100644
index 8fe3a80..0000000
--- a/win32/droplet/rliberr.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * AUTHOR
- * N. Nielsen
- *
- * VERSION
- * 2.2.0b
- *
- * LICENSE
- * This software is in the public domain.
- *
- * The software is provided "as is", without warranty of any kind,
- * express or implied, including but not limited to the warranties
- * of merchantability, fitness for a particular purpose, and
- * noninfringement. In no event shall the author(s) be liable for any
- * claim, damages, or other liability, whether in an action of
- * contract, tort, or otherwise, arising from, out of, or in connection
- * with the software or the use or other dealings in the software.
- *
- * SUPPORT
- * Send bug reports to: <nielsen@memberwebs.com>
- */
-
-#ifndef _RLIBERR_H_
-#define _RLIBERR_H_
-
-#ifndef _WINERROR_
- #error Include winerror.h first.
-#endif
-
-#define HRESULT_FROM_RLIB(code) \
- MAKE_HRESULT(SEVERITY_ERROR, FACILITY_RLIB, abs(code))
-
-/* ------------------------------------------------------------------------ *\
- Rlib Errors
-\* ------------------------------------------------------------------------ */
-//
-// Values are 32 bit values layed out as follows:
-//
-// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
-// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
-// +---+-+-+-----------------------+-------------------------------+
-// |Sev|C|R| Facility | Code |
-// +---+-+-+-----------------------+-------------------------------+
-//
-// where
-//
-// Sev - is the severity code
-//
-// 00 - Success
-// 01 - Informational
-// 10 - Warning
-// 11 - Error
-//
-// C - is the Customer code flag
-//
-// R - is a reserved bit
-//
-// Facility - is the facility code
-//
-// Code - is the facility's status code
-//
-//
-// Define the facility codes
-//
-#define FACILITY_RLIB 0x196
-
-
-//
-// Define the severity codes
-//
-
-
-//
-// MessageId: RLIB_E_NOMEM
-//
-// MessageText:
-//
-// Out of Memory.
-//
-#define RLIB_E_NOMEM ((HRESULT)0x81960001L)
-
-//
-// MessageId: RLIB_E_SYNTAX
-//
-// MessageText:
-//
-// Rep script syntax error.
-//
-#define RLIB_E_SYNTAX ((HRESULT)0x81960002L)
-
-//
-// MessageId: RLIB_E_REGEXP
-//
-// MessageText:
-//
-// Regular expression syntax error.
-//
-#define RLIB_E_REGEXP ((HRESULT)0x81960003L)
-
-//
-// MessageId: RLIB_E_LOOP
-//
-// MessageText:
-//
-// Rep encountered an endless loop.
-//
-#define RLIB_E_LOOP ((HRESULT)0x81960004L)
-
-//
-// MessageId: RLIB_E_USER
-//
-// MessageText:
-//
-// User defined error.
-//
-#define RLIB_E_USER ((HRESULT)0x81960005L)
-
-//
-// MessageId: RLIB_E_IOERR
-//
-// MessageText:
-//
-// There was an error reading or writing the data.
-//
-#define RLIB_E_IOERR ((HRESULT)0x81960006L)
-
-//
-// MessageId: RLIB_E_INVARG
-//
-// MessageText:
-//
-// Programmer Error: Invalid argument.
-//
-#define RLIB_E_INVARG ((HRESULT)0x8196000AL)
-
-#endif // _RLIBERR_H_ \ No newline at end of file
diff --git a/win32/droplet/rliberr.rc b/win32/droplet/rliberr.rc
deleted file mode 100644
index 0885a89..0000000
--- a/win32/droplet/rliberr.rc
+++ /dev/null
@@ -1,2 +0,0 @@
-LANGUAGE 0x9,0x1
-1 11 MSG00001.bin
diff --git a/win32/droplet/temp.cmp b/win32/droplet/temp.cmp
deleted file mode 100644
index 137c82e..0000000
--- a/win32/droplet/temp.cmp
+++ /dev/null
Binary files differ
diff --git a/win32/makedrop/MSG00001.bin b/win32/makedrop/MSG00001.bin
index 83bcd64..d07c9eb 100644
--- a/win32/makedrop/MSG00001.bin
+++ b/win32/makedrop/MSG00001.bin
Binary files differ
diff --git a/win32/makedrop/makedrop.rc b/win32/makedrop/makedrop.rc
index 0b61072..f2aa6f0 100644
--- a/win32/makedrop/makedrop.rc
+++ b/win32/makedrop/makedrop.rc
@@ -86,8 +86,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 2,2,0,1
- PRODUCTVERSION 2,2,0,1
+ FILEVERSION 2,3,2,1
+ PRODUCTVERSION 2,3,2,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -105,7 +105,7 @@ BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Nate Nielsen\0"
VALUE "FileDescription", "Rep Droplet Maker\0"
- VALUE "FileVersion", "2, 2, 0, 1\0"
+ VALUE "FileVersion", "2, 3, 2, 1\0"
VALUE "InternalName", "makedrop\0"
VALUE "LegalCopyright", "Copyright Nate Nielsen 2002\0"
VALUE "LegalTrademarks", "\0"
@@ -113,7 +113,7 @@ BEGIN
VALUE "OriginalFilename", "makedrop.exe\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "rep\0"
- VALUE "ProductVersion", "2, 2, 0, 1\0"
+ VALUE "ProductVersion", "2, 3, 2, 1\0"
VALUE "SpecialBuild", "\0"
END
END
@@ -246,7 +246,8 @@ IDI_REP ICON DISCARDABLE "..\\common\\rep.ico"
// 11
//
-1 11 DISCARDABLE "MSG00001.bin"
+1 11 DISCARDABLE "rliberr.rc"
+
/////////////////////////////////////////////////////////////////////////////
//