summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2010-07-09 17:07:28 +0200
committerGravatar Martin Szulecki2010-07-09 17:07:28 +0200
commit4ac94fe7a174f841b13734f98d237a8afac6cbab (patch)
tree136398afcf78243fabac7b6e2a2f7673292ac236
parentf90bdde9fc347f02a857cc26f14c4d2d5c55f64e (diff)
downloadidevicerestore-4ac94fe7a174f841b13734f98d237a8afac6cbab.tar.gz
idevicerestore-4ac94fe7a174f841b13734f98d237a8afac6cbab.tar.bz2
Rename some variables and functions to fit thier context
-rw-r--r--src/idevicerestore.c20
-rw-r--r--src/idevicerestore.h6
2 files changed, 13 insertions, 13 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index 778673f..00c35c1 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -160,7 +160,7 @@ int main(int argc, char* argv[]) {
// devices are listed in order from oldest to newest
// so we'll need their ECID
if (client->device->index > DEVICE_IPOD2G) {
- debug("Creating TSS request\n");
+ debug("Getting device's ECID for TSS request\n");
// fetch the device's ECID for the TSS request
if (get_ecid(client, &client->ecid) < 0) {
error("ERROR: Unable to find device ECID\n");
@@ -173,7 +173,7 @@ int main(int argc, char* argv[]) {
client->tss = NULL;
plist_t build_identity = NULL;
if (client->flags & FLAG_ERASE) {
- build_identity = get_build_identity(client, buildmanifest, 0);
+ build_identity = build_manifest_get_build_identity(buildmanifest, 0);
if (build_identity == NULL) {
error("ERROR: Unable to find any build identities\n");
plist_free(buildmanifest);
@@ -184,15 +184,15 @@ int main(int argc, char* argv[]) {
// and list the valid ones
int i = 0;
int valid_builds = 0;
- int build_count = get_build_count(buildmanifest);
+ int build_count = build_manifest_get_identity_count(buildmanifest);
for (i = 0; i < build_count; i++) {
- build_identity = get_build_identity(client, buildmanifest, i);
+ build_identity = build_manifest_get_build_identity(buildmanifest, i);
valid_builds++;
}
}
/* print information about current build identity */
- build_identity_print_information(buildidentity);
+ build_identity_print_information(build_identity);
if (client->flags & FLAG_CUSTOM > 0) {
if (client->device->index > DEVICE_IPOD2G) {
@@ -212,7 +212,7 @@ int main(int argc, char* argv[]) {
// Extract filesystem from IPSW and return its name
char* filesystem = NULL;
- if (ipsw_extract_filesystem(client->ipsw, buildidentity, &filesystem) < 0) {
+ if (ipsw_extract_filesystem(client->ipsw, build_identity, &filesystem) < 0) {
error("ERROR: Unable to extract filesystem from IPSW\n");
if (client->tss)
plist_free(client->tss);
@@ -461,9 +461,9 @@ int get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid) {
return 0;
}
-plist_t get_build_identity(struct idevicerestore_client_t* client, plist_t buildmanifest, uint32_t identity) {
+plist_t build_manifest_get_build_identity(plist_t build_manifest, uint32_t identity) {
// fetch build identities array from BuildManifest
- plist_t build_identities_array = plist_dict_get_item(buildmanifest, "BuildIdentities");
+ plist_t build_identities_array = plist_dict_get_item(build_manifest, "BuildIdentities");
if (!build_identities_array || plist_get_node_type(build_identities_array) != PLIST_ARRAY) {
error("ERROR: Unable to find build identities node\n");
return NULL;
@@ -506,9 +506,9 @@ int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, plist_
return 0;
}
-int get_build_count(plist_t buildmanifest) {
+int build_manifest_get_identity_count(plist_t build_manifest) {
// fetch build identities array from BuildManifest
- plist_t build_identities_array = plist_dict_get_item(buildmanifest, "BuildIdentities");
+ plist_t build_identities_array = plist_dict_get_item(build_manifest, "BuildIdentities");
if (!build_identities_array || plist_get_node_type(build_identities_array) != PLIST_ARRAY) {
error("ERROR: Unable to find build identities node\n");
return -1;
diff --git a/src/idevicerestore.h b/src/idevicerestore.h
index 47482d7..4f59a02 100644
--- a/src/idevicerestore.h
+++ b/src/idevicerestore.h
@@ -34,17 +34,17 @@ extern "C" {
void usage(int argc, char* argv[]);
int check_mode(struct idevicerestore_client_t* client);
int check_device(struct idevicerestore_client_t* client);
-int get_build_count(plist_t buildmanifest);
int get_ecid(struct idevicerestore_client_t* client, uint64_t* ecid);
int get_bdid(struct idevicerestore_client_t* client, uint32_t* bdid);
int get_cpid(struct idevicerestore_client_t* client, uint32_t* cpid);
-plist_t get_build_identity(struct idevicerestore_client_t* client, plist_t buildmanifest, uint32_t identity);
int get_shsh_blobs(struct idevicerestore_client_t* client, uint64_t ecid, plist_t build_identity, plist_t* tss);
-int ipsw_get_component_by_path(const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size);
void build_manifest_print_information(plist_t build_manifest);
+plist_t build_manifest_get_build_identity(plist_t build_manifest, uint32_t identity);
+int build_manifest_get_build_count(plist_t build_manifest);
void build_identity_print_information(plist_t build_identity);
int build_identity_get_component_path(plist_t build_identity, const char* component, char** path);
int ipsw_extract_filesystem(const char* ipsw, plist_t build_identity, char** filesystem);
+int ipsw_get_component_by_path(const char* ipsw, plist_t tss, const char* path, char** data, uint32_t* size);
#ifdef __cplusplus
}