Send commitlog mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:

   1. r1867 - in
      trunk/src/target/OM-2007/applications/openmoko-rssreader: . src
      ([EMAIL PROTECTED])
   2. r1868 - in
      trunk/src/target/OM-2007/applications/openmoko-rssreader: . src
      ([EMAIL PROTECTED])
   3. r1869 - in
      trunk/src/target/OM-2007/applications/openmoko-rssreader: . src
      ([EMAIL PROTECTED])
   4. r1870 - trunk/src/target/gsm/src/gsmd ([EMAIL PROTECTED])
   5. r1871 - in
      trunk/src/target/OM-2007/applications/openmoko-rssreader: . src
      ([EMAIL PROTECTED])
   6. r1872 - in
      trunk/src/target/OM-2007/applications/openmoko-rssreader: . src
      ([EMAIL PROTECTED])
--- Begin Message ---
Author: zecke
Date: 2007-04-29 17:23:44 +0200 (Sun, 29 Apr 2007)
New Revision: 1867

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
Log:
2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>

        * src/rfcdate.c: Do not include malloc.h as this is not portable



Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 15:22:30 UTC (rev 1866)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 15:23:44 UTC (rev 1867)
@@ -1,5 +1,9 @@
 2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
 
+        * src/rfcdate.c: Do not include malloc.h as this is not portable
+
+2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
+
         * scripts/prepare-ChangeLog: Added.
 
 2007-03-20: Fix the size of the column headers

Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c      
2007-04-29 15:22:30 UTC (rev 1866)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c      
2007-04-29 15:23:44 UTC (rev 1867)
@@ -28,7 +28,7 @@
 #include "rfcdate.h"
 #include <glib/gi18n.h>
 
-#include <malloc.h>
+#include <stdlib.h>
 #include <stdio.h>
 
 G_DEFINE_TYPE(RSSRFCDate, rss_rfc_date, G_TYPE_OBJECT)




--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2007-04-29 17:25:26 +0200 (Sun, 29 Apr 2007)
New Revision: 1868

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.h
Log:
2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>

        * src/rfcdate.h: Add a proper license header



Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 15:23:44 UTC (rev 1867)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 15:25:26 UTC (rev 1868)
@@ -1,5 +1,9 @@
 2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
 
+        * src/rfcdate.h: Add a proper license header
+
+2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
+
         * src/rfcdate.c: Do not include malloc.h as this is not portable
 
 2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>

Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.h      
2007-04-29 15:23:44 UTC (rev 1867)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.h      
2007-04-29 15:25:26 UTC (rev 1868)
@@ -1,4 +1,28 @@
-
+/*
+ *  RSS Reader, a simple RSS reader
+ *
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *  OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ */
 #ifndef OPENMOKO_RSS_RFC_DATE_H
 #define OPENMOKO_RSS_RFC_DATE_H
 




--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2007-04-29 17:38:24 +0200 (Sun, 29 Apr 2007)
New Revision: 1869

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
Log:
2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>

        * src/callbacks.c: Update documentation, move it around
        (feed_update_thread): Update documentation
        (cb_treeview_selection_changed): make the string i18nable



Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 15:25:26 UTC (rev 1868)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 15:38:24 UTC (rev 1869)
@@ -1,5 +1,11 @@
 2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
 
+        * src/callbacks.c: Update documentation, move it around
+        (feed_update_thread): Update documentation
+        (cb_treeview_selection_changed): make the string i18nable
+
+2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
+
         * src/rfcdate.h: Add a proper license header
 
 2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>

Modified: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c    
2007-04-29 15:25:26 UTC (rev 1868)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c    
2007-04-29 15:38:24 UTC (rev 1869)
@@ -53,10 +53,6 @@
     gtk_container_remove(GTK_CONTAINER(container), item);
 }
 
-
-/*
- * TODO: Use the ModelFilter to filter for All or Category
- */
 void filter_feeds( struct RSSReaderData *data ) {
     gtk_tree_model_filter_refilter (data->filter_model);
 }
