patacongo edited a comment on pull request #1597:
URL: https://github.com/apache/incubator-nuttx/pull/1597#issuecomment-674987885


   > Right, it would end up as `" "arg1", "arg2", "arg3" " actually. So i guess 
it is not that easy (without some string tokenization on runtime).
   
   tools/mkconfig.c tool supports destringifying things this.  It can convert " 
"arg1", "arg2", "arg3" " to automatically arg1", "arg2", "arg3".  See in 
cfgdefine.c:
   
        58 /* These are configuration variable name that are quoted by 
configuration
        59  * tool but which must be unquoted when used in C code.
        60  */
        61
        62 static const char *dequote_list[] =
        63 {
        64   /* NuttX */
        65
        66   "CONFIG_USER_ENTRYPOINT",               /* Name of entry point 
function */
        67   "CONFIG_EXECFUNCS_SYMTAB_ARRAY",        /* Symbol table array used 
by exec[l|v] */
        68   "CONFIG_EXECFUNCS_NSYMBOLS_VAR",        /* Variable holding number 
of symbols in the table */
        69   "CONFIG_MODLIB_SYMTAB_ARRAY",           /* Symbol table array used 
by modlib functions */
        70   "CONFIG_MODLIB_NSYMBOLS_VAR",           /* Variable holding number 
of symbols in the table */
        71   "CONFIG_PASS1_BUILDIR",                 /* Pass1 build directory */
        72   "CONFIG_PASS1_TARGET",                  /* Pass1 build target */
        73   "CONFIG_PASS1_OBJECT",                  /* Pass1 build object */
        74   "CONFIG_DEBUG_OPTLEVEL",                /* Custom debug level */
        75   "CONFIG_INIT_SYMTAB",                   /* Global symbol table */
        76   "CONFIG_INIT_NEXPORTS",                 /* Global symbol table 
size */
        77
        78   /* NxWidgets/NxWM */
        79
        80   "CONFIG_NXWM_BACKGROUND_IMAGE",         /* Name of bitmap image 
class */
        81   "CONFIG_NXWM_STOP_BITMAP",              /* Name of bitmap image 
class */
        82   "CONFIG_NXWM_MINIMIZE_BITMAP",          /* Name of bitmap image 
class */
        83   "CONFIG_NXWM_STARTWINDOW_ICON",         /* Name of bitmap image 
class */
        84   "CONFIG_NXWM_NXTERM_ICON",              /* Name of bitmap image 
class */
        85   "CONFIG_NXWM_CALIBRATION_ICON",         /* Name of bitmap image 
class */
        86   "CONFIG_NXWM_HEXCALCULATOR_ICON",       /* Name of bitmap image 
class */
        87
        88   /* apps/ definitions */
        89
        90   "CONFIG_SYSTEM_NSH_SYMTAB_ARRAYNAME",   /* Symbol table array name 
*/
        91   "CONFIG_SYSTEM_NSH_SYMTAB_COUNTNAME",   /* Name of the variable 
holding the number of symbols */
        92   NULL                                    /* Marks the end of the 
list */
        93 };
   
   It can also handle baskslash quoting of the internal strings if necessary:
   
       270           /* A special case is a quoted list of quoted strings.  In 
that case
       271            * we will need to remove the backspaces from the 
internally quoted
       272            * strings.  NOTE: this will not handle nested quoted 
quotes.
       273            */
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to