1 /* 2 * Copyright (c) 2007-2008 Hyperic, Inc. 3 * Copyright (c) 2009 SpringSource, Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 #ifndef SIGAR_FORMAT_H 19 #define SIGAR_FORMAT_H 20 21 typedef struct { 22 double user; 23 double sys; 24 double nice; 25 double idle; 26 double wait; 27 double irq; 28 double soft_irq; 29 double stolen; 30 double combined; 31 } sigar_cpu_perc_t; 32 33 SIGAR_DECLARE(int) sigar_cpu_perc_calculate(sigar_cpu_t *prev, 34 sigar_cpu_t *curr, 35 sigar_cpu_perc_t *perc); 36 37 SIGAR_DECLARE(int) sigar_uptime_string(sigar_t *sigar, 38 sigar_uptime_t *uptime, 39 char *buffer, 40 int buflen); 41 42 SIGAR_DECLARE(char *) sigar_format_size(sigar_uint64_t size, char *buf); 43 44 SIGAR_DECLARE(int) sigar_net_address_equals(sigar_net_address_t *addr1, 45 sigar_net_address_t *addr2); 46 47 SIGAR_DECLARE(int) sigar_net_address_to_string(sigar_t *sigar, 48 sigar_net_address_t *address, 49 char *addr_str); 50 51 SIGAR_DECLARE(const char *)sigar_net_scope_to_string(int type); 52 53 SIGAR_DECLARE(sigar_uint32_t) sigar_net_address_hash(sigar_net_address_t *address); 54 55 SIGAR_DECLARE(const char *)sigar_net_connection_type_get(int type); 56 57 SIGAR_DECLARE(const char *)sigar_net_connection_state_get(int state); 58 59 SIGAR_DECLARE(char *) sigar_net_interface_flags_to_string(sigar_uint64_t flags, char *buf); 60 61 SIGAR_DECLARE(char *)sigar_net_services_name_get(sigar_t *sigar, 62 int protocol, unsigned long port); 63 64 #endif 65