Lines Matching defs:template

82 void auth_policy_open_key(const char *key, string_t *template)
86 str_append_c(template,'"');
87 json_append_escaped(template, t_strndup(key, (ptr-key)));
88 str_append_c(template,'"');
89 str_append_c(template,':');
90 str_append_c(template,'{');
96 void auth_policy_close_key(const char *key, string_t *template)
98 while((key = strchr(key, '/')) != NULL) { str_append_c(template,'}'); key++; }
102 void auth_policy_open_and_close_to_key(const char *fromkey, const char *tokey, string_t *template)
112 auth_policy_open_key(tokey, template);
117 str_truncate(template, str_len(template)-1);
119 auth_policy_close_key(fromkey, template);
120 str_append_c(template, ',');
137 auth_policy_open_key(tptr, template);
141 str_truncate(template, str_len(template)-1);
142 auth_policy_close_key(fptr, template);
143 str_append_c(template, ',');
147 str_truncate(template, str_len(template)-1);
148 auth_policy_close_key(fptr, template);
149 str_append_c(template, ',');
150 auth_policy_open_key(tptr, template);
175 /* prepare template */
179 string_t *template = t_str_new(64);
203 /* and build a template string */
208 auth_policy_open_and_close_to_key(prevkey, kvptr->key, template);
209 str_append_c(template,'"');
210 json_append_escaped(template, (kptr != NULL?kptr+1:kvptr->key));
211 str_append_c(template,'"');
212 str_append_c(template,':');
213 str_append_c(template,'"');
214 str_append(template,kvptr->value);
215 str_append_c(template,'"');
216 str_append_c(template,',');
220 auth_policy_open_and_close_to_key(prevkey, "", template);
221 str_truncate(template, str_len(template)-1);
222 auth_policy_json_template = i_strdup(str_c(template));
487 "Failed to expand auth policy template: %s", error);