end_shared_string

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


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

#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); }

KEYWORDS

pike_string

SEE ALSO

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