1 /*
   2  * CDDL HEADER START
   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23  * Use is subject to license terms.
  24  */
  25 
  26 #ifndef _FB_MISC_H
  27 #define _FB_MISC_H
  28 
  29 #pragma ident   "%Z%%M% %I%     %E% SMI"
  30 
  31 #include "config.h"
  32 
  33 #include <stdio.h>
  34 #ifdef HAVE_STDINT_H
  35 #include <stdint.h>
  36 #endif
  37 
  38 #include <sys/times.h>
  39 
  40 #include "vars.h"
  41 
  42 #ifdef  __cplusplus
  43 extern "C" {
  44 #endif
  45 
  46 #define DATE_VAR "date"
  47 #define SCRIPT_VAR "scriptname"
  48 #define HOST_VAR "hostname"
  49 
  50 #ifndef HAVE_HRTIME
  51 uint64_t gethrtime();
  52 #define hrtime_t uint64_t
  53 #endif
  54 #define FSECS (double)1000000000.0
  55 
  56 #define LOG_ERROR 0     /* a major error */
  57 #define LOG_ERROR1 1    /* also major error, but turn off error reporting */
  58                         /* for now */
  59 #define LOG_INFO 2      /* some useful information. Default is to print */
  60 #define LOG_VERBOSE 3   /* four more levels of detailed information */
  61 #define LOG_DEBUG_SCRIPT 4
  62 #define LOG_DEBUG_IMPL 6
  63 #define LOG_DEBUG_NEVER 10
  64 #define LOG_FATAL 999   /* really bad error, shut down */
  65 #define LOG_LOG 1000
  66 #define LOG_DUMP 1001
  67 
  68 var_t *date_var(var_t *var);
  69 var_t *script_var(var_t *var);
  70 var_t *host_var(var_t *var);
  71 
  72 #ifdef  __cplusplus
  73 }
  74 #endif
  75 
  76 #endif  /* _FB_MISC_H */