aboutsummaryrefslogtreecommitdiff
path: root/src/meta1lex.l
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-01-08 15:31:17 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-01-08 16:17:35 +0200
commit489432d354d88049afe4af54c29965d382d67f7a (patch)
tree84725496a92564824f75f0a2edd5a595411ffab2 /src/meta1lex.l
parent3325fed2895f079486b88c65409c73153fec306f (diff)
downloadpies-489432d354d88049afe4af54c29965d382d67f7a.tar.gz
pies-489432d354d88049afe4af54c29965d382d67f7a.tar.bz2
Uniformly use grecs memory management functions.
* gnulib.modules: Remove unneded modules. * ident/ident.h: Remove xalloc.h, include errno.h * ident/ident.c: Use standard allocation functions instead of x* * ident/pam.c: Remove. * ident/provider.c: Remove. * ident/system.c: Remove. * src/meta.c: Remove. * src/Makefile.am: Remove meta.c * src/progman.c: Use grecs_* allocation functions instead of x*. (notify): Use wordsplit to expand variables within message. Rename variables: program-name to program_name; canonical-program-name to canonical_program_name. * doc/pies.texi: Update. * src/depmap.c: Use grecs_* allocation functions instead of x*. (depmap_end): New function. * src/diag.c (logmsg_vprintf): Use grecs_txtacc instead of obstack. * src/pies.h (depmap_end): New proto. Remove unused includes. * src/acl.c: Use grecs_* allocation functions instead of x*. * src/ctl.c: Likewise. * src/inetd.c: Likewise. * src/limits.c: Likewise. * src/meta1gram.y: Likewise. * src/meta1lex.l: Likewise. * src/pies.c: Likewise. * src/socket.c: Likewise. * src/sysvinit.c: Likewise. * src/userprivs.c: Likewise.
Diffstat (limited to 'src/meta1lex.l')
-rw-r--r--src/meta1lex.l24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/meta1lex.l b/src/meta1lex.l
index 2aca914..a074a8d 100644
--- a/src/meta1lex.l
+++ b/src/meta1lex.l
@@ -33,8 +33,7 @@
#include "meta1lex.h"
static struct grecs_locus_point meta1_locus_point;
-struct obstack meta1_stk;
-int meta1_stk_init;
+static struct grecs_txtacc *meta1_txtacc;
char *meta1_queue_dir;
#define yylval meta1lval
@@ -119,7 +118,7 @@ yywrap ()
void
meta1_line_add (const char *text, size_t len)
{
- obstack_grow (&meta1_stk, text, len);
+ grecs_txtacc_grow (meta1_txtacc, text, len);
}
static char quote_transtab[] = "\\\\\"\"a\ab\bf\fn\nr\rt\tv\v";
@@ -150,13 +149,13 @@ unescape_to_line (int c)
if (t == c && t != '\\' && t != '\"')
grecs_error (&meta1lloc, 0, _("unknown escape sequence '\\%c'"), c);
}
- obstack_1grow (&meta1_stk, t);
+ grecs_txtacc_grow_char (meta1_txtacc, t);
}
void
meta1_line_add_unescape_last (const char *text, size_t len)
{
- obstack_grow (&meta1_stk, text, len - 2);
+ grecs_txtacc_grow (meta1_txtacc, text, len - 2);
unescape_to_line (text[len - 1]);
}
@@ -165,25 +164,22 @@ meta1_line_add_unescape_hex (const char *text, size_t len)
{
for (; text[len-1] != 'x' && len > 0; len--)
;
- obstack_grow (&meta1_stk, text, len - 2);
- obstack_1grow (&meta1_stk, (char) strtoul (text + len, NULL, 16));
+ grecs_txtacc_grow (meta1_txtacc, text, len - 2);
+ grecs_txtacc_grow_char (meta1_txtacc, (char) strtoul (text + len, NULL, 16));
}
void
meta1_line_begin ()
{
- if (!meta1_stk_init)
- {
- obstack_init (&meta1_stk);
- meta1_stk_init = 1;
- }
+ if (!meta1_txtacc)
+ meta1_txtacc = grecs_txtacc_create();
}
char *
meta1_line_finish ()
{
- obstack_1grow (&meta1_stk, 0);
- return obstack_finish (&meta1_stk);
+ grecs_txtacc_grow_char (meta1_txtacc, 0);
+ return grecs_txtacc_finish (meta1_txtacc, 0);
}
char *

Return to:

Send suggestions and report system problems to the System administrator.