(root)/kissdx/ - Rev 167
Go to most recent revision |
Last modification |
Compare with Previous |
View Log
| RSS feed
Last modification
- Rev 167 2008-01-27 22:51:17
- Author: bluediver
- Log message:
- Feature: loglevel and removal of nested function scandir_selector() and ftw.h specificity
In order to allow a full port on MacOSX platform, nested function are removed (scandir_selector)
Remove nested function scandir_selector() out from transform_subtitle_filename and get_next_picture (connection.c)
This function is a reuseable tool feature to moved to utils.c
scandir_selector function purpose is to filter all filename provided by scandir based on criteria
that is available through a global structure 'scandir_info' defined in util.h.
A structure type scandir_info_t store information like 'dirname','filename pattern' and 'extension' allowed.
Same removal of nested function scandir_selector() out of piccache.c
Caching use another feature related to scandir_selector: the need to retrieve directory name only,
and forget standard filename. Then utils.c/scandir_selector() is enriched with option: FILE or DIR
the variable 'scandir_directory_limited' is included in global structure 'scandir_info'
Nested function are not supported on MaxOsX (10.4 & 10.5)
Even with gcc option, -fnested-functions, the nested function located in utils.c/casestat() crashes the child.
the test case is a LIST VIDEO that stop at the first directory. Same behaviours in reading B2B music.
Modification done in casestat() is to do a full scandir and filter afterwards in 'for' loop.
Robustness for multiple client request:
=========================================
Q:Does a global structure may be a weak point if kissdx serves multiple clients and requests simultanously ?
A1:Transform_subtitle_filename function is called, in a child life dedicated to a GET request.
It could not serve multiple request at the same time. The global variable populated has a child scope range.
A2:trim_cache function also needs a global structured value to enable ftw function, and is called in a child.
Then not weakness is inserted with this global structure.
List of testcase to validate the removal of nested function :
=============================================================
> Scandir_selector / get_next_picture (connection.c)
= select picture display, and click Next on remote
> Scandir_selector / transforme_subtitle_filename (connection.c)
= select a movie subtitled and check verbose log
> Scandir_selector / get_entry (piccache.c)
= At the end of displaying a picture, the get_next_pic_to_precache calls 3xget_entry()
>> check verbose log to validate
> Scandir_selector / remove_entry (piccache.c)
= Set cachepicturesize = 5 and TrimInterval = 0 (occurs on each picture request)
Check directory .piccache with a ls -al : analyse nb of entry, and date time
> Scandir_selector / trim_cache (piccache.c)
test: verbose mode during slideshow of picture
> ftw specific code / trim_cache (piccache.c)
As standard way of 'sort' is running well, why keep the ftw solution ?
both ftw and standard were removed nested function
test: verbose mode during slideshow of picture
test: undefine USE_FTW in piccache.c and do same verbose log check
> Scandir_selector / compose_combinedfile (backtoback.c)
Select a mp3 directory and select the b2b entry of it, listen ...
== Feature Loglevel / Verbose =================
Verbose and loglevel are compliant.
Review of code during each step of new feature coding will be the opportunity to migrate a logv() to loglevel()
Both numeric and alpha numeric parameter is supported:
./kissdx -l5 is same as ./kissdx -l debug and backward compatible with ./kissdx -v
Starting verbose log include this information.
Starting standard log only notifies any command line option accepted like (-l1) to ease diagnostic.
Support in command line (l1 to l5) or (l error to l debug)
Support in kissdx.conf:loglevel options (l1 to l5) or (l error to l debug)
Command line l5 is equivalent to (-v) verbose mode (and the opposite)
config file option l5 generate a verbose mode
Logging feature is customisable from 1 to 5 or in alphanumeric character
l1 = Error only should be displayed
l2 = l1 + Warning only should be displayed
l3 = l2 + Protocol exchange with the player, is only displayed
l4 = l3 + Information only
l5 = l4 + Debug information is fully displayed