Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
7d4b4ede
Commit
7d4b4ede
authored
Aug 10, 2008
by
Christophe Fergeau
Committed by
Matt Colyer
Aug 11, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mark some functions as static
Signed-off-by:
Matt Colyer
<
matt@colyer.name
>
parent
af7d1f5f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
24 deletions
+20
-24
AFC.c
src/AFC.c
+20
-20
AFC.h
src/AFC.h
+0
-4
No files found.
src/AFC.c
View file @
7d4b4ede
...
@@ -28,7 +28,7 @@ extern int debug;
...
@@ -28,7 +28,7 @@ extern int debug;
/* Locking, for thread-safety (well... kind of, hehe) */
/* Locking, for thread-safety (well... kind of, hehe) */
void
afc_lock
(
AFClient
*
client
)
{
static
void
afc_lock
(
AFClient
*
client
)
{
if
(
debug
)
printf
(
"In the midst of a lock...
\n
"
);
if
(
debug
)
printf
(
"In the midst of a lock...
\n
"
);
while
(
client
->
lock
)
{
while
(
client
->
lock
)
{
usleep
(
500
);
// they say it's obsolete, but whatever
usleep
(
500
);
// they say it's obsolete, but whatever
...
@@ -36,7 +36,7 @@ void afc_lock(AFClient *client) {
...
@@ -36,7 +36,7 @@ void afc_lock(AFClient *client) {
client
->
lock
=
1
;
client
->
lock
=
1
;
}
}
void
afc_unlock
(
AFClient
*
client
)
{
// just to be pretty
static
void
afc_unlock
(
AFClient
*
client
)
{
// just to be pretty
if
(
debug
)
printf
(
"Unlock!
\n
"
);
if
(
debug
)
printf
(
"Unlock!
\n
"
);
client
->
lock
=
0
;
client
->
lock
=
0
;
}
}
...
@@ -76,7 +76,7 @@ void afc_disconnect(AFClient *client) {
...
@@ -76,7 +76,7 @@ void afc_disconnect(AFClient *client) {
free
(
client
);
free
(
client
);
}
}
int
count_nullspaces
(
char
*
string
,
int
number
)
{
static
int
count_nullspaces
(
char
*
string
,
int
number
)
{
int
i
=
0
,
nulls
=
0
;
int
i
=
0
,
nulls
=
0
;
for
(
i
=
0
;
i
<
number
;
i
++
)
{
for
(
i
=
0
;
i
<
number
;
i
++
)
{
if
(
string
[
i
]
==
'\0'
)
nulls
++
;
if
(
string
[
i
]
==
'\0'
)
nulls
++
;
...
@@ -84,7 +84,7 @@ int count_nullspaces(char *string, int number) {
...
@@ -84,7 +84,7 @@ int count_nullspaces(char *string, int number) {
return
nulls
;
return
nulls
;
}
}
int
dispatch_AFC_packet
(
AFClient
*
client
,
const
char
*
data
,
int
length
)
{
static
int
dispatch_AFC_packet
(
AFClient
*
client
,
const
char
*
data
,
int
length
)
{
int
bytes
=
0
,
offset
=
0
;
int
bytes
=
0
,
offset
=
0
;
if
(
!
client
||
!
client
->
connection
||
!
client
->
afc_packet
)
return
0
;
if
(
!
client
||
!
client
->
connection
||
!
client
->
afc_packet
)
return
0
;
if
(
!
data
||
!
length
)
length
=
0
;
if
(
!
data
||
!
length
)
length
=
0
;
...
@@ -135,7 +135,7 @@ int dispatch_AFC_packet(AFClient *client, const char *data, int length) {
...
@@ -135,7 +135,7 @@ int dispatch_AFC_packet(AFClient *client, const char *data, int length) {
return
-
1
;
return
-
1
;
}
}
int
receive_AFC_data
(
AFClient
*
client
,
char
**
dump_here
)
{
static
int
receive_AFC_data
(
AFClient
*
client
,
char
**
dump_here
)
{
AFCPacket
*
r_packet
;
AFCPacket
*
r_packet
;
char
*
buffer
=
(
char
*
)
malloc
(
sizeof
(
AFCPacket
)
*
4
);
char
*
buffer
=
(
char
*
)
malloc
(
sizeof
(
AFCPacket
)
*
4
);
char
*
final_buffer
=
NULL
;
char
*
final_buffer
=
NULL
;
...
@@ -232,6 +232,21 @@ int receive_AFC_data(AFClient *client, char **dump_here) {
...
@@ -232,6 +232,21 @@ int receive_AFC_data(AFClient *client, char **dump_here) {
return
current_count
;
return
current_count
;
}
}
static
char
**
make_strings_list
(
char
*
tokens
,
int
true_length
)
{
if
(
!
tokens
||
!
true_length
)
return
NULL
;
int
nulls
=
0
,
i
=
0
,
j
=
0
;
char
**
list
=
NULL
;
nulls
=
count_nullspaces
(
tokens
,
true_length
);
list
=
(
char
**
)
malloc
(
sizeof
(
char
*
)
*
(
nulls
+
1
));
for
(
i
=
0
;
i
<
nulls
;
i
++
)
{
list
[
i
]
=
strdup
(
tokens
+
j
);
j
+=
strlen
(
list
[
i
])
+
1
;
}
list
[
i
]
=
strdup
(
""
);
return
list
;
}
char
**
afc_get_dir_list
(
AFClient
*
client
,
const
char
*
dir
)
{
char
**
afc_get_dir_list
(
AFClient
*
client
,
const
char
*
dir
)
{
afc_lock
(
client
);
afc_lock
(
client
);
client
->
afc_packet
->
operation
=
AFC_LIST_DIR
;
client
->
afc_packet
->
operation
=
AFC_LIST_DIR
;
...
@@ -269,21 +284,6 @@ char **afc_get_devinfo(AFClient *client) {
...
@@ -269,21 +284,6 @@ char **afc_get_devinfo(AFClient *client) {
}
}
char
**
make_strings_list
(
char
*
tokens
,
int
true_length
)
{
if
(
!
tokens
||
!
true_length
)
return
NULL
;
int
nulls
=
0
,
i
=
0
,
j
=
0
;
char
**
list
=
NULL
;
nulls
=
count_nullspaces
(
tokens
,
true_length
);
list
=
(
char
**
)
malloc
(
sizeof
(
char
*
)
*
(
nulls
+
1
));
for
(
i
=
0
;
i
<
nulls
;
i
++
)
{
list
[
i
]
=
strdup
(
tokens
+
j
);
j
+=
strlen
(
list
[
i
])
+
1
;
}
list
[
i
]
=
strdup
(
""
);
return
list
;
}
int
afc_delete_file
(
AFClient
*
client
,
const
char
*
path
)
{
int
afc_delete_file
(
AFClient
*
client
,
const
char
*
path
)
{
if
(
!
client
||
!
path
||
!
client
->
afc_packet
||
!
client
->
connection
)
return
0
;
if
(
!
client
||
!
path
||
!
client
->
afc_packet
||
!
client
->
connection
)
return
0
;
afc_lock
(
client
);
afc_lock
(
client
);
...
...
src/AFC.h
View file @
7d4b4ede
...
@@ -86,10 +86,6 @@ enum {
...
@@ -86,10 +86,6 @@ enum {
AFClient
*
afc_connect
(
iPhone
*
phone
,
int
s_port
,
int
d_port
);
AFClient
*
afc_connect
(
iPhone
*
phone
,
int
s_port
,
int
d_port
);
void
afc_disconnect
(
AFClient
*
client
);
void
afc_disconnect
(
AFClient
*
client
);
int
count_nullspaces
(
char
*
string
,
int
number
);
char
**
make_strings_list
(
char
*
tokens
,
int
true_length
);
int
dispatch_AFC_packet
(
AFClient
*
client
,
const
char
*
data
,
int
length
);
int
receive_AFC_data
(
AFClient
*
client
,
char
**
dump_here
);
char
**
afc_get_dir_list
(
AFClient
*
client
,
const
char
*
dir
);
char
**
afc_get_dir_list
(
AFClient
*
client
,
const
char
*
dir
);
AFCFile
*
afc_get_file_info
(
AFClient
*
client
,
const
char
*
path
);
AFCFile
*
afc_get_file_info
(
AFClient
*
client
,
const
char
*
path
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment