/usr/include/player-3.0/libplayercommon/playercommon.h is in libplayercommon3.0-dev 3.0.2+dfsg-3ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | /*
* Player - One Hell of a Robot Server
* Copyright (C) 2000
* Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/********************************************************************
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
********************************************************************/
/*
* Desc: Some useful macros
* $Id: playercommon.h 8003 2009-07-13 10:34:37Z thjc $
*/
#ifndef _PLAYERCOMMON_H
#define _PLAYERCOMMON_H
/* one of the following will define PATH_MAX */
#include <limits.h>
#if !defined WIN32
#include <sys/param.h>
#endif
#include <libplayercommon/error.h>
#define MAX_FILENAME_SIZE PATH_MAX
/*
* the following macros can be used to get the first char, short, or int
* out of an unstructured buffer (such as a void* that contains a struct
* of unknown type).
*/
#define GETFIRSTUINT8(x) (*((uint8_t*)x))
#define GETFIRSTINT8(x) (*((int8_t*)x))
#define GETFIRSTUINT16(x) (*((uint16_t*)x))
#define GETFIRSTINT16(x) (*((int16_t*)x))
#define GETFIRSTUINT32(x) (*((uint32_t*)x))
#define GETFIRSTINT32(x) (*((int32_t*)x))
#if !defined WIN32
#define LOBYTE(w) ((uint8_t) (w & 0xFF))
#define HIBYTE(w) ((uint8_t) ((w >> 8) & 0xFF))
#endif
#define MAKEUINT16(lo, hi) ((((uint16_t) (hi)) << 8) | ((uint16_t) (lo)))
////////////////////////////////////////////////////////////////////////////////
// Maths stuff
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
// Convert radians to degrees
#ifndef RTOD
#define RTOD(r) ((r) * 180 / M_PI)
#endif
// Convert degrees to radians
#ifndef DTOR
#define DTOR(d) ((d) * M_PI / 180)
#endif
// Normalize angle to domain -pi, pi
#ifndef NORMALIZE
#define NORMALIZE(z) atan2(sin(z), cos(z))
#endif
#if !defined BOOL && !defined WIN32
#define BOOL int
#endif
#ifndef __cplusplus
#if !defined (true)
#define true 1
#endif
#if !defined (false)
#define false 0
#endif
#endif
#ifndef TRUE
#define TRUE true
#endif
#ifndef FALSE
#define FALSE false
#endif
////////////////////////////////////////////////////////////////////////////////
// Array checking macros
// Macro for returning array size
//
#if !defined ARRAYSIZE && !defined WIN32
// Note that the cast to int is used to suppress warning about
// signed/unsigned mismatches.
#define ARRAYSIZE(x) (int) (sizeof(x) / sizeof(x[0]))
#endif
// Macro for checking array bounds
#define ASSERT_INDEX(index, array) \
assert((size_t) (index) >= 0 && (size_t) (index) < sizeof(array) / sizeof(array[0]));
////////////////////////////////////////////////////////////////////////////////
// Misc useful stuff
#ifndef MIN
#define MIN(a,b) ((a < b) ? (a) : (b))
#endif
#ifndef MAX
#define MAX(a,b) ((a > b) ? (a) : (b))
#endif
#include <assert.h>
#define VERIFY(m) assert(m)
#endif
|