Yelp porting to Gnome2



Hi,
I have replaced deprecated calls from Yelp.
Find the diff file attached with this mail.

I found string manipulation deprecated calls
like g_strcasecmp(),g_strncasecmp() in Yelp.
Following two types of replacement are available for these functions:
 1. ASCII functions
 2. Unicode manipulation functions.

Which one to use to replace string deprecated calls ?

- Sandeep.
--- yelp/ChangeLog	Sun Feb 24 10:39:01 2002
+++ yelp-new/ChangeLog	Sun Feb 24 11:26:16 2002
@@ -1,3 +1,8 @@
+2002-02-24  Sandeep V Honde <sandeep honde wipro com>
+	
+	* char replaced by gchar,int replaced by gint
+        * src/gtktreemodelfilter.h : GtkType replaced by GType
+
 2002-02-22  Kjartan Maraas  <kmaraas gnome org>
 
 	* src/yelp-main.c: Remove unsupported #ifdef ENABLE_NLS stuff.
--- yelp/src/gtktreemodelfilter.c	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/gtktreemodelfilter.c	Sun Feb 24 10:39:22 2002
@@ -392,7 +392,7 @@ gtk_tree_model_filter_row_back_child_upd
                                               FilterLevel        *level,
                                               FilterElt          *elt)
 {
-  int i, len;
+  gint i, len;
   GArray *a = NULL;
   GtkTreeIter childs;
 
@@ -2302,7 +2302,7 @@ static void
 gtk_tree_path_add (GtkTreePath *path1,
 		   GtkTreePath *path2)
 {
-  int i;
+  gint i;
   gint depth;
   gint *indices;
 
@@ -2321,7 +2321,7 @@ gtk_tree_path_apply_root (GtkTreePath *p
 			  GtkTreePath *root)
 {
   GtkTreePath *retval;
-  int i;
+  gint i;
   gint depth;
   gint *indices;
 
--- yelp/src/yelp-html.c	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-html.c	Sun Feb 24 10:39:22 2002
@@ -379,7 +379,7 @@ yelp_html_open_uri (YelpHtml    *view, 
         YelpHtmlPriv *priv;
         StreamData   *sdata;
 	GnomeVFSURI  *uri;
-	const char   *fragment;
+	const gchar   *fragment;
 	
         d(puts(G_GNUC_FUNCTION));
 	
--- yelp/src/yelp-info.c	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-info.c	Sun Feb 24 10:39:22 2002
@@ -43,7 +43,7 @@
 
 
 static void
-yelp_info_populate_tree_for_subdir (const char *basedir, GNode *parent)
+yelp_info_populate_tree_for_subdir (const gchar *basedir, GNode *parent)
 {
 	DIR           *dirh;
 	struct dirent *dent;
@@ -56,8 +56,8 @@ yelp_info_populate_tree_for_subdir (cons
 	readdir (dirh);
 
 	while ((dent = readdir (dirh))) {
-		char *ctmp = NULL;
-		char uribuf[128], titlebuf[128];
+		gchar *ctmp = NULL;
+		gchar uribuf[128], titlebuf[128];
 
 		if (dent->d_name[0] == '.')
 			continue;
--- yelp/src/yelp-main.c	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-main.c	Sun Feb 24 10:41:02 2002
@@ -34,6 +34,7 @@
 #include <libgnome/gnome-program.h>
 #include <libgnomeui/gnome-ui-init.h>
 #include <libgnomevfs/gnome-vfs.h>
+#include <stdlib.h>
 
 #include "GNOME_Yelp.h"
 #include "yelp-window.h"
--- yelp/src/yelp-util.c	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-util.c	Sun Feb 24 10:39:22 2002
@@ -29,9 +29,9 @@
 /* This code comes from gnome vfs: */
 
 static gboolean
-is_uri_relative (const char *uri)
+is_uri_relative (const gchar *uri)
 {
-	const char *current;
+	const gchar *current;
 
 	/* RFC 2396 section 3.1 */
 	for (current = uri ; 
@@ -62,9 +62,9 @@ is_uri_relative (const char *uri)
  * in place.
  */
 static void
-remove_internal_relative_components (char *uri_current)
+remove_internal_relative_components (gchar *uri_current)
 {
-	char *segment_prev, *segment_cur;
+	gchar *segment_prev, *segment_cur;
 	gsize len_prev, len_cur;
 
 	len_prev = len_cur = 0;
@@ -135,11 +135,11 @@ remove_internal_relative_components (cha
 /* If I had known this relative uri code would have ended up this long, I would
  * have done it a different way
  */
-char *
-yelp_util_resolve_relative_uri (const char *base_uri,
-				const char *uri)
+gchar *
+yelp_util_resolve_relative_uri (const gchar *base_uri,
+				const gchar *uri)
 {
-	char *result = NULL;
+	gchar *result = NULL;
 
 	g_return_val_if_fail (base_uri != NULL, g_strdup (uri));
 	g_return_val_if_fail (uri != NULL, NULL);
@@ -155,12 +155,12 @@ yelp_util_resolve_relative_uri (const ch
 		result = g_strconcat (base_uri, uri, NULL);
 	}
 	else if (is_uri_relative (uri)) {
-		char *mutable_base_uri;
-		char *mutable_uri;
+		gchar *mutable_base_uri;
+		gchar *mutable_uri;
 
-		char *uri_current;
+		gchar *uri_current;
 		gsize base_uri_length;
-		char *separator;
+		gchar *separator;
 
 		/* We may need one extra character
 		 * to append a "/" to uri's that have no "/"
@@ -276,11 +276,11 @@ yelp_util_resolve_relative_uri (const ch
 	return result;
 }
 
-char *
+gchar *
 yelp_util_node_to_string_path (GNode *node)
 {
-	char *str, *t;
-	char *escaped_node_name;
+	gchar *str, *t;
+	gchar *escaped_node_name;
 	YelpSection *section;
 
 	section = node->data;
@@ -304,10 +304,10 @@ yelp_util_node_to_string_path (GNode *no
 }
 
 static GNode *
-yelp_util_string_path_to_node_helper (char  **path,
+yelp_util_string_path_to_node_helper (gchar  **path,
 				      GNode  *node)
 {
-	char *unescaped_pathname;
+	gchar *unescaped_pathname;
 	YelpSection *section;
 		
 	if (*path == NULL) {
@@ -347,10 +347,10 @@ yelp_util_string_path_to_node_helper (ch
 
      
 GNode *
-yelp_util_string_path_to_node (const char *string_path,
+yelp_util_string_path_to_node (const gchar *string_path,
 			       GNode      *root)
 {
-	char **path;
+	gchar **path;
 	GNode *node;
 
 	path = g_strsplit (string_path, "/", 0);
@@ -365,7 +365,7 @@ yelp_util_string_path_to_node (const cha
 
 GNode *
 yelp_util_decompose_path_url (GNode       *root,
-			      const char  *path_url,
+			      const gchar  *path_url,
 			      gchar      **embedded_url)
 {
 	const gchar *first_part;
@@ -399,11 +399,11 @@ yelp_util_decompose_path_url (GNode     
 	return res;
 }
 
-char *
+gchar *
 yelp_util_compose_path_url (GNode      *node,
-			    const char *embedded_url)
+			    const gchar *embedded_url)
 {
-	char *path;
+	gchar *path;
 
 	path = yelp_util_node_to_string_path (node);
 
--- yelp/src/yelp-view-toc.c	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-view-toc.c	Sun Feb 24 10:39:22 2002
@@ -58,7 +58,7 @@ enum {
 static gint signals[LAST_SIGNAL] = { 0 };
 
 typedef struct {
-	char *title;
+	gchar *title;
 	GList *seriesids;
 } YelpImportantDocsSection;
 
@@ -69,8 +69,8 @@ struct _YelpViewTOCPriv {
 	HtmlDocument *doc;
 	GNode        *doc_tree;
 	GList        *important_sections;
-	char          buffer[BUFFER_SIZE];
-	int           buffer_pos;
+	gchar          buffer[BUFFER_SIZE];
+	gint           buffer_pos;
 };
 
 GType
@@ -167,10 +167,10 @@ yelp_view_toc_close (YelpViewTOC *view)
 }
 
 static void
-yelp_view_toc_write (YelpViewTOC *view, char *data, int len)
+yelp_view_toc_write (YelpViewTOC *view, gchar *data, gint len)
 {
 	YelpViewTOCPriv *priv = view->priv;
-	int chunk_size;
+	gint chunk_size;
 	
 	if (len < 0) {
 		len = strlen (data);
@@ -197,7 +197,7 @@ yelp_view_toc_write (YelpViewTOC *view, 
 }
 
 static void
-yelp_view_toc_printf (YelpViewTOC *view, char *format, ...)
+yelp_view_toc_printf (YelpViewTOC *view, gchar *format, ...)
 {
   va_list args;
   gchar *string;
@@ -214,9 +214,9 @@ yelp_view_toc_printf (YelpViewTOC *view,
 }
 
 static void
-yelp_view_toc_write_header (YelpViewTOC *view, char *title)
+yelp_view_toc_write_header (YelpViewTOC *view, gchar *title)
 {
-	char *header="\n"
+	gchar *header="\n"
 "<html>\n"
 "  <head>\n"
 "    <title>\n"
@@ -231,7 +231,7 @@ yelp_view_toc_write_header (YelpViewTOC 
 "    </style>\n"
 "  </head>\n"
 "  <body bgcolor=\"#ffffff\">";
-	char *s;
+	gchar *s;
 
 	s = g_strdup_printf (header, title);
 
@@ -243,7 +243,7 @@ yelp_view_toc_write_header (YelpViewTOC 
 static void
 yelp_view_toc_write_footer (YelpViewTOC *view)
 {
-	char *footer="\n"
+	gchar *footer="\n"
 "  </body>\n"
 "</html>\n";
 	yelp_view_toc_write (view, footer, -1);
@@ -264,9 +264,9 @@ yelp_view_toc_start (YelpViewTOC *view)
 "      </tr>\n"
 "    </table>\n"
 "   </center>\n";
-	char            *seriesid;
+	gchar            *seriesid;
 	GNode           *root;
-	char            *path;
+	gchar            *path;
 	GList           *sections, *seriesids;
 	gchar           *other_docs_string = _("Other document systems");
 	gchar           *man_string = _("Manual pages");
@@ -379,10 +379,10 @@ yelp_view_toc_start (YelpViewTOC *view)
 	yelp_view_toc_close (view);
 }
 
-static char *
+static gchar *
 yelp_view_toc_full_path_name (YelpViewTOC *view, GNode *node) 
 {
-	char *str, *t;		
+	gchar *str, *t;		
 	YelpSection *section;
 
 	section = node->data;
@@ -414,8 +414,8 @@ yelp_view_toc_man_emit (YelpViewTOC *vie
 	GNode *node, *child;
 	YelpSection *section;
 	gboolean got_a_leaf;
-	char *path, *url;
-	int i;
+	gchar *path, *url;
+	gint i;
 
 	priv = view->priv;
 
@@ -507,7 +507,7 @@ yelp_view_toc_man_1 (YelpViewTOC *view)
 	YelpViewTOCPriv *priv;
 	GNode           *root, *node, *child;
 	YelpSection     *section;
-	char            *path;
+	gchar            *path;
 	gchar           *string = _("Manual page sections");
 	
 	priv = view->priv;
@@ -554,7 +554,7 @@ yelp_view_toc_info (YelpViewTOC *view)
 	YelpViewTOCPriv *priv;
 	GNode           *root, *node;
 	YelpSection     *section;
-	char            *url;
+	gchar            *url;
 	gchar           *string = _("Info pages");
 	
 	priv = view->priv;
@@ -674,7 +674,7 @@ yelp_view_toc_scrollkeeper (YelpViewTOC 
 	GNode           *node, *child;
 	YelpSection     *section;
 	gboolean         got_a_leaf;
-	char            *path;
+	gchar            *path;
 	gchar           *name;
 	gchar           *string = _("Scrollkeeper docs for category");
 
@@ -733,10 +733,10 @@ yelp_view_toc_scrollkeeper (YelpViewTOC 
 
 
 void
-yelp_view_toc_open_url (YelpViewTOC *view, const char *url)
+yelp_view_toc_open_url (YelpViewTOC *view, const gchar *url)
 {
-	const char *toc_type;
-	const char *path_string;
+	const gchar *toc_type;
+	const gchar *path_string;
 	GNode *node;
 	
 	g_assert (strncmp (url, "toc:", 4) == 0);
--- yelp/src/yelp-window.c	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-window.c	Sun Feb 24 10:39:22 2002
@@ -51,8 +51,8 @@ static void        yw_populate          
 static gboolean    yw_handle_url             (YelpWindow          *window,
 					      const gchar         *url);
 static void        yw_url_selected_cb        (gpointer             view,
-					      char                *url,
-					      char                *base_url,
+					      gchar                *url,
+					      gchar                *base_url,
 					      gboolean             handled,
 					      YelpWindow          *window);
 static void        yw_toggle_history_buttons (GtkWidget           *button,
@@ -278,8 +278,8 @@ yw_handle_url (YelpWindow *window, const
 
 static void
 yw_url_selected_cb (gpointer    view,
-		    char       *url,
-		    char       *base_url,
+		    gchar       *url,
+		    gchar       *base_url,
 		    gboolean    handled,
 		    YelpWindow *window)
 {
--- yelp/src/gtktreemodelfilter.h	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/gtktreemodelfilter.h	Sun Feb 24 10:39:22 2002
@@ -68,7 +68,7 @@ struct _GtkTreeModelFilterClass
   GObjectClass parent_class;
 };
 
-GtkType       gtk_tree_model_filter_get_type                   (void);
+GType       gtk_tree_model_filter_get_type                   (void);
 GtkTreeModel *gtk_tree_model_filter_new_with_model             (GtkTreeModel       *child_model,
 								gint                filter_column,
 								GtkTreePath        *virtual_root);
--- yelp/src/yelp-html.h	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-html.h	Sun Feb 24 10:39:22 2002
@@ -50,8 +50,8 @@ struct _YelpHtmlClass {
 
 	/* Signals */
 	void (*url_selected)   (YelpHtml  *view,
-				char      *url,
-				char      *base_url,
+				gchar      *url,
+				gchar      *base_url,
 				gboolean   handled);
 };
 
--- yelp/src/yelp-util.h	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-util.h	Sun Feb 24 10:39:22 2002
@@ -34,7 +34,7 @@ GNode *  yelp_util_string_path_to_node  
 
 GNode *  yelp_util_decompose_path_url       (GNode         *root,
 					     const gchar   *path_url,
-					     char         **embedded_url);
+					     gchar         **embedded_url);
 gchar *  yelp_util_compose_path_url         (GNode         *node,
 					     const gchar   *embedded_url);
 
--- yelp/src/yelp-view-toc.h	Sun Feb 24 10:39:01 2002
+++ yelp-new/src/yelp-view-toc.h	Sun Feb 24 10:39:22 2002
@@ -50,14 +50,14 @@ struct _YelpViewTOCClass {
 
 
 	void (*url_selected)   (YelpViewTOC   *view,
-				char          *url,
-				char          *base_url,
+				gchar          *url,
+				gchar          *base_url,
 				gboolean       handled);
 };
 
 GType           yelp_view_toc_get_type       (void);
 GtkWidget      *yelp_view_toc_new            (GNode        *doc_tree);
 void            yelp_view_toc_open_url       (YelpViewTOC  *view,
-					      const char   *url);
+					      const gchar   *url);
 
 #endif /* __YELP_VIEW_TOC__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]