summaryrefslogtreecommitdiff
path: root/upb/def.c
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2017-03-14 14:47:42 -0700
committerGitHub <noreply@github.com>2017-03-14 14:47:42 -0700
commite35c38fc6535f811ca405e35c1271efc28f511b3 (patch)
tree40078b87840fff89e5c9e40d5986a9d1649eaa32 /upb/def.c
parent5a8467842acfbd117ec9231f8231fc33c3304035 (diff)
parent969ba5ef86a951cb262929cb8a3fa31df6014517 (diff)
Merge pull request #80 from TeBoring/master
Add new file option php_class_prefix.
Diffstat (limited to 'upb/def.c')
-rw-r--r--upb/def.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/upb/def.c b/upb/def.c
index 5fe9e14..b5064be 100644
--- a/upb/def.c
+++ b/upb/def.c
@@ -1859,6 +1859,7 @@ static void freefiledef(upb_refcounted *r) {
upb_inttable_uninit(&f->deps);
upb_gfree((void*)f->name);
upb_gfree((void*)f->package);
+ upb_gfree((void*)f->phpprefix);
upb_gfree(f);
}
@@ -1873,6 +1874,7 @@ upb_filedef *upb_filedef_new(const void *owner) {
f->package = NULL;
f->name = NULL;
+ f->phpprefix = NULL;
f->syntax = UPB_SYNTAX_PROTO2;
if (!upb_refcounted_init(upb_filedef_upcast_mutable(f), &upb_filedef_vtbl,
@@ -1907,6 +1909,10 @@ const char *upb_filedef_package(const upb_filedef *f) {
return f->package;
}
+const char *upb_filedef_phpprefix(const upb_filedef *f) {
+ return f->phpprefix;
+}
+
upb_syntax_t upb_filedef_syntax(const upb_filedef *f) {
return f->syntax;
}
@@ -1963,6 +1969,18 @@ bool upb_filedef_setpackage(upb_filedef *f, const char *package,
return true;
}
+bool upb_filedef_setphpprefix(upb_filedef *f, const char *phpprefix,
+ upb_status *s) {
+ phpprefix = upb_gstrdup(phpprefix);
+ if (!phpprefix) {
+ upb_upberr_setoom(s);
+ return false;
+ }
+ upb_gfree((void*)f->phpprefix);
+ f->phpprefix = phpprefix;
+ return true;
+}
+
bool upb_filedef_setsyntax(upb_filedef *f, upb_syntax_t syntax,
upb_status *s) {
UPB_UNUSED(s);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback