2008-10-26 08:55:15 +01:00
|
|
|
/*
|
|
|
|
* c++check - c/c++ syntax checking
|
|
|
|
* Copyright (C) 2007 Daniel Marjamäki
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-05-24 15:07:30 +02:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
#ifndef CommonCheckH
|
|
|
|
#define CommonCheckH
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2008-03-28 08:18:03 +01:00
|
|
|
#include <list>
|
2007-05-24 15:07:30 +02:00
|
|
|
#include <string>
|
2008-02-16 16:46:32 +01:00
|
|
|
#include <sstream>
|
2008-03-29 10:44:23 +01:00
|
|
|
#include <vector>
|
2007-05-24 15:07:30 +02:00
|
|
|
|
|
|
|
struct TOKEN;
|
|
|
|
|
2008-03-16 14:17:43 +01:00
|
|
|
std::string FileLine(const TOKEN *tok);
|
2008-03-28 08:18:03 +01:00
|
|
|
|
2008-04-06 08:26:11 +02:00
|
|
|
// Are two filenames the same? Case insensitive on windows
|
|
|
|
bool SameFileName( const char fname1[], const char fname2[] );
|
|
|
|
|
2008-02-22 15:30:43 +01:00
|
|
|
extern bool OnlyReportUniqueErrors;
|
2007-05-24 15:07:30 +02:00
|
|
|
|
2008-03-22 18:09:08 +01:00
|
|
|
void ReportErr(const std::string &errmsg);
|
2008-02-16 16:46:32 +01:00
|
|
|
extern std::ostringstream errout;
|
2007-05-24 15:07:30 +02:00
|
|
|
|
2007-05-25 08:45:47 +02:00
|
|
|
|
|
|
|
bool IsName(const char str[]);
|
|
|
|
bool IsNumber(const char str[]);
|
|
|
|
|
2007-07-20 08:20:31 +02:00
|
|
|
bool IsStandardType(const char str[]);
|
|
|
|
|
2008-03-29 10:44:23 +01:00
|
|
|
void FillFunctionList(const unsigned int file_id);
|
2008-03-28 08:18:03 +01:00
|
|
|
const TOKEN *GetFunctionTokenByName( const char funcname[] );
|
2008-03-29 10:44:23 +01:00
|
|
|
void CheckGlobalFunctionUsage(const std::vector<std::string> &filenames);
|
2008-03-28 08:18:03 +01:00
|
|
|
|
2008-03-28 18:40:24 +01:00
|
|
|
bool Match(const TOKEN *tok, const char pattern[], const char *varname1[]=0, const char *varname2[]=0);
|
2008-03-28 08:18:03 +01:00
|
|
|
|
2008-08-16 14:44:46 +02:00
|
|
|
const TOKEN *findmatch(const TOKEN *tok, const char pattern[], const char *varname1[]=0, const char *varname2[]=0);
|
2008-03-23 17:18:31 +01:00
|
|
|
|
2008-08-16 14:44:46 +02:00
|
|
|
void deleteTokens(TOKEN *tok);
|
2007-05-24 15:07:30 +02:00
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
#endif
|