From: Mauro Carvalho Chehab Date: Sun, 7 Jun 2015 08:21:51 +0000 (-0300) Subject: [media] DocBook: handle enums on frontend.h X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2695e66f94cdb7790b2f16c154690aaa366f8417;p=linux-beck.git [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 --- diff --git a/Documentation/DocBook/media/Makefile b/Documentation/DocBook/media/Makefile index ae9d5a0404aa..226152952f58 100644 --- a/Documentation/DocBook/media/Makefile +++ b/Documentation/DocBook/media/Makefile @@ -74,16 +74,26 @@ TYPES = \ $(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/dvb/frontend.h) 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+/' $(srctree)/include/uapi/linux/dvb/audio.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/ca.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/dmx.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/net.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/video.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) \ - $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) + $(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' \ + $(srctree)/include/uapi/linux/videodev2.h \ + $(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 \ + $(srctree)/include/uapi/linux/media.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 = \ $(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 "") > $@ @( \ + for ident in $(ENUM_DEFS) ; do \ + entity=`echo $$ident | tr _ -` ; \ + r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\ + done; \ expand --tabs=8 < $< | \ sed $(ESCAPE) $(DVB_DOCUMENTED) | \ - sed 's/i\.e\./&ie;/') >> $@ + sed 's/i\.e\./&ie;/' | \ + perl -ne "$$r print $$_;") >> $@ @( \ echo "") >> $@ @@ -331,6 +346,15 @@ $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml "linkend='$$entity'>$$ident\">" >>$@ ; \ done) @( \ + echo -e "\n") >>$@ + @( \ + for ident in $(ENUM_DEFS) ; do \ + entity=`echo $$ident | tr _ -` ; \ + echo "$$ident\">" \ + >>$@ ; \ + done) + @( \ echo -e "\n") >>$@ @( \ for ident in $(STRUCTS) ; do \