quran: don't include the newline
[cnoor.git] / cnoor.c
blob26efd1bc1184bad157c62ba9e19c08cf5eab3f68
1 #include <stdlib.h>
2 #include "config.h"
3 #include "txtwin.h"
4 #include "quran.h"
5 #include "util.h"
7 static void ins_sura(struct txtwin *tw, struct quran *quran, int sura)
9 char buf[16 * 1024];
10 int start = sura_start(sura);
11 int ayas = sura_ayas(sura);
12 int i;
13 for (i = 0; i < ayas; i++) {
14 quran_aya(quran, buf, LENGTH(buf), start + i);
15 txtwin_append(tw, buf, "quran");
16 txtwin_append(tw, "\n", "quran");
20 static void set_tags(struct txtwin *tw)
22 txtwin_tag(tw, "quran", QURAN_FG, QURAN_BG, QURAN_FONT);
25 int main(int argc, char **argv)
27 struct txtwin *tw;
28 struct quran *quran;
29 txtwin_gtk_init(argc, argv);
30 tw = txtwin_alloc();
31 quran = quran_alloc(QURAN_PATH);
32 set_tags(tw);
33 ins_sura(tw, quran, 1);
35 txtwin_loop(tw);
36 txtwin_free(tw);
37 quran_free(quran);
38 return 0;