/[jscoverage]/trunk/instrument.c
ViewVC logotype

Diff of /trunk/instrument.c

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

revision 431 by siliconforks, Wed Feb 18 18:24:51 2009 UTC revision 505 by siliconforks, Sat Jan 2 04:55:54 2010 UTC
# Line 1  Line 1 
1  /*  /*
2      instrument.c - file and directory instrumentation routines      instrument.c - file and directory instrumentation routines
3      Copyright (C) 2007, 2008, 2009 siliconforks.com      Copyright (C) 2007, 2008, 2009, 2010 siliconforks.com
4    
5      This program is free software; you can redistribute it and/or modify      This program is free software; you can redistribute it and/or modify
6      it under the terms of the GNU General Public License as published by      it under the terms of the GNU General Public License as published by
# Line 99  Line 99 
99    
100          Stream_write_file_contents(input_stream, input);          Stream_write_file_contents(input_stream, input);
101    
102            /*
103            Check if the source file looks like an instrumented JavaScript file.
104            */
105            if (input_stream->length >= JSCOVERAGE_INSTRUMENTED_HEADER_LENGTH &&
106                memcmp(input_stream->data, JSCOVERAGE_INSTRUMENTED_HEADER, JSCOVERAGE_INSTRUMENTED_HEADER_LENGTH) == 0) {
107              fatal_command_line("file %s in the source directory appears to be already instrumented", id);
108            }
109    
110          size_t num_characters = input_stream->length;          size_t num_characters = input_stream->length;
111          uint16_t * characters = NULL;          uint16_t * characters = NULL;
112          int result = jscoverage_bytes_to_characters(jscoverage_encoding, input_stream->data, input_stream->length, &characters, &num_characters);          int result = jscoverage_bytes_to_characters(jscoverage_encoding, input_stream->data, input_stream->length, &characters, &num_characters);

Legend:
Removed from v.431  
changed lines
  Added in v.505

  ViewVC Help
Powered by ViewVC 1.1.24