~ubuntu-branches/ubuntu/saucy/monit/saucy-proposed

« back to all changes in this revision

Viewing changes to src/lex.yy.c

  • Committer: Package Import Robot
  • Author(s): Sergey B Kirpichev
  • Date: 2012-09-10 14:20:52 UTC
  • mfrom: (1.1.17)
  • Revision ID: package-import@ubuntu.com-20120910142052-7hnet3ghuk10dwwm
Tags: 1:5.5-1
* Bunch of config snippets (debian/monitrc.d/*)
* Imported Upstream version 5.5
* Unfuzz patches
* Add Forwarded: dep3 headers

Show diffs side-by-side

added added

removed removed

Lines of Context:
2725
2725
 * for all of the code used other than OpenSSL.  
2726
2726
 */
2727
2727
#line 30 "src/l.l"
2728
 
  
 
2728
 
2729
2729
/*
2730
2730
 * DESCRIPTION
2731
2731
 *
2734
2734
 */
2735
2735
 
2736
2736
#include "config.h"
2737
 
  
 
2737
 
2738
2738
#ifdef HAVE_STRING_H
2739
2739
#include <string.h>
2740
2740
#endif
2749
2749
 
2750
2750
#include "monit.h"
2751
2751
#include "tokens.h"
2752
 
        
 
2752
 
2753
2753
// libmonit
2754
2754
#include "util/Str.h"
2755
2755
 
2763
2763
    char           *currentfile;
2764
2764
    YY_BUFFER_STATE buffer;
2765
2765
  } buffer_stack[MAX_STACK_DEPTH];
2766
 
  
2767
 
  
 
2766
 
 
2767
 
2768
2768
  int lineno= 1;
2769
2769
  int arglineno= 1;
2770
2770
  char *currentfile=NULL;
2771
2771
  char *argcurrentfile=NULL;
2772
2772
  char *argyytext=NULL;
2773
2773
 
2774
 
  
 
2774
 
2775
2775
  /* Prototypes */
2776
2776
  extern void yyerror(const char*,...);
2777
2777
  extern void yywarning(const char *,...);
2782
2782
  static void push_buffer_state(YY_BUFFER_STATE, char*);
2783
2783
  static int  pop_buffer_state(void);
2784
2784
  static URL_T create_URL(char *proto);
2785
 
  
 
2785
 
2786
2786
 
2787
2787
#line 2788 "src/lex.yy.c"
2788
2788
 
4694
4694
case YY_STATE_EOF(INCLUDE):
4695
4695
#line 708 "src/l.l"
4696
4696
{
4697
 
                       
 
4697
 
4698
4698
                       if ( !pop_buffer_state() )
4699
4699
                       {
4700
4700
                         yyterminate();
5723
5723
      continue;
5724
5724
 
5725
5725
    yyin = fopen( globbuf.gl_pathv[i], "r" );
5726
 
    
 
5726
 
5727
5727
    if (! yyin)
5728
5728
      yyerror( "failed to include file" );
5729
5729
    else
5734
5734
 
5735
5735
 
5736
5736
static void push_buffer_state(YY_BUFFER_STATE buffer, char *filename) {
5737
 
 
5738
 
  if ( buffer_stack_ptr >= MAX_STACK_DEPTH )
5739
 
  {
5740
 
 
5741
 
    yyerror("include files are nested too deeply" );
 
5737
  if ( buffer_stack_ptr >= MAX_STACK_DEPTH ) {
 
5738
    yyerror("include files limit reached");
5742
5739
    exit( 1 );
5743
 
    
5744
5740
  }
5745
5741
 
5746
5742
  buffer_stack[buffer_stack_ptr].lineno = lineno;
5751
5747
 
5752
5748
  lineno = 1;
5753
5749
  currentfile = Str_dup(filename);
5754
 
      
 
5750
 
5755
5751
  yy_switch_to_buffer(buffer);
5756
5752
 
5757
5753
  BEGIN(INITIAL);
5758
 
  
 
5754
 
5759
5755
}
5760
5756
 
5761
5757
 
5766
5762
    return 0;
5767
5763
 
5768
5764
  } else {
5769
 
    
 
5765
 
5770
5766
    fclose(yyin);
5771
5767
    lineno=buffer_stack[buffer_stack_ptr].lineno;
5772
5768
 
5775
5771
 
5776
5772
    yy_delete_buffer(YY_CURRENT_BUFFER );
5777
5773
    yy_switch_to_buffer(buffer_stack[buffer_stack_ptr].buffer );
5778
 
    
 
5774
 
5779
5775
  }
5780
5776
 
5781
5777
  return 1;
5782
 
 
 
5778
 
5783
5779
}
5784
5780
 
5785
5781
 
5786
5782
static void save_arg(void) {
5787
 
  
 
5783
 
5788
5784
  arglineno=lineno;
5789
5785
  argcurrentfile=currentfile;
5790
5786
  FREE(argyytext);
5791
5787
  argyytext=Str_dup(yytext);
5792
 
  
 
5788
 
5793
5789
}
5794
5790
 
5795
5791