Lines Matching defs:self
78 struct param_enum *self = malloc(sizeof(*self));
79 if (self == NULL) {
81 free(self);
84 self->width = type_sizeof(proc, et);
85 if (self->width == (size_t) -1)
88 if (value_init_deref(&self->array, cb_args) < 0)
90 assert(self->array.type->type == ARGTYPE_ARRAY);
92 self->format = (char *)value_get_data(&self->array, arguments);
93 if (self->format == NULL) {
94 value_destroy(&self->array);
98 size_t size = value_size(&self->array, arguments);
100 value_destroy(&self->array);
104 self->percent = 0;
105 self->ptr = self->format;
106 self->end = self->format + size;
107 self->future_length = NULL;
108 return self;
112 drop_future_length(struct param_enum *self)
114 if (self->future_length != NULL) {
115 free(self->future_length);
116 self->future_length = NULL;
121 form_next_param(struct param_enum *self,
154 || self->future_length != NULL) {
170 if (self->future_length != NULL) {
171 l = *self->future_length;
172 drop_future_length(self);
204 param_printf_next(struct param_enum *self, struct arg_type_info *infop,
215 for (; self->ptr < self->end; self->ptr += self->width) {
223 memcpy(u.buf, self->ptr, self->width);
224 switch (self->width) {
231 if (!self->percent) {
233 self->percent = 1;
247 if (self->future_length == NULL)
251 self->future_length
252 = malloc(sizeof(*self->future_length));
254 if (self->future_length != NULL) {
255 self->ptr += self->width;
302 self->percent = 0;
315 self->percent = 0;
323 self->percent = 0;
332 self->percent = 0;
341 self->percent = 0;
349 self->percent = 0;
356 self->percent = 0;
366 if (form_next_param(self, format_type, elt_type, hlf, lng,
381 param_printf_stop(struct param_enum *self, struct value *value)
383 if (self->future_length != NULL
384 && value_extract_word(value, (long *)self->future_length, NULL) < 0)
385 drop_future_length(self);