epoc32/include/stdapis/glib-2.0/glib/glist.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 0 061f57f2323e
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /* GLIB - Library of useful routines for C programming
     2  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald
     3  * Portions copyright (c) 2006 Nokia Corporation.  All rights reserved.
     4  *
     5  * This library is free software; you can redistribute it and/or
     6  * modify it under the terms of the GNU Lesser General Public
     7  * License as published by the Free Software Foundation; either
     8  * version 2 of the License, or (at your option) any later version.
     9  *
    10  * This library is distributed in the hope that it will be useful,
    11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
    13  * Lesser General Public License for more details.
    14  *
    15  * You should have received a copy of the GNU Lesser General Public
    16  * License along with this library; if not, write to the
    17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    18  * Boston, MA 02111-1307, USA.
    19  */
    20 
    21 /*
    22  * Modified by the GLib Team and others 1997-2000.  See the AUTHORS
    23  * file for a list of people on the GLib Team.  See the ChangeLog
    24  * files for a list of changes.  These files are distributed with
    25  * GLib at ftp://ftp.gtk.org/pub/gtk/. 
    26  */
    27 
    28 #ifndef __G_LIST_H__
    29 #define __G_LIST_H__
    30 
    31 #include <_ansi.h>
    32 #include <glib/gmem.h>
    33 
    34 G_BEGIN_DECLS
    35 
    36 typedef struct _GList GList;
    37 
    38 struct _GList
    39 {
    40   gpointer data;
    41   GList *next;
    42   GList *prev;
    43 };
    44 
    45 /* Doubly linked lists
    46  */
    47 IMPORT_C GList*   g_list_alloc          (void);
    48 IMPORT_C void     g_list_free           (GList            *list);
    49 IMPORT_C void     g_list_free_1         (GList            *list);
    50 #define  g_list_free1                   g_list_free_1
    51 IMPORT_C GList*   g_list_append         (GList            *list,
    52 					 gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
    53 IMPORT_C GList*   g_list_prepend        (GList            *list,
    54 					 gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
    55 IMPORT_C GList*   g_list_insert                  (GList            *list,
    56 					 gpointer          data,
    57 					 gint              position) G_GNUC_WARN_UNUSED_RESULT;
    58 IMPORT_C GList*   g_list_insert_sorted           (GList            *list,
    59 					 gpointer          data,
    60 					 GCompareFunc      func) G_GNUC_WARN_UNUSED_RESULT;
    61 IMPORT_C GList*   g_list_insert_sorted_with_data (GList            *list,
    62 					 gpointer          data,
    63 					 GCompareDataFunc  func,
    64 					 gpointer          user_data) G_GNUC_WARN_UNUSED_RESULT;
    65 IMPORT_C GList*   g_list_insert_before  (GList            *list,
    66 					 GList            *sibling,
    67 					 gpointer          data) G_GNUC_WARN_UNUSED_RESULT;
    68 IMPORT_C GList*   g_list_concat         (GList            *list1,
    69 					 GList            *list2) G_GNUC_WARN_UNUSED_RESULT;
    70 IMPORT_C GList*   g_list_remove         (GList            *list,
    71 					 gconstpointer     data) G_GNUC_WARN_UNUSED_RESULT;
    72 IMPORT_C GList*   g_list_remove_all     (GList            *list,
    73 					 gconstpointer     data) G_GNUC_WARN_UNUSED_RESULT;
    74 IMPORT_C GList*   g_list_remove_link    (GList            *list,
    75 					 GList            *llink) G_GNUC_WARN_UNUSED_RESULT;
    76 IMPORT_C GList*   g_list_delete_link    (GList            *list,
    77 					 GList            *link_) G_GNUC_WARN_UNUSED_RESULT;
    78 IMPORT_C GList*   g_list_reverse        (GList            *list);
    79 IMPORT_C GList*   g_list_copy           (GList            *list);
    80 IMPORT_C GList*   g_list_nth            (GList            *list,
    81 					 guint             n);
    82 IMPORT_C GList*   g_list_nth_prev       (GList            *list,
    83 					 guint             n);
    84 IMPORT_C GList*   g_list_find           (GList            *list,
    85 					 gconstpointer     data);
    86 IMPORT_C GList*   g_list_find_custom    (GList            *list,
    87 					 gconstpointer     data,
    88 					 GCompareFunc      func);
    89 IMPORT_C gint     g_list_position       (GList            *list,
    90 					 GList            *llink);
    91 IMPORT_C gint     g_list_index          (GList            *list,
    92 					 gconstpointer     data);
    93 IMPORT_C GList*   g_list_last           (GList            *list);
    94 IMPORT_C GList*   g_list_first          (GList            *list);
    95 IMPORT_C guint    g_list_length         (GList            *list);
    96 IMPORT_C void     g_list_foreach        (GList            *list,
    97 					 GFunc             func,
    98 					 gpointer          user_data);
    99 IMPORT_C GList*   g_list_sort           (GList            *list,
   100 					 GCompareFunc      compare_func) G_GNUC_WARN_UNUSED_RESULT;
   101 IMPORT_C GList*   g_list_sort_with_data (GList            *list,
   102 					 GCompareDataFunc  compare_func,
   103 					 gpointer          user_data)  G_GNUC_WARN_UNUSED_RESULT;
   104 IMPORT_C gpointer g_list_nth_data       (GList            *list,
   105 					 guint             n);
   106 
   107 
   108 #define g_list_previous(list)	        ((list) ? (((GList *)(list))->prev) : NULL)
   109 #define g_list_next(list)	        ((list) ? (((GList *)(list))->next) : NULL)
   110 
   111 #ifndef G_DISABLE_DEPRECATED
   112 IMPORT_C void     g_list_push_allocator          (gpointer          allocator);
   113 IMPORT_C void     g_list_pop_allocator           (void);
   114 #endif
   115 G_END_DECLS
   116 
   117 #endif /* __G_LIST_H__ */
   118