"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libsysinfo-0.2.2/all/sysinfo_common.c" between
linux_logo-5.11.tar.gz and linux_logo-6.0.tar.gz

About: Linux_Logo - an ANSI Color Penguin Logo that can be run at bootup. Also shows some system info.

sysinfo_common.c  (linux_logo-5.11):sysinfo_common.c  (linux_logo-6.0)
#include "version.h" #include "version.h"
#include "sysinfo.h" #include "sysinfo.h"
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
struct our_state { struct our_state {
int pretty_printing; int pretty_printing;
int custom_cpuinfo; int custom_cpuinfo;
char cpuinfo_file[BUFSIZ]; char cpuinfo_file[BUFSIZ];
}; };
struct our_state internal_state={1,0,"/proc/cpuinfo"}; struct our_state internal_state={1,0,"/proc/cpuinfo"};
char *get_sysinfo_version(char *version) { char *get_sysinfo_version(char *version) {
snprintf(version,BUFSIZ,"%i.%i.%i",VERSION_MAJOR,VERSION_MINOR,VERSION_SUBMI snprintf(version,BUFSIZ,"%i.%i.%i",
NOR); VERSION_MAJOR,VERSION_MINOR,VERSION_SUBMINOR);
return version; return version;
} }
int get_numeric_sysinfo_version(void) { int get_numeric_sysinfo_version(void) {
return (VERSION_MAJOR*10000)+(VERSION_MINOR*100)+VERSION_SUBMINOR; return (VERSION_MAJOR*10000)+(VERSION_MINOR*100)+VERSION_SUBMINOR;
} }
int set_cpuinfo_file(char *filename) { int set_cpuinfo_file(char *filename) {
internal_state.custom_cpuinfo=1; internal_state.custom_cpuinfo=1;
strncpy(internal_state.cpuinfo_file,filename,BUFSIZ); strncpy(internal_state.cpuinfo_file,filename,BUFSIZ-1);
return 0; return 0;
} }
char *get_cpuinfo_file(void) { char *get_cpuinfo_file(void) {
return internal_state.cpuinfo_file; return internal_state.cpuinfo_file;
} }
void set_pretty_printing(int value) { void set_pretty_printing(int value) {
internal_state.pretty_printing=value; internal_state.pretty_printing=value;
} }
int get_pretty_printing(void) { int get_pretty_printing(void) {
return internal_state.pretty_printing; return internal_state.pretty_printing;
} }
 End of changes. 7 change blocks. 
13 lines changed or deleted 13 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)