From 475b3f68b5fea9bd1d488c0ae88c95579494365c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Wed, 8 Jun 2016 12:10:16 +0200 Subject: [PATCH] fixed styling --- src/lib/pio.c | 5 ++-- src/lib/pio.h | 70 ++++++++++++++++++++++++++++--------------------------- src/lib/plog.c | 2 +- src/lib/plog.h | 36 ++++++++++++++-------------- src/lib/psensor.h | 6 +++-- 5 files changed, 62 insertions(+), 57 deletions(-) diff --git a/src/lib/pio.c b/src/lib/pio.c index bea067d..ef0c901 100644 --- a/src/lib/pio.c +++ b/src/lib/pio.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 jeanfi@gmail.com + * Copyright (C) 2010-2016 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -30,7 +30,8 @@ #include /* Directory separator is \ when cross-compiling for MS Windows - systems */ + * systems + */ #if defined(__MINGW32__) #define DIRSEP ('\\') #else diff --git a/src/lib/pio.h b/src/lib/pio.h index 385ad33..13eb70e 100644 --- a/src/lib/pio.h +++ b/src/lib/pio.h @@ -1,56 +1,58 @@ /* - Copyright (C) 2010-2014 jeanfi@gmail.com - - 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 2 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, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA -*/ + * Copyright (C) 2010-2016 jeanfi@gmail.com + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ #ifndef _P_IO_H #define _P_IO_H -#define P_IO_VER 4 +#define P_IO_VER 6 /* Returns '1' if a given 'path' denotates a directory else returns - 0 */ + * 0 + */ int is_dir(const char *path); /* Returns '1' if a given 'path' denotates a file else returns - 0 */ + * 0 + */ int is_file(const char *path); -/* Returns a normalized path */ +/* Returns a normalized path */ char *path_normalize(const char *dpath); -/* Returns the null-terminated entries of a directory */ +/* Returns the null-terminated entries of a directory */ char **dir_list(const char *dpath, int (*filter) (const char *path)); void paths_free(char **paths); char *path_append(const char *dir, const char *path); /* - Returns the size of a file. - Returns '-1' if the size cannot be retrieved or not a file. -*/ + * Returns the size of a file. + * Returns '-1' if the size cannot be retrieved or not a file. + */ long file_get_size(const char *path); /* - Returns the content of a file. - Returns 'NULL' if the file cannot be read or failed to allocate - enough memory. - Returns an empty string if the file exists but is empty. -*/ + * Returns the content of a file. + * Returns 'NULL' if the file cannot be read or failed to allocate + * enough memory. + * Returns an empty string if the file exists but is empty. + */ char *file_get_content(const char *path); enum file_copy_error { @@ -64,10 +66,10 @@ enum file_copy_error { void file_copy_print_error(int code, const char *src, const char *dst); /* - Copy a file. - - Returns '0' if sucessfull, otherwise return the error code. -*/ + * Copy a file. + * + * Returns '0' if sucessfull, otherwise return the error code. + */ int file_copy(const char *src, const char *dst); int dir_rcopy(const char *, const char *); diff --git a/src/lib/plog.c b/src/lib/plog.c index 285ac03..2b6ffd1 100644 --- a/src/lib/plog.c +++ b/src/lib/plog.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 jeanfi@gmail.com + * Copyright (C) 2010-2016 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff --git a/src/lib/plog.h b/src/lib/plog.h index 90796eb..2e22975 100644 --- a/src/lib/plog.h +++ b/src/lib/plog.h @@ -1,28 +1,28 @@ /* - Copyright (C) 2010-2014 jeanfi@gmail.com - - 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 2 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, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301 USA + * Copyright (C) 2010-2016 jeanfi@gmail.com + * + * 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 2 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA */ #ifndef _P_LOG_H_ #define _P_LOG_H_ -#define P_LOG_VER 2 +#define P_LOG_VER 3 enum log_level { - LOG_ERR , + LOG_ERR, LOG_WARN, LOG_INFO, LOG_DEBUG diff --git a/src/lib/psensor.h b/src/lib/psensor.h index 1637f89..bfefefb 100644 --- a/src/lib/psensor.h +++ b/src/lib/psensor.h @@ -73,8 +73,10 @@ struct psensor { /* Maximum length of 'values' */ int values_max_length; - /* Last registered measures of the sensor. Index 0 for the - * oldest measure. */ + /* + * Last registered measures of the sensor. Index 0 for the + * oldest measure. + */ struct measure *measures; /* see psensor_type */ -- 2.7.4