@@ -98,7 +94,24 @@
 
 /*
  * asynchronous update thread!
- * This breaks with ATK+
+ * This breaks with ATK+. See 
http://wiki.ekiga.org/index.php/Bug::ATK::Threads and bugs
+ * #329454, #349047, #335838
+ *
+ * DISCUSSION:
+ *    - Should everything be updated?
+ *    - What happens if we update but some feeds can not be connected? Should 
the old
+ *      data be kept?
+ *      ( Just keeping/building a new ListStore does not help, we need a model 
that consists
+ *        out of models... )
+ *
+ *
+ * Clear the current model
+ *
+ * For each feed:
+ *    - Get the Data
+ *    - Fill the GtkListStore
+ *
+ * Refilter the model...
  */
 static void feed_update_thread( struct RSSReaderData *data ) {
     GtkTreeIter iter;
@@ -127,6 +140,9 @@
                         description = tag->value;
 
                         for ( mrss_attribute_t *attribute = tag->attributes; 
attribute; attribute = attribute->next ) {
+                            /*
+                             * Detect the type of the content. Currently we 
know about text/plain and html
+                             */
                             if ( strcmp( attribute->name, "type" ) == 0 ) {
                                 if ( strcmp( attribute->value, "plain" ) == 0 
) {
                                     content_type = RSS_READER_TEXT_TYPE_PLAIN;
@@ -145,7 +161,8 @@
             }
 
             /*
-             * update the model here
+             * update the model here. The order in gtk_list_store_set must 
match
+             * with the order in application-data.h
              */
             RSSRFCDate *date = RSS_RFC_DATE(rss_rfc_date_new ());
             rss_rfc_date_set (date, item->pubDate);
@@ -174,22 +191,7 @@
 }
 
 /*
- * TODO use gconf and GThread as this will block
- * DISCUSSION:
- *    - Should everything be updated?
- *    - What happens if we update but some feeds can not be connected? Should 
the old
- *      data be kept?
- *      ( Just keeping/building a new ListStore does not help, we need a model 
that consists
- *        out of models... )
- *
- *
- * Clear the current model
- *
- * For each feed:
- *    - Get the Data
- *    - Fill the GtkListStore
- *
- * Refilter the model...
+ * Start the update-job in a separate thread
  */
 void cb_refresh_all_button_clicked( GtkButton *btn, struct RSSReaderData *data 
) {
     /*
@@ -231,7 +233,7 @@
         if ( message )
             gtk_text_buffer_set_text( data->textBuffer, message, -1 );
         else
-            gtk_text_buffer_set_text( data->textBuffer, g_strdup( "Failed to 
read the text" ), -1 );
+            gtk_text_buffer_set_text( data->textBuffer, g_strdup( _("Failed to 
read the text") ), -1 );
     }
 }
 




--- End Message ---
--- Begin Message ---
Author: laforge
Date: 2007-04-29 18:26:26 +0200 (Sun, 29 Apr 2007)
New Revision: 1870

Modified:
   trunk/src/target/gsm/src/gsmd/select.c
Log:
* compile fix (include sys/select.h) to make it build on *BSD (Holger Freyther)


Modified: trunk/src/target/gsm/src/gsmd/select.c
===================================================================
--- trunk/src/target/gsm/src/gsmd/select.c      2007-04-29 15:38:24 UTC (rev 
1869)
+++ trunk/src/target/gsm/src/gsmd/select.c      2007-04-29 16:26:26 UTC (rev 
1870)
@@ -20,6 +20,7 @@
  */ 
 
 #include <fcntl.h>
+#include <sys/select.h>
 #include <common/linux_list.h>
 
 #include "gsmd.h"




--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2007-04-29 18:43:19 +0200 (Sun, 29 Apr 2007)
New Revision: 1871

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
Log:
2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>

        * src/rfcdate.c: Handle wrong dates
        (rss_rfc_date_set): If we can't parse set it to 26.01.1983
        (rss_rfc_date_compare): Check if the dates we pass to g_date_compae
are valid


Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 16:26:26 UTC (rev 1870)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 16:43:19 UTC (rev 1871)
@@ -1,5 +1,12 @@
 2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
 
+        * src/rfcdate.c: Handle wrong dates
+        (rss_rfc_date_set): If we can't parse set it to 26.01.1983
+        (rss_rfc_date_compare): Check if the dates we pass to g_date_compae
+are valid
+
+2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
+
         * src/callbacks.c: Update documentation, move it around
         (feed_update_thread): Update documentation
         (cb_treeview_selection_changed): make the string i18nable

Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c      
2007-04-29 16:26:26 UTC (rev 1870)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c      
2007-04-29 16:43:19 UTC (rev 1871)
@@ -194,6 +194,7 @@
      * What should we do with these dates? round to the nearest legal date?
      */
     if ( !g_date_valid (self->date) ) {
+        g_date_set_dmy (self->date, 26, G_DATE_JANUARY, 1983 );
         g_print ("Setting RFC Date failed: '%s' %d %d %s %d  %ld\n",
                         rfc822date,
                         day,
@@ -207,10 +208,14 @@
 /*
  * Start by comparing the dates and only if they are equal compare
  * the times.
+ * For invalid dates we need a special treatment
  */
 gint
 rss_rfc_date_compare (RSSRFCDate *left, RSSRFCDate *right)
 {
+    g_assert ( g_date_valid (left->date) );
+    g_assert ( g_date_valid (right->date) );
+
     int date_result = g_date_compare( left->date, right->date );
     if (  date_result != 0 )
         return date_result;




--- End Message ---
--- Begin Message ---
Author: zecke
Date: 2007-04-29 22:43:06 +0200 (Sun, 29 Apr 2007)
New Revision: 1872

Added:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.c
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.h
Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am
Log:
2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>

        Add a class to handle caching of feeds while making sure not consuming
                too much space. This class is meant to be copied to mokocore 
once done

        * src/Makefile.am: Add moko_cache.[h,c]
        * src/moko_cache.c: Added.
        (moko_cache_finalize): Clean the filename
        (moko_cache_class_init): Make sure to clean the filename
        (moko_cache_init): Initialize it
        (moko_cache_new): Copy the profile name
        (moko_cache_get_allowed_size): not implemented
        (moko_cache_get_utilized_size): not implemtned
        (moko_cache_write_object): not implemented
        (moko_cache_read_object): not implemented



Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 16:43:19 UTC (rev 1871)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/ChangeLog  
2007-04-29 20:43:06 UTC (rev 1872)
@@ -1,5 +1,21 @@
 2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
 
+        Add a class to handle caching of feeds while making sure not consuming
+               too much space. This class is meant to be copied to mokocore 
once done
+
+        * src/Makefile.am: Add moko_cache.[h,c]
+        * src/moko_cache.c: Added.
+        (moko_cache_finalize): Clean the filename
+        (moko_cache_class_init): Make sure to clean the filename
+        (moko_cache_init): Initialize it
+        (moko_cache_new): Copy the profile name
+        (moko_cache_get_allowed_size): not implemented
+        (moko_cache_get_utilized_size): not implemtned
+        (moko_cache_write_object): not implemented
+        (moko_cache_read_object): not implemented
+
+2007-04-29  Holger Hans Peter Freyther  <[EMAIL PROTECTED]>
+
         * src/rfcdate.c: Handle wrong dates
         (rss_rfc_date_set): If we can't parse set it to 26.01.1983
         (rss_rfc_date_compare): Check if the dates we pass to g_date_compae

Modified: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am    
2007-04-29 16:43:19 UTC (rev 1871)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/Makefile.am    
2007-04-29 20:43:06 UTC (rev 1872)
@@ -7,8 +7,8 @@
 
 bin_PROGRAMS = openmoko-rssreader
 
-EXTRA_DIST = application-data.h callbacks.h rfcdate.h
+EXTRA_DIST = application-data.h callbacks.h rfcdate.h moko_cache.h
 
-openmoko_rssreader_SOURCES = main.c callbacks.c rfcdate.c
+openmoko_rssreader_SOURCES = main.c callbacks.c rfcdate.c moko_cache.c
 openmoko_rssreader_LDADD = @OPENMOKO_LIBS@ @MRSS_LIBS@ @GTHREAD_LIBS@
 

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.c   
2007-04-29 16:43:19 UTC (rev 1871)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.c   
2007-04-29 20:43:06 UTC (rev 1872)
@@ -0,0 +1,101 @@
+/*
+ *  RSS Reader, a simple RSS reader
+ *
+ *  A simple secondory/tertiary caching solution to limit the amount of data
+ *  stored. This is meant to be pushed to the mokocore library.
+ *
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *  OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ */
+
+#include "moko_cache.h"
+
+G_DEFINE_TYPE(MokoCache, moko_cache, G_TYPE_OBJECT)
+
+#define MOKO_CACHE_GET_PRIVATE(obj)     (G_TYPE_INSTANCE_GET_PRIVATE((obj), 
MOKO_TYPE_CACHE, MokoCachePrivate))
+
+typedef struct _MokoCachePrivate MokoCachePrivate;
+struct _MokoCachePrivate {
+    gint allowed_size;
+};
+
+static void
+moko_cache_finalize (GObject *object)
+{
+    MokoCache *cache = MOKO_CACHE (object);
+    g_free (cache->cache_name);
+    cache->cache_name = NULL;
+
+    G_OBJECT_CLASS(moko_cache_parent_class)->finalize (object);
+}
+
+static void
+moko_cache_class_init (MokoCacheClass *klass)
+{
+    g_type_class_add_private (klass, sizeof (MokoCachePrivate));
+
+    /*
+     * virtual functions
+     */
+    G_OBJECT_CLASS(klass)->finalize = moko_cache_finalize;
+}
+
+static void
+moko_cache_init (MokoCache *self)
+{
+    self->cache_name = NULL;
+}
+
+GObject*
+moko_cache_new (gchar *name)
+{
+    MokoCache *cache = MOKO_CACHE(g_object_new (MOKO_TYPE_CACHE, NULL));
+    cache->cache_name = g_strdup(name);
+
+
+    return G_OBJECT(cache);
+}
+
+gint
+moko_cache_get_allowed_size (MokoCache *self)
+{
+    return MOKO_CACHE_UNLIMITED;
+}
+
+gint
+moko_cache_get_utilized_size(MokoCache *self)
+{
+    return 0;
+}
+
+gint
+moko_cache_write_object (MokoCache *self, gchar *object_name, gchar *content, 
guint size)
+{
+    return MOKO_CACHE_WRITE_UNKNOWN_ERROR;
+}
+
+gchar*
+moko_cache_read_object  (MokoCache *self, gchar *object_name, gint *size)
+{
+    *size = -1;
+    return NULL;
+}


Property changes on: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.c
___________________________________________________________________
Name: svn:eol-style
   + native

Added: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.h
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.h   
2007-04-29 16:43:19 UTC (rev 1871)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.h   
2007-04-29 20:43:06 UTC (rev 1872)
@@ -0,0 +1,115 @@
+/*
+ *  RSS Reader, a simple RSS reader
+ *
+ *  A simple secondory/tertiary caching solution to limit the amount of data
+ *  stored. This is meant to be pushed to the mokocore library.
+ *
+ *  Copyright (C) 2007 Holger Hans Peter Freyther
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ *  OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ *  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *  OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *  Current Version: $Rev$ ($Date$) [$Author$]
+ */
+#ifndef OPENMOKO_RSS_MOKO_CACHE_H
+#define OPENMOKO_RSS_MOKO_CACHE_H
+
+
+#include <glib.h>
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define MOKO_TYPE_CACHE             (moko_cache_get_type())
+#define MOKO_CACHE(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj), 
MOKO_TYPE_CACHE, MokoCache))
+#define MOKO_CACHE_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((obj),    
MOKO_TYPE_CACHE, MokoCacheClass))
+#define MOKO_IS_CACHE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj), 
MOKO_TYPE_CACHE))
+#define MOKO_IS_CACHE_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),  
MOKO_TYPE_CACHE))
+#define MOKO_CACHE_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),  
MOKO_TYPE_CACHE, MokoCacheClass))
+
+typedef struct _MokoCache MokoCache;
+typedef struct _MokoCacheClass MokoCacheClass;
+
+struct _MokoCache {
+    GObject parent;
+
+    gchar *cache_name;
+};
+
+struct _MokoCacheClass {
+    GObjectClass parent;
+};
+
+enum MokoCacheAllowedSize {
+    MOKO_CACHE_UNLIMITED = 0 
+};
+
+enum MokoCacheWriteResult {
+    MOKO_CACHE_WRITE_SUCCESS,
+    MOKO_CACHE_WRITE_OUT_OF_SPACE,
+    MOKO_CACHE_WRITE_LIMIT_EXCEEDED,
+    MOKO_CACHE_WRITE_UNKNOWN_ERROR
+};
+
+GType         moko_cache_get_type (void);
+GObject*      moko_cache_new (gchar *cache_policy_name);
+gint          moko_cache_get_allowed_size (MokoCache *self);
+gint          moko_cache_get_utilized_size(MokoCache *self);
+
+gint          moko_cache_write_object (MokoCache *self, gchar *object_name, 
gchar *content, guint size);
+gchar*        moko_cache_read_object  (MokoCache *self, gchar *object_name, 
gint *size);
+
+/**
+ * \fn moko_cache_new(gchar *cache_policy_name)
+ * @param cache_policy_name Name of the policy, e.g. "openmoko-rssreader"
+ * 
+ * The policy defines the storage path and the amount of storage available
+ */
+
+/**
+ * \fn moko_cache_get_allowed_size (MokoCache* self)
+ *
+ * @return This method returns the number of bytes this object
+ * may safe. As a special case MOKO_CACHE_UNLIMITED might be returned.
+ */
+
+/**
+ * \fn moko_cache_get_utilized_size (MokoCache *self)
+ *
+ * @return Return the size currently used.
+ */
+
+/**
+ * \fn moko_cache_write_object (MokoCache *self, gchar *object_name, gchar 
*content, guint size);
+ * @param object_name The name of the object. E.g. http://www.heise.de/atom.xml
+ * @param content     The actual content to be written to the cache
+ * @param size        The size of the content. If it is -1 strlen will be used 
to determine the size
+ */
+
+/**
+ * \fn moko_cache_read_object (MokoCache *self, gchar *object_name, gint *size)
+ * @param object_name The name of the object to be retrieved
+ * @param size        Out parameter. The size of the object will be returned
+ *
+ * @return NULL in case of error, otherwise a pointer to the object. You are 
responsible
+ * to delete it! size can be -1 in case of error or >= 0.
+ */
+
+G_END_DECLS
+
+#endif


Property changes on: 
trunk/src/target/OM-2007/applications/openmoko-rssreader/src/moko_cache.h
___________________________________________________________________
Name: svn:eol-style
   + native




--- End Message ---
_______________________________________________
commitlog mailing list
[email protected]
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to