summaryrefslogtreecommitdiffstats
path: root/rbutil/chinachippatcher/chinachip.h
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2011-12-03 09:41:44 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2011-12-03 09:41:44 +0000
commit059cb71c96d0248b7b4898722b47f289dd15ad2d (patch)
tree8c5e69447d299060ef920216204ff9c4bb2638e4 /rbutil/chinachippatcher/chinachip.h
parent07da9ce5ea9ca26436db04a63e281842467ff7fd (diff)
downloadrockbox-059cb71c96d0248b7b4898722b47f289dd15ad2d.tar.gz
rockbox-059cb71c96d0248b7b4898722b47f289dd15ad2d.tar.bz2
rockbox-059cb71c96d0248b7b4898722b47f289dd15ad2d.zip
Extend return codes for chinachip_patch().
Instead of passing error messages using a callback function (which becomes awkward when used from a C++ class object) return distinct error codes from chinachip_patch(). This also removes the kludge to support translations for Rockbox Utility and moves the strings to translate to the installation class where they belong. As a side effect info messages won't be passed to Rockbox Utility anymore, but the details of the patching progress aren't of that much interest for the user anyway. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31115 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/chinachippatcher/chinachip.h')
-rw-r--r--rbutil/chinachippatcher/chinachip.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/rbutil/chinachippatcher/chinachip.h b/rbutil/chinachippatcher/chinachip.h
index 2f8ba9e18a..b92066bb8b 100644
--- a/rbutil/chinachippatcher/chinachip.h
+++ b/rbutil/chinachippatcher/chinachip.h
@@ -26,11 +26,24 @@
extern "C" {
#endif
-int chinachip_patch(const char* firmware, const char* bootloader,
- const char* output, const char* ccpmp_backup,
- void (*info)(void*, char*, ...),
- void (*err)(void*, char*, ...),
- void* userdata);
+enum cc_error {
+ E_OK,
+ E_OPEN_FIRMWARE,
+ E_OPEN_BOOTLOADER,
+ E_MEMALLOC,
+ E_LOAD_FIRMWARE,
+ E_INVALID_FILE,
+ E_NO_CCPMP,
+ E_OPEN_BACKUP,
+ E_WRITE_BACKUP,
+ E_LOAD_BOOTLOADER,
+ E_GET_TIME,
+ E_OPEN_OUTFILE,
+ E_WRITE_OUTFILE,
+};
+
+enum cc_error chinachip_patch(const char* firmware, const char* bootloader,
+ const char* output, const char* ccpmp_backup);
#ifdef __cplusplus
}