diff options
| author | 2008-08-31 18:43:29 +0200 | |
|---|---|---|
| committer | 2008-08-31 19:33:19 +0200 | |
| commit | 5dc380594ad755dd5a9d2cad246e5dcb5480350d (patch) | |
| tree | c90811184619c86f920872e9eb84f35604735779 /src | |
| parent | 8333ca944cc56b4da1ab418c0b890f96f5135210 (diff) | |
| download | libimobiledevice-5dc380594ad755dd5a9d2cad246e5dcb5480350d.tar.gz libimobiledevice-5dc380594ad755dd5a9d2cad246e5dcb5480350d.tar.bz2 | |
prefix public enum with IPHONE_
Diffstat (limited to 'src')
| -rw-r--r-- | src/AFC.c | 2 | ||||
| -rw-r--r-- | src/ifuse.c | 10 | ||||
| -rw-r--r-- | src/main.c | 6 |
3 files changed, 9 insertions, 9 deletions
| @@ -625,7 +625,7 @@ iphone_error_t iphone_afc_get_file_attr ( iphone_afc_client_t client, const char | |||
| 625 | * received by afc_get_file_info) as well as the handle to the file or | 625 | * received by afc_get_file_info) as well as the handle to the file or |
| 626 | * NULL in the case of failure. | 626 | * NULL in the case of failure. |
| 627 | */ | 627 | */ |
| 628 | iphone_error_t iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, uint32_t file_mode, iphone_afc_file_t *file ) { | 628 | iphone_error_t iphone_afc_open_file ( iphone_afc_client_t client, const char *filename, iphone_afc_file_mode_t file_mode, iphone_afc_file_t *file ) { |
| 629 | iphone_afc_file_t file_loc = NULL; | 629 | iphone_afc_file_t file_loc = NULL; |
| 630 | uint32 ag = 0; | 630 | uint32 ag = 0; |
| 631 | int bytes = 0, length = 0; | 631 | int bytes = 0, length = 0; |
diff --git a/src/ifuse.c b/src/ifuse.c index 6d2bae0..353188e 100644 --- a/src/ifuse.c +++ b/src/ifuse.c | |||
| @@ -76,7 +76,7 @@ static int ifuse_create(const char *path, mode_t mode, struct fuse_file_info *fi | |||
| 76 | iphone_afc_file_t file; | 76 | iphone_afc_file_t file; |
| 77 | iphone_afc_client_t afc = fuse_get_context()->private_data; | 77 | iphone_afc_client_t afc = fuse_get_context()->private_data; |
| 78 | 78 | ||
| 79 | iphone_afc_open_file(afc, path, AFC_FILE_WRITE, &file); | 79 | iphone_afc_open_file(afc, path, IPHONE_AFC_FILE_WRITE, &file); |
| 80 | fh_index++; | 80 | fh_index++; |
| 81 | fi->fh = fh_index; | 81 | fi->fh = fh_index; |
| 82 | g_hash_table_insert(file_handles, &fh_index, file); | 82 | g_hash_table_insert(file_handles, &fh_index, file); |
| @@ -89,11 +89,11 @@ static int ifuse_open(const char *path, struct fuse_file_info *fi) { | |||
| 89 | uint32_t mode = 0; | 89 | uint32_t mode = 0; |
| 90 | 90 | ||
| 91 | if ((fi->flags & 3) == O_RDWR || (fi->flags & 3) == O_WRONLY) { | 91 | if ((fi->flags & 3) == O_RDWR || (fi->flags & 3) == O_WRONLY) { |
| 92 | mode = AFC_FILE_READ; | 92 | mode = IPHONE_AFC_FILE_READ; |
| 93 | } else if ((fi->flags & 3) == O_RDONLY) { | 93 | } else if ((fi->flags & 3) == O_RDONLY) { |
| 94 | mode = AFC_FILE_READ; | 94 | mode = IPHONE_AFC_FILE_READ; |
| 95 | } else { | 95 | } else { |
| 96 | mode = AFC_FILE_READ; | 96 | mode = IPHONE_AFC_FILE_READ; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | iphone_afc_open_file(afc, path, mode, &file); | 99 | iphone_afc_open_file(afc, path, mode, &file); |
| @@ -235,7 +235,7 @@ int ifuse_truncate(const char *path, off_t size) { | |||
| 235 | int result = 0; | 235 | int result = 0; |
| 236 | iphone_afc_client_t afc = fuse_get_context()->private_data; | 236 | iphone_afc_client_t afc = fuse_get_context()->private_data; |
| 237 | iphone_afc_file_t tfile = NULL; | 237 | iphone_afc_file_t tfile = NULL; |
| 238 | iphone_afc_open_file(afc, path, AFC_FILE_READ, &tfile); | 238 | iphone_afc_open_file(afc, path, IPHONE_AFC_FILE_READ, &tfile); |
| 239 | if (!tfile) return -1; | 239 | if (!tfile) return -1; |
| 240 | 240 | ||
| 241 | result = iphone_afc_truncate_file(afc, tfile, size); | 241 | result = iphone_afc_truncate_file(afc, tfile, size); |
| @@ -87,7 +87,7 @@ int main(int argc, char *argv[]) { | |||
| 87 | iphone_afc_file_t my_file = NULL; | 87 | iphone_afc_file_t my_file = NULL; |
| 88 | struct stat stbuf; | 88 | struct stat stbuf; |
| 89 | iphone_afc_get_file_attr ( afc, "/iTunesOnTheGoPlaylist.plist", &stbuf ); | 89 | iphone_afc_get_file_attr ( afc, "/iTunesOnTheGoPlaylist.plist", &stbuf ); |
| 90 | if (IPHONE_E_SUCCESS == iphone_afc_open_file(afc, "/iTunesOnTheGoPlaylist.plist", AFC_FILE_READ, &my_file) && my_file) { | 90 | if (IPHONE_E_SUCCESS == iphone_afc_open_file(afc, "/iTunesOnTheGoPlaylist.plist", IPHONE_AFC_FILE_READ, &my_file) && my_file) { |
| 91 | printf("A file size: %i\n", stbuf.st_size); | 91 | printf("A file size: %i\n", stbuf.st_size); |
| 92 | char *file_data = (char*)malloc(sizeof(char) * stbuf.st_size); | 92 | char *file_data = (char*)malloc(sizeof(char) * stbuf.st_size); |
| 93 | iphone_afc_read_file(afc, my_file, file_data, stbuf.st_size, &bytes); | 93 | iphone_afc_read_file(afc, my_file, file_data, stbuf.st_size, &bytes); |
| @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { | |||
| 100 | free(file_data); | 100 | free(file_data); |
| 101 | } else printf("couldn't open a file\n"); | 101 | } else printf("couldn't open a file\n"); |
| 102 | 102 | ||
| 103 | iphone_afc_open_file(afc, "/readme.libiphone.fx", AFC_FILE_WRITE, &my_file); | 103 | iphone_afc_open_file(afc, "/readme.libiphone.fx", IPHONE_AFC_FILE_WRITE, &my_file); |
| 104 | if (my_file) { | 104 | if (my_file) { |
| 105 | char *outdatafile = strdup("this is a bitchin text file\n"); | 105 | char *outdatafile = strdup("this is a bitchin text file\n"); |
| 106 | iphone_afc_write_file(afc, my_file, outdatafile, strlen(outdatafile), &bytes); | 106 | iphone_afc_write_file(afc, my_file, outdatafile, strlen(outdatafile), &bytes); |
| @@ -120,7 +120,7 @@ int main(int argc, char *argv[]) { | |||
| 120 | else printf("Failure. (expected unless you have a /renme file on your phone)\n"); | 120 | else printf("Failure. (expected unless you have a /renme file on your phone)\n"); |
| 121 | 121 | ||
| 122 | printf("Seek & read\n"); | 122 | printf("Seek & read\n"); |
| 123 | iphone_afc_open_file(afc, "/readme.libiphone.fx", AFC_FILE_READ, &my_file); | 123 | iphone_afc_open_file(afc, "/readme.libiphone.fx", IPHONE_AFC_FILE_READ, &my_file); |
| 124 | if (IPHONE_E_SUCCESS != iphone_afc_seek_file(afc, my_file, 5)) printf("WARN: SEEK DID NOT WORK\n"); | 124 | if (IPHONE_E_SUCCESS != iphone_afc_seek_file(afc, my_file, 5)) printf("WARN: SEEK DID NOT WORK\n"); |
| 125 | char *threeletterword = (char*)malloc(sizeof(char) * 5); | 125 | char *threeletterword = (char*)malloc(sizeof(char) * 5); |
| 126 | iphone_afc_read_file(afc, my_file, threeletterword, 3, &bytes); | 126 | iphone_afc_read_file(afc, my_file, threeletterword, 3, &bytes); |
