• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/ntp/sntp/libevent/

Lines Matching refs:struct

29 structref = re.compile(r'^struct\[([a-zA-Z_][a-zA-Z0-9_]*)\]$')
30 structdef = re.compile(r'^struct +[a-zA-Z_][a-zA-Z0-9_]* *{$')
51 # Holds everything that makes a struct
57 declare(' Created struct: %s' % name)
84 """ Knows how to generate C code for a struct """
100 print >>file, 'struct %s;' % self._name
104 print >>file, 'struct %s_access_ {' % self._name
115 print >>file, 'struct %s {' % self._name
116 print >>file, ' struct %s_access_ *base;\n' % self._name
126 """struct %(name)s *%(name)s_new(void);
127 struct %(name)s *%(name)s_new_with_arg(void *);
128 void %(name)s_free(struct %(name)s *);
129 void %(name)s_clear(struct %(name)s *);
130 void %(name)s_marshal(struct evbuffer *, const struct %(name)s *);
131 int %(name)s_unmarshal(struct %(name)s *, struct evbuffer *);
132 int %(name)s_complete(struct %(name)s *);
133 void evtag_marshal_%(name)s(struct evbuffer *, ev_uint32_t,
134 const struct %(name)s *);
135 int evtag_unmarshal_%(name)s(struct evbuffer *, ev_uint32_t,
136 struct %(name)s *);""" % { 'name' : self._name }
157 'static struct %(name)s_access_ %(name)s_base__ = {' % \
165 'struct %(name)s *\n'
171 'struct %(name)s *\n'
174 ' struct %(name)s *tmp;\n'
175 ' if ((tmp = malloc(sizeof(struct %(name)s))) == NULL) {\n'
207 '%(name)s_clear(struct %(name)s *tmp)\n'
217 '%(name)s_free(struct %(name)s *tmp)\n'
229 '%(name)s_marshal(struct evbuffer *evbuf, '
230 'const struct %(name)s *tmp)'
250 '%(name)s_unmarshal(struct %(name)s *tmp, '
251 ' struct evbuffer *evbuf)\n'
292 '%(name)s_complete(struct %(name)s *msg)\n'
313 'evtag_unmarshal_%(name)s(struct evbuffer *evbuf, '
314 'ev_uint32_t need_tag, struct %(name)s *msg)\n'
319 ' struct evbuffer *tmp = evbuffer_new();\n'
338 'evtag_marshal_%(name)s(struct evbuffer *evbuf, ev_uint32_t tag, '
339 'const struct %(name)s *msg)\n'
341 ' struct evbuffer *buf_ = evbuffer_new();\n'
367 def SetStruct(self, struct):
368 self._struct = struct
405 'Entry "%s" does not know which struct it belongs to '
438 code = [ 'int %s(struct %s *, %s *);' % (
445 '%(parent_name)s_%(name)s_get(struct %(parent_name)s *msg, '
464 code = [ 'int %s(struct %s *, const %s);' % (
470 '%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,'
523 code = [ 'int %s(struct %s *, %s **);' % (
528 code = [ 'int %s(struct %s *, const %s *);' % (
540 '%s_%s_get(struct %s *msg, %s **value)' % (
554 '%s_%s_assign(struct %s *msg, const %s *value)' % (
713 %(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,
776 self._ctype = 'struct %s*' % refname
801 'struct evbuffer *tmp = NULL;',
829 '%s_%s_get(struct %s *msg, %s *value)' % (
847 %(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg,
850 struct evbuffer *tmp = NULL;
959 code = [ 'int %s(struct %s *, %s *, ev_uint32_t *);' % (
964 code = [ 'int %s(struct %s *, const %s, ev_uint32_t);' % (
971 '%s_%s_assign(struct %s *msg, '
991 '%s_%s_get(struct %s *msg, %s *value, ev_uint32_t *plen)' % (
1088 'int %(funcname)s(struct %(parent_name)s *, int, %(ctype)s *);' %
1093 code = [ 'int %s(struct %s *, int, const %s);' % (
1100 '%(funcname)s(struct %(parent_name)s *msg%(optaddarg)s);' % \
1106 %(parent_name)s_%(name)s_get(struct %(parent_name)s *msg, int offset,
1120 '%(parent_name)s_%(name)s_assign(struct %(parent_name)s *msg, int off,',
1146 'struct %(parent_name)s *msg)',
1162 'struct %(parent_name)s *msg%(optaddarg)s)',
1385 # References another struct defined in our file
1402 # We need to encapsulate this entry into a struct
1418 # First three tokens are: 'struct' 'name' '{'
1488 raise RpcGenError('Missing struct on line %d: %s'
1495 # We are inside the struct
1502 raise RpcGenError('Trailing garbage after struct on line %d'
1505 # We found the end of the struct
1523 # Just gets the whole struct nicely formatted