Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
[PATCH] Add function to append to an object_list.
author
Daniel Barkalow
<barkalow@iabervon.org>
Mon, 5 Sep 2005 06:04:18 +0000
(
02:04
-0400)
committer
Junio C Hamano
<junkio@cox.net>
Sun, 11 Sep 2005 01:27:40 +0000
(18:27 -0700)
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
object.c
patch
|
blob
|
history
object.h
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
77675e2
)
diff --git
a/object.c
b/object.c
index 72f6aa552f79edcd5f4f5c4a647ab62503365b1b..63e6e784d41ef5aa7bb387a96a85bf0f8e7248ab 100644
(file)
--- a/
object.c
+++ b/
object.c
@@
-184,6
+184,17
@@
struct object_list *object_list_insert(struct object *item,
return new_list;
}
return new_list;
}
+void object_list_append(struct object *item,
+ struct object_list **list_p)
+{
+ while (*list_p) {
+ list_p = &((*list_p)->next);
+ }
+ *list_p = xmalloc(sizeof(struct object_list));
+ (*list_p)->next = NULL;
+ (*list_p)->item = item;
+}
+
unsigned object_list_length(struct object_list *list)
{
unsigned ret = 0;
unsigned object_list_length(struct object_list *list)
{
unsigned ret = 0;
diff --git
a/object.h
b/object.h
index 5af530da5decf0abbfafeee041143c0acd0d600a..bf744490a9a75c5e84af6384b2fa2bc4eb492452 100644
(file)
--- a/
object.h
+++ b/
object.h
@@
-41,6
+41,9
@@
void mark_reachable(struct object *obj, unsigned int mask);
struct object_list *object_list_insert(struct object *item,
struct object_list **list_p);
struct object_list *object_list_insert(struct object *item,
struct object_list **list_p);
+void object_list_append(struct object *item,
+ struct object_list **list_p);
+
unsigned object_list_length(struct object_list *list);
int object_list_contains(struct object_list *list, struct object *obj);
unsigned object_list_length(struct object_list *list);
int object_list_contains(struct object_list *list, struct object *obj);