| 276 | } |
| 277 | |
| 278 | static void emit_index(UdlBuf *b, const char *is_, const char *ie) { |
| 279 | char in_[MAX_NAME]; |
| 280 | extract_attr(is_, ie, "name", in_, sizeof(in_)); |
| 281 | if (!in_[0]) |
| 282 | return; |
| 283 | char props[MAX_NAME * 4] = ""; |
| 284 | elem_content(is_, ie, "Properties", props, sizeof(props)); |
| 285 | bool uniq = tag_is_one(is_, ie, "Unique"); |
| 286 | bool pkey = tag_is_one(is_, ie, "PrimaryKey"); |
| 287 | ub_app(b, "Index "); |
| 288 | ub_app(b, in_); |
| 289 | if (props[0]) { |
| 290 | ub_app(b, " On "); |
| 291 | ub_app(b, props); |
| 292 | } |
| 293 | if (uniq || pkey) { |
| 294 | ub_app(b, " [ "); |
| 295 | if (pkey) |
| 296 | ub_app(b, "PrimaryKey, "); |
| 297 | if (uniq) |
| 298 | ub_app(b, "Unique"); |
| 299 | ub_app(b, " ]"); |
| 300 | } |
| 301 | ub_app(b, ";\n\n"); |
| 302 | } |
| 303 | |
| 304 | static void emit_xdata(UdlBuf *b, const char *xs, const char *xe) { |
| 305 | char xn[MAX_NAME]; |
no test coverage detected