diff -ru3 -N -x CVS /home/src/gnomecvs/glib/configure.in ./configure.in --- /home/src/gnomecvs/glib/configure.in Tue Aug 18 15:04:28 1998 +++ ./configure.in Thu Aug 20 10:03:25 1998 @@ -131,7 +131,15 @@ AC_CHECK_HEADERS(float.h, AC_DEFINE(HAVE_FLOAT_H)) AC_CHECK_HEADERS(limits.h, AC_DEFINE(HAVE_LIMITS_H)) +AC_CHECK_HEADERS(unistd.h, AC_DEFINE(HAVE_UNISTD_H)) AC_CHECK_HEADERS(values.h, AC_DEFINE(HAVE_VALUES_H)) +AC_CHECK_HEADERS(pwd.h, AC_DEFINE(HAVE_PWD_H)) +AC_CHECK_HEADERS(sys/param.h, AC_DEFINE(HAVE_SYS_PARAM_H)) +AC_CHECK_HEADERS(sys/time.h, AC_DEFINE(HAVE_SYS_TIME_H)) +AC_CHECK_HEADERS(sys/times.h, AC_DEFINE(HAVE_SYS_TIMES_H)) + +# Check for lstat +AC_CHECK_FUNCS(lstat) # Check for strerror, strsignal, memmove, vsnprintf, and strcasecmp functions AC_CHECK_FUNCS(strerror strsignal memmove vsnprintf strcasecmp) diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gerror.c ./gerror.c --- /home/src/gnomecvs/glib/gerror.c Tue Aug 18 15:04:28 1998 +++ ./gerror.c Thu Aug 20 10:03:25 1998 @@ -20,13 +20,19 @@ #include #include #include +#include "glib.h" +#ifdef HAVE_SYS_TIME_H #include +#endif +#ifdef HAVE_SYS_TIMES_H #include +#endif #include #include +#ifdef HAVE_UNISTD_H #include -#include "glib.h" +#endif #ifdef HAVE_SYS_SELECT_H #include @@ -119,6 +125,7 @@ debug (const char *progname, int method) { +#ifndef NATIVE_WIN32 pid_t pid; char buf[16]; char *args[4] = { "gdb", NULL, NULL, NULL }; @@ -152,11 +159,15 @@ x = 1; while (x) ; +#else + abort (); +#endif } static void stack_trace (char **args) { +#ifndef NATIVE_WIN32 pid_t pid; int in_fd[2]; int out_fd[2]; @@ -251,6 +262,9 @@ close (out_fd[0]); close (out_fd[1]); _exit (0); +#else + abort (); +#endif } static void diff -ru3 -N -x CVS /home/src/gnomecvs/glib/glib.h ./glib.h --- /home/src/gnomecvs/glib/glib.h Tue Aug 18 15:04:44 1998 +++ ./glib.h Thu Aug 20 10:07:40 1998 @@ -34,6 +34,45 @@ #endif +/* When compiling glib on Win32 (with another compiler than gcc), we + * must tell the compiler which functions and variables are to be + * exported from the DLL. And correspondingly, when compiling code + * that uses glib, we must tell the compiler that the glib functions + * and variables are imported from a DLL. + */ + +#ifdef NATIVE_WIN32 +#ifdef COMPILING_GLIB +#define GLIBAPI __declspec(dllexport) + +/* Watcom 10.6 uses its own object file format, and apparently + severely confuses its linker if several source files of a dll are + compiled with __declspec(dllexport) for the same variable + declaration, even if only one has the definition. With MSVC no + problem, but doesn't harm to do like with Watcom. */ + +#ifdef GUTILS_C +#define GLIBVAR1 __declspec(dllexport) +#else +#define GLIBVAR1 extern +#endif +#ifdef GMESSAGE_C +#define GLIBVAR2 __declspec(dllexport) +#else +#define GLIBVAR2 extern +#endif +#else +#define GLIBAPI __declspec(dllimport) +#define GLIBVAR1 __declspec(dllimport) +#define GLIBVAR2 __declspec(dllimport) +#endif +#else +#define GLIBAPI extern +#define GLIBVAR1 extern +#define GLIBVAR2 extern +#endif + + /* glib provides definitions for the extrema of many * of the standard types. These are: * G_MINFLOAT @@ -488,11 +527,11 @@ /* Glib version. */ -extern const guint glib_major_version; -extern const guint glib_minor_version; -extern const guint glib_micro_version; -extern const guint glib_interface_age; -extern const guint glib_binary_age; +GLIBVAR1 const guint glib_major_version; +GLIBVAR1 const guint glib_minor_version; +GLIBVAR1 const guint glib_micro_version; +GLIBVAR1 const guint glib_interface_age; +GLIBVAR1 const guint glib_binary_age; /* Forward declarations of glib types. @@ -654,43 +693,64 @@ /* Doubly linked lists */ +GLIBAPI GList* g_list_alloc (void); +GLIBAPI void g_list_free (GList *list); +GLIBAPI void g_list_free_1 (GList *list); +GLIBAPI GList* g_list_append (GList *list, gpointer data); +GLIBAPI GList* g_list_prepend (GList *list, gpointer data); +GLIBAPI GList* g_list_insert (GList *list, gpointer data, gint position); +GLIBAPI GList* g_list_insert_sorted (GList *list, gpointer data, GCompareFunc func); +GLIBAPI GList* g_list_concat (GList *list1, GList *list2); +GLIBAPI GList* g_list_remove (GList *list, gpointer data); +GLIBAPI GList* g_list_remove_link (GList *list, GList *llink); +GLIBAPI GList* g_list_reverse (GList *list); +GLIBAPI GList* g_list_nth (GList *list, guint n); +GLIBAPI GList* g_list_find (GList *list, gpointer data); +GLIBAPI GList* g_list_find_custom (GList *list, gpointer data, GCompareFunc func); +GLIBAPI gint g_list_position (GList *list, GList *llink); +GLIBAPI gint g_list_index (GList *list, gpointer data); +GLIBAPI GList* g_list_last (GList *list); +GLIBAPI GList* g_list_first (GList *list); +GLIBAPI guint g_list_length (GList *list); +GLIBAPI void g_list_foreach (GList *list, GFunc func, gpointer user_data); +GLIBAPI gpointer g_list_nth_data (GList *list, guint n); #define g_list_previous(list) ((list) ? (((GList *)(list))->prev) : NULL) @@ -699,42 +759,62 @@ /* Singly linked lists */ +GLIBAPI GSList* g_slist_alloc (void); +GLIBAPI void g_slist_free (GSList *list); +GLIBAPI void g_slist_free_1 (GSList *list); +GLIBAPI GSList* g_slist_append (GSList *list, gpointer data); +GLIBAPI GSList* g_slist_prepend (GSList *list, gpointer data); +GLIBAPI GSList* g_slist_insert (GSList *list, gpointer data, gint position); +GLIBAPI GSList* g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func); +GLIBAPI GSList* g_slist_concat (GSList *list1, GSList *list2); +GLIBAPI GSList* g_slist_remove (GSList *list, gpointer data); +GLIBAPI GSList* g_slist_remove_link (GSList *list, GSList *llink); +GLIBAPI GSList* g_slist_reverse (GSList *list); +GLIBAPI GSList* g_slist_nth (GSList *list, guint n); +GLIBAPI GSList* g_slist_find (GSList *list, gpointer data); +GLIBAPI GSList* g_slist_find_custom (GSList *list, gpointer data, GCompareFunc func); +GLIBAPI gint g_slist_position (GSList *list, GSList *llink); +GLIBAPI gint g_slist_index (GSList *list, gpointer data); +GLIBAPI GSList* g_slist_last (GSList *list); +GLIBAPI guint g_slist_length (GSList *list); +GLIBAPI void g_slist_foreach (GSList *list, GFunc func, gpointer user_data); +GLIBAPI gpointer g_slist_nth_data (GSList *list, guint n); #define g_slist_next(slist) ((slist) ? (((GSList *)(slist))->next) : NULL) @@ -742,38 +822,53 @@ /* List Allocators */ +GLIBAPI GListAllocator* g_list_allocator_new (void); +GLIBAPI void g_list_allocator_free (GListAllocator* allocator); +GLIBAPI GListAllocator* g_slist_set_allocator (GListAllocator* allocator); +GLIBAPI GListAllocator* g_list_set_allocator (GListAllocator* allocator); /* Hash tables */ +GLIBAPI GHashTable* g_hash_table_new (GHashFunc hash_func, GCompareFunc key_compare_func); +GLIBAPI void g_hash_table_destroy (GHashTable *hash_table); +GLIBAPI void g_hash_table_insert (GHashTable *hash_table, gpointer key, gpointer value); +GLIBAPI void g_hash_table_remove (GHashTable *hash_table, gconstpointer key); +GLIBAPI gpointer g_hash_table_lookup (GHashTable *hash_table, gconstpointer key); +GLIBAPI gboolean g_hash_table_lookup_extended(GHashTable *hash_table, gconstpointer lookup_key, gpointer *orig_key, gpointer *value); +GLIBAPI void g_hash_table_freeze (GHashTable *hash_table); +GLIBAPI void g_hash_table_thaw (GHashTable *hash_table); +GLIBAPI void g_hash_table_foreach (GHashTable *hash_table, GHFunc func, gpointer user_data); +GLIBAPI gint g_hash_table_size (GHashTable *hash_table); /* Caches */ +GLIBAPI GCache* g_cache_new (GCacheNewFunc value_new_func, GCacheDestroyFunc value_destroy_func, GCacheDupFunc key_dup_func, @@ -781,14 +876,19 @@ GHashFunc hash_key_func, GHashFunc hash_value_func, GCompareFunc key_compare_func); +GLIBAPI void g_cache_destroy (GCache *cache); +GLIBAPI gpointer g_cache_insert (GCache *cache, gpointer key); +GLIBAPI void g_cache_remove (GCache *cache, gpointer value); +GLIBAPI void g_cache_key_foreach (GCache *cache, GHFunc func, gpointer user_data); +GLIBAPI void g_cache_value_foreach (GCache *cache, GHFunc func, gpointer user_data); @@ -796,23 +896,32 @@ /* Balanced binary trees */ +GLIBAPI GTree* g_tree_new (GCompareFunc key_compare_func); +GLIBAPI void g_tree_destroy (GTree *tree); +GLIBAPI void g_tree_insert (GTree *tree, gpointer key, gpointer value); +GLIBAPI void g_tree_remove (GTree *tree, gpointer key); +GLIBAPI gpointer g_tree_lookup (GTree *tree, gpointer key); +GLIBAPI void g_tree_traverse (GTree *tree, GTraverseFunc traverse_func, GTraverseType traverse_type, gpointer data); +GLIBAPI gpointer g_tree_search (GTree *tree, GSearchFunc search_func, gpointer data); +GLIBAPI gint g_tree_height (GTree *tree); +GLIBAPI gint g_tree_nnodes (GTree *tree); @@ -833,23 +942,34 @@ ((GNode*) (node))->next == NULL) #define G_NODE_IS_LEAF(node) (((GNode*) (node))->children == NULL) +GLIBAPI GNode* g_node_new (gpointer data); +GLIBAPI void g_node_destroy (GNode *root); +GLIBAPI void g_node_unlink (GNode *node); +GLIBAPI GNode* g_node_insert (GNode *parent, gint position, GNode *node); +GLIBAPI GNode* g_node_insert_before (GNode *parent, GNode *sibling, GNode *node); +GLIBAPI GNode* g_node_prepend (GNode *parent, GNode *node); +GLIBAPI guint g_node_n_nodes (GNode *root, GTraverseFlags flags); +GLIBAPI GNode* g_node_get_root (GNode *node); +GLIBAPI gboolean g_node_is_ancestor (GNode *node, GNode *descendant); +GLIBAPI guint g_node_depth (GNode *node); +GLIBAPI GNode* g_node_find (GNode *root, GTraverseType order, GTraverseFlags flags, @@ -872,6 +992,7 @@ * this function is just a high level interface to * low level traversal functions, optimized for speed. */ +GLIBAPI void g_node_traverse (GNode *root, GTraverseType order, GTraverseFlags flags, @@ -884,26 +1005,37 @@ * adding `guint height' to struct _GNode, but then again, this is not very * often needed, and would make g_node_insert() more time consuming. */ +GLIBAPI guint g_node_max_height (GNode *root); +GLIBAPI void g_node_children_foreach (GNode *node, GTraverseFlags flags, GNodeForeachFunc func, gpointer data); +GLIBAPI void g_node_reverse_children (GNode *node); +GLIBAPI guint g_node_n_children (GNode *node); +GLIBAPI GNode* g_node_nth_child (GNode *node, guint n); +GLIBAPI GNode* g_node_last_child (GNode *node); +GLIBAPI GNode* g_node_find_child (GNode *node, GTraverseFlags flags, gpointer data); +GLIBAPI gint g_node_child_position (GNode *node, GNode *child); +GLIBAPI gint g_node_child_index (GNode *node, gpointer data); +GLIBAPI GNode* g_node_first_sibling (GNode *node); +GLIBAPI GNode* g_node_last_sibling (GNode *node); #define g_node_prev_sibling(node) ((node) ? \ @@ -916,35 +1048,45 @@ /* Fatal error handlers */ +GLIBAPI void g_attach_process (const gchar *progname, gboolean query); +GLIBAPI void g_debug (const gchar *progname); +GLIBAPI void g_stack_trace (const gchar *progname, gboolean query); /* Logging mechanism */ -extern const gchar *g_log_domain_glib; + +GLIBVAR2 const gchar *g_log_domain_glib; +GLIBAPI guint g_log_set_handler (const gchar *log_domain, GLogLevelFlags log_levels, GLogFunc log_func, gpointer user_data); +GLIBAPI void g_log_remove_handler (const gchar *log_domain, guint handler_id); +GLIBAPI void g_log_default_handler (const gchar *log_domain, GLogLevelFlags log_level, const gchar *message, gpointer unused_data); +GLIBAPI void g_log (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, ...) G_GNUC_PRINTF (3, 4); +GLIBAPI void g_logv (const gchar *log_domain, GLogLevelFlags log_level, const gchar *format, va_list *args1, va_list *args2); +GLIBAPI GLogLevelFlags g_log_set_fatal_mask (const gchar *log_domain, GLogLevelFlags fatal_mask); #ifndef G_LOG_DOMAIN @@ -991,11 +1133,15 @@ #endif /* !__GNUC__ */ typedef void (*GPrintFunc) (const gchar *string); +GLIBAPI void g_print (const gchar *format, ...) G_GNUC_PRINTF (1, 2); +GLIBAPI GPrintFunc g_set_print_handler (GPrintFunc func); +GLIBAPI void g_printerr (const gchar *format, ...) G_GNUC_PRINTF (1, 2); +GLIBAPI GPrintFunc g_set_printerr_handler (GPrintFunc func); /* deprecated compatibility functions, use g_log_set_handler() instead */ @@ -1017,15 +1163,21 @@ #else /* !USE_DMALLOC */ +GLIBAPI gpointer g_malloc (gulong size); +GLIBAPI gpointer g_malloc0 (gulong size); +GLIBAPI gpointer g_realloc (gpointer mem, gulong size); +GLIBAPI void g_free (gpointer mem); #endif /* !USE_DMALLOC */ +GLIBAPI void g_mem_profile (void); +GLIBAPI void g_mem_check (gpointer mem); @@ -1051,17 +1203,25 @@ #define G_ALLOC_ONLY 1 #define G_ALLOC_AND_FREE 2 +GLIBAPI GMemChunk* g_mem_chunk_new (gchar *name, gint atom_size, gulong area_size, gint type); +GLIBAPI void g_mem_chunk_destroy (GMemChunk *mem_chunk); +GLIBAPI gpointer g_mem_chunk_alloc (GMemChunk *mem_chunk); +GLIBAPI void g_mem_chunk_free (GMemChunk *mem_chunk, gpointer mem); +GLIBAPI void g_mem_chunk_clean (GMemChunk *mem_chunk); +GLIBAPI void g_mem_chunk_reset (GMemChunk *mem_chunk); +GLIBAPI void g_mem_chunk_print (GMemChunk *mem_chunk); +GLIBAPI void g_mem_chunk_info (void); /* Ah yes...we have a "g_blow_chunks" function. @@ -1072,16 +1232,23 @@ * much better name than "g_mem_chunk_clean_all" or something * similar. */ +GLIBAPI void g_blow_chunks (void); /* Timer */ +GLIBAPI GTimer* g_timer_new (void); +GLIBAPI void g_timer_destroy (GTimer *timer); +GLIBAPI void g_timer_start (GTimer *timer); +GLIBAPI void g_timer_stop (GTimer *timer); +GLIBAPI void g_timer_reset (GTimer *timer); +GLIBAPI gdouble g_timer_elapsed (GTimer *timer, gulong *microseconds); @@ -1089,51 +1256,73 @@ /* String utility functions */ #define G_STR_DELIMITERS "_-|> <." +GLIBAPI void g_strdelimit (gchar *string, const gchar *delimiters, gchar new_delimiter); +GLIBAPI gchar* g_strdup (const gchar *str); +GLIBAPI gchar* g_strconcat (const gchar *string1, ...); /* NULL terminated */ +GLIBAPI gdouble g_strtod (const gchar *nptr, gchar **endptr); +GLIBAPI gchar* g_strerror (gint errnum); +GLIBAPI gchar* g_strsignal (gint signum); +GLIBAPI gint g_strcasecmp (const gchar *s1, const gchar *s2); +GLIBAPI void g_strdown (gchar *string); +GLIBAPI void g_strup (gchar *string); +GLIBAPI void g_strreverse (gchar *string); /* Retrive static string info */ +GLIBAPI gchar* g_get_user_name (void); +GLIBAPI gchar* g_get_real_name (void); +GLIBAPI gchar* g_get_home_dir (void); +GLIBAPI gchar* g_get_tmp_dir (void); +GLIBAPI gchar* g_get_prgname (void); +GLIBAPI void g_set_prgname (const gchar *prgname); /* Miscellaneous utility functions */ +GLIBAPI guint g_parse_debug_string (const gchar *string, GDebugKey *keys, guint nkeys); +GLIBAPI gint g_snprintf (gchar *string, gulong n, gchar const *format, ...) G_GNUC_PRINTF (3, 4); +GLIBAPI gint g_vsnprintf (gchar *string, gulong n, gchar const *format, va_list *args1, va_list *args2); +GLIBAPI gchar* g_basename (const gchar *file_name); /* strings are newly allocated with g_malloc() */ +GLIBAPI gchar* g_dirname (const gchar *file_name); +GLIBAPI gchar* g_get_current_dir (void); /* We make the assumption that if memmove isn't available, then @@ -1198,46 +1387,66 @@ /* String Chunks */ +GLIBAPI GStringChunk* g_string_chunk_new (gint size); +GLIBAPI void g_string_chunk_free (GStringChunk *chunk); +GLIBAPI gchar* g_string_chunk_insert (GStringChunk *chunk, const gchar *string); +GLIBAPI gchar* g_string_chunk_insert_const (GStringChunk *chunk, const gchar *string); /* Strings */ +GLIBAPI GString* g_string_new (const gchar *init); +GLIBAPI GString* g_string_sized_new (guint dfl_size); +GLIBAPI void g_string_free (GString *string, gint free_segment); +GLIBAPI GString* g_string_assign (GString *lval, const gchar *rval); +GLIBAPI GString* g_string_truncate (GString *string, gint len); +GLIBAPI GString* g_string_append (GString *string, const gchar *val); +GLIBAPI GString* g_string_append_c (GString *string, gchar c); +GLIBAPI GString* g_string_prepend (GString *string, const gchar *val); +GLIBAPI GString* g_string_prepend_c (GString *string, gchar c); +GLIBAPI GString* g_string_insert (GString *string, gint pos, const gchar *val); +GLIBAPI GString* g_string_insert_c (GString *string, gint pos, gchar c); +GLIBAPI GString* g_string_erase (GString *string, gint pos, gint len); +GLIBAPI GString* g_string_down (GString *string); +GLIBAPI GString* g_string_up (GString *string); +GLIBAPI void g_string_sprintf (GString *string, const gchar *format, ...) G_GNUC_PRINTF (2, 3); +GLIBAPI void g_string_sprintfa (GString *string, const gchar *format, ...) G_GNUC_PRINTF (2, 3); @@ -1260,15 +1469,20 @@ #define g_array_index(array,type,index) \ ((type*) array->data)[index] +GLIBAPI GArray* g_array_new (gboolean zero_terminated); +GLIBAPI void g_array_free (GArray *array, gboolean free_segment); +GLIBAPI GArray* g_rarray_append (GArray *array, gpointer data, gint size); +GLIBAPI GArray* g_rarray_prepend (GArray *array, gpointer data, gint size); +GLIBAPI GArray* g_rarray_truncate (GArray *array, gint length, gint size); @@ -1279,15 +1493,21 @@ * cleared spot and shortens the array. */ #define g_ptr_array_index(array,index) (array->pdata)[index] +GLIBAPI GPtrArray* g_ptr_array_new (void); +GLIBAPI void g_ptr_array_free (GPtrArray *array, gboolean free_seg); +GLIBAPI void g_ptr_array_set_size (GPtrArray *array, gint length); +GLIBAPI void g_ptr_array_remove_index (GPtrArray *array, gint index); +GLIBAPI gboolean g_ptr_array_remove (GPtrArray *array, gpointer data); +GLIBAPI void g_ptr_array_add (GPtrArray *array, gpointer data); @@ -1295,57 +1515,76 @@ /* Byte arrays, an array of guint8. Implemented as a GArray, * but type-safe. */ +GLIBAPI GByteArray* g_byte_array_new (void); +GLIBAPI void g_byte_array_free (GByteArray *array, gint free_segment); +GLIBAPI GByteArray* g_byte_array_append (GByteArray *array, const guint8 *data, guint len); +GLIBAPI GByteArray* g_byte_array_prepend (GByteArray *array, const guint8 *data, guint len); +GLIBAPI GByteArray* g_byte_array_truncate (GByteArray *array, gint length); /* Hash Functions */ +GLIBAPI gint g_str_equal (gconstpointer v, gconstpointer v2); +GLIBAPI guint g_str_hash (gconstpointer v); +GLIBAPI gint g_int_equal (gconstpointer v, gconstpointer v2); +GLIBAPI guint g_int_hash (gconstpointer v); /* This "hash" function will just return the key's adress as an * unsigned integer. Useful for hashing on plain adresses or * simple integer values. */ +GLIBAPI guint g_direct_hash (gconstpointer v); +GLIBAPI gint g_direct_equal (gconstpointer v, gconstpointer v2); /* Quarks (string<->id association) */ +GLIBAPI GQuark g_quark_try_string (const gchar *string); +GLIBAPI GQuark g_quark_from_static_string (const gchar *string); +GLIBAPI GQuark g_quark_from_string (const gchar *string); +GLIBAPI gchar* g_quark_to_string (GQuark quark); /* Location Associated Data */ +GLIBAPI void g_dataset_destroy (gconstpointer dataset_location); +GLIBAPI gpointer g_dataset_id_get_data (gconstpointer dataset_location, GQuark key_id); +GLIBAPI void g_dataset_id_set_data_full (gconstpointer dataset_location, GQuark key_id, gpointer data, GDestroyNotify destroy_func); +GLIBAPI void g_dataset_id_set_destroy (gconstpointer dataset_location, GQuark key_id, GDestroyNotify destroy_func); @@ -1523,40 +1762,60 @@ GScannerMsgFunc msg_handler; }; +GLIBAPI GScanner* g_scanner_new (GScannerConfig *config_templ); +GLIBAPI void g_scanner_destroy (GScanner *scanner); +GLIBAPI void g_scanner_input_file (GScanner *scanner, gint input_fd); +GLIBAPI void g_scanner_input_text (GScanner *scanner, const gchar *text, guint text_len); +GLIBAPI GTokenType g_scanner_get_next_token (GScanner *scanner); +GLIBAPI GTokenType g_scanner_peek_next_token (GScanner *scanner); +GLIBAPI GTokenType g_scanner_cur_token (GScanner *scanner); +GLIBAPI GValue g_scanner_cur_value (GScanner *scanner); +GLIBAPI guint g_scanner_cur_line (GScanner *scanner); +GLIBAPI guint g_scanner_cur_position (GScanner *scanner); +GLIBAPI gboolean g_scanner_eof (GScanner *scanner); +GLIBAPI guint g_scanner_set_scope (GScanner *scanner, guint scope_id); +GLIBAPI void g_scanner_scope_add_symbol (GScanner *scanner, guint scope_id, const gchar *symbol, gpointer value); +GLIBAPI void g_scanner_scope_remove_symbol (GScanner *scanner, guint scope_id, const gchar *symbol); +GLIBAPI gpointer g_scanner_scope_lookup_symbol (GScanner *scanner, guint scope_id, const gchar *symbol); +GLIBAPI void g_scanner_scope_foreach_symbol (GScanner *scanner, guint scope_id, GHFunc func, gpointer func_data); +GLIBAPI gpointer g_scanner_lookup_symbol (GScanner *scanner, const gchar *symbol); +GLIBAPI void g_scanner_freeze_symbol_table (GScanner *scanner); +GLIBAPI void g_scanner_thaw_symbol_table (GScanner *scanner); +GLIBAPI void g_scanner_unexp_token (GScanner *scanner, GTokenType expected_token, const gchar *identifier_spec, @@ -1564,12 +1823,15 @@ const gchar *symbol_name, const gchar *message, gint is_error); +GLIBAPI void g_scanner_error (GScanner *scanner, const gchar *format, ...) G_GNUC_PRINTF (2,3); +GLIBAPI void g_scanner_warn (GScanner *scanner, const gchar *format, ...) G_GNUC_PRINTF (2,3); +GLIBAPI gint g_scanner_stat_mode (const gchar *filename); /* keep downward source compatibility */ #define g_scanner_add_symbol( scanner, symbol, value ) G_STMT_START { \ @@ -1594,15 +1856,21 @@ GList* cache; }; +GLIBAPI GCompletion* g_completion_new (GCompletionFunc func); +GLIBAPI void g_completion_add_items (GCompletion* cmp, GList* items); +GLIBAPI void g_completion_remove_items (GCompletion* cmp, GList* items); +GLIBAPI void g_completion_clear_items (GCompletion* cmp); +GLIBAPI GList* g_completion_complete (GCompletion* cmp, gchar* prefix, gchar** new_prefix); +GLIBAPI void g_completion_free (GCompletion* cmp); @@ -1627,28 +1895,39 @@ * g_relation_count() counts ... */ +GLIBAPI GRelation* g_relation_new (gint fields); +GLIBAPI void g_relation_destroy (GRelation *relation); +GLIBAPI void g_relation_index (GRelation *relation, gint field, GHashFunc hash_func, GCompareFunc key_compare_func); +GLIBAPI void g_relation_insert (GRelation *relation, ...); +GLIBAPI gint g_relation_delete (GRelation *relation, gconstpointer key, gint field); +GLIBAPI GTuples* g_relation_select (GRelation *relation, gconstpointer key, gint field); +GLIBAPI gint g_relation_count (GRelation *relation, gconstpointer key, gint field); +GLIBAPI gboolean g_relation_exists (GRelation *relation, ...); +GLIBAPI void g_relation_print (GRelation *relation); +GLIBAPI void g_tuples_destroy (GTuples *tuples); +GLIBAPI gpointer g_tuples_index (GTuples *tuples, gint index, gint field); diff -ru3 -N -x CVS /home/src/gnomecvs/glib/glibconfig.h.in ./glibconfig.h.in --- /home/src/gnomecvs/glib/glibconfig.h.in Tue Aug 18 15:04:44 1998 +++ ./glibconfig.h.in Thu Aug 20 10:03:25 1998 @@ -24,9 +24,14 @@ #undef HAVE_FLOAT_H #undef HAVE_LIMITS_H #undef HAVE_LONG_DOUBLE +#undef HAVE_PWD_H +#undef HAVE_SYS_PARAM_H #undef HAVE_SYS_SELECT_H +#undef HAVE_SYS_TIME_H +#undef HAVE_SYS_TIMES_H #undef HAVE_STRERROR #undef HAVE_STRSIGNAL +#undef HAVE_UNISTD_H #undef HAVE_VSNPRINTF #undef HAVE_VALUES_H #undef HAVE_VPRINTF @@ -64,6 +69,9 @@ /* Define if you have the atexit function. */ #undef HAVE_ATEXIT +/* Define if you have the lstat function. */ +#undef HAVE_LSTAT + /* Define if you have the memmove function. */ #undef HAVE_MEMMOVE @@ -90,3 +98,9 @@ /* Define if you have the header file. */ #undef HAVE_VALUES_H + +/* Define if you are on Win32. */ +#undef WIN32 + +/* Define if you are on Win32 but not using the Cygnus emulation layer. */ +#undef NATIVE_WIN32 diff -ru3 -N -x CVS /home/src/gnomecvs/glib/glibconfig.h.win32 ./glibconfig.h.win32 --- /home/src/gnomecvs/glib/glibconfig.h.win32 Thu Jan 1 02:00:00 1970 +++ ./glibconfig.h.win32 Thu Aug 20 10:04:14 1998 @@ -0,0 +1,122 @@ +/* glibconfig.h.win32. Handcrafted for MSVC and Watcom. */ + +#if !(defined(_MSC_VER) || defined(__WATCOMC__)) +#error Unrecognized Win32 compiler, edit glibconfig.h by hand +#endif + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define if you don't have vprintf but do have _doprnt. */ +/* #undef HAVE_DOPRNT */ + +/* Define if you have the vprintf function. */ +#define HAVE_VPRINTF 1 + +/* Define as __inline if that's what the C compiler calls it. */ +#ifdef _MSC_VER +#define inline __inline +#elif defined __WATCOMC__ +#define inline +#endif + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* #undef ENABLE_MEM_CHECK */ +/* #undef ENABLE_MEM_PROFILE */ + +/* #undef G_COMPILED_WITH_DEBUGGING */ +/* #undef HAVE_BROKEN_WCTYPE */ +/* #undef HAVE_DOPRNT */ +/* #undef HAVE_LONG_DOUBLE */ +/* #undef HAVE_PWD_H */ +/* #undef HAVE_SYS_PARAM_H */ +/* #undef HAVE_SYS_SELECT_H */ +/* #undef HAVE_SYS_TIME_H */ +/* #undef HAVE_SYS_TIMES_H */ +#ifdef __WATCOMC__ +#define HAVE_UNISTD_H 1 +#else +/* #undef HAVE_UNISTD_H */ +#endif +/* #undef HAVE_VSNPRINTF */ +#define HAVE_VPRINTF 1 +#ifdef _MSC_VER +#define HAVE_WCHAR_H 1 +#define HAVE_WCTYPE_H 1 +#else +#undef HAVE_WCHAR_H +#undef HAVE_WCTYPE_H +#endif + +#define NO_FD_SET 1 +/* #undef NO_SYS_ERRLIST */ +#define NO_SYS_SIGLIST 1 + +#define GLIB_MAJOR_VERSION 1 +#define GLIB_MINOR_VERSION 1 +#define GLIB_MICRO_VERSION 3 +#define GLIB_INTERFACE_AGE 0 +#define GLIB_BINARY_AGE 0 + +/* The number of bytes in a char. */ +#define SIZEOF_CHAR 1 + +/* The number of bytes in a int. */ +#define SIZEOF_INT 4 + +/* The number of bytes in a long. */ +#define SIZEOF_LONG 4 + +/* The number of bytes in a long long. */ +/* #undef SIZEOF_LONG_LONG */ + +/* The number of bytes in a short. */ +#define SIZEOF_SHORT 2 + +/* The number of bytes in a void *. */ +#define SIZEOF_VOID_P 4 + +/* Define if you have the atexit function. */ +#define HAVE_ATEXIT 1 + +/* Define if you have the lstat function. */ +/* #undef HAVE_LSTAT */ + +/* Define if you have the memmove function. */ +#define HAVE_MEMMOVE 1 + +/* Define if you have the on_exit function. */ +/* #undef HAVE_ON_EXIT */ + +/* Define if you have the strcasecmp function. */ +/* #undef HAVE_STRCASECMP */ + +/* Define if you have the strerror function. */ +#define HAVE_STRERROR 1 + +/* Define if you have the strsignal function. */ +/* #undef HAVE_STRSIGNAL */ + +/* Define if you have the vsnprintf function. */ +/* #undef HAVE_VSNPRINTF */ + +/* Define if you have the header file. */ +#ifdef _MSC_VER +#define HAVE_FLOAT_H 1 +#else +/* #undef HAVE_FLOAT_H */ +#endif + +/* Define if you have the header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the header file. */ +/* #undef HAVE_VALUES_H */ + +/* Define if you are on Win32. */ +#define WIN32 1 + +/* Define if you are on Win32 but not using the Cygnus emulation layer. */ +#define NATIVE_WIN32 1 diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gmessages.c ./gmessages.c --- /home/src/gnomecvs/glib/gmessages.c Tue Aug 18 15:04:45 1998 +++ ./gmessages.c Thu Aug 20 10:03:25 1998 @@ -19,8 +19,23 @@ #include #include #include -#include +#define GMESSAGES_C #include "glib.h" +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef NATIVE_WIN32 +#include +#define NL "\r\n" +#define NLL 2 +static DWORD cchWritten; +#define write(fd, buf, len) \ + (WriteConsole (fd, buf, len, &cchWritten, NULL), cchWritten) +#else +#define NL "\n" +#define NLL 1 +#endif /* --- structures --- */ @@ -307,7 +322,11 @@ const gchar *message, gpointer unused_data) { +#ifdef NATIVE_WIN32 + HANDLE fd; +#else gint fd; +#endif gboolean in_recursion; gboolean is_fatal; @@ -318,7 +337,14 @@ if (!message) message = "g_log_default_handler(): (NULL) message"; +#ifdef NATIVE_WIN32 + /* Write to a Win32 console, allocate a new one if necessary. */ + AllocConsole (); + fd = GetStdHandle ((log_level >= G_LOG_LEVEL_MESSAGE) ? + STD_OUTPUT_HANDLE : STD_ERROR_HANDLE); +#else fd = (log_level >= G_LOG_LEVEL_MESSAGE) ? 1 : 2; +#endif switch (log_level) { @@ -332,40 +358,40 @@ /* use write(2) for output, in case we are out of memeory */ if (log_domain) { - write (fd, "\n", 1); + write (fd, NL, NLL); write (fd, log_domain, strlen (log_domain)); write (fd, "-", 1); } else - write (fd, "\n** ", 4); + write (fd, NL "** ", NLL+3); if (in_recursion) write (fd, "ERROR (recursed) **: ", 21); else write (fd, "ERROR **: ", 10); write (fd, message, strlen(message)); if (is_fatal) - write (fd, "\naborting...\n", 13); + write (fd, NL "aborting..." NL, 2*NLL+11); else - write (fd, "\n", 1); + write (fd, NL, NLL); break; case G_LOG_LEVEL_CRITICAL: if (log_domain) { - write (fd, "\n", 1); + write (fd, NL, NLL); write (fd, log_domain, strlen (log_domain)); write (fd, "-", 1); } else - write (fd, "\n** ", 4); + write (fd, NL "** ", NLL + 3); if (in_recursion) write (fd, "CRITICAL (recursed) **: ", 24); else write (fd, "CRITICAL **: ", 13); write (fd, message, strlen(message)); if (is_fatal) - write (fd, "\naborting...\n", 13); + write (fd, NL "aborting..." NL, 2*NLL+11); else - write (fd, "\n", 1); + write (fd, NL, NLL); break; case G_LOG_LEVEL_WARNING: if (!log_domain && glib_warning_func) @@ -376,21 +402,21 @@ } if (log_domain) { - write (fd, "\n", 1); + write (fd, NL, NLL); write (fd, log_domain, strlen (log_domain)); write (fd, "-", 1); } else - write (fd, "\n** ", 4); + write (fd, NL "** ", NLL+3); if (in_recursion) write (fd, "WARNING (recursed) **: ", 23); else write (fd, "WARNING **: ", 12); write (fd, message, strlen(message)); if (is_fatal) - write (fd, "\naborting...\n", 13); + write (fd, NL "aborting..." NL, 2*NLL+11); else - write (fd, "\n", 1); + write (fd, NL, NLL); break; case G_LOG_LEVEL_MESSAGE: if (!log_domain && glib_message_func) @@ -410,9 +436,9 @@ write (fd, "Message: ", 9); write (fd, message, strlen(message)); if (is_fatal) - write (fd, "\naborting...\n", 13); + write (fd, NL "aborting..." NL, 2*NLL+11); else - write (fd, "\n", 1); + write (fd, NL, NLL); break; case G_LOG_LEVEL_INFO: if (log_domain) @@ -426,9 +452,9 @@ write (fd, "INFO: ", 6); write (fd, message, strlen(message)); if (is_fatal) - write (fd, "\naborting...\n", 13); + write (fd, NL "aborting..." NL, 2*NLL+11); else - write (fd, "\n", 1); + write (fd, NL, NLL); break; case G_LOG_LEVEL_DEBUG: if (log_domain) @@ -442,9 +468,9 @@ write (fd, "DEBUG: ", 7); write (fd, message, strlen(message)); if (is_fatal) - write (fd, "\naborting...\n", 13); + write (fd, NL "aborting..." NL, 2*NLL+11); else - write (fd, "\n", 1); + write (fd, NL, NLL); break; default: /* we are used for a log level that is not defined by GLib itself, @@ -481,9 +507,9 @@ write (fd, "): ", 3); write (fd, message, strlen(message)); if (is_fatal) - write (fd, "\naborting...\n", 13); + write (fd, NL "aborting..." NL, 2*NLL+11); else - write (fd, "\n", 1); + write (fd, NL, NLL); break; } } diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gmodule/gmodule.c ./gmodule/gmodule.c --- /home/src/gnomecvs/glib/gmodule/gmodule.c Tue Aug 18 15:04:55 1998 +++ ./gmodule/gmodule.c Thu Aug 20 10:03:25 1998 @@ -107,6 +107,8 @@ #include "gmodule-dl.c" #elif (G_MODULE_IMPL == G_MODULE_IMPL_DLD) #include "gmodule-dld.c" +#elif (G_MODULE_IMPL == G_MODULE_IMPL_WIN32) +#include "gmodule-win32.c" #else #undef CHECK_ERROR #define CHECK_ERROR(rv) { g_module_set_error ("unsupported"); return rv; } diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gmodule/gmodule.h ./gmodule/gmodule.h --- /home/src/gnomecvs/glib/gmodule/gmodule.h Tue Aug 18 15:04:55 1998 +++ ./gmodule/gmodule.h Thu Aug 20 10:03:25 1998 @@ -25,16 +25,26 @@ #pragma } #endif /* __cplusplus */ -extern const char *g_log_domain_gmodule; #include /* exporting and importing functions, * we need autoconf support here to feature Windows dll stubs. */ -#define G_MODULE_IMPORT extern -#define G_MODULE_EXPORT +#ifdef NATIVE_WIN32 +#ifdef COMPILING_GMODULE +#define GMODULEAPI __declspec(dllexport) +#else +#define GMODULEAPI __declspec(dllimport) +#endif +#define G_MODULE_EXPORT __declspec(dllexport) +#else +#define GMODULEAPI extern +#define G_MODULE_EXPORT +#endif + +GMODULEAPI const char *g_log_domain_gmodule; typedef enum { @@ -43,28 +53,36 @@ } GModuleFlags; typedef struct _GModule GModule; +GMODULEAPI typedef const gchar* (*GModuleCheckInit) (GModule *module); +GMODULEAPI typedef void (*GModuleDeInit) (GModule *module); /* return TRUE if dynamic module loading is supported */ +GMODULEAPI gboolean g_module_supported (void); /* open a module `file_name' and return handle, which is NULL on error */ +GMODULEAPI GModule* g_module_open (const gchar *file_name, GModuleFlags flags); /* close a previously opened module, returns TRUE on success */ +GMODULEAPI gboolean g_module_close (GModule *module); /* query the last module error as a string */ +GMODULEAPI gchar* g_module_error (void); /* retrive a symbol pointer from `module', returns TRUE on success */ +GMODULEAPI gboolean g_module_symbol (GModule *module, const gchar *symbol_name, gpointer *symbol); /* retrive the file name from an existing module */ +GMODULEAPI gchar* g_module_name (GModule *module); diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gmodule/gmoduleconf.h.in ./gmodule/gmoduleconf.h.in --- /home/src/gnomecvs/glib/gmodule/gmoduleconf.h.in Tue Aug 18 15:04:55 1998 +++ ./gmodule/gmoduleconf.h.in Thu Aug 20 10:03:25 1998 @@ -29,6 +29,7 @@ #define G_MODULE_IMPL_NONE 0 #define G_MODULE_IMPL_DL 1 #define G_MODULE_IMPL_DLD 2 +#define G_MODULE_IMPL_WIN32 3 #define G_MODULE_IMPL @G_MODULE_IMPL@ #undef G_MODULE_HAVE_DLERROR diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gmodule/gmoduleconf.h.win32 ./gmodule/gmoduleconf.h.win32 --- /home/src/gnomecvs/glib/gmodule/gmoduleconf.h.win32 Thu Jan 1 02:00:00 1970 +++ ./gmodule/gmoduleconf.h.win32 Thu Aug 20 10:27:14 1998 @@ -0,0 +1,42 @@ +/* GMODULE - GLIB wrapper code for dynamic module loading + * Copyright (C) 1998 Tim Janik + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ +#ifndef __G_MODULE_CONF_H__ +#define __G_MODULE_CONF_H__ + + +#ifdef __cplusplus +extern "C" { +#pragma } +#endif /* __cplusplus */ + + +#define G_MODULE_IMPL_NONE 0 +#define G_MODULE_IMPL_DL 1 +#define G_MODULE_IMPL_DLD 2 +#define G_MODULE_IMPL_WIN32 3 + +#define G_MODULE_IMPL G_MODULE_IMPL_WIN32 +#undef G_MODULE_HAVE_DLERROR + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __G_MODULE_CONF_H__ */ diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gmodule/testgmodule.c ./gmodule/testgmodule.c --- /home/src/gnomecvs/glib/gmodule/testgmodule.c Tue Aug 18 15:04:55 1998 +++ ./gmodule/testgmodule.c Thu Aug 20 10:03:25 1998 @@ -20,7 +20,7 @@ #include -void +G_MODULE_EXPORT void g_clash_func (void) { g_print ("GModule: Hello global clash\n"); @@ -44,8 +44,13 @@ string = g_get_current_dir (); g_print ("testgmodule (%s):\n", string); +#ifdef WIN32 + plugin_a = g_strconcat (string, "\\libgplugin_a.dll", NULL); + plugin_b = g_strconcat (string, "\\libgplugin_b.dll", NULL); +#else plugin_a = g_strconcat (string, "/.libs/", "libgplugin_a.so", NULL); plugin_b = g_strconcat (string, "/.libs/", "libgplugin_b.so", NULL); +#endif g_free (string); /* module handles diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gscanner.c ./gscanner.c --- /home/src/gnomecvs/glib/gscanner.c Tue Aug 18 15:04:47 1998 +++ ./gscanner.c Thu Aug 20 10:03:25 1998 @@ -25,11 +25,13 @@ #include #include #include +#include "glib.h" +#ifdef HAVE_UNISTD_H #include +#endif #include #include /* needed for sys/stat.h */ #include -#include "glib.h" @@ -1048,9 +1050,11 @@ gint st_mode; stat_buf = g_new0 (struct stat, 1); - +#ifdef HAVE_LSTAT lstat (filename, stat_buf); - +#else + stat (filename, stat_buf); +#endif st_mode = stat_buf->st_mode; g_free (stat_buf); diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gtimer.c ./gtimer.c --- /home/src/gnomecvs/glib/gtimer.c Tue Aug 18 15:04:48 1998 +++ ./gtimer.c Thu Aug 20 10:03:25 1998 @@ -16,21 +16,32 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ -#include -#include #include "glib.h" +#ifdef HAVE_UNISTD_H +#include +#endif +#ifndef NATIVE_WIN32 +#include +#endif +#ifdef NATIVE_WIN32 +#include +#endif typedef struct _GRealTimer GRealTimer; struct _GRealTimer { +#ifdef NATIVE_WIN32 + DWORD start; + DWORD end; +#else struct timeval start; struct timeval end; +#endif gint active; }; - GTimer* g_timer_new (void) { @@ -39,8 +50,11 @@ timer = g_new (GRealTimer, 1); timer->active = TRUE; +#ifdef NATIVE_WIN32 + timer->start = GetTickCount (); +#else gettimeofday (&timer->start, NULL); - +#endif return ((GTimer*) timer); } @@ -60,7 +74,11 @@ g_assert (timer != NULL); rtimer = (GRealTimer*) timer; +#ifdef NATIVE_WIN32 + rtimer->start = GetTickCount (); +#else gettimeofday (&rtimer->start, NULL); +#endif rtimer->active = 1; } @@ -72,7 +90,11 @@ g_assert (timer != NULL); rtimer = (GRealTimer*) timer; +#ifdef NATIVE_WIN32 + rtimer->end = GetTickCount (); +#else gettimeofday (&rtimer->end, NULL); +#endif rtimer->active = 0; } @@ -84,7 +106,11 @@ g_assert (timer != NULL); rtimer = (GRealTimer*) timer; +#ifdef NATIVE_WIN32 + rtimer->start = GetTickCount (); +#else gettimeofday (&rtimer->start, NULL); +#endif } gdouble @@ -99,6 +125,26 @@ rtimer = (GRealTimer*) timer; +#ifdef NATIVE_WIN32 + if (rtimer->active) + rtimer->end = GetTickCount (); + /* Check for wraparound, which happend every 49.7 days. */ + /* No, Win95 machines probably are never running for that long, + but NT machines are. */ + if (rtimer->end < rtimer->start) + total = (UINT_MAX - (rtimer->start - rtimer->end)) / 1000.0; + else + total = (rtimer->end - rtimer->start) / 1000.0; + if (microseconds) + { + if (rtimer->end < rtimer->start) + *microseconds = + ((UINT_MAX - (rtimer->start - rtimer->end)) % 1000) * 1000; + else + *microseconds = + ((rtimer->end - rtimer->start) % 1000) * 1000; + } +#else if (rtimer->active) gettimeofday (&rtimer->end, NULL); @@ -115,6 +161,6 @@ if (microseconds) *microseconds = elapsed.tv_usec; - +#endif return total; } diff -ru3 -N -x CVS /home/src/gnomecvs/glib/gutils.c ./gutils.c --- /home/src/gnomecvs/glib/gutils.c Tue Aug 18 15:04:49 1998 +++ ./gutils.c Thu Aug 20 10:03:25 1998 @@ -16,15 +16,38 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ +#define GUTILS_C /* For stupid Watcom 10.6 */ +#include "glib.h" +#ifdef HAVE_UNISTD_H #include +#endif #include #include #include #include +#ifdef HAVE_PWD_H #include +#endif #include +#ifdef HAVE_SYS_PARAM_H #include -#include "glib.h" +#endif + +#ifdef NATIVE_WIN32 +#include +#include +#ifdef _MSC_VER +#define getcwd _getcwd +#endif +#endif + +#ifndef MAXPATHLEN +#ifdef PATH_MAX +#define MAXPATHLEN PATH_MAX +#else +#define MAXPATHLEN 1024 +#endif +#endif const guint glib_major_version = GLIB_MAJOR_VERSION; const guint glib_minor_version = GLIB_MINOR_VERSION; @@ -224,8 +247,9 @@ { if (!g_tmp_dir) { +#ifdef HAVE_PWD_H struct passwd *pw; - +#endif g_tmp_dir = g_strdup (getenv ("TMPDIR")); if (!g_tmp_dir) g_tmp_dir = g_strdup (getenv ("TMP")); @@ -236,10 +260,11 @@ g_home_dir = g_strdup (getenv ("HOME")); +#ifdef HAVE_PWD_H setpwent (); pw = getpwuid (getuid ()); endpwent (); - + if (pw) { g_user_name = g_strdup (pw->pw_name); @@ -247,6 +272,24 @@ if (!g_home_dir) g_home_dir = g_strdup (pw->pw_dir); } +#else +#ifdef NATIVE_WIN32 + { + DWORD nSize = 17; + g_user_name = g_malloc (nSize); + + if (!GetUserName (g_user_name, &nSize)) + { + g_free (g_user_name); + g_user_name = g_strdup ("somebody"); + } + g_real_name = g_strdup ("Unknown"); + } +#else + g_user_name = g_strdup ("somebody"); + g_real_name = g_strdup ("Unknown"); +#endif +#endif } } diff -ru3 -N -x CVS /home/src/gnomecvs/glib/makefile.msvc ./makefile.msvc --- /home/src/gnomecvs/glib/makefile.msvc Thu Jan 1 02:00:00 1970 +++ ./makefile.msvc Thu Aug 20 10:04:01 1998 @@ -0,0 +1,70 @@ +## Makefile for building glib.dll and gmodule.dll with MSVC +## Use: nmake -f makefile.msvc + +CFLAGS = /I. + +all : \ + glib.dll \ + gmodule.dll \ + testglib.exe \ + testgmodule.exe + +glib_OBJECTS = \ + garray.obj \ + gcache.obj \ + gcompletion.obj \ + gdataset.obj \ + gerror.obj \ + ghash.obj \ + glist.obj \ + gmem.obj \ + gmessages.obj \ + gnode.obj \ + gprimes.obj \ + gslist.obj \ + gtimer.obj \ + gtree.obj \ + grel.obj \ + gstring.obj \ + gstrfuncs.obj \ + gscanner.obj \ + gutils.obj + +glib.dll : $(glib_OBJECTS) + $(CC)$(CFLAGS) /LD /Feglib.dll $(glib_OBJECTS) advapi32.lib + +.c.obj : + $(CC) $(CFLAGS) /c /DCOMPILING_GLIB $< + +gmodule_OBJECTS = \ + gmodule.obj + +gmodule.dll : $(gmodule_OBJECTS) + $(CC) $(CFLAGS) /LD /Fegmodule.dll $(gmodule_OBJECTS) glib.lib + +gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c + $(CC) $(CFLAGS) /Igmodule /c /DCOMPILING_GMODULE gmodule\gmodule.c + +testglib.exe : glib.dll testglib.obj + $(CC) $(CFLAGS) testglib.obj glib.lib + +testglib.obj : testglib.c + $(CC) /c $(CFLAGS) testglib.c + +testgmodule.exe : glib.dll gmodule.dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll + $(CC) $(CFLAGS) /Fetestgmodule.exe testgmodule.obj glib.lib gmodule.lib + +testgmodule.obj : gmodule\testgmodule.c + $(CC) $(CFLAGS) /Igmodule /c gmodule\testgmodule.c + +libgplugin_a.dll : libgplugin_a.obj + $(CC) $(CFLAGS) /LD libgplugin_a.obj glib.lib gmodule.lib + +libgplugin_a.obj : gmodule\libgplugin_a.c + $(CC) $(CFLAGS) /Igmodule /c gmodule\libgplugin_a.c + +libgplugin_b.dll : libgplugin_b.obj + $(CC) $(CFLAGS) /LD libgplugin_b.obj /link glib.lib gmodule.lib + +libgplugin_b.obj : gmodule\libgplugin_b.c + $(CC) $(CFLAGS) /Igmodule /c gmodule\libgplugin_b.c diff -ru3 -N -x CVS /home/src/gnomecvs/glib/makefile.watcom ./makefile.watcom --- /home/src/gnomecvs/glib/makefile.watcom Thu Jan 1 02:00:00 1970 +++ ./makefile.watcom Thu Aug 20 10:03:53 1998 @@ -0,0 +1,78 @@ +## Makefile for building glib.dll and gmodule.dll with Watcom +## Use: wmake -u -f makefile.watcom + +CC = wcc386 -w4 -otexan -5r -fp5 -zc -bt=nt $(INCLUDES) +LD = wlink d all + +INCLUDES = -iF:\watcom\h;F:\watcom\h\nt +CFLAGS = -i. + +all : \ + glib.dll \ + gmodule.dll \ + testglib.exe \ + testgmodule.exe + +glib_OBJECTS = \ + garray.obj \ + gcache.obj \ + gcompletion.obj \ + gdataset.obj \ + gerror.obj \ + ghash.obj \ + glist.obj \ + gmem.obj \ + gmessages.obj \ + gnode.obj \ + gprimes.obj \ + gslist.obj \ + gtimer.obj \ + gtree.obj \ + grel.obj \ + gstring.obj \ + gstrfuncs.obj \ + gscanner.obj \ + gutils.obj + +glib.dll : $(glib_OBJECTS) + $(LD) sys nt_dll name glib @glib.lk1 libr advapi32.lib + wlib -n -b glib.lib +glib.dll + +.c.obj : + $(CC) $(CFLAGS) -bd -dCOMPILING_GLIB $< + +gmodule_OBJECTS = \ + gmodule.obj + +gmodule.dll : $(gmodule_OBJECTS) + $(LD) sys nt_dll name gmodule file gmodule.obj libr glib.lib + wlib -n -b gmodule.lib +gmodule.dll + +gmodule.obj : gmodule\gmodule.c gmodule\gmodule-win32.c + $(CC) $(CFLAGS) -bd -igmodule -dCOMPILING_GMODULE gmodule\gmodule.c + +testglib.exe : glib.dll testglib.obj + $(LD) sys nt file testglib.obj libr glib.lib + +testglib.obj : testglib.c + $(CC) $(CFLAGS) testglib.c + +testgmodule.exe : glib.dll gmodule.dll testgmodule.obj libgplugin_a.dll libgplugin_b.dll + $(LD) sys nt name testgmodule file testgmodule.obj libr glib.lib,gmodule.lib + +testgmodule.obj : gmodule\testgmodule.c + $(CC) $(CFLAGS) -igmodule gmodule\testgmodule.c + +libgplugin_a.dll : libgplugin_a.obj + $(LD) sys nt_dll name libgplugin_a file libgplugin_a.obj libr glib.lib,gmodule.lib + wlib -n -b libgplugin_a.lib +libgplugin_a.dll + +libgplugin_a.obj : gmodule\libgplugin_a.c + $(CC) $(CFLAGS) -bd -igmodule gmodule\libgplugin_a.c + +libgplugin_b.dll : libgplugin_b.obj + $(LD) sys nt_dll name libgplugin_b file libgplugin_b.obj libr glib.lib,gmodule.lib + wlib -n -b libgplugin_b.lib +libgplugin_b.dll + +libgplugin_b.obj : gmodule\libgplugin_b.c + $(CC) $(CFLAGS) -bd -igmodule gmodule\libgplugin_b.c diff -ru3 -N -x CVS /home/src/gnomecvs/glib/testglib.c ./testglib.c --- /home/src/gnomecvs/glib/testglib.c Tue Aug 18 15:04:52 1998 +++ ./testglib.c Thu Aug 20 10:03:25 1998 @@ -588,12 +588,30 @@ for (i = 0; i < 10000; i++) g_string_append_c (string1, 'a'+(i%26)); +#ifndef _MSC_VER g_string_sprintf (string2, "%s|%0100d|%s|%s|%0*d|%*.*f|%10000.10000f", "this pete guy sure is a wuss, like he's the number ", 1, " wuss. everyone agrees.\n", string1->str, 10, 666, 15, 15, 666.666666666, 666.666666666); +#else + g_string_sprintf (string2, "%s|%0100d|%s|%s|%0*d|%*.*f|%100.100f", + "this pete guy sure is a wuss, like he's the number ", + 1, + " wuss. everyone agrees.\n", + string1->str, + 10, 666, 15, 15, 666.666666666, 666.666666666); +#endif + + g_print ("string2 length = %d...\n", string2->len); + string2->str[70] = '\0'; + g_print ("first 70 chars:\n%s\n", string2->str); + string2->str[141] = '\0'; + g_print ("next 70 chars:\n%s\n", string2->str+71); + string2->str[212] = '\0'; + g_print ("and next 70:\n%s\n", string2->str+142); + g_print ("last 70 chars:\n%s\n", string2->str+string2->len - 70); g_print ("ok\n");