/alps/ipecamera

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/ipecamera

« back to all changes in this revision

Viewing changes to tools.h

  • Committer: Suren A. Chilingaryan
  • Date: 2015-04-27 00:28:57 UTC
  • Revision ID: csa@suren.me-20150427002857-82fk6r3e8rfgy4wr
First stand-alone ipecamera implementation

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _PCITOOL_TOOLS_H
2
 
#define _PCITOOL_TOOLS_H
3
 
 
4
 
#include <stdio.h>
5
 
#include <stdint.h>
6
 
 
7
 
#define BIT_MASK(bits) ((1ll << (bits)) - 1)
8
 
 
9
 
#define min2(a, b) (((a)<(b))?(a):(b))
10
 
 
11
 
typedef enum {
12
 
    PCILIB_TRISTATE_NO = 0,
13
 
    PCILIB_TRISTATE_PARTIAL = 1,
14
 
    PCILIB_TRISTATE_YES = 2
15
 
} pcilib_tristate_t;
16
 
 
17
 
#include "pci.h"
18
 
 
19
 
int pcilib_isnumber(const char *str);
20
 
int pcilib_isxnumber(const char *str);
21
 
int pcilib_isnumber_n(const char *str, size_t len);
22
 
int pcilib_isxnumber_n(const char *str, size_t len);
23
 
 
24
 
uint16_t pcilib_swap16(uint16_t x);
25
 
uint32_t pcilib_swap32(uint32_t x);
26
 
uint64_t pcilib_swap64(uint64_t x);
27
 
void pcilib_swap(void *dst, void *src, size_t size, size_t n);
28
 
 
29
 
void * pcilib_memcpy8(void * dst, void const * src, size_t len);
30
 
void * pcilib_memcpy32(void * dst, void const * src, size_t len);
31
 
void * pcilib_memcpy64(void * dst, void const * src, size_t len);
32
 
void * pcilib_datacpy32(void * dst, void const * src, uint8_t size, size_t n, pcilib_endianess_t endianess);
33
 
 
34
 
int pcilib_get_page_mask();
35
 
int pcilib_get_cpu_count();
36
 
 
37
 
 
38
 
int pcilib_add_timeout(struct timeval *tv, pcilib_timeout_t timeout);
39
 
int pcilib_calc_deadline(struct timeval *tv, pcilib_timeout_t timeout);
40
 
int pcilib_check_deadline(struct timeval *tve, pcilib_timeout_t timeout);
41
 
pcilib_timeout_t pcilib_calc_time_to_deadline(struct timeval *tve);
42
 
int pcilib_sleep_until_deadline(struct timeval *tv);
43
 
int pcilib_timecmp(struct timeval *tv1, struct timeval *tv2);
44
 
pcilib_timeout_t pcilib_timediff(struct timeval *tve, struct timeval *tvs);
45
 
 
46
 
#endif /* _PCITOOL_TOOS_H */