/[svn]/linuxsampler/trunk/scripts/generate_lscp_shell_reference.pl
ViewVC logotype

Diff of /linuxsampler/trunk/scripts/generate_lscp_shell_reference.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3053 by schoenebeck, Wed Dec 14 17:34:54 2016 UTC revision 3054 by schoenebeck, Thu Dec 15 12:47:45 2016 UTC
# Line 10  Line 10 
10  # Then src/network/lscp_shell_reference.cpp is generated by this script with  # Then src/network/lscp_shell_reference.cpp is generated by this script with
11  # the documentation for each individual LSCP command extracted.  # the documentation for each individual LSCP command extracted.
12  #  #
13  # Usage: generate_lscp_shell_reference.pl  # Usage: generate_lscp_shell_reference.pl [--output=OUTFILE] [--debug-xml-extract]
14    
15  use XML::Parser;  use XML::Parser;
16  use Data::Dumper; # just for debugging  use Data::Dumper; # just for debugging
# Line 278  print OUT <<EOF_BLOCK; Line 278  print OUT <<EOF_BLOCK;
278   *                                                                           *   *                                                                           *
279   *  LSCP documentation reference built into LSCP shell.                      *   *  LSCP documentation reference built into LSCP shell.                      *
280   *                                                                           *   *                                                                           *
281   *  Copyright (c) 2014 Christian Schoenebeck                                 *   *  Copyright (c) 2014 - 2016 Christian Schoenebeck                          *
282   *                                                                           *   *                                                                           *
283   *  This program is part of LinuxSampler and released under the same terms.  *   *  This program is part of LinuxSampler and released under the same terms.  *
284   *                                                                           *   *                                                                           *
# Line 320  print OUT <<EOF_BLOCK; Line 320  print OUT <<EOF_BLOCK;
320  };  };
321    
322  lscp_ref_entry_t* lscp_reference_for_command(const char* cmd) {  lscp_ref_entry_t* lscp_reference_for_command(const char* cmd) {
323      const int n1 = strlen(cmd);      const int n1 = (int)strlen(cmd);
324      if (!n1) return NULL;      if (!n1) return NULL;
325      int foundLength = 0;      int foundLength = 0;
326      lscp_ref_entry_t* foundEntry = NULL;      lscp_ref_entry_t* foundEntry = NULL;
327      for (int i = 0; i < sizeof(lscp_reference) / sizeof(lscp_ref_entry_t); ++i) {      for (int i = 0; i < sizeof(lscp_reference) / sizeof(lscp_ref_entry_t); ++i) {
328          const int n2 = strlen(lscp_reference[i].name);          const int n2 = (int)strlen(lscp_reference[i].name);
329          const int n = n1 < n2 ? n1 : n2;          const int n = n1 < n2 ? n1 : n2;
330          if (!strncmp(cmd, lscp_reference[i].name, n)) {          if (!strncmp(cmd, lscp_reference[i].name, n)) {
331              if (foundEntry) {              if (foundEntry) {

Legend:
Removed from v.3053  
changed lines
  Added in v.3054

  ViewVC Help
Powered by ViewVC