end_shared_string

[ Start > PikeDevel > C Modules > end_shared_string ] [ Edit this Page | Show Page Versions | Show Formatted ]


__NAME__

        end_shared_string - link a shared string into the hashtable

__SYNTAX__

        #include "stralloc.h"

        struct pike_string *end_shared_string(struct pike_string *p);

__DESCRIPTION__

        This function the prepared output from a begin_shared_string and
        links the string into the hash table. If an identical string is
        already present in the hash table, p is freed and that string is
        returned instead. The returned string will have one extra reference
        added.

__EXAMPLE__

{code}
#include "global.h"
#include "stralloc.h"

        struct pike_string *mkcharstring(int ch)
        {
          struct pike_string *ret;
          ret=begin_shared_string(1);
          ret->str[0]=ch;
          return end_shared_string(ret);
        }
{code}

__KEYWORDS__

        pike_string

__SEE ALSO__

        [PikeDevel/C Modules/begin_shared_string]

Powered by PikeWiki2

 
gotpike.org | Copyright © 2004 - 2009 | Pike is a trademark of Department of Computer and Information Science, Linköping University