|
Packit |
cb6d3d |
/*
|
|
Packit |
cb6d3d |
Copyright (C) 2004, 2005, 2008 Rocky Bernstein <rocky@gnu.org>
|
|
Packit |
cb6d3d |
Copyright (C) 2014 Robert Kausch <robert.kausch@freac.org>
|
|
Packit |
cb6d3d |
Copyright (C) 1998 Monty xiphmont@mit.edu
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
This program is free software: you can redistribute it and/or modify
|
|
Packit |
cb6d3d |
it under the terms of the GNU General Public License as published by
|
|
Packit |
cb6d3d |
the Free Software Foundation, either version 3 of the License, or
|
|
Packit |
cb6d3d |
(at your option) any later version.
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
This program is distributed in the hope that it will be useful,
|
|
Packit |
cb6d3d |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
cb6d3d |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit |
cb6d3d |
GNU General Public License for more details.
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
You should have received a copy of the GNU General Public License
|
|
Packit |
cb6d3d |
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
cb6d3d |
*/
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
#include <cdio/bytesex.h>
|
|
Packit |
cb6d3d |
#include <stdio.h>
|
|
Packit |
cb6d3d |
#include <time.h>
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
/* I wonder how many alignment issues this is gonna trip in the
|
|
Packit |
cb6d3d |
future... it shouldn't trip any... I guess we'll find out :) */
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
static inline int
|
|
Packit |
cb6d3d |
bigendianp(void)
|
|
Packit |
cb6d3d |
{
|
|
Packit |
cb6d3d |
int test=1;
|
|
Packit |
cb6d3d |
char *hack=(char *)(&test);
|
|
Packit |
cb6d3d |
if(hack[0])return(0);
|
|
Packit |
cb6d3d |
return(1);
|
|
Packit |
cb6d3d |
}
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
extern char *catstring(char *buff, const char *s);
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
extern int gettime(struct timespec *);
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
/*#if BYTE_ORDER == LITTLE_ENDIAN*/
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
#ifndef WORDS_BIGENDIAN
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
static inline int16_t be16_to_cpu(int16_t x){
|
|
Packit |
cb6d3d |
return(UINT16_SWAP_LE_BE_C(x));
|
|
Packit |
cb6d3d |
}
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
static inline int16_t le16_to_cpu(int16_t x){
|
|
Packit |
cb6d3d |
return(x);
|
|
Packit |
cb6d3d |
}
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
#else
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
static inline int16_t be16_to_cpu(int16_t x){
|
|
Packit |
cb6d3d |
return(x);
|
|
Packit |
cb6d3d |
}
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
static inline int16_t le16_to_cpu(int16_t x){
|
|
Packit |
cb6d3d |
return(UINT16_SWAP_LE_BE_C(x));
|
|
Packit |
cb6d3d |
}
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
#endif
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
static inline int16_t cpu_to_be16(int16_t x){
|
|
Packit |
cb6d3d |
return(be16_to_cpu(x));
|
|
Packit |
cb6d3d |
}
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
static inline int16_t cpu_to_le16(int16_t x){
|
|
Packit |
cb6d3d |
return(le16_to_cpu(x));
|
|
Packit |
cb6d3d |
}
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
void cderror(cdrom_drive_t *d, const char *s);
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
void cdmessage(cdrom_drive_t *d,const char *s);
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
void idperror(int messagedest, char **messages, const char *f, const char *s);
|
|
Packit |
cb6d3d |
|
|
Packit |
cb6d3d |
void idmessage(int messagedest, char **messages, const char *f, const char *s);
|
|
Packit |
cb6d3d |
|