Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 66 → Rev 67

/SPARTAN/trunk/include/list.h
72,7 → 72,7
 
#define list_get_instance(link,type,member) (type *)(((__u8*)(link))-((__u8*)&(((type *)NULL)->member)))
 
extern int list_member(link_t *link, link_t *head);
extern bool list_member(const link_t *link, const link_t *head);
extern void list_concat(link_t *head1, link_t *head2);
 
#endif
/SPARTAN/trunk/include/typedefs.h
29,6 → 29,11
#ifndef __TYPEDEFS_H__
#define __TYPEDEFS_H__
 
#define false 0
#define true 1
 
typedef short bool;
 
typedef struct config config_t;
typedef struct cpu_private_data cpu_private_data_t;
typedef struct cpu_info cpu_info_t;
/SPARTAN/trunk/src/lib/list.c
37,17 → 37,17
* @param link Item to look for.
* @param head List to look in.
*
* @return 1 if link is contained in head, 0 otherwise.
* @return true if link is contained in head, false otherwise.
*
*/
int list_member(link_t *link, link_t *head)
bool list_member(const link_t *link, const link_t *head)
{
int found = 0;
bool found = false;
link_t *hlp = head->next;
while (hlp != head) {
if (hlp == link) {
found = 1;
found = true;
break;
}
hlp = hlp->next;