/[james]/sargasso2/sargasso.c
ViewVC logotype

Diff of /sargasso2/sargasso.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 79 by james, Sat Sep 30 21:35:19 2006 UTC revision 83 by james, Mon Jul 6 01:59:16 2009 UTC
# Line 10  Line 10 
10  #include <stdio.h>  #include <stdio.h>
11  #include <string.h>  #include <string.h>
12  #include <sys/stat.h>  #include <sys/stat.h>
13    #include <sys/types.h>
14  #include <oslib/colourtrans.h>  #include <oslib/colourtrans.h>
15  #include <oslib/osfile.h>  #include <oslib/osfile.h>
16  #include <oslib/uri.h>  #include <oslib/uri.h>
# Line 17  Line 18 
18  #include <oslib/wimpspriteop.h>  #include <oslib/wimpspriteop.h>
19  #include <rufl.h>  #include <rufl.h>
20  #include "feed.h"  #include "feed.h"
 #include "netsurf/utils/log.h"  
21    
22    
23  #define MAX_LINES 20  #define MAX_LINES 20
# Line 26  Line 26 
26  #define FEEDS_WRITE "<Choices$Write>.Sargasso.Feeds"  #define FEEDS_WRITE "<Choices$Write>.Sargasso.Feeds"
27  #define CHOICES_READ "Choices:Sargasso.Choices"  #define CHOICES_READ "Choices:Sargasso.Choices"
28  #define CHOICES_WRITE "<Choices$Write>.Sargasso.Choices"  #define CHOICES_WRITE "<Choices$Write>.Sargasso.Choices"
29    #define WRITE_DIR "<Choices$Write>.Sargasso"
30    
31    #define LOG(x) (printf(__FILE__ " %s %i: ", __PRETTY_FUNCTION__, __LINE__), printf x, fputc('\n', stdout));
32    
33  typedef void (*click_callback)(unsigned int i);  typedef void (*click_callback)(unsigned int i);
34    
# Line 140  int main(int argc, char *argv[]) Line 143  int main(int argc, char *argv[])
143          if (stat(FEEDS_READ, &s)) {          if (stat(FEEDS_READ, &s)) {
144                  warn("Welcome to Sargasso! A selection of feeds have been "                  warn("Welcome to Sargasso! A selection of feeds have been "
145                                  "added. To add more feeds, use the main menu.");                                  "added. To add more feeds, use the main menu.");
146                    mkdir(WRITE_DIR, S_IRWXU);
147                  for (unsigned int i = 0; i != sizeof default_feeds /                  for (unsigned int i = 0; i != sizeof default_feeds /
148                                  sizeof default_feeds[0]; i++)                                  sizeof default_feeds[0]; i++)
149                          feed_add(default_feeds[i]);                          feed_add(default_feeds[i]);
# Line 179  void gui_init(void) Line 183  void gui_init(void)
183                  { "!sargasso" } } };                  { "!sargasso" } } };
184          os_error *error;          os_error *error;
185    
         code = rufl_init();  
         if (code != rufl_OK) {  
                 LOG(("rufl_init: %i", code));  
                 die("Failed to initialise Unicode font library");  
         }  
   
186          error = xwimp_initialise(wimp_VERSION_RO3, "Sargasso",          error = xwimp_initialise(wimp_VERSION_RO3, "Sargasso",
187                          (const wimp_message_list *) &messages, 0, &task);                          (const wimp_message_list *) &messages, 0, &task);
188          if (error) {          if (error) {
# Line 193  void gui_init(void) Line 191  void gui_init(void)
191                  die(error->errmess);                  die(error->errmess);
192          }          }
193    
194            code = rufl_init();
195            if (code != rufl_OK) {
196                    LOG(("rufl_init: %i", code));
197                    die("Failed to initialise Unicode font library");
198            }
199    
200          error = xosfile_read_stamped_no_path("<Sargasso$Dir>.Sprites",          error = xosfile_read_stamped_no_path("<Sargasso$Dir>.Sprites",
201                          &obj_type, 0, 0, &size, 0, 0);                          &obj_type, 0, 0, &size, 0, 0);
202          if (error) {          if (error) {

Legend:
Removed from v.79  
changed lines
  Added in v.83

  ViewVC Help
Powered by ViewVC 1.1.26