Skip to content

Commit

Permalink
Change sel into sel_list in oh_domain
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhuang committed Jul 15, 2003
1 parent 2834fc0 commit 640b097
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion include/openhpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct oh_domain {
/* System Event Log */
enum oh_sel_state sel_state;
int sel_counter;
GSList *sel;
GSList *sel_list;
};

/*
Expand Down
14 changes: 7 additions & 7 deletions src/eventlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int dsel_get_info(SaHpiDomainIdT domain_id, SaHpiSelInfoT *info)
return -1;
}

info->Entries = g_slist_length(d->sel);
info->Entries = g_slist_length(d->sel_list);
info->Size = 0xFFFFFFFF;
info->UpdateTimestamp = 0;
gettimeofday1(&info->CurrentTime);
Expand Down Expand Up @@ -103,7 +103,7 @@ void dsel_add(SaHpiDomainIdT domain_id, SaHpiSelEntryT *entry)

memcpy(&sel->entry, entry, sizeof(*entry));
sel->entry.EntryId = d->sel_counter++;
d->sel = g_slist_append(d->sel, sel);
d->sel_list = g_slist_append(d->sel_list, sel);
}

void dsel_add2(struct oh_domain *d, struct oh_event *e)
Expand All @@ -124,7 +124,7 @@ void dsel_add2(struct oh_domain *d, struct oh_event *e)

memcpy(&sel->entry.Event, &e->u.hpi_event.event, sizeof(sel->entry.Event));

d->sel = g_slist_append(d->sel, sel);
d->sel_list = g_slist_append(d->sel_list, sel);
}

void dsel_del(SaHpiDomainIdT domain_id, SaHpiSelEntryIdT id)
Expand All @@ -137,11 +137,11 @@ void dsel_del(SaHpiDomainIdT domain_id, SaHpiSelEntryIdT id)
return;
}

g_slist_for_each(i, d->sel) {
g_slist_for_each(i, d->sel_list) {
struct oh_sel *sel;
sel = i->data;
if (sel->entry.EntryId == id) {
d->sel = g_slist_remove_link(d->sel, i);
d->sel_list = g_slist_remove_link(d->sel_list, i);
free(sel);
break;
}
Expand All @@ -159,10 +159,10 @@ void dsel_clr(SaHpiDomainIdT domain_id)
return;
}

g_slist_for_each_safe(i, i2, d->sel) {
g_slist_for_each_safe(i, i2, d->sel_list) {
struct oh_sel *sel;
sel = i->data;
d->sel = g_slist_remove_link(d->sel, i);
d->sel_list = g_slist_remove_link(d->sel_list, i);
free(sel);
}
}
14 changes: 7 additions & 7 deletions src/safhpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,20 +424,20 @@ SaErrorT SAHPI_API saHpiEventLogEntryGet (
dbg("Internal error?!");
}

if (d->sel==NULL) {
if (d->sel_list==NULL) {
return SA_ERR_HPI_INVALID;
} else if (EntryId==SAHPI_OLDEST_ENTRY) {
pi = NULL;
i = g_slist_nth(d->sel, 0);
ni = g_slist_nth(d->sel, 1);
i = g_slist_nth(d->sel_list, 0);
ni = g_slist_nth(d->sel_list, 1);
} else if (EntryId==SAHPI_NEWEST_ENTRY) {
int num;
num = g_slist_length(d->sel);
pi = g_slist_nth(d->sel, num-2);
i = g_slist_nth(d->sel, num-1);
num = g_slist_length(d->sel_list);
pi = g_slist_nth(d->sel_list, num-2);
i = g_slist_nth(d->sel_list, num-1);
ni = NULL;
} else {
g_slist_for_each(pi, d->sel) {
g_slist_for_each(pi, d->sel_list) {
i = g_slist_next(pi);
ni= g_slist_next(i);
if (i && ((struct oh_sel*)(i->data))->entry.EntryId == EntryId)
Expand Down

0 comments on commit 640b097

Please sign in to comment.