aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/intern.h
diff options
context:
space:
mode:
authorGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2015-07-26 10:20:13 +0800
committerGravatar David Adam <zanchey@ucc.gu.uwa.edu.au>2015-07-26 10:20:13 +0800
commit3929e9de0e69666b37df87347d5ce15663e81347 (patch)
treeb2701c439c0260840ce1c68beaebf7de1178cc53 /src/intern.h
parent793e1afa084982dac92c4fe19e50c25e326a79c2 (diff)
parentf4d1657c22c81a7720a91026f915b80d2d6aa6e8 (diff)
Merge branch 'master' into iwyu
Diffstat (limited to 'src/intern.h')
-rw-r--r--src/intern.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/intern.h b/src/intern.h
new file mode 100644
index 00000000..b9d07526
--- /dev/null
+++ b/src/intern.h
@@ -0,0 +1,26 @@
+/** \file intern.h
+
+ Library for pooling common strings
+
+*/
+
+#ifndef FISH_INTERN_H
+#define FISH_INTERN_H
+
+/**
+ Return an identical copy of the specified string from a pool of unique strings. If the string was not in the pool, add a copy.
+
+ \param in the string to return an interned copy of
+*/
+const wchar_t *intern(const wchar_t *in);
+
+/**
+ Insert the specified string literal into the pool of unique
+ strings. The string will not first be copied, and it will not be
+ free'd on exit.
+
+ \param in the string to add to the interned pool
+*/
+const wchar_t *intern_static(const wchar_t *in);
+
+#endif