projects
/
prss.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(no commit message)
[prss.git]
/
src
/
ttrss_model.c
diff --git
a/src/ttrss_model.c
b/src/ttrss_model.c
index
a1cdcef
..
3cba736
100644
(file)
--- a/
src/ttrss_model.c
+++ b/
src/ttrss_model.c
@@
-104,7
+104,7
@@
struct headline *headline_new(int id, const char *url, const char *title)
h->unread = -1;
h->excerpt = NULL;
h->content = NULL;
h->unread = -1;
h->excerpt = NULL;
h->content = NULL;
-
+
return h;
}
return h;
}
@@
-167,14
+167,29
@@
struct feed *feeds_get_feed(struct feed **feeds, int id)
{
struct feed **cur;
{
struct feed **cur;
- printf("%p\n", feeds);
-
if (feeds)
for (cur = feeds; *cur; cur++)
if (feeds)
for (cur = feeds; *cur; cur++)
- if ((*cur)->id == id) {
- printf("match!\n");
+ if ((*cur)->id == id)
return *cur;
return *cur;
- }
+
+ return NULL;
+}
+
+struct headline *feeds_get_headline(struct feed **feeds, int id)
+{
+ struct headline *h;
+
+ if (!feeds)
+ return NULL;
+
+ while (*feeds) {
+ h = feed_get_headline(*feeds, id);
+
+ if (h)
+ return h;
+
+ feeds++;
+ }
return NULL;
}
return NULL;
}