Commit f11ec7ba authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Guard macro unification/cleanup

parent 24cc29e9
/*
labcomm.h -- user interface for handling encoding and decoding of
labcomm2006.h -- user interface for handling encoding and decoding of
labcomm samples.
Copyright 2006-2013 Anders Blomdell <anders.blomdell@control.lth.se>
......@@ -20,8 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_H_
#define _LABCOMM_H_
#ifndef __LABCOMM2006_H__
#define __LABCOMM2006_H__
#include <stdarg.h>
......
......@@ -18,7 +18,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM2006_DEFAULT_ERROR_HANDLER_H__
#define __LABCOMM2006_DEFAULT_ERROR_HANDLER_H__
#include "labcomm2006.h"
extern struct labcomm2006_error_handler *labcomm2006_default_error_handler;
#endif
......@@ -18,9 +18,12 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM2006_DEFAULT_MEMORY_H__
#define __LABCOMM2006_DEFAULT_MEMORY_H__
#include <stdlib.h>
#include "labcomm2006.h"
extern struct labcomm2006_memory *labcomm2006_default_memory;
#endif
......@@ -18,7 +18,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM2006_DEFAULT_SCHEDULER_H__
#define __LABCOMM2006_DEFAULT_SCHEDULER_H__
#include "labcomm2006.h"
extern struct labcomm2006_scheduler *labcomm2006_default_scheduler;
#endif
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_DYNAMIC_BUFFER_READER_WRITER_H_
#define _LABCOMM_DYNAMIC_BUFFER_READER_WRITER_H_
#ifndef __LABCOMM2006_DYNAMIC_BUFFER_READER_WRITER_H__
#define __LABCOMM2006_DYNAMIC_BUFFER_READER_WRITER_H__
#include "labcomm2006.h"
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM_ERROR_H__
#define __LABCOMM_ERROR_H__
#ifndef __LABCOMM2006_ERROR_H__
#define __LABCOMM2006_ERROR_H__
enum labcomm2006_error {
#define LABCOMM_ERROR(name, description) name ,
......
/*
labcomm2006_fd_reader.c -- a reader for unix style file-descriptors
......@@ -19,8 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_FD_READER_H_
#define _LABCOMM_FD_READER_H_
#ifndef __LABCOMM2006_FD_READER_H__
#define __LABCOMM2006_FD_READER_H__
#include "labcomm2006.h"
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_FD_WRITER_H_
#define _LABCOMM_FD_WRITER_H_
#ifndef __LABCOMM2006_FD_WRITER_H__
#define __LABCOMM2006_FD_WRITER_H__
#include "labcomm2006.h"
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM_IOCTL_H__
#define __LABCOMM_IOCTL_H__
#ifndef __LABCOMM2006_IOCTL_H__
#define __LABCOMM2006_IOCTL_H__
#include "labcomm2006.h"
......
......@@ -20,8 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_PRIVATE_H_
#define _LABCOMM_PRIVATE_H_
#ifndef __LABCOMM2006_PRIVATE_H__
#define __LABCOMM2006_PRIVATE_H__
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_PTHREAD_SCHEDULER_H_
#define _LABCOMM_PTHREAD_SCHEDULER_H_
#ifndef __LABCOMM2006_PTHREAD_SCHEDULER_H__
#define __LABCOMM2006_PTHREAD_SCHEDULER_H__
#include "labcomm2006.h"
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_SCHEDULER_H_
#define _LABCOMM_SCHEDULER_H_
#ifndef __LABCOMM2006_SCHEDULER_H__
#define __LABCOMM2006_SCHEDULER_H__
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_SCHEDULER_PRIVATE_H_
#define _LABCOMM_SCHEDULER_PRIVATE_H_
#ifndef __LABCOMM2006_SCHEDULER_PRIVATE_H__
#define __LABCOMM2006_SCHEDULER_PRIVATE_H__
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
......
#ifndef _LABCOMM2006_COMPAT_VXWORKS_H_
#define _LABCOMM2006_COMPAT_VXWORKS_H_
#ifndef __LABCOMM2006_COMPAT_VXWORKS_H__
#define __LABCOMM2006_COMPAT_VXWORKS_H__
#ifndef __VXWORKS__
#error "__VXWORKS__" not defined
......
......@@ -20,8 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_H_
#define _LABCOMM_H_
#ifndef __LABCOMM_H__
#define __LABCOMM_H__
#include <stdarg.h>
......
......@@ -18,7 +18,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM_DEFAULT_ERROR_HANDLER_H__
#define __LABCOMM_DEFAULT_ERROR_HANDLER_H__
#include "labcomm.h"
extern struct labcomm_error_handler *labcomm_default_error_handler;
#endif
......@@ -18,9 +18,12 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM_DEFAULT_MEMORY_H__
#define __LABCOMM_DEFAULT_MEMORY_H__
#include <stdlib.h>
#include "labcomm.h"
extern struct labcomm_memory *labcomm_default_memory;
#endif
......@@ -18,7 +18,11 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM_DEFAULT_SCHEDULER_H__
#define __LABCOMM_DEFAULT_SCHEDULER_H__
#include "labcomm.h"
extern struct labcomm_scheduler *labcomm_default_scheduler;
#endif
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_DYNAMIC_BUFFER_READER_WRITER_H_
#define _LABCOMM_DYNAMIC_BUFFER_READER_WRITER_H_
#ifndef __LABCOMM_DYNAMIC_BUFFER_READER_WRITER_H__
#define __LABCOMM_DYNAMIC_BUFFER_READER_WRITER_H__
#include "labcomm.h"
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM_ERROR_H__
#define __LABCOMM_ERROR_H__
#ifndef __LABCOMM_ERROR_H___
#define __LABCOMM_ERROR_H___
enum labcomm_error {
#define LABCOMM_ERROR(name, description) name ,
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_FD_READER_H_
#define _LABCOMM_FD_READER_H_
#ifndef __LABCOMM_FD_READER_H__
#define __LABCOMM_FD_READER_H__
#include "labcomm.h"
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_FD_WRITER_H_
#define _LABCOMM_FD_WRITER_H_
#ifndef __LABCOMM_FD_WRITER_H__
#define __LABCOMM_FD_WRITER_H__
#include "labcomm.h"
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __LABCOMM_IOCTL_H__
#define __LABCOMM_IOCTL_H__
#ifndef __LABCOMM_IOCTL_H___
#define __LABCOMM_IOCTL_H___
#include "labcomm.h"
......
......@@ -20,8 +20,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_PRIVATE_H_
#define _LABCOMM_PRIVATE_H_
#ifndef __LABCOMM_PRIVATE_H__
#define __LABCOMM_PRIVATE_H__
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_PTHREAD_SCHEDULER_H_
#define _LABCOMM_PTHREAD_SCHEDULER_H_
#ifndef __LABCOMM_PTHREAD_SCHEDULER_H__
#define __LABCOMM_PTHREAD_SCHEDULER_H__
#include "labcomm.h"
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_SCHEDULER_H_
#define _LABCOMM_SCHEDULER_H_
#ifndef __LABCOMM_SCHEDULER_H__
#define __LABCOMM_SCHEDULER_H__
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
......
......@@ -19,8 +19,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_SCHEDULER_PRIVATE_H_
#define _LABCOMM_SCHEDULER_PRIVATE_H_
#ifndef __LABCOMM_SCHEDULER_PRIVATE_H__
#define __LABCOMM_SCHEDULER_PRIVATE_H__
#ifdef LABCOMM_COMPAT
#include LABCOMM_COMPAT
......
......@@ -9,7 +9,7 @@ class File:
def __init__(self, path, match, replacement):
def replace(s):
return re.sub('[ \t]+', ' ', s).replace(match, replacement)
return re.sub('[ \t]+', ' ', s).replace(match, replacement).strip()
self.name = path.replace(match, replacement)
self.path = path
with open(path) as f:
......@@ -50,7 +50,7 @@ if __name__ == '__main__':
else:
equal = True
for l in difflib.unified_diff(a.lines, b.lines, a.path, b.path):
print l,
print l
equal = False
if equal:
print "Identical", a.path, b.path
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment