diff options
author | David <dbphillipsnz@gmail.com> | 2014-09-27 11:22:59 +1200 |
---|---|---|
committer | David <dbphillipsnz@gmail.com> | 2014-09-27 11:22:59 +1200 |
commit | 54242903bd3c85e2f4bef5de10ff818480b17404 (patch) | |
tree | 916988dd8727423c0b39af7cf3b0ccbe882c640d | |
parent | 3cee02998b117ee10e081aa8a6678c16a8efa413 (diff) | |
download | paramano-54242903bd3c85e2f4bef5de10ff818480b17404.tar.xz |
Capitalisation fix in licence
-rw-r--r-- | bat_tray.c | 13 | ||||
-rw-r--r-- | bat_tray.h | 8 | ||||
-rw-r--r-- | config_file.c | 10 | ||||
-rw-r--r-- | config_file.h | 8 | ||||
-rw-r--r-- | defaults.c | 8 | ||||
-rw-r--r-- | defaults.h | 8 | ||||
-rw-r--r-- | getcore.c | 10 | ||||
-rw-r--r-- | getcore.h | 8 | ||||
-rw-r--r-- | getfreq.h | 12 | ||||
-rw-r--r-- | getgov.c | 53 | ||||
-rw-r--r-- | getgov.h | 14 | ||||
-rw-r--r-- | paramano.c | 12 | ||||
-rw-r--r-- | paramano.h | 8 | ||||
-rw-r--r-- | paramano_set.c | 8 | ||||
-rw-r--r-- | paramano_set_interface.c | 8 | ||||
-rw-r--r-- | paramano_set_interface.h | 8 | ||||
-rw-r--r-- | reload.c | 8 | ||||
-rw-r--r-- | reload.h | 8 | ||||
-rw-r--r-- | tray.c | 14 | ||||
-rw-r--r-- | tray.h | 8 |
20 files changed, 118 insertions, 116 deletions
@@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -190,7 +190,7 @@ int get_battery_state() if (file_has_line(CHARGE_STATE_PATH, "Charging")) { debug("Battery charging\n"); - return STATE_CHARGING; + return STATE_CHARGING; } debug("Fallthrough: unknown status\n"); return STATE_UNKNOWN; @@ -209,8 +209,7 @@ int get_bat_num() for(i = 0; i < 10; i++) { asprintf(&file, "/sys/class/power_supply/BAT%d/present", i); - debug("Attempting to open '%s'\n",file); - if( (fd = fopen(file, "r")) ) + if( (fd = check_for_file(file)) ) { debug("Found battery %d\n",i); if (fgetc(fd) == '1') @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ diff --git a/config_file.c b/config_file.c index 781502e..33dd512 100644 --- a/config_file.c +++ b/config_file.c @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -32,7 +32,7 @@ gboolean config_open(struct config_file* config_file) gboolean success = g_key_file_load_from_file( config_file->key_file, config_file->file_name, - G_KEY_FILE_NONE, + G_KEY_FILE_NONE, NULL); debug("Returning %s\n",success? "TRUE" : "FALSE"); return success; diff --git a/config_file.h b/config_file.h index ce07735..e4d8696 100644 --- a/config_file.h +++ b/config_file.h @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -39,7 +39,7 @@ bool core_exists(unsigned int core) debug("Checking if core %d exists by opening '%s'\n",core,path); result = access(path, F_OK); free (path); - return (result != -1); + return (result != -1); } @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -1,27 +1,29 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ #ifndef GETFREQ_H #define GETFREQ_H +#include <stdbool.h> + void gf_init(); int gf_current(int core); -int gf_available(int core, char* out, int size); +bool gf_available(int core, char* out, int size); char* gf_get_frequency_label(int freq); char* gf_freqa(int core, int index); int gf_freqi(int core, int index); @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -38,7 +38,7 @@ void gg_init() gchar gov_string[500]; int i = 0; total_governors = 0; - for(i = 0; i < gc_number(); ++i) + for (i = 0; i < gc_number(); ++i) { memset(gov_string, '\0', sizeof(gov_string) ); gg_available(i, gov_string, sizeof(gov_string) ); @@ -46,7 +46,7 @@ void gg_init() // go through every governor in gov_string gchar* curr = (char*)&gov_string; gchar* end_of_curr = g_strstr_len(curr, strlen(curr), " "); - while(end_of_curr) + while (end_of_curr) { memset(governors[i][total_governors], '\0', 13); memmove(governors[i][total_governors], curr, end_of_curr - curr); @@ -62,51 +62,50 @@ void gg_init() /*********************************************************************** * Populate out with current governor for core **********************************************************************/ -int gg_current(int core, char* out, int size) +bool gg_current(int core, char* out, int size) { FILE* fd; - char path[FILE_PATH_SIZE]; + char *path; + asprintf(&path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor", core); - sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor", core); - - if(!(fd = fopen(path, "r"))) + if (!(fd = check_for_file(path))) { - debug("Couldn't open '%s'\n",path); - return -1; + free(path); + return false; } fgets(out, size, fd); - // Chomp + + // Get first line gchar* newline = g_strrstr(out, "\n"); *newline = '\0'; debug("Current gov for core %d is '%s'\n",core,out); fclose(fd); - return 0; + free(path); + return true; } /*********************************************************************** - * Populate out with number of available cores + * Populate `out` with number of available cores **********************************************************************/ -int gg_available(int core, char* out, int size) +bool gg_available(int core, char* out, int size) { - FILE* fd; - char path[80]; + char *path; + FILE *fd; + asprintf(&path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_available_governors", core); - sprintf(path, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_available_governors", core); - - if(!(fd = fopen(path, "r"))) + if (!(fd = check_for_file(path))) { - debug("Couldn't open '%s'\n",path); - return -1; + free(path); + return false; } - fgets(out, size, fd); - fclose(fd); - return 0; + free(path); + return true; } @@ -1,27 +1,29 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ #ifndef GETGOV_H #define GETGOV_H +#include <stdbool.h> + void gg_init(); -int gg_current(int core, char* out, int size); -int gg_available(int core, char* out, int size); +bool gg_current(int core, char* out, int size); +bool gg_available(int core, char* out, int size); char* gg_gov(int core, int index); int gg_number(); @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -32,7 +32,7 @@ #include <unistd.h> // getuid, getgid #include <stdio.h> // printf, FILE, fopen, etc #include <string.h> // strlen - + #include <libintl.h> // gettext #include <locale.h> // LC_ALL etc @@ -135,7 +135,7 @@ void config_init() char* temp = config_get_key(&config, "battery", "show"); if (temp) _DEFAULT_SHOW_BATTERY = ( temp[0] == '1' ); - + info("UID: %d GID: %d\n", getuid(), getgid()); temp = config_get_key(&config, "extra", "theme"); @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ diff --git a/paramano_set.c b/paramano_set.c index e724049..99bb56f 100644 --- a/paramano_set.c +++ b/paramano_set.c @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ diff --git a/paramano_set_interface.c b/paramano_set_interface.c index 7daad08..fe4e2dc 100644 --- a/paramano_set_interface.c +++ b/paramano_set_interface.c @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ diff --git a/paramano_set_interface.h b/paramano_set_interface.h index d0040f2..20b96bf 100644 --- a/paramano_set_interface.h +++ b/paramano_set_interface.h @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * + * along with Paramano. If not, see * * <http://www.gnu.org/licenses/>. * ************************************************************************/ @@ -1,18 +1,18 @@ /************************************************************************ - * This file is part of paramano. * + * This file is part of Paramano. * * * - * paramano is free software; you can redistribute it and/or * + * Paramano 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. * * * - * paramano is distributed in the hope that it will be useful, * + * Paramano 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 paramano. If not, see * |