summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2017-04-13 13:43:48 +0000
committerkrasimir <krasimir@chalmers.se>2017-04-13 13:43:48 +0000
commit2588a6f016cd1d0bc47d9ab0ab5a8b1d2f376000 (patch)
tree7373cac6936a14f2fd13f1f01c2543a89c706970
parente650b9c5fc38ebb408ddf1982249479aac73836d (diff)
gu_string_buf -> gu_new_string_buf in libgu
-rw-r--r--src/runtime/c/gu/string.c4
-rw-r--r--src/runtime/c/gu/string.h2
-rw-r--r--src/runtime/c/pgf/aligner.c2
-rw-r--r--src/runtime/c/pgf/expr.c4
-rw-r--r--src/runtime/c/pgf/linearizer.c4
-rw-r--r--src/runtime/c/pgf/literals.c4
-rw-r--r--src/runtime/c/pgf/parseval.c2
-rw-r--r--src/runtime/c/pgf/typechecker.c8
-rw-r--r--src/runtime/haskell-bind/PGF2/FFI.hs6
-rw-r--r--src/runtime/python/pypgf.c16
10 files changed, 26 insertions, 26 deletions
diff --git a/src/runtime/c/gu/string.c b/src/runtime/c/gu/string.c
index 386eb7a6f..118e0cb0b 100644
--- a/src/runtime/c/gu/string.c
+++ b/src/runtime/c/gu/string.c
@@ -50,7 +50,7 @@ gu_string_buf_end(GuOutStream* stream, size_t sz, GuExn* err)
}
GuStringBuf*
-gu_string_buf(GuPool* pool)
+gu_new_string_buf(GuPool* pool)
{
GuStringBuf* sbuf = gu_new(GuStringBuf, pool);
sbuf->stream.output = gu_string_buf_output;
@@ -152,7 +152,7 @@ GuString
gu_format_string_v(const char* fmt, va_list args, GuPool* pool)
{
GuPool* tmp_pool = gu_local_pool();
- GuStringBuf* sb = gu_string_buf(tmp_pool);
+ GuStringBuf* sb = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sb);
gu_vprintf(fmt, args, out, NULL);
gu_out_flush(out, NULL);
diff --git a/src/runtime/c/gu/string.h b/src/runtime/c/gu/string.h
index d52c9dddb..5136b0189 100644
--- a/src/runtime/c/gu/string.h
+++ b/src/runtime/c/gu/string.h
@@ -25,7 +25,7 @@ gu_string_in(GuString string, GuPool* pool);
typedef struct GuStringBuf GuStringBuf;
GuStringBuf*
-gu_string_buf(GuPool* pool);
+gu_new_string_buf(GuPool* pool);
GuOut*
gu_string_buf_out(GuStringBuf* sb);
diff --git a/src/runtime/c/pgf/aligner.c b/src/runtime/c/pgf/aligner.c
index b23b3d2e9..be7034f58 100644
--- a/src/runtime/c/pgf/aligner.c
+++ b/src/runtime/c/pgf/aligner.c
@@ -210,7 +210,7 @@ pgf_align_words(PgfConcr* concr, PgfExpr expr,
.parent_current = gu_new_buf(int, tmp_pool),
.phrases = phrases,
.last_phrase = NULL,
- .sbuf = gu_string_buf(tmp_pool),
+ .sbuf = gu_new_string_buf(tmp_pool),
.n_matches = 0,
.err = err,
.bind = true,
diff --git a/src/runtime/c/pgf/expr.c b/src/runtime/c/pgf/expr.c
index 4a186dabc..e967b5459 100644
--- a/src/runtime/c/pgf/expr.c
+++ b/src/runtime/c/pgf/expr.c
@@ -350,7 +350,7 @@ pgf_expr_parser_token(PgfExprParser* parser)
case '\'':
pgf_expr_parser_getc(parser);
- GuStringBuf* chars = gu_string_buf(parser->tmp_pool);
+ GuStringBuf* chars = gu_new_string_buf(parser->tmp_pool);
while (parser->ch != '\'' && parser->ch != EOF) {
if (parser->ch == '\\') {
pgf_expr_parser_getc(parser);
@@ -366,7 +366,7 @@ pgf_expr_parser_token(PgfExprParser* parser)
}
break;
default: {
- GuStringBuf* chars = gu_string_buf(parser->tmp_pool);
+ GuStringBuf* chars = gu_new_string_buf(parser->tmp_pool);
if (pgf_is_ident_first(parser->ch)) {
do {
diff --git a/src/runtime/c/pgf/linearizer.c b/src/runtime/c/pgf/linearizer.c
index 629ac357f..f3b527536 100644
--- a/src/runtime/c/pgf/linearizer.c
+++ b/src/runtime/c/pgf/linearizer.c
@@ -460,7 +460,7 @@ pgf_cnc_resolve(PgfCnc* cnc,
GuPool* tmp_pool = gu_local_pool();
GuExn* err = gu_new_exn(tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
gu_putc('[', out, err);
@@ -1209,7 +1209,7 @@ pgf_get_tokens(PgfSymbols* syms, uint16_t sym_idx, GuPool* pool)
{
GuPool* tmp_pool = gu_new_pool();
GuExn* err = gu_new_exn(tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
PgfSimpleLin flin = {
diff --git a/src/runtime/c/pgf/literals.c b/src/runtime/c/pgf/literals.c
index b5332b1ec..e667b58bb 100644
--- a/src/runtime/c/pgf/literals.c
+++ b/src/runtime/c/pgf/literals.c
@@ -234,7 +234,7 @@ pgf_match_name_lit(PgfLiteralCallback* self, PgfConcr* concr,
return NULL;
GuPool* tmp_pool = gu_local_pool();
- GuStringBuf *sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf *sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_new_exn(tmp_pool);
@@ -361,7 +361,7 @@ pgf_match_unknown_lit(PgfLiteralCallback* self, PgfConcr* concr,
GuUCS ucs = gu_utf8_decode(&p);
if (!gu_ucs_is_upper(ucs)) {
GuPool* tmp_pool = gu_local_pool();
- GuStringBuf *sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf *sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_new_exn(tmp_pool);
diff --git a/src/runtime/c/pgf/parseval.c b/src/runtime/c/pgf/parseval.c
index 7ef41577d..c76e75a17 100644
--- a/src/runtime/c/pgf/parseval.c
+++ b/src/runtime/c/pgf/parseval.c
@@ -150,7 +150,7 @@ pgf_parseval(PgfConcr* concr, PgfExpr expr, PgfType* type,
}
GuStringBuf* sbuf =
- gu_string_buf(pool);
+ gu_new_string_buf(pool);
PgfMetricsLznState state;
state.bind = true;
diff --git a/src/runtime/c/pgf/typechecker.c b/src/runtime/c/pgf/typechecker.c
index 3e04c3afe..ab8f80d73 100644
--- a/src/runtime/c/pgf/typechecker.c
+++ b/src/runtime/c/pgf/typechecker.c
@@ -101,7 +101,7 @@ pgf_tc_mk_print_context(PgfTypeChecker* checker, PgfContext* ctxt)
static void
pgf_tc_err_cannot_infer(PgfTypeChecker* checker, PgfContext* ctxt, PgfExpr e)
{
- GuStringBuf* sbuf = gu_string_buf(checker->tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(checker->tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_exn(checker->tmp_pool);
@@ -117,7 +117,7 @@ static void
pgf_tc_err_exp_fun_type_1(PgfTypeChecker* checker, PgfContext* ctxt,
PgfExpr e, PgfType* ty)
{
- GuStringBuf* sbuf = gu_string_buf(checker->tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(checker->tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_exn(checker->tmp_pool);
@@ -137,7 +137,7 @@ static void
pgf_tc_err_exp_fun_type_2(PgfTypeChecker* checker, PgfContext* ctxt,
PgfExpr e, PgfType* ty)
{
- GuStringBuf* sbuf = gu_string_buf(checker->tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(checker->tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_exn(checker->tmp_pool);
@@ -170,7 +170,7 @@ pgf_tc_err_type_mismatch(PgfTypeChecker* checker,
PgfContext* ctxt,
PgfExpr e, PgfCFType ty1, PgfCFType ty2)
{
- GuStringBuf* sbuf = gu_string_buf(checker->tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(checker->tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
GuExn* err = gu_exn(checker->tmp_pool);
diff --git a/src/runtime/haskell-bind/PGF2/FFI.hs b/src/runtime/haskell-bind/PGF2/FFI.hs
index d2b5d5365..5ca2ee01f 100644
--- a/src/runtime/haskell-bind/PGF2/FFI.hs
+++ b/src/runtime/haskell-bind/PGF2/FFI.hs
@@ -68,8 +68,8 @@ gu_exn_type_PgfTypeError = Ptr "PgfTypeError"# :: CString
foreign import ccall "gu/string.h gu_string_in"
gu_string_in :: CString -> Ptr GuPool -> IO (Ptr GuIn)
-foreign import ccall "gu/string.h gu_string_buf"
- gu_string_buf :: Ptr GuPool -> IO (Ptr GuStringBuf)
+foreign import ccall "gu/string.h gu_new_string_buf"
+ gu_new_string_buf :: Ptr GuPool -> IO (Ptr GuStringBuf)
foreign import ccall "gu/string.h gu_string_buf_out"
gu_string_buf_out :: Ptr GuStringBuf -> IO (Ptr GuOut)
@@ -97,7 +97,7 @@ withGuPool f = bracket gu_new_pool gu_pool_free f
newOut :: Ptr GuPool -> IO (Ptr GuStringBuf, Ptr GuOut)
newOut pool =
- do sb <- gu_string_buf pool
+ do sb <- gu_new_string_buf pool
out <- gu_string_buf_out sb
return (sb,out)
diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c
index fa2a7dd5f..70de766f6 100644
--- a/src/runtime/python/pypgf.c
+++ b/src/runtime/python/pypgf.c
@@ -133,7 +133,7 @@ Expr_repr(ExprObject *self)
GuPool* tmp_pool = gu_local_pool();
GuExn* err = gu_exn(tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
pgf_print_expr(self->expr, NULL, 0, out, err);
@@ -876,7 +876,7 @@ Type_repr(TypeObject *self)
GuPool* tmp_pool = gu_local_pool();
GuExn* err = gu_exn(tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
pgf_print_type(self->type, NULL, 0, out, err);
@@ -1377,7 +1377,7 @@ pypgf_literal_callback_match(PgfLiteralCallback* self, PgfConcr* concr,
GuPool* tmp_pool = gu_local_pool();
GuExn* err = gu_exn(tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
pgf_print_expr(ep->expr, NULL, 0, out, err);
@@ -1658,7 +1658,7 @@ Concr_linearize(ConcrObject* self, PyObject *args)
GuPool* tmp_pool = gu_local_pool();
GuExn* err = gu_exn(tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
pgf_linearize(self->concr, pyexpr->expr, out, err);
@@ -1693,7 +1693,7 @@ Iter_fetch_linearization(IterObject* self)
GuExn* err = gu_new_exn(tmp_pool);
restart:;
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
@@ -1823,7 +1823,7 @@ Concr_tabularLinearize(ConcrObject* self, PyObject *args)
pgf_lzr_get_table(self->concr, ctree, &n_lins, &labels);
for (size_t lin_idx = 0; lin_idx < n_lins; lin_idx++) {
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
pgf_lzr_linearize_simple(self->concr, ctree, lin_idx, out, err, tmp_pool);
@@ -2209,7 +2209,7 @@ Concr_graphvizParseTree(ConcrObject* self, PyObject *args) {
GuPool* tmp_pool = gu_local_pool();
GuExn* err = gu_exn(tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
pgf_graphviz_parse_tree(self->concr, pyexpr->expr, out, err);
@@ -2996,7 +2996,7 @@ PGF_graphvizAbstractTree(PGFObject* self, PyObject *args) {
GuPool* tmp_pool = gu_local_pool();
GuExn* err = gu_new_exn(tmp_pool);
- GuStringBuf* sbuf = gu_string_buf(tmp_pool);
+ GuStringBuf* sbuf = gu_new_string_buf(tmp_pool);
GuOut* out = gu_string_buf_out(sbuf);
pgf_graphviz_abstract_tree(self->pgf, pyexpr->expr, out, err);