X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgl_sublist.c;h=19158d02d208bb6532917a1aa597b9cefc07f31b;hb=2fd7e9189c239ef737105bc085ace4dc80435533;hp=0760cbd520ccd592eacb8bf5cb3e8612abff9daf;hpb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;p=gnulib.git diff --git a/lib/gl_sublist.c b/lib/gl_sublist.c index 0760cbd52..19158d02d 100644 --- a/lib/gl_sublist.c +++ b/lib/gl_sublist.c @@ -1,5 +1,5 @@ /* Sequential list data type backed by another list. - Copyright (C) 2006-2007 Free Software Foundation, Inc. + Copyright (C) 2006-2008 Free Software Foundation, Inc. Written by Bruno Haible , 2006. This program is free software: you can redistribute it and/or modify @@ -87,6 +87,16 @@ gl_sublist_node_value (gl_list_t list, gl_list_node_t node) return gl_list_get_at (list->whole, list->start + index); } +static void +gl_sublist_node_set_value (gl_list_t list, gl_list_node_t node, const void *elt) +{ + uintptr_t index = NODE_TO_INDEX (node); + if (!(index < list->end - list->start)) + /* Invalid argument. */ + abort (); + gl_list_set_at (list->whole, list->start + index, elt); +} + static gl_list_node_t gl_sublist_next_node (gl_list_t list, gl_list_node_t node) { @@ -397,6 +407,7 @@ static const struct gl_list_implementation gl_sublist_list_implementation = gl_sublist_create_fill, gl_sublist_size, gl_sublist_node_value, + gl_sublist_node_set_value, gl_sublist_next_node, gl_sublist_previous_node, gl_sublist_get_at,