wrap some long lines
This commit is contained in:
parent
82512ad3eb
commit
70bd73151a
|
@ -107,7 +107,8 @@ namespace Hyperic.Sigar {
|
||||||
private readonly ulong NA_cached;
|
private readonly ulong NA_cached;
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_mem_get(IntPtr sigar, IntPtr mem);
|
private static extern int
|
||||||
|
sigar_mem_get(IntPtr sigar, IntPtr mem);
|
||||||
|
|
||||||
internal static Mem NativeGet(Sigar sigar) {
|
internal static Mem NativeGet(Sigar sigar) {
|
||||||
Type type = typeof(Mem);
|
Type type = typeof(Mem);
|
||||||
|
@ -135,7 +136,8 @@ namespace Hyperic.Sigar {
|
||||||
public readonly ulong Free;
|
public readonly ulong Free;
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_swap_get(IntPtr sigar, IntPtr swap);
|
private static extern int
|
||||||
|
sigar_swap_get(IntPtr sigar, IntPtr swap);
|
||||||
|
|
||||||
internal static Swap NativeGet(Sigar sigar) {
|
internal static Swap NativeGet(Sigar sigar) {
|
||||||
Type type = typeof(Swap);
|
Type type = typeof(Swap);
|
||||||
|
@ -164,7 +166,8 @@ namespace Hyperic.Sigar {
|
||||||
public readonly ulong Total;
|
public readonly ulong Total;
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_cpu_get(IntPtr sigar, IntPtr cpu);
|
private static extern int
|
||||||
|
sigar_cpu_get(IntPtr sigar, IntPtr cpu);
|
||||||
|
|
||||||
internal static Cpu NativeGet(Sigar sigar) {
|
internal static Cpu NativeGet(Sigar sigar) {
|
||||||
Type type = typeof(Cpu);
|
Type type = typeof(Cpu);
|
||||||
|
@ -201,12 +204,12 @@ namespace Hyperic.Sigar {
|
||||||
private readonly IntPtr data;
|
private readonly IntPtr data;
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_cpu_info_list_get(IntPtr sigar,
|
private static extern int
|
||||||
IntPtr cpu_infos);
|
sigar_cpu_info_list_get(IntPtr sigar, IntPtr cpu_infos);
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_cpu_info_list_destroy(IntPtr sigar,
|
private static extern int
|
||||||
IntPtr cpu_infos);
|
sigar_cpu_info_list_destroy(IntPtr sigar, IntPtr cpu_infos);
|
||||||
|
|
||||||
internal static CpuInfo[] NativeGet(Sigar sigar) {
|
internal static CpuInfo[] NativeGet(Sigar sigar) {
|
||||||
Type type = typeof(CpuInfoList);
|
Type type = typeof(CpuInfoList);
|
||||||
|
@ -228,7 +231,8 @@ namespace Hyperic.Sigar {
|
||||||
int size = Marshal.SizeOf(infos[0]);
|
int size = Marshal.SizeOf(infos[0]);
|
||||||
|
|
||||||
for (int i=0; i<infosPtr.Number; i++) {
|
for (int i=0; i<infosPtr.Number; i++) {
|
||||||
infos[i] = (CpuInfo)Marshal.PtrToStructure(eptr, typeof(CpuInfo));
|
infos[i] =
|
||||||
|
(CpuInfo)Marshal.PtrToStructure(eptr, typeof(CpuInfo));
|
||||||
|
|
||||||
//eptr += sizeof(sigar_cpu_info_t);
|
//eptr += sizeof(sigar_cpu_info_t);
|
||||||
eptr = Sigar.incrementIntPtr(eptr, size);
|
eptr = Sigar.incrementIntPtr(eptr, size);
|
||||||
|
@ -263,12 +267,12 @@ namespace Hyperic.Sigar {
|
||||||
private readonly IntPtr data;
|
private readonly IntPtr data;
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_file_system_list_get(IntPtr sigar,
|
private static extern int
|
||||||
IntPtr fslist);
|
sigar_file_system_list_get(IntPtr sigar, IntPtr fslist);
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_file_system_list_destroy(IntPtr sigar,
|
private static extern int
|
||||||
IntPtr fslist);
|
sigar_file_system_list_destroy(IntPtr sigar, IntPtr fslist);
|
||||||
|
|
||||||
internal static FileSystem[] NativeGet(Sigar sigar) {
|
internal static FileSystem[] NativeGet(Sigar sigar) {
|
||||||
Type type = typeof(FileSystemList);
|
Type type = typeof(FileSystemList);
|
||||||
|
@ -290,7 +294,9 @@ namespace Hyperic.Sigar {
|
||||||
int size = Marshal.SizeOf(fs[0]);
|
int size = Marshal.SizeOf(fs[0]);
|
||||||
|
|
||||||
for (int i=0; i<fsPtr.Number; i++) {
|
for (int i=0; i<fsPtr.Number; i++) {
|
||||||
fs[i] = (FileSystem)Marshal.PtrToStructure(fptr, typeof(FileSystem));
|
fs[i] =
|
||||||
|
(FileSystem)Marshal.PtrToStructure(fptr,
|
||||||
|
typeof(FileSystem));
|
||||||
|
|
||||||
//fptr += sizeof(sigar_fs_t);
|
//fptr += sizeof(sigar_fs_t);
|
||||||
fptr = Sigar.incrementIntPtr(fptr, size);
|
fptr = Sigar.incrementIntPtr(fptr, size);
|
||||||
|
@ -314,11 +320,12 @@ namespace Hyperic.Sigar {
|
||||||
public readonly double UsePercent;
|
public readonly double UsePercent;
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_file_system_usage_get(IntPtr sigar,
|
private static extern int
|
||||||
string dirname,
|
sigar_file_system_usage_get(IntPtr sigar, string dirname,
|
||||||
IntPtr fsusage);
|
IntPtr fsusage);
|
||||||
|
|
||||||
internal static FileSystemUsage NativeGet(Sigar sigar, string dirname) {
|
internal static FileSystemUsage NativeGet(Sigar sigar,
|
||||||
|
string dirname) {
|
||||||
Type type = typeof(FileSystemUsage);
|
Type type = typeof(FileSystemUsage);
|
||||||
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(type));
|
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(type));
|
||||||
|
|
||||||
|
@ -346,18 +353,19 @@ namespace Hyperic.Sigar {
|
||||||
private readonly IntPtr data;
|
private readonly IntPtr data;
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_net_interface_list_get(IntPtr sigar,
|
private static extern int
|
||||||
IntPtr iflist);
|
sigar_net_interface_list_get(IntPtr sigar, IntPtr iflist);
|
||||||
|
|
||||||
[DllImport(Sigar.LIBSIGAR)]
|
[DllImport(Sigar.LIBSIGAR)]
|
||||||
private static extern int sigar_net_interface_list_destroy(IntPtr sigar,
|
private static extern int
|
||||||
IntPtr iflist);
|
sigar_net_interface_list_destroy(IntPtr sigar, IntPtr iflist);
|
||||||
|
|
||||||
internal static String[] NativeGet(Sigar sigar) {
|
internal static String[] NativeGet(Sigar sigar) {
|
||||||
Type type = typeof(NetInterfaceList);
|
Type type = typeof(NetInterfaceList);
|
||||||
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(type));
|
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(type));
|
||||||
|
|
||||||
int status = sigar_net_interface_list_get(sigar.sigar.Handle, ptr);
|
int status =
|
||||||
|
sigar_net_interface_list_get(sigar.sigar.Handle, ptr);
|
||||||
|
|
||||||
if (status != Sigar.OK) {
|
if (status != Sigar.OK) {
|
||||||
Marshal.FreeHGlobal(ptr);
|
Marshal.FreeHGlobal(ptr);
|
||||||
|
|
Loading…
Reference in New Issue