blob: 78f367a37076adf293083e469c4d805983c5636b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#include <time.h>
#include "foo.upb.h"
int main() {
upb_arena *arena = upb_arena_new();
Foo* foo = Foo_new(arena);
const char greeting[] = "Hello, World!\n";
Foo_set_time(foo, time(NULL));
/* Warning: the proto will not copy this, the string data must outlive
* the proto. */
Foo_set_greeting(foo, upb_strview_makez(greeting));
upb_arena_free(arena);
}
|