/* $Id: plugin_meminfo.c,v 1.2 2004/01/16 07:26:25 reinelt Exp $ * * plugin for /proc/meminfo parsing * * Copyright 2003 Michael Reinelt * Copyright 2004 The LCD4Linux Team * * This file is part of LCD4Linux. * * LCD4Linux 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, or (at your option) * any later version. * * LCD4Linux 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., 675 Mass Ave, Cambridge, MA 02139, USA. * * * $Log: plugin_meminfo.c,v $ * Revision 1.2 2004/01/16 07:26:25 reinelt * moved various /proc parsing to own functions * made some progress with /proc/stat parsing * * Revision 1.1 2004/01/15 04:29:45 reinelt * moved lcd4linux.conf.sample to *.old * lcd4linux.conf.sample with new layout * new plugins 'loadavg' and 'meminfo' * text widget have pre- and postfix * */ /* * exported functions: * * int plugin_init_meminfo (void) * adds functions to access /proc/meminfo * */ #include #include #include #include #include #include #include "debug.h" #include "plugin.h" #include "hash.h" static HASH MemInfo = { 0, 0, NULL }; static int parse_meminfo (void) { static time_t now=0; FILE *stream; int line; // reread every second only if (time(NULL)==now) return 0; time(&now); stream=fopen("/proc/meminfo", "r"); if (stream==NULL) { error ("fopen(/proc/meminfo) failed: %s", strerror(errno)); return -1; } line=0; while (!feof(stream)) { char buffer[256]; char *c, *key, *val; fgets (buffer, sizeof(buffer), stream); c=strchr(buffer, ':'); if (c==NULL) continue; key=buffer; val=c+1; // strip leading blanks from key while (isspace(*key)) *key++='\0'; // strip trailing blanks from key do *c='\0'; while (isspace(*--c)); // strip leading blanks from value while (isspace(*val)) *val++='\0'; // strip trailing blanks from value for (c=val; *c!='\0';c++); while (isspace(*--c)) *c='\0'; // skip lines that do not end with " kB" if (*c=='B' && *(c-1)=='k' && *(c-2)==' ') { // strip trailing " kB" from value *(c-2)='\0'; // add entry to hash table hash_set (&MemInfo, key, val); } } fclose (stream); return 0; } static void my_meminfo (RESULT *result, RESULT *arg1) { char *key, *val; if (parse_meminfo()<0) { SetResult(&result, R_STRING, ""); return; } key=R2S(arg1); val=hash_get(&MemInfo, key); if (val==NULL) val=""; SetResult(&result, R_STRING, val); } int plugin_init_meminfo (void) { AddFunction ("meminfo", 1, my_meminfo); return 0; } /th>AuthorFilesLines 2022-11-25dtv-scan-tables: hu-Digikabel changesHrotkó Gábor1-1/+26 Modifications by: https://digi.hu/tv/csatornalista FREQUENCY = 121000000 Link: https://lore.kernel.org/linux-media/8c632dad-d428-402e-a171-baf7234f2d85@gmail.com Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> 2022-04-30pt-All: fix modulationMauro Carvalho Chehab1-10/+10 Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> 2022-04-30pt-All: Update Portugal channelsMauro Carvalho Chehab1-34/+70 There were some changes at Portugal channel frequencies, mostly in 2020. Update the DVB-T channel list accordingly, in order to reflect the current list of emitters. Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> 2022-03-07Update Brazilian ISDB-T tablesMauro Carvalho Chehab549-2923/+13860 Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> 2022-03-07Update satellite channel lists from LyngsatMauro Carvalho Chehab54-1882/+2326 Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org> 2021-12-14dtv-scan-tables: latest UK changesSimon Liddicott4-24/+24 only includes transmitters where there have been changes Link: https://lore.kernel.org/linux-media/20210128234622.75009-1-simon@liddicott.com Signed-off-by: Simon Liddicott <simon@liddicott.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30update Brazilian scan filesMauro Carvalho Chehab2476-12805/+69312 Data updated according with https://portalbsd.com.br/. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30Remove legacy entriesMauro Carvalho Chehab129-24898/+0 There are several entries that used to be at Lyngsat. Several of them were merged with other entries. On others, there's no TV signal anymore. So, drop them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30Add new satellites from LyngsatMauro Carvalho Chehab75-21/+29721 Those are are new satellite descriptions that didn't use to exist on Lyngsat. Add them. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30Rename a few satellites with two names and update frequenciesMauro Carvalho Chehab2-283/+182 Those two satellites have two names. Use Just one of them. While here, update their frequencies from Lyngsat. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> 2021-04-30Update frequencies from LyngsatMauro Carvalho Chehab188-12304/+12666 Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>