15184Sek110237 /* 25184Sek110237 * CDDL HEADER START 35184Sek110237 * 45184Sek110237 * The contents of this file are subject to the terms of the 55184Sek110237 * Common Development and Distribution License (the "License"). 65184Sek110237 * You may not use this file except in compliance with the License. 75184Sek110237 * 85184Sek110237 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 95184Sek110237 * or http://www.opensolaris.org/os/licensing. 105184Sek110237 * See the License for the specific language governing permissions 115184Sek110237 * and limitations under the License. 125184Sek110237 * 135184Sek110237 * When distributing Covered Code, include this CDDL HEADER in each 145184Sek110237 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 155184Sek110237 * If applicable, add the following below this CDDL HEADER, with the 165184Sek110237 * fields enclosed by brackets "[]" replaced with your own identifying 175184Sek110237 * information: Portions Copyright [yyyy] [name of copyright owner] 185184Sek110237 * 195184Sek110237 * CDDL HEADER END 205184Sek110237 */ 215184Sek110237 /* 226084Saw148015 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 235184Sek110237 * Use is subject to license terms. 245184Sek110237 */ 255184Sek110237 265184Sek110237 #ifndef _FB_MISC_H 275184Sek110237 #define _FB_MISC_H 285184Sek110237 295184Sek110237 #pragma ident "%Z%%M% %I% %E% SMI" 305184Sek110237 315184Sek110237 #include "config.h" 325184Sek110237 335184Sek110237 #include <stdio.h> 345184Sek110237 #ifdef HAVE_STDINT_H 355184Sek110237 #include <stdint.h> 365184Sek110237 #endif 375184Sek110237 385184Sek110237 #include <sys/times.h> 395184Sek110237 40*6613Sek110237 #include "vars.h" 41*6613Sek110237 425184Sek110237 #ifdef __cplusplus 435184Sek110237 extern "C" { 445184Sek110237 #endif 455184Sek110237 465184Sek110237 #define DATE_VAR "date" 475184Sek110237 #define SCRIPT_VAR "scriptname" 485184Sek110237 #define HOST_VAR "hostname" 495184Sek110237 505184Sek110237 #ifndef HAVE_HRTIME 515184Sek110237 uint64_t gethrtime(); 525184Sek110237 #define hrtime_t uint64_t 535184Sek110237 #endif 545184Sek110237 #define FSECS (double)1000000000.0 555184Sek110237 566305Saw148015 #define LOG_ERROR 0 /* a major error */ 576305Saw148015 #define LOG_ERROR1 1 /* also major error, but turn off error reporting */ 586305Saw148015 /* for now */ 596305Saw148015 #define LOG_INFO 2 /* some useful information. Default is to print */ 606305Saw148015 #define LOG_VERBOSE 3 /* four more levels of detailed information */ 616084Saw148015 #define LOG_DEBUG_SCRIPT 4 626084Saw148015 #define LOG_DEBUG_IMPL 6 635184Sek110237 #define LOG_DEBUG_NEVER 10 646305Saw148015 #define LOG_FATAL 999 /* really bad error, shut down */ 655184Sek110237 #define LOG_LOG 1000 665184Sek110237 #define LOG_DUMP 1001 675184Sek110237 685184Sek110237 var_t *date_var(var_t *var); 695184Sek110237 var_t *script_var(var_t *var); 705184Sek110237 var_t *host_var(var_t *var); 715184Sek110237 725184Sek110237 #ifdef __cplusplus 735184Sek110237 } 745184Sek110237 #endif 755184Sek110237 765184Sek110237 #endif /* _FB_MISC_H */ 77