From: Andre Noll Date: Sun, 27 Aug 2017 10:11:22 +0000 (+0200) Subject: Merge branch 'refs/heads/t/si_conversion' X-Git-Tag: v0.6.1~11 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=fe3d9cd155b5eac8706015854c343440823e12da;hp=13ba5f96e64bd0f3157a6fe73ed7b950ec9c5ea7 Merge branch 'refs/heads/t/si_conversion' A single patch which moves the list of status items from configure.ac to para.h. Cooking for five weeks. * refs/heads/t/si_conversion: Define status items in para.h. --- diff --git a/Doxyfile b/Doxyfile index 70c71261..d8960dde 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.6 +# Doxyfile 1.8.11 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -46,10 +46,10 @@ PROJECT_NUMBER = PROJECT_BRIEF = -# With the PROJECT_LOGO tag one can specify an logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. PROJECT_LOGO = @@ -60,7 +60,7 @@ PROJECT_LOGO = OUTPUT_DIRECTORY = web_sync/doxygen -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where @@ -70,6 +70,14 @@ OUTPUT_DIRECTORY = web_sync/doxygen CREATE_SUBDIRS = NO +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. @@ -85,14 +93,14 @@ CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the @@ -127,7 +135,7 @@ ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. @@ -197,9 +205,9 @@ MULTILINE_CPP_IS_BRIEF = NO INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO @@ -261,11 +269,14 @@ OPTIMIZE_OUTPUT_VHDL = NO # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. # -# Note For files without extension you can use no_extension as a placeholder. +# Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. @@ -284,8 +295,8 @@ MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES @@ -325,13 +336,20 @@ SIP_SUPPORT = NO IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent @@ -390,7 +408,7 @@ LOOKUP_CACHE_SIZE = 0 # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. @@ -400,35 +418,35 @@ LOOKUP_CACHE_SIZE = 0 EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = NO -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = NO -# This flag is only useful for Objective-C code. When set to YES local methods, +# This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are +# included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. @@ -453,21 +471,21 @@ HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be +# (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these +# documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. @@ -481,7 +499,7 @@ HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also +# names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. @@ -490,12 +508,19 @@ INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the +# their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = YES +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. @@ -523,14 +548,14 @@ INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. +# name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = NO # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that +# name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. @@ -575,27 +600,25 @@ SORT_BY_SCOPE_NAME = NO STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. @@ -620,8 +643,8 @@ ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES @@ -669,8 +692,7 @@ LAYOUT_FILE = # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. +# search path. See also \cite for info how to create references. CITE_BIB_FILES = @@ -686,7 +708,7 @@ CITE_BIB_FILES = QUIET = YES # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. @@ -694,7 +716,7 @@ QUIET = YES WARNINGS = YES -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. @@ -711,12 +733,18 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = YES +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated @@ -740,7 +768,7 @@ WARN_LOGFILE = # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with -# spaces. +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = . @@ -756,12 +784,17 @@ INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, +# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. FILE_PATTERNS = *.c \ *.h @@ -848,6 +881,10 @@ IMAGE_PATH = # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = @@ -857,11 +894,15 @@ INPUT_FILTER = # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for +# INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. @@ -921,7 +962,7 @@ REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. @@ -998,7 +1039,7 @@ IGNORE_PREFIX = # Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES @@ -1060,13 +1101,15 @@ HTML_FOOTER = web/footer.html HTML_STYLESHEET = -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = @@ -1082,7 +1125,7 @@ HTML_EXTRA_STYLESHEET = HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to +# will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 @@ -1113,8 +1156,9 @@ HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES @@ -1210,28 +1254,29 @@ GENERATE_HTMLHELP = NO CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. @@ -1344,7 +1389,7 @@ DISABLE_INDEX = NO # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has @@ -1372,7 +1417,7 @@ ENUM_VALUES_PER_LINE = 4 TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1401,7 +1446,7 @@ FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. @@ -1471,11 +1516,11 @@ SEARCHENGINE = NO # When the SERVER_BASED_SEARCH tag is enabled the search engine will be # implemented using a web server instead of a web client using Javascript. There -# are two flavours of web server based searching depending on the -# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for -# searching and an index file used by the script. When EXTERNAL_SEARCH is -# enabled the indexing and searching needs to be provided by external tools. See -# the section "External Indexing and Searching" for details. +# are two flavors of web server based searching depending on the EXTERNAL_SEARCH +# setting. When disabled, doxygen will generate a PHP script for searching and +# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing +# and searching needs to be provided by external tools. See the section +# "External Indexing and Searching" for details. # The default value is: NO. # This tag requires that the tag SEARCHENGINE is set to YES. @@ -1487,7 +1532,7 @@ SERVER_BASED_SEARCH = NO # external search engine pointed to by the SEARCHENGINE_URL option to obtain the # search results. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). # @@ -1500,7 +1545,7 @@ EXTERNAL_SEARCH = NO # The SEARCHENGINE_URL should point to a search engine hosted by a web server # which will return the search results when EXTERNAL_SEARCH is enabled. # -# Doxygen ships with an example indexer ( doxyindexer) and search engine +# Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library # Xapian (see: http://xapian.org/). See the section "External Indexing and # Searching" for details. @@ -1538,7 +1583,7 @@ EXTRA_SEARCH_MAPPINGS = # Configuration options related to the LaTeX output #--------------------------------------------------------------------------- -# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output. +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. # The default value is: YES. GENERATE_LATEX = NO @@ -1569,7 +1614,7 @@ LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex -# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1587,9 +1632,12 @@ COMPACT_LATEX = NO PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names -# that should be included in the LaTeX output. To get the times font for -# instance you can specify -# EXTRA_PACKAGES=times +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1603,23 +1651,36 @@ EXTRA_PACKAGES = # # Note: Only use a user-defined header if you know what you are doing! The # following commands have a special meaning inside the header: $title, -# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will -# replace them by respectively the title of the page, the current date and time, -# only the current date, the version number of doxygen, the project name (see -# PROJECT_NAME), or the project number (see PROJECT_NUMBER). +# $datetime, $date, $doxygenversion, $projectname, $projectnumber, +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last -# chapter. If it is left blank doxygen will generate a standard footer. +# chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. # # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_FOOTER = +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output # directory. Note that the files will be copied as-is; there are no commands or @@ -1637,8 +1698,8 @@ LATEX_EXTRA_FILES = PDF_HYPERLINKS = NO -# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate -# the PDF file directly from the LaTeX files. Set this option to YES to get a +# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate +# the PDF file directly from the LaTeX files. Set this option to YES, to get a # higher quality PDF documentation. # The default value is: YES. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1679,11 +1740,19 @@ LATEX_SOURCE_CODE = NO LATEX_BIB_STYLE = plain +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- -# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The # RTF output is optimized for Word 97 and may not look too pretty with other RTF # readers/editors. # The default value is: NO. @@ -1698,7 +1767,7 @@ GENERATE_RTF = NO RTF_OUTPUT = rtf -# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF # documents. This may be useful for small projects and may help to save some # trees in general. # The default value is: NO. @@ -1735,11 +1804,21 @@ RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + #--------------------------------------------------------------------------- # Configuration options related to the man page output #--------------------------------------------------------------------------- -# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for # classes and files. # The default value is: NO. @@ -1763,6 +1842,13 @@ MAN_OUTPUT = man MAN_EXTENSION = .3 +# The MAN_SUBDIR tag determines the name of the directory created within +# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by +# MAN_EXTENSION with the initial . removed. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_SUBDIR = + # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real # man page(s). These additional files only source the real man page, but without @@ -1776,7 +1862,7 @@ MAN_LINKS = NO # Configuration options related to the XML output #--------------------------------------------------------------------------- -# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that # captures the structure of the code including all documentation. # The default value is: NO. @@ -1790,19 +1876,7 @@ GENERATE_XML = NO XML_OUTPUT = xml -# The XML_SCHEMA tag can be used to specify a XML schema, which can be used by a -# validating XML parser to check the syntax of the XML files. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify a XML DTD, which can be used by a -# validating XML parser to check the syntax of the XML files. -# This tag requires that the tag GENERATE_XML is set to YES. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program # listings (including syntax highlighting and cross-referencing information) to # the XML output. Note that enabling this will significantly increase the size # of the XML output. @@ -1815,7 +1889,7 @@ XML_PROGRAMLISTING = YES # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- -# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files # that can be used to generate PDF. # The default value is: NO. @@ -1829,14 +1903,23 @@ GENERATE_DOCBOOK = NO DOCBOOK_OUTPUT = docbook +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the +# program listings (including syntax highlighting and cross-referencing +# information) to the DOCBOOK output. Note that enabling this will significantly +# increase the size of the DOCBOOK output. +# The default value is: NO. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_PROGRAMLISTING = NO + #--------------------------------------------------------------------------- # Configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- -# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen -# Definitions (see http://autogen.sf.net) file that captures the structure of -# the code including all documentation. Note that this feature is still -# experimental and incomplete at the moment. +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sf.net) file that captures the +# structure of the code including all documentation. Note that this feature is +# still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1845,7 +1928,7 @@ GENERATE_AUTOGEN_DEF = NO # Configuration options related to the Perl module output #--------------------------------------------------------------------------- -# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module # file that captures the structure of the code including all documentation. # # Note that this feature is still experimental and incomplete at the moment. @@ -1853,7 +1936,7 @@ GENERATE_AUTOGEN_DEF = NO GENERATE_PERLMOD = NO -# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary # Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI # output from the Perl module output. # The default value is: NO. @@ -1861,9 +1944,9 @@ GENERATE_PERLMOD = NO PERLMOD_LATEX = NO -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely # formatted so it can be parsed by a human reader. This is useful if you want to -# understand what is going on. On the other hand, if this tag is set to NO the +# understand what is going on. On the other hand, if this tag is set to NO, the # size of the Perl module output will be much smaller and Perl will parse it # just the same. # The default value is: YES. @@ -1883,14 +1966,14 @@ PERLMOD_MAKEVAR_PREFIX = # Configuration options related to the preprocessor #--------------------------------------------------------------------------- -# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all # C-preprocessor directives found in the sources and include files. # The default value is: YES. ENABLE_PREPROCESSING = YES -# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names -# in the source code. If set to NO only conditional compilation will be +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be # performed. Macro expansion can be done in a controlled way by setting # EXPAND_ONLY_PREDEF to YES. # The default value is: NO. @@ -1906,7 +1989,7 @@ MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO -# If the SEARCH_INCLUDES tag is set to YES the includes files in the +# If the SEARCH_INCLUDES tag is set to YES, the include files in the # INCLUDE_PATH will be searched if a #include is found. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1949,9 +2032,9 @@ PREDEFINED = __GNUC__=4 \ EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will -# remove all refrences to function-like macros that are alone on a line, have an -# all uppercase name, and do not end with a semicolon. Such function macros are -# typically used for boiler-plate code, and will confuse the parser if not +# remove all references to function-like macros that are alone on a line, have +# an all uppercase name, and do not end with a semicolon. Such function macros +# are typically used for boiler-plate code, and will confuse the parser if not # removed. # The default value is: YES. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. @@ -1971,7 +2054,7 @@ SKIP_FUNCTION_MACROS = YES # where loc1 and loc2 can be relative or absolute paths or URLs. See the # section "Linking to external documentation" for more information about the use # of tag files. -# Note: Each tag file must have an unique name (where the name does NOT include +# Note: Each tag file must have a unique name (where the name does NOT include # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. @@ -1983,20 +2066,21 @@ TAGFILES = GENERATE_TAGFILE = -# If the ALLEXTERNALS tag is set to YES all external class will be listed in the -# class index. If set to NO only the inherited external classes will be listed. +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. # The default value is: NO. ALLEXTERNALS = NO -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in -# the modules index. If set to NO, only the current project's groups will be +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be # listed. # The default value is: YES. EXTERNAL_GROUPS = YES -# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in # the related pages index. If set to NO, only the current project's pages will # be listed. # The default value is: YES. @@ -2013,7 +2097,7 @@ PERL_PATH = /usr/bin/perl # Configuration options related to the dot tool #--------------------------------------------------------------------------- -# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram # (in HTML and LaTeX) for classes with base or super classes. Setting the tag to # NO turns the diagrams off. Note that this option also works with HAVE_DOT # disabled, but it is recommended to install and use dot, since it yields more @@ -2038,7 +2122,7 @@ MSCGEN_PATH = DIA_PATH = -# If set to YES, the inheritance and collaboration graphs will hide inheritance +# If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. # The default value is: YES. @@ -2063,7 +2147,7 @@ HAVE_DOT = NO DOT_NUM_THREADS = 0 -# When you want a differently looking font n the dot files that doxygen +# When you want a differently looking font in the dot files that doxygen # generates you can specify the font name using DOT_FONTNAME. You need to make # sure dot is able to find the font, which can be done by putting it in a # standard location or by setting the DOTFONTPATH environment variable or by @@ -2111,7 +2195,7 @@ COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. # The default value is: NO. @@ -2163,7 +2247,8 @@ INCLUDED_BY_GRAPH = YES # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2174,7 +2259,8 @@ CALL_GRAPH = NO # # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable caller graphs for selected -# functions only using the \callergraph command. +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2197,11 +2283,15 @@ GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). # Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order # to make the SVG files visible in IE 9+ (other browsers do not have this # requirement). -# Possible values are: png, jpg, gif and svg. +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. # The default value is: png. # This tag requires that the tag HAVE_DOT is set to YES. @@ -2244,6 +2334,19 @@ MSCFILE_DIRS = DIAFILE_DIRS = +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file. If left blank, it is assumed +# PlantUML is not used or called during a preprocessing step. Doxygen will +# generate a warning when it encounters a \startuml command in this case and +# will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes # larger than this value, doxygen will truncate the graph, which is visualized @@ -2280,7 +2383,7 @@ MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) support # this, this feature is disabled by default. @@ -2297,7 +2400,7 @@ DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES -# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot # files that are used to generate the various graphs. # The default value is: YES. # This tag requires that the tag HAVE_DOT is set to YES. diff --git a/Makefile.in b/Makefile.in index b3e3be5c..556a926c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -9,6 +9,7 @@ PACKAGE_TARNAME := @PACKAGE_TARNAME@ PACKAGE_VERSION := @PACKAGE_VERSION@ M4 := @M4@ +LOPSUBGEN := @LOPSUBGEN@ executables := @executables@ diff --git a/NEWS.md b/NEWS.md index 313446f8..d9f092c9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,12 +1,24 @@ NEWS ==== +--------------------- +current master branch +--------------------- ------------------------------------------------- -0.6.1 (to be announced) "hyperbolic correlation" ------------------------------------------------- - +- New sort order for the ls command: -s=h sorts the ls output by hash + value of the audio file. +- autogen.sh now runs the test suite after a successful build. - The contents of overview.pdf have been integrated into the user manual. +- The doxygen source browser has been disabled temporarily. The + API reference is still online, though. +- Overhaul of the source code documentation. +- The deprecated --full-path option of the ls command has been + removed. It was a no-op since 0.6.0. +- The wma decoder has been cleaned up and its bitstream API made + more robust. +- The image/lyrics ID status items of the current audio file are now + updated on changes. This affects para_gui, which used to report the + old value until EOF. ------------------------------- 0.6.0 (2017-04-28) "fuzzy flux" diff --git a/aacdec_filter.c b/aacdec_filter.c index 26d5f652..ce3eb3bd 100644 --- a/aacdec_filter.c +++ b/aacdec_filter.c @@ -28,7 +28,7 @@ /** * data specific to the aacdec filter * - * \sa filter, filter_node + * \sa \ref filter, \ref filter_node. */ struct private_aacdec_data { /** the return value of aac_open */ diff --git a/afh.h b/afh.h index 6dc5a3fc..20c61dba 100644 --- a/afh.h +++ b/afh.h @@ -103,7 +103,7 @@ struct audio_format_handler { * success, the function must return a positive value and fill in the * given struct afh_info. * - * \sa struct afh_info + * \sa struct \ref afh_info. */ int (*get_file_info)(char *map, size_t numbytes, int fd, struct afh_info *afhi); diff --git a/afh_common.c b/afh_common.c index 516ea654..dd9b3192 100644 --- a/afh_common.c +++ b/afh_common.c @@ -16,7 +16,17 @@ #include "afh.h" typedef void afh_init_func(struct audio_format_handler *); -/* It does not hurt to declare init functions which are not available. */ + +/* + * Declaration of the audio format handler init functions. + * + * These symbols are referenced in the afl array below. + * + * Most audio format handlers depend on an external library and are not + * compiled in if the library is not installed. Hence it is well possible that + * not all of these functions are defined. It does not hurt to declare them + * anyway, and this avoids another set of ifdefs. + */ extern afh_init_func mp3_afh_init, ogg_afh_init, aac_afh_init, wma_afh_init, spx_afh_init, flac_afh_init, opus_afh_init; diff --git a/afh_recv.c b/afh_recv.c index 9d6effe1..d2d8b52b 100644 --- a/afh_recv.c +++ b/afh_recv.c @@ -237,6 +237,7 @@ out: return ret; } +/** See \ref recv_init(). */ const struct receiver lsg_recv_cmd_com_afh_user_data = { .init = afh_init, .open = afh_recv_open, diff --git a/afs.c b/afs.c index 75b82c21..ef05a473 100644 --- a/afs.c +++ b/afs.c @@ -37,22 +37,22 @@ #include "sideband.h" #include "command.h" -/** The osl tables used by afs. \sa blob.c. */ +/** The osl tables used by afs. \sa \ref blob.c. */ enum afs_table_num { - /** Contains audio file information. See aft.c. */ + /** Contains audio file information. See \ref aft.c. */ TBLNUM_AUDIO_FILES, - /** The table for the paraslash attributes. See attribute.c. */ + /** The table for the paraslash attributes. See \ref attribute.c. */ TBLNUM_ATTRIBUTES, /** * Paraslash's scoring system is based on Gaussian normal * distributions, and the relevant data is stored in the rbtrees of an - * osl table containing only volatile columns. See score.c for + * osl table containing only volatile columns. See \ref score.c for * details. */ TBLNUM_SCORES, /** * A standard blob table containing the mood definitions. For details - * see mood.c. + * see \ref mood.c. */ TBLNUM_MOODS, /** A blob table containing lyrics on a per-song basis. */ @@ -130,7 +130,7 @@ extern uint32_t afs_socket_cookie; * command socket, so that the handler process can read the id, attach the * shared memory area and use the result. * - * \sa struct callback_result. + * \sa \ref struct callback_result. */ struct callback_query { /** The function to be called. */ @@ -146,7 +146,7 @@ struct callback_query { * into the shared memory area holding the result, mainly to let the command * handler know the size of the result. * - * \sa struct callback_query. + * \sa \ref struct callback_query. */ struct callback_result { /** The number of bytes of the result. */ @@ -201,9 +201,8 @@ static int dispatch_result(int result_shmid, callback_result_handler *handler, * shmid are passed to that function as an osl object. The private_result_data * pointer is passed as the second argument to \a result_handler. * - * \return Number of shared memory areas dispatched on success, negative on errors. - * - * \sa send_option_arg_callback_request(), send_standard_callback_request(). + * \return Number of shared memory areas dispatched on success, negative on + * errors. */ int send_callback_request(afs_callback *f, struct osl_object *query, callback_result_handler *result_handler, @@ -381,7 +380,7 @@ int for_each_matching_row(struct pattern_match_data *pmd) * \a obj1 is found, respectively, to be less than, to match, or be greater than * obj2. * - * \sa strcmp(3), strncmp(3), osl_compare_func. + * \sa strcmp(3), strncmp(3). */ int string_compare(const struct osl_object *obj1, const struct osl_object *obj2) { @@ -433,7 +432,7 @@ static int pass_afd(int fd, char *buf, size_t size) * * \return Standard. * - * \sa open_and_update_audio_file(). + * \sa \ref open_and_update_audio_file(). */ static int open_next_audio_file(void) { @@ -483,7 +482,7 @@ static int activate_mood_or_playlist(const char *arg, int *num_admissible) ret = change_current_mood(arg + 2); mode = PLAY_MODE_MOOD; } else - return -E_AFS_SYNTAX; + return -ERRNO_TO_PARA_ERROR(EINVAL); if (ret < 0) return ret; } @@ -498,10 +497,12 @@ static int activate_mood_or_playlist(const char *arg, int *num_admissible) strncpy(mmd->afs_mode_string, arg, sizeof(mmd->afs_mode_string)); mmd->afs_mode_string[sizeof(mmd->afs_mode_string) - 1] = '\0'; + mmd->events++; mutex_unlock(mmd_mutex); } else { mutex_lock(mmd_mutex); strcpy(mmd->afs_mode_string, "dummy"); + mmd->events++; mutex_unlock(mmd_mutex); current_mop = NULL; } @@ -581,7 +582,7 @@ static int com_select_callback(struct afs_callback_arg *aca) goto out; /* ignore subsequent errors (but log them) */ para_printf(&aca->pbout, "could not activate %s\n", arg); - if (current_mop) { + if (current_mop && strcmp(current_mop, arg) != 0) { int ret2; para_printf(&aca->pbout, "switching back to %s\n", current_mop); ret2 = activate_mood_or_playlist(current_mop, &num_admissible); @@ -616,8 +617,13 @@ EXPORT_SERVER_CMD_HANDLER(select); static void init_admissible_files(const char *arg) { - if (activate_mood_or_playlist(arg, NULL) < 0) + int ret = activate_mood_or_playlist(arg, NULL); + if (ret < 0) { + assert(arg); + PARA_WARNING_LOG("could not activate %s: %s\n", arg, + para_strerror(-ret)); activate_mood_or_playlist(NULL, NULL); /* always successful */ + } } static int setup_command_socket_or_die(void) diff --git a/afs.h b/afs.h index c2a8f2e9..ea4b497e 100644 --- a/afs.h +++ b/afs.h @@ -141,7 +141,7 @@ struct pattern_match_data { unsigned loop_col_num; /** Data from this column is matched against the given patterns. */ unsigned match_col_num; - /** \see pattern_match_flags. */ + /** \see \ref pattern_match_flags. */ unsigned pm_flags; /** This value is passed verbatim to fnmatch(). */ int fnmatch_flags; @@ -174,7 +174,7 @@ struct afs_callback_arg { * Therefore afs commands typically consist of two functions: The command * handler and the corresponding callback function that runs in afs context. * - * \sa send_callback_request(). + * \sa \ref send_callback_request(). */ typedef int afs_callback(struct afs_callback_arg *aca); diff --git a/aft.c b/aft.c index 68e89dbb..1679a549 100644 --- a/aft.c +++ b/aft.c @@ -138,7 +138,7 @@ struct ls_options { /** * Describes the layout of the mmapped-afs info struct. * - * \sa struct afs_info. + * \sa struct \ref afs_info. */ enum afsi_offsets { /** Where .last_played is stored. */ @@ -167,7 +167,7 @@ enum afsi_offsets { * \param afsi Pointer to the audio file info to be converted. * \param obj Result pointer. * - * \sa load_afsi(). + * \sa \ref load_afsi(). */ static void save_afsi(struct afs_info *afsi, struct osl_object *obj) { @@ -192,7 +192,7 @@ static void save_afsi(struct afs_info *afsi, struct osl_object *obj) * * \return Standard. * - * \sa save_afsi(). + * \sa \ref save_afsi(). */ static int load_afsi(struct afs_info *afsi, struct osl_object *obj) { @@ -365,7 +365,10 @@ static void save_afhi(struct afh_info *afhi, char *buf) write_u32(buf + CHUNK_TV_TV_SEC_OFFSET, afhi->chunk_tv.tv_sec); write_u32(buf + CHUNK_TV_TV_USEC_OFFSET, afhi->chunk_tv.tv_usec); p = buf + AFHI_INFO_STRING_OFFSET; - /* The sprintf's below are OK as our caller made sure that buf is large enough */ + /* + * The below sprintf(3) calls are OK because our caller already made + * sure that buf is large enough. + */ p += sprintf(p, "%s", afhi->techinfo) + 1; p += sprintf(p, "%s", afhi->tags.artist) + 1; p += sprintf(p, "%s", afhi->tags.title) + 1; @@ -529,7 +532,7 @@ static int get_afsi_of_path(const char *path, struct afs_info *afsi) * \param row Pointer to a row in the audio file table. * \param path Result pointer. * - * The result is a pointer to mmapped data. The caller must not attempt + * The result is a pointer to memory-mapped data. The caller must not attempt * to free it. * * \return Standard. @@ -539,10 +542,12 @@ int get_audio_file_path_of_row(const struct osl_row *row, char **path) struct osl_object path_obj; int ret = osl(osl_get_object(audio_file_table, row, AFTCOL_PATH, &path_obj)); + if (ret < 0) - return ret; - *path = path_obj.data; - return 1; + *path = NULL; + else + *path = path_obj.data; + return ret; } /** @@ -553,7 +558,7 @@ int get_audio_file_path_of_row(const struct osl_row *row, char **path) * * \return The return value of the underlying call to osl_get_object(). * - * \sa get_hash_of_row(). + * \sa \ref get_hash_of_row(). */ static int get_hash_object_of_aft_row(const struct osl_row *row, struct osl_object *obj) @@ -594,8 +599,6 @@ static int get_hash_of_row(const struct osl_row *row, unsigned char **hash) * After the call the members of the afhi structure point to mapped memory * which is owned by the osl table, Hence the caller must not attempt to free * this memory by calling \ref clear_afhi(). - * - * \sa get_chunk_table_of_row(). */ int get_afhi_of_row(const struct osl_row *row, struct afh_info *afhi) { @@ -988,6 +991,8 @@ static int make_status_items(void) time_t current_time; int ret; + if (!status_item_ls_data.path) /* no audio file open */ + return 0; ret = lls_parse(ARRAY_SIZE(argv), argv, cmd, &opts.lpr, NULL); assert(ret >= 0); time(¤t_time); @@ -1109,6 +1114,12 @@ out: return ret; } +static int ls_hash_compare(const void *a, const void *b) +{ + struct ls_data *d1 = *(struct ls_data **)a, *d2 = *(struct ls_data **)b; + return memcmp(d1->hash, d2->hash, HASH_SIZE); +} + static int ls_audio_format_compare(const void *a, const void *b) { struct ls_data *d1 = *(struct ls_data **)a, *d2 = *(struct ls_data **)b; @@ -1226,6 +1237,8 @@ static int sort_matching_paths(struct ls_options *options) compar = ls_duration_compare; break; case LS_SORT_BY_AUDIO_FORMAT: compar = ls_audio_format_compare; break; + case LS_SORT_BY_HASH: + compar = ls_hash_compare; break; default: return -E_BAD_SORT; } @@ -1374,7 +1387,6 @@ out: return ret; } -/* TODO: flags -h (sort by hash) */ static int com_ls(struct command_context *cc, struct lls_parse_result *lpr) { const struct lls_command *cmd = SERVER_CMD_CMD_PTR(LS); @@ -1440,6 +1452,8 @@ static int com_ls(struct command_context *cc, struct lls_parse_result *lpr) opts->sorting = LS_SORT_BY_DURATION; else if (!strcmp(val, "a") || !strcmp(val, "audio-format")) opts->sorting = LS_SORT_BY_AUDIO_FORMAT; + else if (!strcmp(val, "h") || !strcmp(val, "hash")) + opts->sorting = LS_SORT_BY_HASH; else { ret = -E_AFT_SYNTAX; goto out; @@ -1912,11 +1926,7 @@ out: } EXPORT_SERVER_CMD_HANDLER(add); -/** - * Flags used by the touch command. - * - * \sa com_touch(). - */ +/** Flags used by the touch command. */ enum touch_flags { /** Whether the \p FNM_PATHNAME flag should be passed to fnmatch(). */ TOUCH_FLAG_FNM_PATHNAME = 1, @@ -2402,8 +2412,6 @@ static int check_audio_file(struct osl_row *row, void *data) * \param aca Only ->pbout is used for diagnostics. * * \return Standard. Inconsistencies are reported but not regarded as an error. - * - * \sa com_check(). */ int aft_check_callback(struct afs_callback_arg *aca) { @@ -2472,7 +2480,7 @@ int aft_check_attributes(uint64_t att_mask, struct para_buffer *pb) * * \param flags Usual flags that are passed to osl_close_table(). * - * \sa osl_close_table(). + * \sa \ref osl_close_table(). */ static void aft_close(void) { @@ -2487,7 +2495,7 @@ static void aft_close(void) * * \return Standard. * - * \sa osl_open_table(). + * \sa \ref osl_open_table(). */ static int aft_open(const char *dir) { @@ -2563,6 +2571,16 @@ static int aft_event_handler(enum afs_events event, struct para_buffer *pb, return ret; make_status_items(); return 1; + } + case BLOB_RENAME: + case BLOB_REMOVE: + case BLOB_ADD: { + /* + * These events are rare. We don't bother to check whether the + * current status items are affected and simply recreate them + * every time. + */ + make_status_items(); } default: return 0; } diff --git a/attribute.c b/attribute.c index 637e1f51..2ea73a6a 100644 --- a/attribute.c +++ b/attribute.c @@ -476,7 +476,7 @@ int attribute_check_callback(struct afs_callback_arg *aca) /** * Close the attribute table. * - * \sa osl_close_table(). + * \sa \ref osl_close_table(). */ static void attribute_close(void) { @@ -491,7 +491,7 @@ static void attribute_close(void) * * \return Positive on success, negative on errors. * - * \sa osl_open_table(). + * \sa \ref osl_open_table(). */ static int attribute_open(const char *dir) { diff --git a/audioc.c b/audioc.c index 2711ac1a..ed39ce6e 100644 --- a/audioc.c +++ b/audioc.c @@ -132,7 +132,6 @@ static void grab_completer(struct i9e_completion_info *ci, i9e_complete_option(opts, ci, cr); } -I9E_DUMMY_COMPLETER(SUPERCOMMAND_UNAVAILABLE); static struct i9e_completer audiod_completers[] = { #define LSG_AUDIOD_CMD_CMD(_name) {.name = #_name, \ .completer = _name ## _completer} @@ -332,7 +331,7 @@ static void handle_help_flag(void) * * \return EXIT_SUCCESS or EXIT_FAILURE. * - * \sa send_cred_buffer(), para_audioc(1), para_audiod(1). + * \sa \ref send_cred_buffer(), para_audioc(1), para_audiod(1). */ int main(int argc, char *argv[]) { diff --git a/audiod.c b/audiod.c index d3c9c464..42f4c0a3 100644 --- a/audiod.c +++ b/audiod.c @@ -109,9 +109,7 @@ struct slot_info { * para_audiod uses \p MAX_STREAM_SLOTS different slots, each of which may * be associated with a receiver/filter/writer triple. This array holds all * information on the status of these slots. - * - * \sa struct slot_info - * */ + */ struct slot_info slot[MAX_STREAM_SLOTS]; /** The vss status flags audiod is interested in. */ @@ -167,8 +165,8 @@ struct status_task { char *stat_item_values[NUM_STAT_ITEMS] = {NULL}; /** - * the current mode of operation of which can be changed by the on/off/cycle - * commands. It is either, AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY. + * The current mode of operation (AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY). + * Set by the on/off/cycle commands. */ int audiod_status = AUDIOD_ON; @@ -179,20 +177,20 @@ static struct status_task status_task_struct; static uid_t *uid_whitelist; /** - * the task that calls the status command of para_server + * The task that calls the status command of para_server. * - * \sa struct status_task + * \sa \ref struct status_task. */ static struct status_task *stat_task = &status_task_struct; struct command_task { /** The local listening socket. */ int fd; - /** the associated task structure */ + /** The associated task structure. */ struct task *task; }; -/** iterate over all supported audio formats */ +/** Iterate over all supported audio formats. */ #define FOR_EACH_AUDIO_FORMAT(af) for (af = 0; af < NUM_AUDIO_FORMATS; af++) /** @@ -668,6 +666,7 @@ static int open_receiver(int format) EMBRACE(.name = name, .context = rn)); ret = r->open(rn); if (ret < 0) { + PARA_ERROR_LOG("could not open %s receiver\n", name); btr_remove_node(&rn->btrn); free(rn); return ret; diff --git a/audiod_command.c b/audiod_command.c index 09201620..a6a49b74 100644 --- a/audiod_command.c +++ b/audiod_command.c @@ -416,7 +416,7 @@ EXPORT_AUDIOD_CMD_HANDLER(version) * \return Positive on success, negative on errors, zero if there was no * connection to accept. * - * \sa para_accept(), recv_cred_buffer() + * \sa \ref para_accept(), \ref recv_cred_buffer(). * */ int handle_connect(int accept_fd, fd_set *rfds) { diff --git a/autogen.sh b/autogen.sh index 708602e7..caf1401d 100755 --- a/autogen.sh +++ b/autogen.sh @@ -25,4 +25,4 @@ echo configuring... ./configure $@ > /dev/null echo compiling... make clean > /dev/null 2>&1 -make -j $n > /dev/null +make -j $n > /dev/null && make check diff --git a/bitstream.c b/bitstream.c index 9cd1273c..c2018b56 100644 --- a/bitstream.c +++ b/bitstream.c @@ -47,7 +47,7 @@ static void alloc_table(struct vlc *vlc, int size) if (vlc->table_size > vlc->table_allocated) { vlc->table_allocated += (1 << vlc->bits); vlc->table = para_realloc(vlc->table, - sizeof(VLC_TYPE) * 2 * vlc->table_allocated); + sizeof(int16_t) * 2 * vlc->table_allocated); } } @@ -57,7 +57,7 @@ static int build_table(struct vlc *vlc, int table_nb_bits, int nb_codes, { int i, j, k, n, table_size, table_index, nb, n1, idx; uint32_t code; - VLC_TYPE(*table)[2]; + int16_t (*table)[2]; table_size = 1 << table_nb_bits; table_index = vlc->table_size; @@ -165,33 +165,29 @@ void free_vlc(struct vlc *vlc) * Parse a vlc code. * * \param gbc The getbit context structure. - * \param table The vlc tables to use. - * \param bits The number of bits which will be read at once. - * - * The \a bits parameter must be identical to the \a nb_bits value supplied to - * \ref init_vlc(). + * \param vlc The vlc tables to use. * * \return The vlc code. */ -int get_vlc(struct getbit_context *gbc, VLC_TYPE(*table)[2], int bits) +int get_vlc(struct getbit_context *gbc, const struct vlc *vlc) { int n, idx, nb_bits, code; - idx = show_bits(gbc, bits); - code = table[idx][0]; - n = table[idx][1]; + idx = show_bits(gbc, vlc->bits); + code = vlc->table[idx][0]; + n = vlc->table[idx][1]; if (n < 0) { - skip_bits(gbc, bits); + skip_bits(gbc, vlc->bits); nb_bits = -n; idx = show_bits(gbc, nb_bits) + code; - code = table[idx][0]; - n = table[idx][1]; + code = vlc->table[idx][0]; + n = vlc->table[idx][1]; if (n < 0) { skip_bits(gbc, nb_bits); nb_bits = -n; idx = show_bits(gbc, nb_bits) + code; - code = table[idx][0]; - n = table[idx][1]; + code = vlc->table[idx][0]; + n = vlc->table[idx][1]; } } skip_bits(gbc, n); diff --git a/bitstream.h b/bitstream.h index a6349861..4d81fa3b 100644 --- a/bitstream.h +++ b/bitstream.h @@ -13,20 +13,18 @@ struct getbit_context { /** Start of the internal buffer. */ const uint8_t *buffer; - /** End of the internal buffer. */ - const uint8_t *buffer_end; + /** Length of buffer in bits (always a multiple of 8). */ + uint32_t num_bits; /** Bit counter. */ int index; }; -#define VLC_TYPE int16_t - /** A variable length code table. */ struct vlc { /** Number of bits of the table. */ int bits; /** The code and the bits table. */ - VLC_TYPE(*table)[2]; + int16_t (*table)[2]; /** The size of the table. */ int table_size; /** Amount of memory allocated so far. */ @@ -36,8 +34,12 @@ struct vlc { static inline uint32_t show_bits(struct getbit_context *gbc, int num) { int idx = gbc->index; - const char *p = (const char *)gbc->buffer + (idx >> 3); - uint32_t x = read_u32_be(p); + const char *p; + uint32_t x; + + assert(idx + num <= gbc->num_bits); + p = (const char *)gbc->buffer + (idx >> 3); + x = read_u32_be(p); return (x << (idx & 7)) >> (32 - num); } @@ -48,12 +50,13 @@ static inline int get_bits_count(struct getbit_context *gbc) static inline void skip_bits(struct getbit_context *gbc, int n) { + assert(gbc->index + n <= gbc->num_bits); gbc->index += n; } static inline unsigned int get_bits(struct getbit_context *gbc, int n) { - unsigned int ret = show_bits(gbc, n); + unsigned int ret = show_bits(gbc, n); /* checks n */ skip_bits(gbc, n); return ret; } @@ -61,8 +64,13 @@ static inline unsigned int get_bits(struct getbit_context *gbc, int n) /* This is rather hot, we can do better than get_bits(gbc, 1). */ static inline unsigned int get_bit(struct getbit_context *gbc) { - int idx = gbc->index++; - uint8_t tmp = gbc->buffer[idx >> 3], mask = 1 << (7 - (idx & 7)); + int idx; + uint8_t tmp, mask; + + assert(gbc->index < gbc->num_bits); + idx = gbc->index++; + tmp = gbc->buffer[idx >> 3]; + mask = 1 << (7 - (idx & 7)); return !!(tmp & mask); } @@ -81,11 +89,11 @@ static inline void init_get_bits(struct getbit_context *gbc, const uint8_t *buffer, int size) { gbc->buffer = buffer; - gbc->buffer_end = buffer + size; + gbc->num_bits = size * 8; gbc->index = 0; } void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, const void *bits, const void *codes, int codes_size); void free_vlc(struct vlc *vlc); -int get_vlc(struct getbit_context *gbc, VLC_TYPE(*table)[2], int bits); +int get_vlc(struct getbit_context *gbc, const struct vlc *vlc); diff --git a/blob.c b/blob.c index 8abecf6a..2d7c6050 100644 --- a/blob.c +++ b/blob.c @@ -30,8 +30,6 @@ * \param obj2 Pointer to the second integer. * * \return The values required for an osl compare function. - * - * \sa osl_compare_func, osl_hash_compare(). */ static int uint32_compare(const struct osl_object *obj1, const struct osl_object *obj2) { diff --git a/buffer_tree.c b/buffer_tree.c index b0cd6665..9b5bcda1 100644 --- a/buffer_tree.c +++ b/buffer_tree.c @@ -905,7 +905,7 @@ size_t btr_get_output_queue_size(struct btr_node *btrn) * \return \p -ENOTSUP if no parent node of \a btrn understands \a command. * Otherwise the return value of the command handler is returned. * - * \sa \ref receiver::execute, filter::execute, writer::execute. + * \sa \ref receiver::execute, \ref filter::execute, \ref writer::execute. */ int btr_exec_up(struct btr_node *btrn, const char *command, char **value_result) { @@ -935,7 +935,7 @@ int btr_exec_up(struct btr_node *btrn, const char *command, char **value_result) * * \return A pointer to the \a context address specified at node creation time. * - * \sa btr_new_node(), struct \ref btr_node_description. + * \sa \ref btr_new_node(), struct \ref btr_node_description. */ void *btr_context(struct btr_node *btrn) { diff --git a/client.c b/client.c index 68d8a7ef..2607ee20 100644 --- a/client.c +++ b/client.c @@ -497,7 +497,6 @@ static int client_i9e_line_handler(char *line) return 1; } -I9E_DUMMY_COMPLETER(SUPERCOMMAND_UNAVAILABLE); static struct i9e_completer completers[] = { #define LSG_SERVER_CMD_CMD(_name) {.name = #_name, \ .completer = _name ## _completer} @@ -616,7 +615,8 @@ static struct supervisor_task supervisor_task; * * \return EXIT_SUCCESS or EXIT_FAILURE * - * \sa client_open(), stdin.c, stdout.c, para_client(1), para_server(1) + * \sa \ref client_open(), \ref stdin.c, \ref stdout.c, para_client(1), + * para_server(1). */ int main(int argc, char *argv[]) { diff --git a/close_on_fork.c b/close_on_fork.c index c606d98c..655dbc56 100644 --- a/close_on_fork.c +++ b/close_on_fork.c @@ -19,7 +19,7 @@ static int initialized; /** * Describes an element of the close-on-fork list. * - * \sa list.h + * \sa \ref list.h. */ struct close_on_fork { /** The file descriptor which should be closed after fork(). */ diff --git a/command.c b/command.c index 52f4153b..69564336 100644 --- a/command.c +++ b/command.c @@ -107,8 +107,8 @@ static unsigned get_status(struct misc_meta_data *nmmd, bool parser_friendly, clock_get_realtime(¤t_time); /* * The calls to WRITE_STATUS_ITEM() below never fail because - * b->max_size is zero (unlimited), see para_printf(). However, clang - * is not smart enough to prove this and complains nevertheless. + * b->max_size is zero (unlimited), see \ref para_printf(). However, + * clang is not smart enough to prove this and complains nevertheless. * Casting the return value to void silences clang. */ (void)WRITE_STATUS_ITEM(&b, SI_status, "%s\n", status); @@ -227,7 +227,7 @@ static int check_sender_args(struct command_context *cc, struct lls_parse_result *lpr, struct sender_command_data *scd) { int i, ret; - const char *subcmds[] = {SENDER_SUBCOMMANDS}; + const char * const subcmds[] = {SENDER_SUBCOMMANDS}; const char *arg; char *errctx; unsigned num_inputs = lls_num_inputs(lpr); @@ -246,10 +246,10 @@ static int check_sender_args(struct command_context *cc, return -E_COMMAND_SYNTAX; scd->sender_num = i; arg = lls_input(1, lpr); - for (i = 0; subcmds[i]; i++) + for (i = 0; i < NUM_SENDER_CMDS; i++) if (!strcmp(subcmds[i], arg)) break; - if (!subcmds[i]) + if (i == NUM_SENDER_CMDS) return -E_COMMAND_SYNTAX; scd->cmd_num = i; if (!senders[scd->sender_num].client_cmds[scd->cmd_num]) @@ -457,10 +457,9 @@ EXPORT_SERVER_CMD_HANDLER(version); ITEM(num_chunks) \ ITEM(amplification) \ -/** - * Write a list of audio-file related status items with empty values. - * - * This is used by vss when currently no audio file is open. +/* + * Create a set of audio-file related status items with empty values. These are + * written to stat clients when no audio file is open. */ static unsigned empty_status_items(bool parser_friendly, char **result) { @@ -884,7 +883,7 @@ static int run_command(struct command_context *cc, struct iovec *iov, * the function if the connection was not authenticated when the timeout * expires. * - * \sa alarm(2), crypt.c, crypt.h + * \sa alarm(2), \ref crypt.c, \ref crypt.h. */ __noreturn void handle_connect(int fd, const char *peername) { @@ -893,7 +892,7 @@ __noreturn void handle_connect(int fd, const char *peername) unsigned char challenge_hash[HASH_SIZE]; char *command = NULL, *buf = para_malloc(HANDSHAKE_BUFSIZE) /* must be on the heap */; size_t numbytes; - struct command_context cc_struct = {.peer = peername}, *cc = &cc_struct; + struct command_context cc_struct = {.u = NULL}, *cc = &cc_struct; struct iovec iov; struct connection_features cf; diff --git a/command.h b/command.h index 5b01eb79..0265f056 100644 --- a/command.h +++ b/command.h @@ -2,8 +2,6 @@ /** Per connection data available to command handlers. */ struct command_context { - /** Network address of the peer. */ - const char *peer; /** The paraslash user that executes this command. */ struct user *u; /** File descriptor and crypto keys. */ diff --git a/configure.ac b/configure.ac index b51f72d1..83375559 100644 --- a/configure.ac +++ b/configure.ac @@ -54,10 +54,6 @@ AC_PATH_PROG([M4], [m4]) test -z "$M4" && AC_MSG_ERROR( [The m4 macro processor is required to build this package]) -AC_PATH_PROG([lopsubgen], [lopsubgen]) -test -z "$lopsubgen" && AC_MSG_ERROR( - [lopsubgen is required to build this package]) - AC_PROG_CC AC_PROG_CPP @@ -71,9 +67,11 @@ AC_CHECK_LIB([osl], [osl_open_table], [], [HAVE_OSL=no]) LIB_SUBST_FLAGS(osl) UNSTASH_FLAGS ######################################################################## lopsub +HAVE_LOPSUB=yes +AC_PATH_PROG([LOPSUBGEN], [lopsubgen]) +test -z "$LOPSUBGEN" && HAVE_LOPSUB=no STASH_FLAGS LIB_ARG_WITH([lopsub], [-llopsub]) -HAVE_LOPSUB=yes AC_CHECK_HEADER(lopsub.h, [], [HAVE_LOPSUB=no]) AC_CHECK_LIB([lopsub], [lls_merge], [], [HAVE_LOPSUB=no]) if test $HAVE_LOPSUB = no; then AC_MSG_ERROR([ @@ -165,17 +163,12 @@ AC_DEFINE_UNQUOTED(ICONV_CAST, $cast, [cast for second arg to iconv()]) AC_MSG_RESULT($msg) UNSTASH_FLAGS ########################################################################### ucred -AC_MSG_CHECKING(for struct ucred) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +AC_CHECK_TYPE([struct ucred], [ + AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred) +], [], [ #include #include -]], [[ - struct ucred sucred; sucred.pid=0; -]])],[have_ucred=yes],[have_ucred=no]) -AC_MSG_RESULT($have_ucred) -if test ${have_ucred} = yes; then - AC_DEFINE(HAVE_UCRED, 1, define to 1 you have struct ucred) -fi +]) ########################################################################### curses STASH_FLAGS LIB_ARG_WITH([curses], []) @@ -186,18 +179,12 @@ curses_ldflags="$curses_ldflags $LIBS" LIB_SUBST_FLAGS(curses) UNSTASH_FLAGS ########################################################################### ip_mreqn -AC_MSG_CHECKING(for struct ip_mreqn (UDPv4 multicast)) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +AC_CHECK_TYPE([struct ip_mreqn], [ + AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 if you have struct ip_mreqn) +], [], [ #include #include -]], [[ - struct ip_mreqn mn; - mn.imr_ifindex = 0; -]])],[have_ip_mreqn=yes],[have_ip_mreqn=no]) -AC_MSG_RESULT($have_ip_mreqn) -if test ${have_ip_mreqn} = yes; then - AC_DEFINE(HAVE_IP_MREQN, 1, define to 1 if you have struct ip_mreqn) -fi +]) ########################################################################### ogg STASH_FLAGS LIB_ARG_WITH([ogg], [-logg]) diff --git a/daemon.c b/daemon.c index 20cdc6ae..4e15824f 100644 --- a/daemon.c +++ b/daemon.c @@ -374,8 +374,6 @@ time_t daemon_get_uptime(const struct timeval *current_time) * \param current_time See a \ref daemon_get_uptime(). * * \return A dynamically allocated string of the form "days:hours:minutes". - * - * \sa server_uptime. */ __malloc char *daemon_get_uptime_str(const struct timeval *current_time) { diff --git a/dccp_recv.c b/dccp_recv.c index 318969af..3385d66c 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -155,6 +155,7 @@ out: return ret; } +/** See \ref recv_init(). */ const struct receiver lsg_recv_cmd_com_dccp_user_data = { .open = dccp_recv_open, .close = dccp_recv_close, diff --git a/dccp_send.c b/dccp_send.c index 61d42126..4ad25e73 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -138,7 +138,7 @@ static void dccp_post_select(fd_set *rfds, __a_unused fd_set *wfds) /* * Bypass unused CCID paths: the sender does not receive application data * from the client; by shutting down this unused communication path we can - * reduce processing costs a bit. See analogous comment in dccp_recv.c. + * reduce processing costs a bit. See analogous comment in \ref dccp_recv.c. */ if (shutdown(sc->fd, SHUT_RD) < 0) { PARA_WARNING_LOG("%s\n", strerror(errno)); diff --git a/error.h b/error.h index 407859ca..e792b058 100644 --- a/error.h +++ b/error.h @@ -17,7 +17,6 @@ PARA_ERROR(AFS_SHORT_READ, "short read from afs socket"), \ PARA_ERROR(AFS_SIGNAL, "afs caught deadly signal"), \ PARA_ERROR(AFS_SOCKET, "afs socket not writable"), \ - PARA_ERROR(AFS_SYNTAX, "afs syntax error"), \ PARA_ERROR(AFT_SYNTAX, "audio file table syntax error"), \ PARA_ERROR(ALSA, "alsa error"), \ PARA_ERROR(ALSA_MIX_GET_VAL, "could not read control element state"), \ @@ -339,8 +338,8 @@ _static_inline_ int osl(int ret) /** * Wrapper for lopsub library calls. * - * \param ret See osl(). - * \return See osl(). + * \param ret See \ref osl(). + * \return See \ref osl(). */ _static_inline_ int lls(int ret) { diff --git a/fd.c b/fd.c index 6a26ce5e..49736448 100644 --- a/fd.c +++ b/fd.c @@ -405,7 +405,7 @@ __must_check int mark_fd_nonblocking(int fd) * This wrapper for FD_SET() passes its first two arguments to \p FD_SET. Upon * return, \a max_fileno contains the maximum of the old_value and \a fd. * - * \sa para_select. + * \sa \ref para_select. */ void para_fd_set(int fd, fd_set *fds, int *max_fileno) { @@ -573,20 +573,6 @@ close_cwd: return ret; } -/** - * A wrapper for fchdir(). - * - * \param fd An open file descriptor. - * - * \return Standard. - */ -static int para_fchdir(int fd) -{ - if (fchdir(fd) < 0) - return -ERRNO_TO_PARA_ERROR(errno); - return 1; -} - /** * A wrapper for mkdir(2). * @@ -674,7 +660,7 @@ out: * * \return Standard. * - * \sa munmap(2), mmap_full_file(). + * \sa munmap(2), \ref mmap_full_file(). */ int para_munmap(void *start, size_t length) { @@ -716,8 +702,6 @@ int write_ok(int fd) * * Common approach that opens /dev/null until it gets a file descriptor greater * than two. - * - * \sa okir's Black Hats Manual. */ void valid_fd_012(void) { @@ -751,7 +735,7 @@ int for_each_file_in_dir(const char *dirname, { DIR *dir; struct dirent *entry; - int cwd_fd, ret2, ret = para_opendir(dirname, &dir, &cwd_fd); + int cwd_fd, ret = para_opendir(dirname, &dir, &cwd_fd); if (ret < 0) return ret == -ERRNO_TO_PARA_ERROR(EACCES)? 1 : ret; @@ -787,9 +771,8 @@ int for_each_file_in_dir(const char *dirname, ret = 1; out: closedir(dir); - ret2 = para_fchdir(cwd_fd); - if (ret2 < 0 && ret >= 0) - ret = ret2; + if (fchdir(cwd_fd) < 0 && ret >= 0) + ret = -ERRNO_TO_PARA_ERROR(errno); close(cwd_fd); return ret; } diff --git a/filter.h b/filter.h index 4537b220..ab98c244 100644 --- a/filter.h +++ b/filter.h @@ -41,7 +41,7 @@ struct filter_node { * time, all these filter functions must be reentrant; no static non-constant * variables may be used. * - * \sa mp3dec_filter.c, oggdec_filter.c, wav_filter.c, compress_filter.c, filter_node + * \sa \ref filter_node. */ struct filter { /** @@ -143,6 +143,5 @@ static inline void write_int16_host_endian(char *buf, int val) #endif } -/** Make a filter pointer from the filter number. */ const struct filter *filter_get(int filter_num); const char *filter_name(int filter_num); diff --git a/filter_common.c b/filter_common.c index b406951e..5533d4dc 100644 --- a/filter_common.c +++ b/filter_common.c @@ -21,7 +21,7 @@ #include "string.h" /** Iterate over all filters. */ -#define FOR_EACH_FILTER(j) for (j = 1; lls_cmd(j, filter_cmd_suite); j++) +#define FOR_EACH_FILTER(j) for (j = 1; FILTER_CMD(j); j++) /** * Obtain a reference to a filter structure. diff --git a/http_recv.c b/http_recv.c index d49cf2a8..67691a34 100644 --- a/http_recv.c +++ b/http_recv.c @@ -30,7 +30,7 @@ /** * the possible states of a http receiver node * - * \sa receiver_node + * \sa \ref receiver_node. */ enum http_recv_status {HTTP_CONNECTED, HTTP_SENT_GET_REQUEST, HTTP_STREAMING}; @@ -46,7 +46,7 @@ struct private_http_recv_data { * It gets initialized to \p HTTP_CONNECTED by the open function of the * http receiver. * - * \sa receiver::open, receiver_node. + * \sa \ref receiver::open, \ref receiver_node. */ enum http_recv_status status; }; @@ -167,6 +167,7 @@ static int http_recv_open(struct receiver_node *rn) return 1; } +/** See \ref recv_init(). */ const struct receiver lsg_recv_cmd_com_http_user_data = { .open = http_recv_open, .close = http_recv_close, diff --git a/interactive.h b/interactive.h index e6d53dee..82d3cd71 100644 --- a/interactive.h +++ b/interactive.h @@ -33,7 +33,7 @@ struct i9e_completion_result { * * \param name Determines the name of the function to be defined. */ -#define I9E_DUMMY_COMPLETER(name) void name ## _completer( \ +#define I9E_DUMMY_COMPLETER(name) static void name ## _completer( \ __a_unused struct i9e_completion_info *ciname, \ struct i9e_completion_result *result) {result->matches = NULL;} diff --git a/ipc.c b/ipc.c index d7f515df..3cc5c156 100644 --- a/ipc.c +++ b/ipc.c @@ -68,7 +68,7 @@ static void para_semop(int id, struct sembuf *sops, int num) * * This function either succeeds or aborts. * - * \sa semop(2), struct misc_meta_data. + * \sa semop(2), struct \ref misc_meta_data. */ void mutex_lock(int id) { @@ -94,7 +94,7 @@ void mutex_lock(int id) * * This function either succeeds or aborts. * - * \sa semop(2), struct misc_meta_data. + * \sa semop(2), struct \ref misc_meta_data. */ void mutex_unlock(int id) { diff --git a/m4/lls/makefile b/m4/lls/makefile index cf3965e6..dd86b51d 100644 --- a/m4/lls/makefile +++ b/m4/lls/makefile @@ -3,27 +3,27 @@ lls_m4_include_dir := $(lls_m4_dir)/include $(lls_suite_dir)/%.m4d: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir) @[ -z "$(Q)" ] || echo 'M4D $<' - $(Q) $(M4) -Pg -I $(lls_m4_include_dir) -s $< \ | awk '{if ($$1 ~ /#line/) {gsub(/"/, "", $$3); if ($$3 != "$<") \ print "$(lls_suite_dir)/$(*F).suite: " $$3}}' | sort | uniq > $@ $(lls_suite_dir)/%.suite: $(lls_m4_dir)/%.suite.m4 | $(lls_suite_dir) + @[ -z "$(Q)" ] || echo 'M4 $<' $(Q) $(M4) -Pg -I $(lls_m4_include_dir) -D GIT_VERSION=$(GIT_VERSION) \ -D COPYRIGHT_YEAR=$(COPYRIGHT_YEAR) -D LOGLEVELS=$(LOGLEVELS) \ $< > $@ $(lls_suite_dir)/%.lsg.c: $(lls_suite_dir)/%.suite @[ -z "$(Q)" ] || echo 'LSGC $<' - $(Q) lopsubgen --gen-c --output-dir $(lls_suite_dir) < $< + $(Q) $(LOPSUBGEN) --gen-c --output-dir $(lls_suite_dir) < $< $(lls_suite_dir)/%.lsg.h: $(lls_suite_dir)/%.suite @[ -z "$(Q)" ] || echo 'LSGH $<' - $(Q) lopsubgen --gen-header --output-dir $(lls_suite_dir) < $< + $(Q) $(LOPSUBGEN) --gen-header --output-dir $(lls_suite_dir) < $< $(lls_suite_dir)/%.lsg.man: $(lls_suite_dir)/%.suite @[ -z "$(Q)" ] || echo 'LSGM $<' - $(Q) lopsubgen --gen-man --output-dir $(lls_suite_dir) < $< + $(Q) $(LOPSUBGEN) --gen-man --output-dir $(lls_suite_dir) < $< $(object_dir)/%.o: $(lls_suite_dir)/%.c | $(object_dir) @[ -z "$(Q)" ] || echo 'CC $<' diff --git a/m4/lls/server_cmd.suite.m4 b/m4/lls/server_cmd.suite.m4 index e2bd162d..2145c516 100644 --- a/m4/lls/server_cmd.suite.m4 +++ b/m4/lls/server_cmd.suite.m4 @@ -219,13 +219,6 @@ aux_info_prefix = Permissions: also given), chunk time and chunk offsets. [/help] - [option full-path] - short_opt = F - summary = list full paths, match full paths against patterns - [help] - This option is the default, so it does nothing. Deprecated as of - v0.6.0, scheduled for removal in v0.6.1. - [/help] [option basename] short_opt = b summary = list and match basenames only @@ -284,6 +277,8 @@ aux_info_prefix = Permissions: audio-format (a) + hash (h) + If --sort is not given, path sort is implied. [/help] diff --git a/mm.h b/mm.h index 2caace7f..e6c0d125 100644 --- a/mm.h +++ b/mm.h @@ -17,7 +17,7 @@ * Mood score functions must return values between -100 and +100 inclusively. * Boolean score functions should always return either -100 or +100. * - * \sa struct mood_method, mood_parser. + * \sa struct \ref mood_method, \ref mood_parser. */ typedef int mood_score_function(const char *path, const struct afs_info *afsi, const struct afh_info *afhi, const void *data); @@ -36,19 +36,15 @@ typedef int mood_score_function(const char *path, const struct afs_info *afsi, * later in the mood_score_function of the mood_method. The mood_parser may * store a pointer to its structure via the void** pointer. * - * \sa mood_open(), mood_cleanup_function, mood_score_function. + * \sa \ref mood_cleanup_function, \ref mood_score_function. */ typedef int mood_parser(int, char **, void **); /** * Deallocate resources which were allocated by the mood_parser. * - * This optional function of a mood_method is used to free any resources - * allocated in mood_open() by the mood_parser. The argument passed is a - * pointer to the mood_method specific data structure that was returned by the - * mood_parser. - * - * \sa mood_parser. + * Function to free the resources allocated in \ref mood_method::parser. The + * argument is a pointer to mood method specific data returned by ->parser(). */ typedef void mood_cleanup_function(void *); diff --git a/mood.c b/mood.c index 208bdc45..40228be5 100644 --- a/mood.c +++ b/mood.c @@ -16,11 +16,8 @@ #include "afh.h" #include "afs.h" #include "list.h" -#include "ipc.h" #include "mm.h" -#include "sideband.h" #include "mood.h" -#include "sched.h" /** * Contains statistical data of the currently admissible audio files. @@ -59,15 +56,13 @@ struct mood_item { struct list_head mood_item_node; }; -/** - * Created from the mood definition by mood_open(). +/* + * Created from the mood definition by \ref change_current_mood(). * * When a mood is opened, each line of its definition is investigated, and a - * corresponding mood item is produced. Each mood line starts with \p accept, - * \p deny, or \p score which determines the type of the mood line. For each - * such type a linked list is maintained whose entries are the mood items. - * - * \sa mood_item, mood_open(). + * corresponding mood item is produced. Each mood line starts with accept, + * deny, or score which determines the type of the mood line. For each such + * type a linked list is maintained whose entries are the mood items. */ struct mood { /** The name of this mood. */ @@ -82,7 +77,7 @@ struct mood { /* * If current_mood is NULL then no mood is currently open. If - * current_mood->name is NULL, the dummy mood is currently open + * current_mood->name is NULL, the dummy mood is currently open. */ static struct mood *current_mood; @@ -365,9 +360,7 @@ success: ret = 1; out: free_argv(argv); - if (ret >= 0) - return ret; - if (mi) { + if (mi && (ret < 0 || !mlpd->m)) { /* mi was not added to any list */ free(mi->parser_data); free(mi); } @@ -523,9 +516,7 @@ static int del_afs_statistics(const struct osl_row *row) return 1; } -/** - * Structure used during mood_open(). - * +/* * At mood open time we determine the set of admissible files for the given * mood. The mood score of each admissible file is computed by adding up all * mood item scores. Next, we update the afs statistics and append a struct @@ -536,8 +527,6 @@ static int del_afs_statistics(const struct osl_row *row) * the afs_statistics and the current time) to the mood score. Finally, all * audio files in the temporary array are added to the score table and the * array is freed. - * - * \sa mood_method, admissible_array. */ struct admissible_file_info { @@ -679,7 +668,7 @@ static int delete_from_statistics_and_score_table(const struct osl_row *aft_row) * * \return Positive on success, negative on errors. * - * \sa score_delete(). + * \sa \ref score_delete(). */ static int mood_delete_audio_file(const struct osl_row *aft_row) { @@ -782,8 +771,7 @@ static void log_statistics(void) /** * Close the current mood. * - * Free all resources of the current mood which were allocated during - * mood_open(). + * Frees all resources of the current mood. */ void close_current_mood(void) { @@ -805,8 +793,7 @@ void close_current_mood(void) * \return Positive on success, negative on errors. Loading the dummy mood * always succeeds. * - * \sa struct admissible_file_info, struct admissible_array, struct - * afs_info::last_played, mood_close(). + * \sa struct \ref afs_info::last_played. */ int change_current_mood(const char *mood_name) { @@ -855,18 +842,14 @@ out: return ret; } -/** +/* * Close and re-open the current mood. * - * This function is used if changes to the audio file table or the - * attribute table were made that render the current list of admissible - * files useless. For example, if an attribute is removed from the - * attribute table, this function is called. - * - * \return Positive on success, negative on errors. If no mood is currently - * open, the function returns success. + * This function is called on events which render the current list of + * admissible files useless, for example if an attribute is removed from the + * attribute table. * - * \sa mood_open(), mood_close(). + * If no mood is currently open, the function returns success. */ static int reload_current_mood(void) { diff --git a/net.c b/net.c index 50243673..a58d84ef 100644 --- a/net.c +++ b/net.c @@ -44,7 +44,7 @@ * default of 32 if not specified. * * \return Pointer to \a addr if successful, NULL on error. - * \sa RFC 4632 + * \sa RFC 4632. */ char *parse_cidr(const char *cidr, char *addr, ssize_t addrlen, @@ -104,7 +104,7 @@ static bool is_v4_dot_quad(const char *address) * \param host The host string to check. * \return True if \a host passes the syntax checks. * - * \sa RFC 3986, 3.2.2; RFC 1123, 2.1; RFC 1034, 3.5 + * \sa RFC 3986, 3.2.2; RFC 1123, 2.1; RFC 1034, 3.5. */ static bool host_string_ok(const char *host) { @@ -146,7 +146,7 @@ static bool host_string_ok(const char *host) * \a host and \a port are undefined. If no port number was present in \a url, * \a port is set to -1. * - * \sa RFC 3986, 3.2.2/3.2.3 + * \sa RFC 3986, 3.2.2/3.2.3. */ char *parse_url(const char *url, char *host, ssize_t hostlen, @@ -191,7 +191,7 @@ failed: * \param transport Transport protocol name (e.g. "udp", "tcp"), or NULL. * \return Pointer to static result buffer. * - * \sa getservent(3), services(5), nsswitch.conf(5) + * \sa getservent(3), services(5), nsswitch.conf(5). */ const char *stringify_port(int port, const char *transport) { @@ -215,7 +215,7 @@ const char *stringify_port(int port, const char *transport) * * \param l4type The symbolic name of the transport-layer protocol. * - * \sa ip(7), socket(2) + * \sa ip(7), socket(2). */ static inline int sock_type(const unsigned l4type) { @@ -247,7 +247,7 @@ static const char *layer4_name(const unsigned l4type) * directly after makesock(). The 'pre_conn_opt' structure is for internal use * only and should not be visible elsewhere. * - * \sa setsockopt(2), makesock() + * \sa setsockopt(2), \ref makesock(). */ struct pre_conn_opt { int sock_level; /**< Second argument to setsockopt() */ @@ -288,7 +288,7 @@ struct flowopts *flowopt_new(void) * \param val The value to set \a opt to. * \param len Length of \a val. * - * \sa setsockopt(2) + * \sa setsockopt(2). */ void flowopt_add(struct flowopts *fo, int lev, int opt, const char *name, const void *val, int len) @@ -505,7 +505,7 @@ int makesock(unsigned l4type, bool passive, const char *host, uint16_t port_numb * \return Positive integer (socket descriptor) on success, negative value * otherwise. * - * \sa makesock(), ip(7), ipv6(7), bind(2), listen(2). + * \sa \ref makesock(), ip(7), ipv6(7), bind(2), listen(2). */ int para_listen(unsigned l4type, uint16_t port, struct flowopts *fo) { @@ -551,7 +551,7 @@ static bool SS_IS_ADDR_V4MAPPED(const struct sockaddr_storage *ss) * \param ss Container of IPv4/6 address. * \return Pointer to normalized address (may be static storage). * - * \sa RFC 3493 + * \sa RFC 3493. */ static const struct sockaddr * normalize_ip_address(const struct sockaddr_storage *ss) @@ -624,7 +624,7 @@ int generic_max_transport_msg_size(int sockfd) * \return A static character string identifying hostname and port of the * chosen side in numeric host:port format. * - * \sa getsockname(2), getpeername(2), parse_url(), getnameinfo(3), + * \sa getsockname(2), getpeername(2), \ref parse_url(), getnameinfo(3), * services(5), nsswitch.conf(5). */ char *remote_name(int fd) @@ -735,7 +735,7 @@ __must_check int recv_bin_buffer(int fd, char *buf, size_t size) * * \return The return value of the underlying call to \a recv_bin_buffer(). * - * \sa recv_bin_buffer() + * \sa \ref recv_bin_buffer() */ int recv_buffer(int fd, char *buf, size_t size) { @@ -914,7 +914,7 @@ err: * \return The file descriptor of the connected socket on success, negative on * errors. * - * \sa create_local_socket(), unix(7), connect(2). + * \sa \ref create_local_socket(), unix(7), connect(2). */ int connect_local_socket(const char *name) { @@ -956,8 +956,7 @@ int recv_cred_buffer(int fd, char *buf, size_t size) * \return On success, this call returns the number of bytes sent. On errors, * \p -E_SENDMSG is returned. * - * \sa \ref recv_cred_buffer, sendmsg(2), socket(7), unix(7), okir's Black Hats - * Manual. + * \sa \ref recv_cred_buffer, sendmsg(2), socket(7), unix(7). */ ssize_t send_cred_buffer(int sock, char *buf) { diff --git a/net.h b/net.h index a70954a9..a8dd650b 100644 --- a/net.h +++ b/net.h @@ -93,7 +93,7 @@ _static_inline_ bool is_valid_ipv4_address(const char *address) * \param address The address string to check. * * \return 1 if string has a valid IPv6 address syntax, 0 if not. - * \sa RFC 4291 + * \sa RFC 4291. */ _static_inline_ bool is_valid_ipv6_address(const char *address) { diff --git a/play.c b/play.c index 7b8192d4..2155ebf8 100644 --- a/play.c +++ b/play.c @@ -85,7 +85,7 @@ struct play_task { struct filter_node fn; struct writer_node wn; - /* See comment to enum state_change_request_type above */ + /* See comment to enum \ref state_change_request_type above. */ enum state_change_request_type rq; /* only relevant if rq == CRT_FILE_CHANGE */ unsigned next_file; @@ -718,7 +718,6 @@ static void help_completer(struct i9e_completion_info *ci, result->matches = i9e_complete_commands(ci->word, pp_completers); } -I9E_DUMMY_COMPLETER(SUPERCOMMAND_UNAVAILABLE); static struct i9e_completer pp_completers[] = { #define LSG_PLAY_CMD_CMD(_name) {.name = #_name, \ .completer = _name ## _completer} diff --git a/playlist.c b/playlist.c index b9e52c75..55a83436 100644 --- a/playlist.c +++ b/playlist.c @@ -140,7 +140,7 @@ int playlist_check_callback(struct afs_callback_arg *aca) /** * Close the current playlist. * - * \sa playlist_open(). + * \sa \ref playlist_open(). */ void playlist_close(void) { diff --git a/recv.h b/recv.h index 68978a38..6fb70b9a 100644 --- a/recv.h +++ b/recv.h @@ -40,27 +40,23 @@ struct receiver_node { /** * Describes one supported paraslash receiver. * - * \sa http_recv.c, udp_recv.c + * \sa \ref http_recv.c, \ref udp_recv.c. */ struct receiver { /** * The optional receiver init function. * * Performs any initialization needed before the receiver can be opened. - * - * \sa http_recv_init udp_recv_init. */ void (*init)(void); /** * Open one instance of the receiver. * - * This should allocate the output buffer of \a rn. and may also - * perform any other work necessary for retrieving the stream according - * to the configuration stored in the \a conf member of \a rn which is - * guaranteed to point to valid configuration data (as previously - * obtained from the config parser). + * This should allocate the output buffer of the given receiver node + * and prepare it for retrieving the audio stream according to the + * configuration stored in rn->lpr. * - * \sa receiver_node::conf, receiver_node::buf. + * \sa struct \ref receiver_node. */ int (*open)(struct receiver_node *rn); /** @@ -69,37 +65,38 @@ struct receiver { * It should free all resources associated with given receiver node * that were allocated during the corresponding open call. * - * \sa receiver_node. + * \sa \ref receiver_node. */ void (*close)(struct receiver_node *rn); /** * Add file descriptors to fd_sets and compute timeout for select(2). * - * The pre_select function gets called from the driving application - * before entering its select loop. The receiver may use this hook to - * add any file descriptors to the sets of file descriptors given by \a - * s. + * If this is not NULL, the function is called in each iteration of the + * scheduler's select loop. The receiver may define it to add file + * descriptors to the file descriptor sets given by s. Those will be + * monitored in the subsequent call to select(2). The function may also + * lower the timeout value of s to make select(2) return earlier if no + * file descriptors are ready for I/O. * - * \sa select(2), time.c struct task, struct sched. + * \sa select(2), \ref time.c, struct \ref sched. */ void (*pre_select)(struct sched *s, void *context); /** - * Evaluate the result from select(). + * Evaluate the result from select(2). * - * This hook gets called after the call to select(). It should check - * all file descriptors which were added to any of the fd sets during - * the previous call to pre_select. According to the result, it may - * then use any non-blocking I/O to establish a connection or to - * receive the audio data. + * This is called after the call to select(2). It should check all file + * descriptors which were added to any of the fd sets in the previous + * call to ->pre_select() and perform (non-blocking) I/O operations on + * those fds which are ready for I/O, for example in order to establish + * a connection or to receive a part of the audio stream. * - * \sa select(2), struct receiver. + * \sa select(2), struct \ref receiver. */ int (*post_select)(struct sched *s, void *context); - /** * Answer a buffer tree query. * - * This optional function pointer is used for inter node communications + * This optional function pointer allows for inter node communication * of the buffer tree nodes. See \ref btr_command_handler for details. */ btr_command_handler execute; diff --git a/recv_common.c b/recv_common.c index d48b3476..1ad84438 100644 --- a/recv_common.c +++ b/recv_common.c @@ -21,6 +21,12 @@ /** * Call the init function of each paraslash receiver. + * + * Receivers employ the user_data feature of the lopsub library: Each receiver + * of the recv_cmd suite defines a struct receiver as its user data. + * recv_init() obtains a pointer to this structure by calling lls_user_data(). + * If the receiver has an init function (i.e., if ->init is not NULL), ->init() + * is called to initialize the receiver. */ void recv_init(void) { diff --git a/sched.c b/sched.c index bc301778..297348a1 100644 --- a/sched.c +++ b/sched.c @@ -387,7 +387,7 @@ void sched_min_delay(struct sched *s) * function does nothing. Otherwise the timeout for the next select() call is * set to the given value. * - * \sa sched_request_timeout_ms(). + * \sa \ref sched_request_timeout_ms(). */ void sched_request_timeout(struct timeval *to, struct sched *s) { @@ -420,7 +420,7 @@ void sched_request_timeout_ms(long unsigned ms, struct sched *s) * \return If \a barrier is in the past, this function does nothing and returns * zero. Otherwise it returns one. * - * \sa sched_request_barrier_or_min_delay(). + * \sa \ref sched_request_barrier_or_min_delay(). */ int sched_request_barrier(struct timeval *barrier, struct sched *s) { @@ -441,7 +441,7 @@ int sched_request_barrier(struct timeval *barrier, struct sched *s) * \return If \a barrier is in the past, this function requests a minimal * timeout and returns zero. Otherwise it returns one. * - * \sa sched_min_delay(), sched_request_barrier(). + * \sa \ref sched_min_delay(), \ref sched_request_barrier(). */ int sched_request_barrier_or_min_delay(struct timeval *barrier, struct sched *s) { diff --git a/score.c b/score.c index ddd3c7a2..30761e75 100644 --- a/score.c +++ b/score.c @@ -34,8 +34,6 @@ static int ptr_compare(const struct osl_object *obj1, const struct osl_object *o * This function first compares the score values as usual integers. If they compare as * equal, the address of \a obj1 and \a obj2 are compared. So this compare function * returns zero if and only if \a obj1 and \a obj2 point to the same memory area. - * - * \sa osl_compare_function. */ static int score_compare(const struct osl_object *obj1, const struct osl_object *obj2) { @@ -92,8 +90,6 @@ static struct osl_table_description score_table_desc = { * \param num Result is returned here. * * \return Positive on success, negative on errors. - * - * \sa osl_get_num_rows(). */ int get_num_admissible_files(unsigned *num) { @@ -284,7 +280,7 @@ int score_get_best(struct osl_row **aft_row, long *score) * \return Positive on success, negative on errors. Possible errors: * Errors returned by osl_get_row() and osl_del_row(). * - * \sa score_add(), score_shutdown(). + * \sa \ref score_add(). */ int score_delete(const struct osl_row *aft_row) { diff --git a/send.h b/send.h index 54205234..b70ba094 100644 --- a/send.h +++ b/send.h @@ -25,7 +25,7 @@ enum sender_subcommand { /** * Describes one supported sender of para_server. * - * \sa http_send.c udp_send.c, dccp_send.c. + * \sa \ref http_send.c \ref udp_send.c, \ref dccp_send.c. */ struct sender { /** The name of the sender. */ diff --git a/send_common.c b/send_common.c index 988e8d48..b03be877 100644 --- a/send_common.c +++ b/send_common.c @@ -72,7 +72,7 @@ static int open_sender(unsigned l4type, int port) * list, destroy the chunk queue of this client, delete the client from the * list of connected clients and free the sender_client struct. * - * \sa shutdown_clients(). + * \sa \ref shutdown_clients(). */ void shutdown_client(struct sender_client *sc, struct sender_status *ss) { @@ -212,7 +212,7 @@ char *generic_sender_status(struct sender_status *ss, const char *name) * \param scd Contains the IP and the netmask. * \param ss The sender. * - * \sa generic_com_deny(). + * \sa \ref generic_com_deny(). */ void generic_com_allow(struct sender_command_data *scd, struct sender_status *ss) @@ -226,7 +226,7 @@ void generic_com_allow(struct sender_command_data *scd, * \param scd see \ref generic_com_allow(). * \param ss see \ref generic_com_allow(). * - * \sa generic_com_allow(). + * \sa \ref generic_com_allow(). */ void generic_com_deny(struct sender_command_data *scd, struct sender_status *ss) @@ -262,7 +262,7 @@ int generic_com_on(struct sender_status *ss, unsigned protocol) * * \param ss The sender to deactivate. * - * \sa \ref del_close_on_fork_list(), shutdown_clients(). + * \sa \ref del_close_on_fork_list(), \ref shutdown_clients(). */ void generic_com_off(struct sender_status *ss) { diff --git a/server.c b/server.c index 43ede2a9..c5f9ede6 100644 --- a/server.c +++ b/server.c @@ -196,7 +196,6 @@ void parse_config_or_die(bool reload) goto free_cf; if (ret == -ERRNO_TO_PARA_ERROR(ENOENT) && OPT_GIVEN(CONFIG_FILE)) goto free_cf; - ret = 0; server_lpr = cmdline_lpr; goto success; } @@ -212,7 +211,7 @@ void parse_config_or_die(bool reload) if (reload) /* config file overrides command line */ ret = lls(lls_merge(cf_lpr, cmdline_lpr, CMD_PTR, &merged_lpr, &errctx)); - else /* command line options overrride config file options */ + else /* command line options override config file options */ ret = lls(lls_merge(cmdline_lpr, cf_lpr, CMD_PTR, &merged_lpr, &errctx)); lls_free_parse_result(cf_lpr, CMD_PTR); @@ -357,8 +356,6 @@ static int command_post_select(struct sched *s, void *context) ret = para_accept(sct->listen_fd, &s->rfds, NULL, 0, &new_fd); if (ret <= 0) goto out; - peer_name = remote_name(new_fd); - PARA_INFO_LOG("got connection from %s, forking\n", peer_name); mmd->num_connects++; mmd->active_connections++; /* @@ -384,6 +381,8 @@ static int command_post_select(struct sched *s, void *context) /* parent keeps accepting connections */ return 0; } + peer_name = remote_name(new_fd); + PARA_INFO_LOG("accepted connection from %s\n", peer_name); /* mmd might already have changed at this point */ free(chunk_table); alarm(ALARM_TIMEOUT); @@ -534,7 +533,7 @@ static void server_init(int argc, char **argv) init_signal_task(); para_unblock_signal(SIGCHLD); PARA_NOTICE_LOG("initializing virtual streaming system\n"); - init_vss_task(afs_socket, &sched); + vss_init(afs_socket, &sched); init_server_command_task(argc, argv); if (daemon_pipe >= 0) { if (write(daemon_pipe, "\0", 1) < 0) { diff --git a/signal.c b/signal.c index 5d6e6e45..9153349f 100644 --- a/signal.c +++ b/signal.c @@ -25,7 +25,7 @@ static int signal_pipe[2]; * This function creates a pipe, the signal pipe, to deliver pending * signals to the application (Bernstein's trick). It should be called * during the application's startup part, followed by subsequent calls - * to para_install_sighandler() for each signal that should be caught. + * to \ref para_install_sighandler() for each signal that should be caught. * * A generic signal handler is used for all signals simultaneously. When a * signal arrives, the signal handler writes the number of the signal received @@ -33,7 +33,7 @@ static int signal_pipe[2]; * by checking if the file descriptor of the other end of the signal pipe is * ready for reading, see select(2). * - * \return This function either succeeds or calls exit(2) to terminate the + * \return This function either succeeds or calls exit(3) to terminate the * current process. On success, a signal task structure is returned. */ struct signal_task *signal_init_or_die(void) diff --git a/stdin.c b/stdin.c index e5c40bcb..7b70690b 100644 --- a/stdin.c +++ b/stdin.c @@ -114,6 +114,7 @@ void stdin_task_register(struct stdin_task *sit, struct sched *s) exit(EXIT_FAILURE); } sit->fd_flags = ret; - sit->must_set_nonblock_flag = (sit->fd_flags & O_NONBLOCK) == 0; + sit->must_set_nonblock_flag = (sit->fd_flags & O_NONBLOCK) == 0 + && !isatty(STDIN_FILENO); sit->task = task_register(&ti, s); } diff --git a/stdout.c b/stdout.c index 29db2b7e..9fc20ed0 100644 --- a/stdout.c +++ b/stdout.c @@ -89,13 +89,14 @@ void stdout_task_register(struct stdout_task *sot, struct sched *s) .name = "stdout", }; - /* See stdin.c for details. */ + /* See \ref stdin.c for details. */ ret = fcntl(STDOUT_FILENO, F_GETFL); if (ret < 0) { PARA_EMERG_LOG("F_GETFL: %s\n", strerror(errno)); exit(EXIT_FAILURE); } sot->fd_flags = ret; - sot->must_set_nonblock_flag = (sot->fd_flags & O_NONBLOCK) == 0; + sot->must_set_nonblock_flag = (sot->fd_flags & O_NONBLOCK) == 0 + && !isatty(STDOUT_FILENO); sot->task = task_register(&ti, s); } diff --git a/string.c b/string.c index 8dddd2fd..e675502c 100644 --- a/string.c +++ b/string.c @@ -189,7 +189,7 @@ __printf_2_3 unsigned xasprintf(char **result, const char *fmt, ...) * \return This function either returns a pointer to a string that must be * freed by the caller or aborts without returning. * - * \sa printf(3), xasprintf(). + * \sa printf(3), \ref xasprintf(). */ __must_check __printf_1_2 __malloc char *make_message(const char *fmt, ...) { @@ -229,7 +229,7 @@ void freep(void *arg) * return \a a without making a copy of \a a. Otherwise, construct the * concatenation \a c, free \a a (but not \a b) and return \a c. * - * \sa strcat(3) + * \sa strcat(3). */ __must_check __malloc char *para_strcat(char *a, const char *b) { @@ -547,7 +547,7 @@ __printf_2_3 int para_printf(struct para_buffer *b, const char *fmt, ...) * * \return Standard. * - * \sa para_atoi32(), strtol(3), atoi(3). + * \sa \ref para_atoi32(), strtol(3), atoi(3). */ int para_atoi64(const char *str, int64_t *value) { @@ -584,7 +584,7 @@ int para_atoi64(const char *str, int64_t *value) * * \return Standard. * - * \sa para_atoi64(). + * \sa \ref para_atoi64(). */ int para_atoi32(const char *str, int32_t *value) { diff --git a/string.h b/string.h index 52f98941..a4093003 100644 --- a/string.h +++ b/string.h @@ -20,7 +20,7 @@ struct para_buffer { size_t size; /** The maximal size this buffer may grow. Zero means unlimited. */ size_t max_size; - /** \sa para_buffer_flags. */ + /** \sa \ref para_buffer_flags. */ unsigned flags; /** The next para_printf() will write at this offset. */ size_t offset; @@ -37,7 +37,7 @@ struct para_buffer { /** * Controls the behavior of for_each_line(). * - * \sa for_each_line(). + * \sa \ref for_each_line(). */ enum for_each_line_flags { /** Activate read-only mode. */ @@ -52,14 +52,14 @@ int for_each_line(unsigned flags, char *buf, size_t size, line_handler_t *line_handler, void *private_data); /** - * Write the contents of a status item to a para_buffer. - * - * \param b The para_buffer. - * \param n The number of the status item. - * \param f A format string. - * - * \return The return value of the underlying call to para_printf(). - */ + * Write the contents of a status item to a para_buffer. + * + * \param b The para_buffer. + * \param n The number of the status item. + * \param f A format string. + * + * \return The return value of the underlying call to \ref para_printf(). + */ #define WRITE_STATUS_ITEM(b, n, f, ...) (\ { \ if ((b)->flags & PBF_SIZE_PREFIX) { \ diff --git a/t/t0004-server.sh b/t/t0004-server.sh index 5329ef0f..6a8e5bf1 100755 --- a/t/t0004-server.sh +++ b/t/t0004-server.sh @@ -69,7 +69,7 @@ bad[$i]='.' let i++ commands[$i]="ls" required_objects[$i]='ogg_afh' -cmdline[$i]="ls -l=v -F ${oggs[@]}" +cmdline[$i]="ls -l=v ${oggs[@]}" good[$i]='^attributes_txt: 33' let i++ diff --git a/udp_recv.c b/udp_recv.c index a5dfc879..4620d61a 100644 --- a/udp_recv.c +++ b/udp_recv.c @@ -190,6 +190,7 @@ err: return ret; } +/** See \ref recv_init(). */ const struct receiver lsg_recv_cmd_com_udp_user_data = { .open = udp_recv_open, .close = udp_recv_close, diff --git a/udp_send.c b/udp_send.c index 8c9eebc9..0ea95e41 100644 --- a/udp_send.c +++ b/udp_send.c @@ -65,8 +65,9 @@ static void udp_close_target(struct sender_client *sc) PARA_NOTICE_LOG("sending FEC EOF\n"); len = vss_get_fec_eof_packet(&buf); /* Ignore write() errors since we are closing the target anyway. */ - if (write(sc->fd, buf, len) == len) - ut->sent_fec_eof = true; + if (write(sc->fd, buf, len)) + do_nothing; /* avoid "ignoring return value" warning */ + ut->sent_fec_eof = true; } static void udp_delete_target(struct sender_client *sc, const char *msg) diff --git a/user_list.c b/user_list.c index 23fe086f..b2d2ff5e 100644 --- a/user_list.c +++ b/user_list.c @@ -98,7 +98,7 @@ err: } /** - * Initialize the list of users allowed to connect to to para_server. + * Initialize the list of users allowed to connect to para_server. * * \param user_list_file The file containing access information. * diff --git a/vss.c b/vss.c index 3632cf54..f225aa74 100644 --- a/vss.c +++ b/vss.c @@ -1024,7 +1024,8 @@ err: */ static void vss_send(struct vss_task *vsst) { - int i, fec_active = 0; + int i; + bool fec_active = false; struct timeval due; struct fec_client *fc, *tmp_fc; @@ -1032,24 +1033,23 @@ static void vss_send(struct vss_task *vsst) return; if (chk_barrier("eof", &vsst->eof_barrier, &due, 1) < 0) return; - if (chk_barrier("data send", &vsst->data_send_barrier, - &due, 1) < 0) + if (chk_barrier("data send", &vsst->data_send_barrier, &due, 1) < 0) return; list_for_each_entry_safe(fc, tmp_fc, &fec_client_list, node) { if (fc->state == FEC_STATE_DISABLED) continue; if (!next_slice_is_due(fc, NULL)) { - fec_active = 1; + fec_active = true; continue; } if (compute_next_fec_slice(fc, vsst) <= 0) continue; PARA_DEBUG_LOG("sending %u:%u (%u bytes)\n", fc->group.num, fc->current_slice_num, fc->group.slice_bytes); + fc->current_slice_num++; fc->fcp->send_fec(fc->sc, (char *)fc->enc_buf, fc->group.slice_bytes + FEC_HEADER_SIZE); - fc->current_slice_num++; - fec_active = 1; + fec_active = true; } if (mmd->current_chunk >= mmd->afd.afhi.chunks_total) { /* eof */ if (!fec_active) @@ -1067,37 +1067,17 @@ static void vss_send(struct vss_task *vsst) mmd->events++; set_mmd_offset(); } - /* - * We call the send function also in case of empty chunks as - * they might have still some data queued which can be sent in - * this case. - */ vss_get_chunk(mmd->current_chunk, vsst, &buf, &len); for (i = 0; senders[i].name; i++) { + /* + * We call ->send() even if len is zero because senders + * might have data queued which can be sent now. + */ if (!senders[i].send) continue; senders[i].send(mmd->current_chunk, mmd->chunks_sent, buf, len, vsst->header_buf, vsst->header_len); } - /* - * Prefault next chunk(s) - * - * If the backing device of the memory-mapped audio file is - * slow and read-ahead is turned off or prevented for some - * reason, e.g. due to memory pressure, it may take much longer - * than the chunk interval to get the next chunk on the wire, - * causing buffer underruns on the client side. Mapping the - * file with MAP_POPULATE seems to help a bit, but it does not - * eliminate the delays completely. Moreover, it is supported - * only on Linux. So we do our own read-ahead here. - */ - if (mmd->current_chunk > 0) { /* chunk 0 might be on the heap */ - buf += len; - for (i = 0; i < 5 && buf < vsst->map + vsst->mapsize; i++) { - __a_unused volatile char x = *buf; - buf += 4096; - } - } mmd->chunks_sent++; mmd->current_chunk++; } @@ -1178,11 +1158,10 @@ static int vss_post_select(struct sched *s, void *context) * This also initializes all supported senders and starts streaming * if the --autoplay command line flag was given. */ -void init_vss_task(int afs_socket, struct sched *s) +void vss_init(int afs_socket, struct sched *s) { static struct vss_task vss_task_struct, *vsst = &vss_task_struct; int i; - char *hn = para_hostname(), *home = para_homedir(); long unsigned announce_time = OPT_UINT32_VAL(ANNOUNCE_TIME), autoplay_delay = OPT_UINT32_VAL(AUTOPLAY_DELAY); vsst->header_interval.tv_sec = 5; /* should this be configurable? */ @@ -1194,8 +1173,6 @@ void init_vss_task(int afs_socket, struct sched *s) PARA_NOTICE_LOG("initializing %s sender\n", senders[i].name); senders[i].init(&senders[i]); } - free(hn); - free(home); mmd->sender_cmd_data.cmd_num = -1; if (OPT_GIVEN(AUTOPLAY)) { struct timeval tmp; diff --git a/vss.h b/vss.h index d2b1ad1d..bf135786 100644 --- a/vss.h +++ b/vss.h @@ -6,7 +6,7 @@ /** \file vss.h Exported functions from vss.c (para_server). */ -void init_vss_task(int afs_socket, struct sched *s); +void vss_init(int afs_socket, struct sched *s); unsigned int vss_playing(void); unsigned int vss_next(void); unsigned int vss_repos(void); diff --git a/web/manual.md b/web/manual.md index 96d724c9..5e411742 100644 --- a/web/manual.md +++ b/web/manual.md @@ -330,7 +330,7 @@ code repository, execute git clone git://git.tuebingen.mpg.de/osl -- [openssl](http://www.openssl.org/) or +- [openssl](https://www.openssl.org/) or [libgcrypt](ftp://ftp.gnupg.org/gcrypt/libgcrypt/). At least one of these two libraries is needed as the backend for cryptographic routines on both the server and the client side. Both openssl and @@ -344,12 +344,12 @@ is called `libmad0-dev` on debian-based systems. Note that libmad is not necessary on the server side, i.e., for sending MP3 files. - [libid3tag](http://www.underbit.com/products/mad/). For version-2 -ID3 tag support, you willl need the libid3tag development package +ID3 tag support, you will need the libid3tag development package `libid3tag0-dev`. Without libid3tag, only version-1 tags are recognized. The mp3 tagger also needs this library for modifying (id3v1 and id3v2) tags. -- [ogg vorbis](http://www.xiph.org/downloads/). For ogg vorbis streams +- [ogg vorbis](https://www.xiph.org/downloads/). For ogg vorbis streams you need libogg, libvorbis, libvorbisfile. The corresponding Debian packages are called `libogg-dev` and `libvorbis-dev`. @@ -359,10 +359,10 @@ that for some distributions, e.g. Ubuntu, mp4ff is not part of the libfaad package. Install the faad library from sources (available through the above link) to get the mp4ff library and header files. -- [speex](http://www.speex.org/). In order to stream or decode speex +- [speex](https://www.speex.org/). In order to stream or decode speex files, libspeex (`libspeex-dev`) is required. -- [flac](http://flac.sourceforge.net/). To stream or decode files +- [flac](https://xiph.org/flac/). To stream or decode files encoded with the _Free Lossless Audio Codec_, libFLAC (`libFLAC-dev`) must be installed. @@ -373,7 +373,7 @@ installed. Debian package: `libsamplerate-dev`. - [alsa-lib](ftp://ftp.alsa-project.org/pub/lib/). On Linux, you will need to have the ALSA development package `libasound2-dev` installed. -- [libao](http://downloads.xiph.org/releases/ao/). Needed to build +- [libao](https://ftp.osuosl.org/pub/xiph/releases/ao/). Needed to build the ao writer (ESD, PulseAudio,...). Debian package: `libao-dev`. - [curses](ftp://ftp.gnu.org/pub/gnu/ncurses). Needed for @@ -1439,7 +1439,7 @@ only for Linux. - UDP. Recommended for multicast LAN streaming. -See the Appendix on [network protocols](/#Network.protocols) +See the Appendix on [network protocols](#Network.protocols) for brief descriptions of the various protocols relevant for network audio streaming with paraslash. @@ -2007,7 +2007,7 @@ and for getting updates. the configure file which is shipped in the tarballs but has to be generated when compiling from git. -- [discount](http://www.pell.portland.or.us/~orc/Code/discount). The +- [discount](http://www.pell.portland.or.us/~orc/Code/discount/). The HTML version of this manual and some of the paraslash web pages are written in the Markdown markup language and are translated into html with the converter of the *Discount* package. @@ -2111,7 +2111,7 @@ Coding Style The preferred coding style for paraslash coincides more or less with the style of the Linux kernel. So rather than repeating what is -written [there](http://www.kernel.org/doc/Documentation/process/coding-style.rst), +written [there](https://www.kernel.org/doc/Documentation/process/coding-style.rst), here are the most important points. - Burn the GNU coding standards. @@ -2374,17 +2374,17 @@ Application web pages --------------------- - [paraslash](http://people.tuebingen.mpg.de/maan/paraslash/) -- [xmms](http://xmms2.org/wiki/Main_Page) +- [xmms](https://xmms2.org/wiki/Main_Page) - [mpg123](http://www.mpg123.de/) -- [gstreamer](http://gstreamer.freedesktop.org/) +- [gstreamer](https://gstreamer.freedesktop.org/) - [icecast](http://www.icecast.org/) -- [Audio Compress](http://beesbuzz.biz/code/audiocompress.php) +- [Audio Compress](https://beesbuzz.biz/code/audiocompress.php) External documentation ---------------------- - [The mathematics of -Raid6](http://kernel.org/pub/linux/kernel/people/hpa/raid6.pdf) +Raid6](https://www.kernel.org/pub/linux/kernel/people/hpa/raid6.pdf) by H. Peter Anvin - [Effective Erasure Codes for reliable Computer Communication diff --git a/wma_afh.c b/wma_afh.c index ebb2f9c3..01674f1a 100644 --- a/wma_afh.c +++ b/wma_afh.c @@ -377,14 +377,17 @@ static int make_cdo(struct taginfo *tags, const struct asf_object *cdo, ret = convert_utf8_to_utf16(tags->artist, &artist); if (ret < 0) return ret; + assert(artist); artist_bytes = ret; ret = convert_utf8_to_utf16(tags->title, &title); if (ret < 0) goto out; + assert(title); title_bytes = ret; ret = convert_utf8_to_utf16(tags->comment, &comment); if (ret < 0) goto out; + assert(comment); comment_bytes = ret; if (cdo) { @@ -458,10 +461,12 @@ static int make_ecdo(struct taginfo *tags, struct asf_object *result) ret = convert_utf8_to_utf16(tags->album, &album); if (ret < 0) return ret; + assert(album); album_bytes = ret; ret = convert_utf8_to_utf16(tags->year, &year); if (ret < 0) goto out; + assert(year); year_bytes = ret; result->size = 16 + 8 + 2; /* GUID, size, count */ /* name_length + name + null + data type + val length + val */ diff --git a/wmadec_filter.c b/wmadec_filter.c index 525ed315..b96f1460 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -15,8 +15,6 @@ * This decoder handles Microsoft Windows Media Audio data version 2. */ -#define _XOPEN_SOURCE 600 - #include #include #include @@ -81,7 +79,6 @@ struct private_wmadec_data { struct vlc coef_vlc[2]; uint16_t *run_table[2]; uint16_t *level_table[2]; - const struct coef_vlc_table *coef_vlcs[2]; /** Frame length in samples. */ int frame_len; /** log2 of frame_len. */ @@ -100,8 +97,6 @@ struct private_wmadec_data { int block_len; /** Current position in frame. */ int block_pos; - /** True if mid/side stereo mode. */ - uint8_t ms_stereo; /** True if channel is coded. */ uint8_t channel_coded[MAX_CHANNELS]; /** log2 ratio frame/exp. length. */ @@ -159,51 +154,27 @@ static void sine_window_init(float *window, int n) window[i] = sinf((i + 0.5) * (M_PI / (2.0 * n))); } -static void wmadec_cleanup(struct private_wmadec_data *pwd) -{ - int i; - - for (i = 0; i < pwd->nb_block_sizes; i++) - imdct_end(pwd->mdct_ctx[i]); - if (pwd->ahi.use_exp_vlc) - free_vlc(&pwd->exp_vlc); - if (pwd->use_noise_coding) - free_vlc(&pwd->hgain_vlc); - for (i = 0; i < 2; i++) { - free_vlc(&pwd->coef_vlc[i]); - free(pwd->run_table[i]); - free(pwd->level_table[i]); - } -} - -static void init_coef_vlc(struct vlc *vlc, uint16_t **prun_table, - uint16_t **plevel_table, const struct coef_vlc_table *vlc_table) +static void init_coef_vlc(struct private_wmadec_data *pwd, int sidx, int didx) { - int n = vlc_table->n; - const uint8_t *table_bits = vlc_table->huffbits; - const uint32_t *table_codes = vlc_table->huffcodes; - const uint16_t *levels_table = vlc_table->levels; - uint16_t *run_table, *level_table; - int i, l, j, k, level; + const struct coef_vlc_table *src = coef_vlcs + sidx; + struct vlc *dst = pwd->coef_vlc + didx; + int i, l, j, k, level, n = src->n; - init_vlc(vlc, VLCBITS, n, table_bits, table_codes, 4); - - run_table = para_malloc(n * sizeof(uint16_t)); - level_table = para_malloc(n * sizeof(uint16_t)); + init_vlc(dst, VLCBITS, n, src->huffbits, src->huffcodes, 4); + pwd->run_table[didx] = para_malloc(n * sizeof(uint16_t)); + pwd->level_table[didx] = para_malloc(n * sizeof(uint16_t)); i = 2; level = 1; k = 0; while (i < n) { - l = levels_table[k++]; + l = src->levels[k++]; for (j = 0; j < l; j++) { - run_table[i] = j; - level_table[i] = level; + pwd->run_table[didx][i] = j; + pwd->level_table[didx][i] = level; i++; } level++; } - *prun_table = run_table; - *plevel_table = level_table; } /* compute the scale factor band sizes for each MDCT block size */ @@ -413,19 +384,15 @@ static int wma_init(struct private_wmadec_data *pwd) } /* choose the VLC tables for the coefficients */ - coef_vlc_table = 2; + coef_vlc_table = 4; if (ahi->sample_rate >= 32000) { if (bps1 < 0.72) coef_vlc_table = 0; else if (bps1 < 1.16) - coef_vlc_table = 1; + coef_vlc_table = 2; } - pwd->coef_vlcs[0] = &coef_vlcs[coef_vlc_table * 2]; - pwd->coef_vlcs[1] = &coef_vlcs[coef_vlc_table * 2 + 1]; - init_coef_vlc(&pwd->coef_vlc[0], &pwd->run_table[0], &pwd->level_table[0], - pwd->coef_vlcs[0]); - init_coef_vlc(&pwd->coef_vlc[1], &pwd->run_table[1], &pwd->level_table[1], - pwd->coef_vlcs[1]); + init_coef_vlc(pwd, coef_vlc_table, 0); + init_coef_vlc(pwd, coef_vlc_table + 1, 1); return 0; } @@ -581,7 +548,7 @@ static int decode_exp_vlc(struct private_wmadec_data *pwd, int ch) last_exp = 36; while (q < q_end) { - code = get_vlc(&pwd->gb, pwd->exp_vlc.table, EXPVLCBITS); + code = get_vlc(&pwd->gb, &pwd->exp_vlc); if (code < 0) return code; /* NOTE: this offset is the same as MPEG4 AAC ! */ @@ -708,8 +675,7 @@ static int compute_high_band_values(struct private_wmadec_data *pwd, if (val == (int)0x80000000) val = get_bits(&pwd->gb, 7) - 19; else { - int code = get_vlc(&pwd->gb, - pwd->hgain_vlc.table, HGAINVLCBITS); + int code = get_vlc(&pwd->gb, &pwd->hgain_vlc); if (code < 0) return code; val += code - 18; @@ -828,6 +794,7 @@ static int wma_decode_block(struct private_wmadec_data *pwd) int ret, n, v, ch, code, bsize; int coef_nb_bits, total_gain; int nb_coefs[MAX_CHANNELS]; + bool ms_stereo = false; /* mid/side stereo mode */ /* compute current block length */ if (pwd->ahi.use_variable_block_len) { @@ -865,7 +832,7 @@ static int wma_decode_block(struct private_wmadec_data *pwd) return -E_INCOHERENT_BLOCK_LEN; if (pwd->ahi.channels == 2) - pwd->ms_stereo = get_bit(&pwd->gb); + ms_stereo = get_bit(&pwd->gb); v = 0; for (ch = 0; ch < pwd->ahi.channels; ch++) { int a = get_bit(&pwd->gb); @@ -931,7 +898,7 @@ static int wma_decode_block(struct private_wmadec_data *pwd) * special VLC tables are used for ms stereo because there is * potentially less energy there */ - tindex = (ch == 1 && pwd->ms_stereo); + tindex = ch == 1 && ms_stereo; coef_vlc = &pwd->coef_vlc[tindex]; run_table = pwd->run_table[tindex]; level_table = pwd->level_table[tindex]; @@ -940,7 +907,7 @@ static int wma_decode_block(struct private_wmadec_data *pwd) eptr = ptr + nb_coefs[ch]; memset(ptr, 0, pwd->block_len * sizeof(int16_t)); for (;;) { - code = get_vlc(&pwd->gb, coef_vlc->table, VLCBITS); + code = get_vlc(&pwd->gb, coef_vlc); if (code < 0) return code; if (code == 1) /* EOB */ @@ -966,7 +933,7 @@ static int wma_decode_block(struct private_wmadec_data *pwd) } } compute_mdct_coefficients(pwd, bsize, total_gain, nb_coefs); - if (pwd->ms_stereo && pwd->channel_coded[1]) { + if (ms_stereo && pwd->channel_coded[1]) { float a, b; int i; /* @@ -994,7 +961,7 @@ next: n4 = pwd->block_len / 2; if (pwd->channel_coded[ch]) imdct(pwd->mdct_ctx[bsize], pwd->output, pwd->coefs[ch]); - else if (!(pwd->ms_stereo && ch == 1)) + else if (!(ms_stereo && ch == 1)) memset(pwd->output, 0, sizeof(pwd->output)); /* multiply by the window and add in the frame */ @@ -1058,24 +1025,13 @@ static int wma_decode_frame(struct private_wmadec_data *pwd, int16_t *samples) return 0; } -static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data, - int *data_size, const uint8_t *buf, int buf_size) +static int wma_decode_superframe(struct private_wmadec_data *pwd, void *out, + int *out_size, const uint8_t *in) { - int ret; - int16_t *samples; + int ret, in_size = pwd->ahi.packet_size - WMA_FRAME_SKIP; + int16_t *samples = out; - if (buf_size == 0) { - pwd->last_superframe_len = 0; - *data_size = 0; - return 0; - } - if (buf_size < pwd->ahi.block_align) { - *data_size = 0; - return 0; - } - buf_size = pwd->ahi.block_align; - samples = data; - init_get_bits(&pwd->gb, buf, buf_size); + init_get_bits(&pwd->gb, in, in_size); if (pwd->ahi.use_bit_reservoir) { int i, nb_frames, bit_offset, pos, len; uint8_t *q; @@ -1086,7 +1042,7 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data, // PARA_DEBUG_LOG("have %d frames\n", nb_frames); ret = -E_WMA_OUTPUT_SPACE; if ((nb_frames + 1) * pwd->ahi.channels * pwd->frame_len - * sizeof(int16_t) > *data_size) + * sizeof(int16_t) > *out_size) goto fail; bit_offset = get_bits(&pwd->gb, pwd->byte_offset_bits + 3); @@ -1124,7 +1080,7 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data, /* read each frame starting from bit_offset */ pos = bit_offset + 4 + 4 + pwd->byte_offset_bits + 3; - init_get_bits(&pwd->gb, buf + (pos >> 3), + init_get_bits(&pwd->gb, in + (pos >> 3), (MAX_CODED_SUPERFRAME_SIZE - (pos >> 3))); len = pos & 7; if (len > 0) @@ -1143,16 +1099,16 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data, ((bit_offset + 4 + 4 + pwd->byte_offset_bits + 3) & ~7); pwd->last_bitoffset = pos & 7; pos >>= 3; - len = buf_size - pos; + len = in_size - pos; ret = -E_WMA_BAD_SUPERFRAME; if (len > MAX_CODED_SUPERFRAME_SIZE || len < 0) goto fail; pwd->last_superframe_len = len; - memcpy(pwd->last_superframe, buf + pos, len); + memcpy(pwd->last_superframe, in + pos, len); } else { PARA_DEBUG_LOG("not using bit reservoir\n"); ret = -E_WMA_OUTPUT_SPACE; - if (pwd->ahi.channels * pwd->frame_len * sizeof(int16_t) > *data_size) + if (pwd->ahi.channels * pwd->frame_len * sizeof(int16_t) > *out_size) goto fail; /* single frame decode */ ret = wma_decode_frame(pwd, samples); @@ -1162,8 +1118,8 @@ static int wma_decode_superframe(struct private_wmadec_data *pwd, void *data, } PARA_DEBUG_LOG("frame_len: %d, block_len: %d, outbytes: %d, eaten: %d\n", pwd->frame_len, pwd->block_len, - (int)((int8_t *)samples - (int8_t *)data), pwd->ahi.block_align); - *data_size = (int8_t *)samples - (int8_t *)data; + (int)((int8_t *)samples - (int8_t *)out), pwd->ahi.block_align); + *out_size = (int8_t *)samples - (int8_t *)out; return pwd->ahi.block_align; fail: /* reset the bit reservoir on errors */ @@ -1174,10 +1130,21 @@ fail: static void wmadec_close(struct filter_node *fn) { struct private_wmadec_data *pwd = fn->private_data; + int i; if (!pwd) return; - wmadec_cleanup(pwd); + for (i = 0; i < pwd->nb_block_sizes; i++) + imdct_end(pwd->mdct_ctx[i]); + if (pwd->ahi.use_exp_vlc) + free_vlc(&pwd->exp_vlc); + if (pwd->use_noise_coding) + free_vlc(&pwd->hgain_vlc); + for (i = 0; i < 2; i++) { + free_vlc(&pwd->coef_vlc[i]); + free(pwd->run_table[i]); + free(pwd->level_table[i]); + } free(fn->private_data); fn->private_data = NULL; } @@ -1233,7 +1200,7 @@ next_buffer: out_size = WMA_OUTPUT_BUFFER_SIZE; out = para_malloc(out_size); ret = wma_decode_superframe(pwd, out, &out_size, - (uint8_t *)in + WMA_FRAME_SKIP, len - WMA_FRAME_SKIP); + (uint8_t *)in + WMA_FRAME_SKIP); if (ret < 0) { free(out); goto err;