ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
includes.h File Reference
#include "os.h"
#include <ctype.h>
#include <dirent.h>
#include <fcntl.h>
#include <iconv.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/signal.h>
#include <sys/stat.h>
#include <sys/time.h>
#include "structures.h"
+ Include dependency graph for includes.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INDEX_OF(entry, array)   (int)(entry - array)
 
#define ckb_s_out   stdout
 
#define ckb_s_err   stdout
 
#define __FILE_NOPATH__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
 
#define ckb_fatal_nofile(fmt, args...)   fprintf(ckb_s_err, "[F] " fmt, ## args)
 
#define ckb_fatal_fn(fmt, file, line, args...)   fprintf(ckb_s_err, "[F] %s (via %s:%d): " fmt, __func__, file, line, ## args)
 
#define ckb_fatal(fmt, args...)   fprintf(ckb_s_err, "[F] %s (%s:%d): " fmt, __func__, __FILE_NOPATH__, __LINE__, ## args)
 
#define ckb_err_nofile(fmt, args...)   fprintf(ckb_s_err, "[E] " fmt, ## args)
 
#define ckb_err_fn(fmt, file, line, args...)   fprintf(ckb_s_err, "[E] %s (via %s:%d): " fmt, __func__, file, line, ## args)
 
#define ckb_err(fmt, args...)   fprintf(ckb_s_err, "[E] %s (%s:%d): " fmt, __func__, __FILE_NOPATH__, __LINE__, ## args)
 
#define ckb_warn_nofile(fmt, args...)   fprintf(ckb_s_out, "[W] " fmt, ## args)
 
#define ckb_warn_fn(fmt, file, line, args...)   fprintf(ckb_s_out, "[W] %s (via %s:%d): " fmt, __func__, file, line, ## args)
 
#define ckb_warn(fmt, args...)   fprintf(ckb_s_out, "[W] %s (%s:%d): " fmt, __func__, __FILE_NOPATH__, __LINE__, ## args)
 
#define ckb_info_nofile(fmt, args...)   fprintf(ckb_s_out, "[I] " fmt, ## args)
 
#define ckb_info_fn(fmt, file, line, args...)   fprintf(ckb_s_out, "[I] " fmt, ## args)
 
#define ckb_info(fmt, args...)   fprintf(ckb_s_out, "[I] " fmt, ## args)
 
#define timespec_gt(left, right)   ((left).tv_sec > (right).tv_sec || ((left).tv_sec == (right).tv_sec && (left).tv_nsec > (right).tv_nsec))
 
#define timespec_eq(left, right)   ((left).tv_sec == (right).tv_sec && (left).tv_nsec == (right).tv_nsec)
 
#define timespec_ge(left, right)   ((left).tv_sec > (right).tv_sec || ((left).tv_sec == (right).tv_sec && (left).tv_nsec >= (right).tv_nsec))
 
#define timespec_lt(left, right)   (!timespec_ge(left, right))
 
#define timespec_le(left, right)   (!timespec_gt(left, right))
 

Typedefs

typedef unsigned char uchar
 
typedef unsigned short ushort
 

Functions

void timespec_add (struct timespec *timespec, long nanoseconds)
 

Macro Definition Documentation

#define __FILE_NOPATH__   (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)

Definition at line 40 of file includes.h.

#define ckb_err (   fmt,
  args... 
)    fprintf(ckb_s_err, "[E] %s (%s:%d): " fmt, __func__, __FILE_NOPATH__, __LINE__, ## args)
#define ckb_err_fn (   fmt,
  file,
  line,
  args... 
)    fprintf(ckb_s_err, "[E] %s (via %s:%d): " fmt, __func__, file, line, ## args)

Definition at line 48 of file includes.h.

Referenced by _nk95cmd(), _usbrecv(), os_usbrecv(), and os_usbsend().

#define ckb_err_nofile (   fmt,
  args... 
)    fprintf(ckb_s_err, "[E] " fmt, ## args)

Definition at line 47 of file includes.h.

#define ckb_fatal (   fmt,
  args... 
)    fprintf(ckb_s_err, "[F] %s (%s:%d): " fmt, __func__, __FILE_NOPATH__, __LINE__, ## args)

Definition at line 46 of file includes.h.

Referenced by usbmain().

#define ckb_fatal_fn (   fmt,
  file,
  line,
  args... 
)    fprintf(ckb_s_err, "[F] %s (via %s:%d): " fmt, __func__, file, line, ## args)

Definition at line 45 of file includes.h.

#define ckb_fatal_nofile (   fmt,
  args... 
)    fprintf(ckb_s_err, "[F] " fmt, ## args)

Definition at line 44 of file includes.h.

Referenced by main().

#define ckb_info (   fmt,
  args... 
)    fprintf(ckb_s_out, "[I] " fmt, ## args)
#define ckb_info_fn (   fmt,
  file,
  line,
  args... 
)    fprintf(ckb_s_out, "[I] " fmt, ## args)

Definition at line 54 of file includes.h.

#define ckb_info_nofile (   fmt,
  args... 
)    fprintf(ckb_s_out, "[I] " fmt, ## args)

Definition at line 53 of file includes.h.

Referenced by main().

#define ckb_s_err   stdout

Definition at line 36 of file includes.h.

#define ckb_s_out   stdout

Definition at line 35 of file includes.h.

#define ckb_warn (   fmt,
  args... 
)    fprintf(ckb_s_out, "[W] %s (%s:%d): " fmt, __func__, __FILE_NOPATH__, __LINE__, ## args)
#define ckb_warn_fn (   fmt,
  file,
  line,
  args... 
)    fprintf(ckb_s_out, "[W] %s (via %s:%d): " fmt, __func__, file, line, ## args)

Definition at line 51 of file includes.h.

Referenced by os_usbrecv(), and os_usbsend().

#define ckb_warn_nofile (   fmt,
  args... 
)    fprintf(ckb_s_out, "[W] " fmt, ## args)

Definition at line 50 of file includes.h.

Referenced by main().

#define INDEX_OF (   entry,
  array 
)    (int)(entry - array)
#define timespec_eq (   left,
  right 
)    ((left).tv_sec == (right).tv_sec && (left).tv_nsec == (right).tv_nsec)

Definition at line 60 of file includes.h.

#define timespec_ge (   left,
  right 
)    ((left).tv_sec > (right).tv_sec || ((left).tv_sec == (right).tv_sec && (left).tv_nsec >= (right).tv_nsec))

Definition at line 61 of file includes.h.

#define timespec_gt (   left,
  right 
)    ((left).tv_sec > (right).tv_sec || ((left).tv_sec == (right).tv_sec && (left).tv_nsec > (right).tv_nsec))

Definition at line 59 of file includes.h.

#define timespec_le (   left,
  right 
)    (!timespec_gt(left, right))

Definition at line 63 of file includes.h.

#define timespec_lt (   left,
  right 
)    (!timespec_ge(left, right))

Definition at line 62 of file includes.h.

Typedef Documentation

typedef unsigned char uchar

Definition at line 24 of file includes.h.

typedef unsigned short ushort

Definition at line 25 of file includes.h.

Function Documentation

void timespec_add ( struct timespec *  timespec,
long  nanoseconds 
)

Definition at line 19 of file main.c.

19  {
20  nanoseconds += timespec->tv_nsec;
21  timespec->tv_sec += nanoseconds / 1000000000;
22  timespec->tv_nsec = nanoseconds % 1000000000;
23 }