[media] DocBook: handle enums on frontend.h

In order to be sure that all enum definitions will be documented,
let's parse the enum values and add xref links to them.

Lots of missing references will be risen as we miss adding
id's to those symbols at the documentation. Next patches will
fix this.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Mauro Carvalho Chehab 2015-06-07 05:21:51 -03:00
parent 7f3c2e1d1d
commit 2695e66f94

View File

@ -74,16 +74,26 @@ TYPES = \
$(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/dvb/frontend.h) $(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/dvb/frontend.h)
ENUMS = \ ENUMS = \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \ $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/audio.h) \ $(srctree)/include/uapi/linux/videodev2.h \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/ca.h) \ $(srctree)/include/uapi/linux/dvb/audio.h \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/dmx.h) \ $(srctree)/include/uapi/linux/dvb/ca.h \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \ $(srctree)/include/uapi/linux/dvb/dmx.h \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/net.h) \ $(srctree)/include/uapi/linux/dvb/frontend.h \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/video.h) \ $(srctree)/include/uapi/linux/dvb/net.h \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \ $(srctree)/include/uapi/linux/dvb/video.h \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) \ $(srctree)/include/uapi/linux/media.h \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) $(srctree)/include/uapi/linux/v4l2-mediabus.h \
$(srctree)/include/uapi/linux/v4l2-subdev.h)
ENUM_DEFS = \
$(shell perl -e 'while (<>) { if ($$enum) {print "$$1\n" if (/\s*([A-Z]\S+)\b/); } $$enum = 0 if ($enum && /^\}/); $$enum = 1 if(/^\s*enum\s/); }' \
$(srctree)/include/uapi/linux/dvb/audio.h \
$(srctree)/include/uapi/linux/dvb/ca.h \
$(srctree)/include/uapi/linux/dvb/dmx.h \
$(srctree)/include/uapi/linux/dvb/frontend.h \
$(srctree)/include/uapi/linux/dvb/net.h \
$(srctree)/include/uapi/linux/dvb/video.h)
STRUCTS = \ STRUCTS = \
$(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \ $(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \
@ -252,9 +262,14 @@ $(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/uapi/linux/dvb/frontend.h $(
@( \ @( \
echo "<programlisting>") > $@ echo "<programlisting>") > $@
@( \ @( \
for ident in $(ENUM_DEFS) ; do \
entity=`echo $$ident | tr _ -` ; \
r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\
done; \
expand --tabs=8 < $< | \ expand --tabs=8 < $< | \
sed $(ESCAPE) $(DVB_DOCUMENTED) | \ sed $(ESCAPE) $(DVB_DOCUMENTED) | \
sed 's/i\.e\./&ie;/') >> $@ sed 's/i\.e\./&ie;/' | \
perl -ne "$$r print $$_;") >> $@
@( \ @( \
echo "</programlisting>") >> $@ echo "</programlisting>") >> $@
@ -331,6 +346,15 @@ $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
"linkend='$$entity'>$$ident</link>\">" >>$@ ; \ "linkend='$$entity'>$$ident</link>\">" >>$@ ; \
done) done)
@( \ @( \
echo -e "\n<!-- Enum definitions -->") >>$@
@( \
for ident in $(ENUM_DEFS) ; do \
entity=`echo $$ident | tr _ -` ; \
echo "<!ENTITY $$entity \"<link" \
"linkend='$$entity'><constant>$$ident</constant></link>\">" \
>>$@ ; \
done)
@( \
echo -e "\n<!-- Structures -->") >>$@ echo -e "\n<!-- Structures -->") >>$@
@( \ @( \
for ident in $(STRUCTS) ; do \ for ident in $(STRUCTS) ; do \