Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Chris Müller
crystal
Commits
867d49d0
Commit
867d49d0
authored
Oct 28, 2012
by
Chris Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: Rename struct CryPosition to struct CryIndex.
parent
8ad9ba34
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
35 deletions
+30
-35
src/structures/double_linked_list.c
src/structures/double_linked_list.c
+19
-19
src/structures/list.h
src/structures/list.h
+11
-16
No files found.
src/structures/double_linked_list.c
View file @
867d49d0
...
...
@@ -146,7 +146,7 @@ cry_list_prepend(struct CryList* list, pointer data)
void
cry_list_insert
(
struct
CryList
*
list
,
struct
Cry
Position
*
position
,
pointer
data
)
cry_list_insert
(
struct
CryList
*
list
,
struct
Cry
Index
*
position
,
pointer
data
)
{
assert
(
list
!=
0
);
...
...
@@ -165,26 +165,26 @@ cry_list_insert(struct CryList* list, struct CryPosition* position, pointer data
}
struct
Cry
Position
*
struct
Cry
Index
*
cry_list_begin
(
struct
CryList
*
list
)
{
assert
(
list
!=
0
);
return
cry_cast
(
struct
Cry
Position
*
,
list
->
head
);
return
cry_cast
(
struct
Cry
Index
*
,
list
->
head
);
}
struct
Cry
Position
*
struct
Cry
Index
*
cry_list_end
(
struct
CryList
*
list
)
{
assert
(
list
!=
0
);
return
cry_cast
(
struct
Cry
Position
*
,
list
->
tail
);
return
cry_cast
(
struct
Cry
Index
*
,
list
->
tail
);
}
struct
Cry
Position
*
struct
Cry
Index
*
cry_list_index
(
struct
CryList
*
list
,
size_t
index
)
{
assert
(
list
!=
0
);
...
...
@@ -196,32 +196,32 @@ cry_list_index(struct CryList* list, size_t index)
--
index
;
}
return
cry_cast
(
struct
Cry
Position
*
,
node
);
return
cry_cast
(
struct
Cry
Index
*
,
node
);
}
struct
Cry
Position
*
cry_list_next
(
struct
Cry
Position
*
position
)
struct
Cry
Index
*
cry_list_next
(
struct
Cry
Index
*
position
)
{
assert
(
position
!=
0
);
return
cry_cast
(
struct
Cry
Position
*
,
cry_cast
(
struct
Node
*
,
position
)
->
next
);
return
cry_cast
(
struct
Cry
Index
*
,
cry_cast
(
struct
Node
*
,
position
)
->
next
);
}
struct
Cry
Position
*
cry_list_prev
(
struct
Cry
Position
*
position
)
struct
Cry
Index
*
cry_list_prev
(
struct
Cry
Index
*
position
)
{
assert
(
position
!=
0
);
return
cry_cast
(
struct
Cry
Position
*
,
cry_cast
(
struct
Node
*
,
position
)
->
prev
);
return
cry_cast
(
struct
Cry
Index
*
,
cry_cast
(
struct
Node
*
,
position
)
->
prev
);
}
struct
Cry
Position
*
cry_list_step
(
struct
Cry
Position
*
position
,
int
index
)
struct
Cry
Index
*
cry_list_step
(
struct
Cry
Index
*
position
,
int
index
)
{
assert
(
position
!=
0
);
...
...
@@ -237,12 +237,12 @@ cry_list_step(struct CryPosition* position, int index)
}
}
return
cry_cast
(
struct
Cry
Position
*
,
node
);
return
cry_cast
(
struct
Cry
Index
*
,
node
);
}
pointer
cry_list_data
(
struct
Cry
Position
*
position
)
cry_list_data
(
struct
Cry
Index
*
position
)
{
assert
(
position
!=
0
);
...
...
@@ -252,7 +252,7 @@ cry_list_data(struct CryPosition* position)
pointer
cry_list_swap
(
struct
Cry
Position
*
position
,
pointer
new_data
)
cry_list_swap
(
struct
Cry
Index
*
position
,
pointer
new_data
)
{
struct
Node
*
node
=
cry_cast
(
struct
Node
*
,
position
);
pointer
tmp
=
node
->
data
;
...
...
@@ -262,7 +262,7 @@ cry_list_swap(struct CryPosition* position, pointer new_data)
pointer
cry_list_remove
(
struct
CryList
*
list
,
struct
Cry
Position
*
position
)
cry_list_remove
(
struct
CryList
*
list
,
struct
Cry
Index
*
position
)
{
assert
(
list
!=
0
);
assert
(
position
!=
0
);
...
...
src/structures/list.h
View file @
867d49d0
...
...
@@ -21,7 +21,7 @@
#include "structures.h"
struct
Cry
Position
;
struct
Cry
Index
;
struct
CryList
;
struct
CryList
*
cry_list_new
(
void
);
...
...
@@ -33,25 +33,20 @@ pointer cry_list_tail(struct CryList* list);
void
cry_list_append
(
struct
CryList
*
list
,
pointer
data
);
void
cry_list_prepend
(
struct
CryList
*
list
,
pointer
data
);
void
cry_list_insert
(
struct
CryList
*
list
,
struct
Cry
Position
*
position
,
pointer
data
);
void
cry_list_insert
(
struct
CryList
*
list
,
struct
Cry
Index
*
position
,
pointer
data
);
struct
Cry
Position
*
cry_list_begin
(
struct
CryList
*
list
);
struct
Cry
Position
*
cry_list_end
(
struct
CryList
*
list
);
struct
Cry
Position
*
cry_list_index
(
struct
CryList
*
list
,
size_t
index
);
struct
Cry
Index
*
cry_list_begin
(
struct
CryList
*
list
);
struct
Cry
Index
*
cry_list_end
(
struct
CryList
*
list
);
struct
Cry
Index
*
cry_list_index
(
struct
CryList
*
list
,
size_t
index
);
struct
Cry
Position
*
cry_list_next
(
struct
Cry
Position
*
position
);
struct
Cry
Position
*
cry_list_prev
(
struct
Cry
Position
*
position
);
struct
Cry
Position
*
cry_list_step
(
struct
Cry
Position
*
position
,
int
steps
);
pointer
cry_list_data
(
struct
Cry
Position
*
position
);
pointer
cry_list_swap
(
struct
Cry
Position
*
position
,
pointer
new_data
);
struct
Cry
Index
*
cry_list_next
(
struct
Cry
Index
*
position
);
struct
Cry
Index
*
cry_list_prev
(
struct
Cry
Index
*
position
);
struct
Cry
Index
*
cry_list_step
(
struct
Cry
Index
*
position
,
int
steps
);
pointer
cry_list_data
(
struct
Cry
Index
*
position
);
pointer
cry_list_swap
(
struct
Cry
Index
*
position
,
pointer
new_data
);
pointer
cry_list_remove
(
struct
CryList
*
list
,
struct
Cry
Position
*
position
);
pointer
cry_list_remove
(
struct
CryList
*
list
,
struct
Cry
Index
*
position
);
struct
CryList
*
cry_list_concat
(
struct
CryList
*
first
,
struct
CryList
*
second
);
/*
struct CryList* cry_list_filter(struct CryList* list, cry_predicate_function predicate, pointer context);
struct CryList* cry_list_map(struct CryList* list, cry_mapping_function mapping, pointer context);
*/
#endif // CRYSTAL_STRUCTURES_LIST_H
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