Usage of maapi_do_display()

I am looking to provide custom user code for ‘display-when’ clause and came across following in UG.

int maapi_do_display(int sock, int thandle, const char *fmtpath, ...);

If the data model uses the YANG when or tailf:display-when statement, this function can be used
to determine if the item given by fmtpath, ... should be displayed or not

But I am not sure how to hook this up with an yang.

If you implement your own northbound interface based on MAAPI, you can use that function to check if an item should be displayed.

I believe you can find when statements in the schema, but if you want to find out about tailf.display-when extensions, you need to add that as meta-data.

Regarding meta-data, see for example this post Is the schema range available via confd_cs_node_info?