removed junk, reindentation to adhere to style guidelines
This commit is contained in:
parent
3a78f44e39
commit
4d6c6760b3
@ -1,5 +1,7 @@
|
|||||||
/*
|
/* vim: tabstop=2 shiftwidth=2 expandtab textwidth=80 linebreak wrap
|
||||||
|
*
|
||||||
* Copyright 2012 Matthew McCormick
|
* Copyright 2012 Matthew McCormick
|
||||||
|
* Copyright 2015 Pawel 'l0ner' Soltys
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -12,10 +14,7 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* */
|
*/
|
||||||
// This file was Authored by Justin Crawford <Justasic@gmail.com>
|
|
||||||
// Based on: github.com/freebsd/freebsd/blob/master/usr.bin/top/machine.c
|
|
||||||
// Based on: Apple.cpp for load_string/mem_string and apple's documentation
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h> // usleep
|
#include <unistd.h> // usleep
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
/* vim: tabstop=2 shiftwidth=2 expandtab textwidth=80 linebreak wrap
|
||||||
|
*
|
||||||
|
* Copyright 2012 Matthew McCormick
|
||||||
|
* Copyright 2015 Pawel 'l0ner' Soltys
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef CPU_H_
|
#ifndef CPU_H_
|
||||||
#define CPU_H_
|
#define CPU_H_
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
/*
|
/* vim: tabstop=2 shiftwidth=2 expandtab textwidth=80 linebreak wrap
|
||||||
|
*
|
||||||
* Copyright 2012 Matthew McCormick
|
* Copyright 2012 Matthew McCormick
|
||||||
|
* Copyright 2015 Pawel 'l0ner' Soltys
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -12,29 +14,13 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* */
|
*/
|
||||||
// This file was Authored by Justin Crawford <Justasic@gmail.com>
|
|
||||||
// Based on: github.com/freebsd/freebsd/blob/master/usr.bin/top/machine.c
|
|
||||||
// Based on: Apple.cpp for load_string/mem_string and apple's documentation
|
|
||||||
|
|
||||||
#ifndef BSD_METER_COMMON_H_
|
#ifndef BSD_ERROR_H_
|
||||||
#define BSD_METER_COMMON_H_
|
#define BSD_ERROR_H_
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// Memory Sizes
|
|
||||||
#define KILOBYTES(x) ((x)/1024)
|
|
||||||
#define MEGABYTES(x) (KILOBYTES((x))/1024)
|
|
||||||
#define GIGABYTES(x) (MEGABYTES((x))/1024)
|
|
||||||
|
|
||||||
// CPU percentages stuff
|
|
||||||
#define CP_USER 0
|
|
||||||
#define CP_NICE 1
|
|
||||||
#define CP_SYS 2
|
|
||||||
#define CP_INTR 3
|
|
||||||
#define CP_IDLE 4
|
|
||||||
#define CPUSTATES 5
|
|
||||||
|
|
||||||
inline void error(const char * error) {
|
inline void error(const char * error) {
|
||||||
std::cerr << error << std::endl;
|
std::cerr << error << std::endl;
|
||||||
exit(23);
|
exit(23);
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
/*
|
/* vim: tabstop=2 shiftwidth=2 expandtab textwidth=80 linebreak wrap
|
||||||
|
*
|
||||||
* Copyright 2012 Matthew McCormick
|
* Copyright 2012 Matthew McCormick
|
||||||
|
* Copyright 2015 Pawel 'l0ner' Soltys
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -12,11 +14,7 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* */
|
*/
|
||||||
// This file was Authored by Justin Crawford <Justasic@gmail.com>
|
|
||||||
// Based on: https://github.com/freebsd/freebsd/blob/master/usr.bin/top/machine.c
|
|
||||||
// Based on: Apple.cpp for load_string/mem_string and apple's documentation
|
|
||||||
|
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
/* vim: tabstop=2 shiftwidth=2 expandtab textwidth=80 linebreak wrap
|
||||||
|
*
|
||||||
|
* Copyright 2012 Matthew McCormick
|
||||||
|
* Copyright 2015 Pawel 'l0ner' Soltys
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef LOAD_H_
|
#ifndef LOAD_H_
|
||||||
#define LOAD_H_
|
#define LOAD_H_
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
/*
|
/* vim: tabstop=2 shiftwidth=2 expandtab textwidth=80 linebreak wrap
|
||||||
|
*
|
||||||
* Copyright 2012 Matthew McCormick
|
* Copyright 2012 Matthew McCormick
|
||||||
|
* Copyright 2015 Pawel 'l0ner' Soltys
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -12,12 +14,7 @@
|
|||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
* */
|
*/
|
||||||
// This file was Authored by Justin Crawford <Justasic@gmail.com>
|
|
||||||
// Pawel Soltys <pwslts@gmail.com>
|
|
||||||
|
|
||||||
//#error ToDo: OpenBSD. This file is incomplete and likely will not compile if
|
|
||||||
//you remove this error (it is here to tell you it's unfinished)
|
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -1,3 +1,21 @@
|
|||||||
|
/* vim: tabstop=2 shiftwidth=2 expandtab textwidth=80 linebreak wrap
|
||||||
|
*
|
||||||
|
* Copyright 2012 Matthew McCormick
|
||||||
|
* Copyright 2015 Pawel 'l0ner' Soltys
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef MEMORY_H_
|
#ifndef MEMORY_H_
|
||||||
#define MEMORY_H_
|
#define MEMORY_H_
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user