+
+ if type.is_smap():
+ print """
+void
+%(s)s_set_%(c)s(const struct %(s)s *row, const struct smap *smap)
+{
+ struct ovsdb_datum datum;
+
+ ovs_assert(inited);
+ if (smap) {
+ struct smap_node *node;
+ size_t i;
+
+ datum.n = smap_count(smap);
+ datum.keys = xmalloc(datum.n * sizeof *datum.keys);
+ datum.values = xmalloc(datum.n * sizeof *datum.values);
+
+ i = 0;
+ SMAP_FOR_EACH (node, smap) {
+ datum.keys[i].string = xstrdup(node->key);
+ datum.values[i].string = xstrdup(node->value);
+ i++;
+ }
+ ovsdb_datum_sort_unique(&datum, OVSDB_TYPE_STRING, OVSDB_TYPE_STRING);
+ } else {
+ ovsdb_datum_init_empty(&datum);
+ }
+ ovsdb_idl_txn_write(&row->header_,
+ &%(s)s_columns[%(S)s_COL_%(C)s],
+ &datum);
+}
+""" % {'s': structName,
+ 'S': structName.upper(),
+ 'c': columnName,
+ 'C': columnName.upper()}
+ continue
+
+