Author: miguel
Date: 2006-10-06 17:11:07 -0400 (Fri, 06 Oct 2006)
New Revision: 66378
Modified:
trunk/mono/eglib/ChangeLog
trunk/mono/eglib/TODO
trunk/mono/eglib/src/glib.h
trunk/mono/eglib/src/gstr.c
Log:
2006-10-06 Miguel de Icaza <[EMAIL PROTECTED]>
* src/gstr.c (g_ascii_strdown): Implement.
* str/glib.c (g_log_set_handler): empty.
(g_printerr): empty.
(GMemVTable): define, empty, ignored.
(G_USEC_PER_SEC) :-)
Modified: trunk/mono/eglib/ChangeLog
===================================================================
--- trunk/mono/eglib/ChangeLog 2006-10-06 21:00:14 UTC (rev 66377)
+++ trunk/mono/eglib/ChangeLog 2006-10-06 21:11:07 UTC (rev 66378)
@@ -1,5 +1,11 @@
2006-10-06 Miguel de Icaza <[EMAIL PROTECTED]>
+ * src/gstr.c (g_ascii_strdown): Implement.
+
+ * str/glib.c (g_log_set_handler): empty.
+ (g_printerr): empty.
+ (GMemVTable): define, empty, ignored.
+
* src/gunicode.c (g_convert): Add bytes_read, bytes_written
support; Small fixes to avoid valgrind errors.
Modified: trunk/mono/eglib/TODO
===================================================================
--- trunk/mono/eglib/TODO 2006-10-06 21:00:14 UTC (rev 66377)
+++ trunk/mono/eglib/TODO 2006-10-06 21:11:07 UTC (rev 66378)
@@ -19,21 +19,14 @@
3 g_thread_supported
3 g_thread_init
- * Information retrieval
- 1 g_win32_getlocale
-
* String manipulation
1 g_filename_from_utf8 [LIMITATION: UTF8 only today]
- 1 g_ascii_strdown
10 g_strlcpy
2 g_strdelimit
1 g_strescape
* Miscelaneous
3 g_spaced_primes_closest
- 2 g_printerr
- 1 g_mem_set_vtable
- 1 g_log_set_handler
Remove code from Mono:
@@ -43,10 +36,7 @@
Macros:
6 G_UNLIKELY
4 G_LIKELY
- 2 G_USEC_PER_SEC
2 G_STRLOC
- 1 G_SPAWN_SEARCH_PATH
- 1 G_ALLOC_ONLY
* Unimplemented, not supported currently:
@@ -63,5 +53,8 @@
g_dir_open, g_dir_close, g_dir_read_name
- We're missing a native windows implementation. The unix one is in place.
+ We're missing a native windows implementation. The unix one is in place.
+ * Information retrieval
+ 1 g_win32_getlocale
+
Modified: trunk/mono/eglib/src/glib.h
===================================================================
--- trunk/mono/eglib/src/glib.h 2006-10-06 21:00:14 UTC (rev 66377)
+++ trunk/mono/eglib/src/glib.h 2006-10-06 21:11:07 UTC (rev 66378)
@@ -52,6 +52,8 @@
#define G_STMT_START do
#define G_STMT_END while (0)
+#define G_USEC_PER_SEC 1000000
+
#define ABS(a,b) (((a)>(b)) ? ((a)-(b)) : ((b)-(a)))
#define G_STRUCT_OFFSET(p_type,field) \
@@ -77,6 +79,16 @@
gpointer g_memdup (gconstpointer mem, guint byte_size);
+typedef struct {
+ gpointer (*malloc) (gsize n_bytes);
+ gpointer (*realloc) (gpointer mem, gsize n_bytes);
+ void (*free) (gpointer mem);
+ gpointer (*calloc) (gsize n_blocks, gsize n_block_bytes);
+ gpointer (*try_malloc) (gsize n_bytes);
+ gpointer (*try_realloc) (gpointer mem, gsize n_bytes);
+} GMemVTable;
+
+#define g_mem_set_vtable(x)
/*
* Misc.
*/
@@ -417,6 +429,8 @@
#define g_message(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format)
#define g_debug(format...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format)
+#define g_log_set_handler(a,b,c,d)
+#define g_printerr(format...) fprintf (stderr, format)
/*
* Conversions
*/
@@ -660,6 +674,5 @@
gsize *bytes_read, gsize *bytes_written, GError
**error);
gboolean g_utf8_validate (const gchar *str, gssize max_len, const gchar
**end);
-
#endif
Modified: trunk/mono/eglib/src/gstr.c
===================================================================
--- trunk/mono/eglib/src/gstr.c 2006-10-06 21:00:14 UTC (rev 66377)
+++ trunk/mono/eglib/src/gstr.c 2006-10-06 21:11:07 UTC (rev 66378)
@@ -485,3 +485,26 @@
*string = tolower (*string);
}
}
+
+gchar *
+g_ascii_strdown (const gchar *str, gssize len)
+{
+ char *ret;
+ int i;
+
+ g_return_val_if_fail (str != NULL, NULL);
+
+ if (len == -1)
+ len = strlen (str);
+
+ ret = g_malloc (len + 1);
+ for (i = 0; i < len; i++){
+ guchar c = (guchar) str [i];
+ if (c >= 'A' && c <= 'Z')
+ c += 'a' - 'A';
+ ret [i] = c;
+ }
+ ret [i] = 0;
+
+ return ret;
+}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches