15 #define RPLY_VERSION "RPly 1.1.3" 16 #define RPLY_COPYRIGHT "Copyright (C) 2003-2013 Diego Nehab, 2014 Thiago Perrotta" 17 #define RPLY_AUTHORS "Diego Nehab, Thiago Perrotta" 33 #if defined(_MSC_VER) && (_MSC_VER < 1600) 41 # define PLY_INT8_MAX (127) 42 # define PLY_INT8_MIN (-PLY_INT8_MAX-1) 43 # define PLY_INT16_MAX (32767) 44 # define PLY_INT16_MIN (-PLY_INT16_MAX-1) 45 # define PLY_INT32_MAX (2147483647) 46 # define PLY_INT32_MIN (-PLY_INT32_MAX-1) 47 # define PLY_UINT8_MAX (255) 48 # define PLY_UINT16_MAX (65535) 49 # define PLY_UINT32_MAX (4294967295) 65 # define INT8_MIN (-0x7f-1) 66 # define INT16_MIN (-0x7fff-1) 67 # define INT32_MIN (-0x7fffffff-1) 69 # define INT8_MAX 0x7f 70 # define INT16_MAX 0x7fff 71 # define INT32_MAX 0x7fffffff 73 # define UINT8_MAX 0xff 74 # define UINT16_MAX 0xffff 75 # define UINT32_MAX 0xffffffffU 78 # define INT64_MIN (-0x7fffffffffffffff-1) 79 # define INT64_MAX 0x7fffffffffffffff 80 # define UINT64_MAX 0xffffffffffffffff 82 # define INT64_MIN (-0x7fffffffffffffffLL-1) 83 # define INT64_MAX 0x7fffffffffffffffLL 84 # define UINT64_MAX 0xffffffffffffffffULL 89 # define PLY_INT8_MIN INT8_MIN 90 # define PLY_INT8_MAX INT8_MAX 91 # define PLY_INT16_MIN INT16_MIN 92 # define PLY_INT16_MAX INT16_MAX 93 # define PLY_INT32_MIN INT32_MIN 94 # define PLY_INT32_MAX INT32_MAX 95 # define PLY_UINT8_MAX UINT8_MAX 96 # define PLY_UINT16_MAX UINT16_MAX 97 # define PLY_UINT32_MAX UINT32_MAX 301 p_ply_property last);
339 inline int ply_add_element(p_ply ply,
const char *name,
long ninstances);
446 "binary_big_endian",
"binary_little_endian",
"ascii", NULL
450 "int8",
"uint8",
"int16",
"uint16",
451 "int32",
"uint32",
"float32",
"float64",
452 "char",
"uchar",
"short",
"ushort",
453 "int",
"uint",
"float",
"double",
597 static int ply_read_chunk(p_ply ply,
void *anybuffer,
size_t size);
601 static void ply_reverse(
void *anydata,
size_t size);
606 static int ply_find_string(
const char *item,
const char*
const list[]);
624 static void ply_error_cb(p_ply ply,
const char *message);
625 static void ply_ferror(p_ply ply,
const char *fmt, ...);
636 static void *
ply_grow_array(p_ply ply,
void **pointer,
long *nmemb,
long size);
648 p_ply_argument argument);
650 p_ply_property
property, p_ply_argument argument);
652 p_ply_property
property, p_ply_argument argument);
654 p_ply_property
property, p_ply_argument argument);
660 #define BWORD(p) (p->buffer + p->buffer_token) 661 #define BLINE(p) (p->buffer + p->buffer_token) 664 #define BFIRST(p) (p->buffer + p->buffer_first) 667 #define BSIZE(p) (p->buffer_last - p->buffer_first) 670 #define BSKIP(p, s) (p->buffer_first += s) 675 size_t size =
BSIZE(ply);
684 if (size <= 0)
return 0;
697 char *magic = ply->
buffer;
699 ply->
error_cb(ply,
"Unable to read magic number from file");
703 if (magic[0] !=
'p' || magic[1] !=
'l' || magic[2] !=
'y' 704 || !isspace(magic[3])) {
705 ply->
error_cb(ply,
"Wrong magic number. Expected 'ply'");
710 ply->
rn = magic[3] ==
'\r' && magic[4] ==
'\n';
721 *value = strtol(
BWORD(ply), &end, 10);
729 *value = strtol(
BWORD(ply), &end, 10);
737 *value = strtol(
BWORD(ply), &end, 10);
745 *value = strtol(
BWORD(ply), &end, 10);
753 *value = strtol(
BWORD(ply), &end, 10);
761 *value = strtol(
BWORD(ply), &end, 10);
769 *value = strtod(
BWORD(ply), &end);
770 if (*end || *value < -FLT_MAX || *value > FLT_MAX)
return 0;
777 *value = strtod(
BWORD(ply), &end);
778 if (*end || *value < -DBL_MAX || *value > DBL_MAX)
return 0;
798 if (!ply->
idriver->
ichunk(ply, &int16,
sizeof(int16)))
return 0;
805 if (!ply->
idriver->
ichunk(ply, &uint16,
sizeof(uint16)))
return 0;
812 if (!ply->
idriver->
ichunk(ply, &int32,
sizeof(int32)))
return 0;
819 if (!ply->
idriver->
ichunk(ply, &uint32,
sizeof(uint32)))
return 0;
826 if (!ply->
idriver->
ichunk(ply, &float32,
sizeof(float32)))
return 0;
869 if (value < -FLT_MAX || value > FLT_MAX)
return 0;
870 return fprintf(ply->
fp,
"%g", (
float) value) > 0;
874 if (value < -DBL_MAX || value > DBL_MAX)
return 0;
875 return fprintf(ply->
fp,
"%g", value) > 0;
915 float float32 = (float) value;
916 if (value > FLT_MAX || value < -FLT_MAX)
return 0;
954 "reverse binary input" 984 "reverse binary output" 999 error_cb(NULL,
"Out of memory");
1007 error_cb(ply,
"Incompatible type system");
1012 fp = fopen(name,
"rb");
1014 error_cb(ply,
"Unable to open file");
1032 while (strcmp(
BWORD(ply),
"end_header")) {
1055 p_ply_property
property = NULL;
1056 assert(ply && element_name && property_name);
1058 if (!element)
return 0;
1061 property->read_cb = read_cb;
1062 property->pdata =
pdata;
1063 property->idata =
idata;
1069 p_ply_argument argument;
1091 error_cb(NULL,
"Out of memory");
1095 error_cb(ply,
"Incompatible type system");
1100 fp = fopen(name,
"wb");
1102 error_cb(ply,
"Unable to create file");
1123 assert(name && strlen(name) <
WORDSIZE && ninstances >= 0);
1124 if (strlen(name) >=
WORDSIZE || ninstances < 0) {
1129 if (!element)
return 0;
1130 strcpy(element->
name, name);
1137 p_ply_property
property = NULL;
1139 assert(name && strlen(name) <
WORDSIZE);
1149 property->type = type;
1156 p_ply_property
property = NULL;
1158 assert(name && strlen(name) <
WORDSIZE);
1174 property->length_type = length_type;
1175 property->value_type = value_type;
1188 char *new_comment = NULL;
1189 assert(ply && comment && strlen(comment) <
LINESIZE);
1190 if (!comment || strlen(comment) >=
LINESIZE) {
1196 if (!new_comment)
return 0;
1197 strcpy(new_comment, comment);
1202 char *new_obj_info = NULL;
1203 assert(ply && obj_info && strlen(obj_info) <
LINESIZE);
1204 if (!obj_info || strlen(obj_info) >=
LINESIZE) {
1210 if (!new_obj_info)
return 0;
1211 strcpy(new_obj_info, obj_info);
1220 if (fprintf(ply->
fp,
"ply\nformat %s 1.0\n",
1232 if (fprintf(ply->
fp,
"element %s %ld\n", element->
name,
1235 p_ply_property
property = &element->
property[j];
1237 if (fprintf(ply->
fp,
"property list %s %s %s\n",
1242 if (fprintf(ply->
fp,
"property %s %s\n",
1248 return fprintf(ply->
fp,
"end_header\n") > 0;
1256 p_ply_property
property = NULL;
1268 }
else type =
property->value_type;
1270 type =
property->type;
1274 ply_ferror(ply,
"Failed writing %s of %s %d (%s: %s)",
1299 return (!spaceafter || putc(
' ', ply->
fp) > 0) &&
1300 (!breakafter || putc(
'\n', ply->
fp) > 0);
1308 assert(ply && ply->
fp);
1336 p_ply_element last) {
1338 if (!last)
return ply->
element;
1347 if (name) *name = element->
name;
1348 if (ninstances) *ninstances = (long) element->
ninstances;
1353 p_ply_property last) {
1355 if (!last)
return element->
property;
1364 if (name) *name =
property->name;
1365 if (type) *type =
property->type;
1366 if (length_type) *length_type =
property->length_type;
1367 if (value_type) *value_type =
property->value_type;
1374 if (!last)
return ply->
comment;
1394 if (!argument)
return 0;
1395 if (element) *element = argument->
element;
1403 if (!argument)
return 0;
1404 if (property) *
property = argument->
property;
1405 if (length) *length = argument->
length;
1406 if (value_index) *value_index = argument->
value_index;
1413 if (!argument)
return 0;
1414 if (pdata) *pdata = argument->
pdata;
1415 if (idata) *idata = argument->
idata;
1421 if (!argument)
return 0.0;
1422 return argument->
value;
1428 if (pdata) *pdata = ply->
pdata;
1429 if (idata) *idata = ply->
idata;
1437 p_ply_property
property, p_ply_argument argument) {
1444 if (!handler(ply, &length)) {
1445 ply_ferror(ply,
"Error reading '%s' of '%s' number %d",
1450 argument->
length = (long) length;
1453 if (read_cb && !read_cb(argument)) {
1458 handler = driver[
property->value_type];
1460 for (l = 0; l < (long) length; l++) {
1463 if (!handler(ply, &argument->
value)) {
1464 ply_ferror(ply,
"Error reading value number %d of '%s' of " 1465 "'%s' number %d", l+1, property->
name,
1470 if (read_cb && !read_cb(argument)) {
1479 p_ply_property
property, p_ply_argument argument) {
1485 if (!handler(ply, &argument->
value)) {
1486 ply_ferror(ply,
"Error reading '%s' of '%s' number %d",
1490 if (read_cb && !read_cb(argument)) {
1498 p_ply_property
property, p_ply_argument argument) {
1506 p_ply_argument argument) {
1513 p_ply_property
property = &element->
property[k];
1515 argument->
pdata =
property->pdata;
1516 argument->
idata =
property->idata;
1526 assert(item && list);
1527 for (i = 0; list[i]; i++)
1528 if (!strcmp(list[i], item))
return i;
1535 assert(ply && name);
1538 assert(element || nelements == 0);
1539 assert(!element || nelements > 0);
1540 for (i = 0; i < nelements; i++)
1541 if (!strcmp(element[i].name, name))
return &element[i];
1549 assert(element && name);
1552 assert(property || nproperties == 0);
1553 assert(!property || nproperties > 0);
1554 for (i = 0; i < nproperties; i++)
1555 if (!strcmp(property[i].name, name))
return &
property[i];
1560 size_t size = strlen(
BWORD(ply));
1564 }
else if (size == 0) {
1576 t = strspn(
BFIRST(ply),
" \n\r\t");
1578 if (t >=
BSIZE(ply)) {
1587 t = strcspn(
BFIRST(ply),
" \n\r\t");
1589 if (t <
BSIZE(ply)) {
1602 t += strcspn(
BFIRST(ply) + t,
" \n\r\t");
1604 if (t >=
BSIZE(ply)) {
1629 const char *end = NULL;
1632 end = strchr(
BFIRST(ply),
'\n');
1649 end = strchr(end,
'\n');
1664 char *buffer = (
char *) anybuffer;
1683 char *buffer = (
char *) anybuffer;
1716 char *data = (
char *) anydata;
1719 for (i = 0; i < size/2; i++) {
1721 data[i] = data[size-i-1];
1722 data[size-i-1] = temp;
1745 element->
name[0] =
'\0';
1752 property->name[0] =
'\0';
1753 property->type =
static_cast<e_ply_type>(-1);
1754 property->length_type =
static_cast<e_ply_type>(-1);
1755 property->value_type =
static_cast<e_ply_type>(-1);
1757 property->pdata = NULL;
1758 property->idata = 0;
1763 if (!ply)
return NULL;
1769 long *nmemb,
long size) {
1770 void *temp = *pointer;
1771 long count = *nmemb + 1;
1772 if (!temp) temp = malloc(count*size);
1773 else temp = realloc(temp, count*size);
1780 return (
char *) temp + (count-1) * size;
1790 if (!element)
return NULL;
1796 p_ply_property
property = NULL;
1811 if (strcmp(
BWORD(ply),
"format"))
return 0;
1817 ply->
idriver = &ply_idriver_binary;
1818 else ply->
idriver = &ply_idriver_binary_reverse;
1820 if (strcmp(
BWORD(ply),
"1.0"))
return 0;
1827 if (strcmp(
BWORD(ply),
"comment"))
return 0;
1836 if (strcmp(
BWORD(ply),
"obj_info"))
return 0;
1845 p_ply_property
property = NULL;
1847 if (strcmp(
BWORD(ply),
"property"))
return 0;
1875 if (strcmp(
BWORD(ply),
"element"))
return 0;
1878 if (!element)
return 0;
1884 if (sscanf(
BWORD(ply),
"%ld", &dummy) != 1) {
1899 fprintf(stderr,
"RPly: %s\n", message);
1906 vsprintf(buffer, fmt, ap);
1912 unsigned long i = 1;
1913 unsigned char *s = (
unsigned char *) &i;
1925 assert(
sizeof(
float) == 4);
1926 assert(
sizeof(
double) == 8);
1933 if (
sizeof(
float) != 4)
return 0;
1934 if (
sizeof(
double) != 8)
return 0;
#define BWORD(p)
Definition: rply.hpp:660
int ply_add_list_property(p_ply ply, const char *name, e_ply_type length_type, e_ply_type value_type)
Definition: rply.hpp:1153
static int ibinary_uint16(p_ply ply, double *value)
Definition: rply.hpp:803
static int ply_write_chunk_reverse(p_ply ply, void *anybuffer, size_t size)
Definition: rply.hpp:1701
static int oascii_int32(p_ply ply, double value)
Definition: rply.hpp:858
char name[WORDSIZE]
Definition: rply.hpp:492
p_ply_property ply_get_next_property(p_ply_element element, p_ply_property last)
Definition: rply.hpp:1352
static int ply_read_header_property(p_ply ply)
Definition: rply.hpp:1843
static void ply_init(p_ply ply)
Definition: rply.hpp:1726
static int iascii_int8(p_ply ply, double *value)
Definition: rply.hpp:718
int ply_get_argument_user_data(p_ply_argument argument, void **pdata, long *idata)
Definition: rply.hpp:1410
int(* p_ply_ochunk)(p_ply ply, void *anydata, size_t size)
Definition: rply.hpp:533
static p_ply_property ply_grow_property(p_ply ply, p_ply_element element)
Definition: rply.hpp:1795
static int oascii_int16(p_ply ply, double value)
Definition: rply.hpp:848
static int ply_read_header_magic(p_ply ply)
Definition: rply.hpp:696
static int obinary_uint32(p_ply ply, double value)
Definition: rply.hpp:908
static int BREFILL(p_ply ply)
Definition: rply.hpp:673
static p_ply_element ply_find_element(p_ply ply, const char *name)
Definition: rply.hpp:1532
static const char *const ply_storage_mode_list[]
Definition: rply.hpp:445
p_ply_ochunk ochunk
Definition: rply.hpp:536
int ply_get_ply_user_data(p_ply ply, void **pdata, long *idata)
Definition: rply.hpp:1425
static int iascii_float64(p_ply ply, double *value)
Definition: rply.hpp:774
uint16_t t_ply_uint16
Definition: rply.hpp:61
p_ply_property property
Definition: rply.hpp:512
static void ply_finish_word(p_ply ply, size_t size)
Definition: rply.hpp:1613
const int WORDSIZE
Definition: rply.hpp:436
static int obinary_int8(p_ply ply, double value)
Definition: rply.hpp:878
void(* p_ply_error_cb)(p_ply ply, const char *message)
Definition: rply.hpp:134
static int ply_check_word(p_ply ply)
Definition: rply.hpp:1559
char * obj_info
Definition: rply.hpp:573
static int obinary_int16(p_ply ply, double value)
Definition: rply.hpp:890
#define BLINE(p)
Definition: rply.hpp:661
char * comment
Definition: rply.hpp:571
static int oascii_int8(p_ply ply, double value)
Definition: rply.hpp:838
int ply_add_scalar_property(p_ply ply, const char *name, e_ply_type type)
Definition: rply.hpp:1135
void * pdata
Definition: rply.hpp:477
e_ply_type length_type
Definition: rply.hpp:493
long ncomments
Definition: rply.hpp:572
int ply_write(p_ply ply, double value)
Definition: rply.hpp:1254
const int LINESIZE
Definition: rply.hpp:437
const int BUFFERSIZE
Definition: rply.hpp:438
static int ply_read_chunk_reverse(p_ply ply, void *anybuffer, size_t size)
Definition: rply.hpp:1709
static int ibinary_int32(p_ply ply, double *value)
Definition: rply.hpp:810
p_ply_element element
Definition: rply.hpp:569
int(* p_ply_ihandler)(p_ply ply, double *value)
Definition: rply.hpp:523
p_ply_read_cb read_cb
Definition: rply.hpp:494
int32_t t_ply_int32
Definition: rply.hpp:59
int(* p_ply_ichunk)(p_ply ply, void *anydata, size_t size)
Definition: rply.hpp:524
static int ply_type_check(void)
Definition: rply.hpp:1918
const char * ply_get_next_obj_info(p_ply ply, const char *last)
Definition: rply.hpp:1380
p_ply_ihandler ihandler[16]
Definition: rply.hpp:526
static void ply_property_init(p_ply_property property)
Definition: rply.hpp:1751
static p_ply ply_alloc(void)
Definition: rply.hpp:1761
struct t_ply_argument_ * p_ply_argument
Definition: rply.hpp:109
static int ply_read_word(p_ply ply)
Definition: rply.hpp:1571
static int oascii_float32(p_ply ply, double value)
Definition: rply.hpp:868
size_t buffer_last
Definition: rply.hpp:578
#define PLY_INT16_MAX
Definition: rply.hpp:92
static int ibinary_uint8(p_ply ply, double *value)
Definition: rply.hpp:789
static int ply_read_line(p_ply ply)
Definition: rply.hpp:1628
int ply_read(p_ply ply)
Definition: rply.hpp:1067
static int iascii_uint16(p_ply ply, double *value)
Definition: rply.hpp:742
#define PLY_INT8_MIN
Definition: rply.hpp:89
void * pdata
Definition: rply.hpp:495
#define PLY_UINT8_MAX
Definition: rply.hpp:95
static int iascii_int16(p_ply ply, double *value)
Definition: rply.hpp:734
static int ibinary_uint32(p_ply ply, double *value)
Definition: rply.hpp:817
static t_ply_idriver ply_idriver_ascii
Definition: rply.hpp:927
long value_index
Definition: rply.hpp:475
static int ply_read_chunk(p_ply ply, void *anybuffer, size_t size)
Definition: rply.hpp:1663
t_ply_odriver * p_ply_odriver
Definition: rply.hpp:539
static int iascii_int32(p_ply ply, double *value)
Definition: rply.hpp:750
static t_ply_odriver ply_odriver_ascii
Definition: rply.hpp:957
static void ply_reverse(void *anydata, size_t size)
Definition: rply.hpp:1715
char buffer[BUFFERSIZE]
Definition: rply.hpp:577
static int ibinary_float64(p_ply ply, double *value)
Definition: rply.hpp:831
static int ply_read_list_property(p_ply ply, p_ply_element element, p_ply_property property, p_ply_argument argument)
Definition: rply.hpp:1436
p_ply ply_create(const char *name, e_ply_storage_mode storage_mode, p_ply_error_cb error_cb, long idata, void *pdata)
Definition: rply.hpp:1085
int(* p_ply_read_cb)(p_ply_argument argument)
Definition: rply.hpp:172
uint8_t t_ply_uint8
Definition: rply.hpp:60
static int obinary_uint8(p_ply ply, double value)
Definition: rply.hpp:884
double ply_get_argument_value(p_ply_argument argument)
Definition: rply.hpp:1419
const char * ply_get_next_comment(p_ply ply, const char *last)
Definition: rply.hpp:1372
int ply_add_element(p_ply ply, const char *name, long ninstances)
Definition: rply.hpp:1120
p_ply_idriver idriver
Definition: rply.hpp:579
double value
Definition: rply.hpp:476
int ply_get_property_info(p_ply_property property, const char **name, e_ply_type *type, e_ply_type *length_type, e_ply_type *value_type)
Definition: rply.hpp:1361
void * pdata
Definition: rply.hpp:585
static int ibinary_float32(p_ply ply, double *value)
Definition: rply.hpp:824
static int obinary_int32(p_ply ply, double value)
Definition: rply.hpp:902
static t_ply_idriver ply_idriver_binary
Definition: rply.hpp:937
uint32_t t_ply_uint32
Definition: rply.hpp:62
e_ply_type type
Definition: rply.hpp:493
static p_ply_element ply_grow_element(p_ply ply)
Definition: rply.hpp:1783
struct t_ply_element_ * p_ply_element
Definition: rply.hpp:107
int8_t t_ply_int8
Definition: rply.hpp:57
size_t buffer_first
Definition: rply.hpp:578
int ply_add_obj_info(p_ply ply, const char *obj_info)
Definition: rply.hpp:1201
long nobj_infos
Definition: rply.hpp:574
static void ply_element_init(p_ply_element element)
Definition: rply.hpp:1744
static e_ply_storage_mode ply_arch_endian(void)
Definition: rply.hpp:1911
int ply_close(p_ply ply)
Definition: rply.hpp:1306
long welement
Definition: rply.hpp:582
char name[WORDSIZE]
Definition: rply.hpp:510
t_ply_argument_ argument
Definition: rply.hpp:581
static int obinary_uint16(p_ply ply, double value)
Definition: rply.hpp:896
p_ply_error_cb error_cb
Definition: rply.hpp:584
#define BSKIP(p, s)
Definition: rply.hpp:670
long winstance_index
Definition: rply.hpp:583
#define PLY_UINT16_MAX
Definition: rply.hpp:96
static void * ply_grow_array(p_ply ply, void **pointer, long *nmemb, long size)
Definition: rply.hpp:1768
p_ply ply_open(const char *name, p_ply_error_cb error_cb, long idata, void *pdata)
Definition: rply.hpp:993
static int ply_read_header_comment(p_ply ply)
Definition: rply.hpp:1825
int ply_write_header(p_ply ply)
Definition: rply.hpp:1215
struct t_ply_property_ * p_ply_property
Definition: rply.hpp:108
long wproperty
Definition: rply.hpp:582
long instance_index
Definition: rply.hpp:473
#define PLY_INT32_MAX
Definition: rply.hpp:94
#define PLY_INT16_MIN
Definition: rply.hpp:91
e_ply_type value_type
Definition: rply.hpp:493
static t_ply_odriver ply_odriver_binary_reverse
Definition: rply.hpp:977
int ply_get_argument_property(p_ply_argument argument, p_ply_property *property, long *length, long *value_index)
Definition: rply.hpp:1400
struct t_ply_ * p_ply
Definition: rply.hpp:106
static int iascii_uint8(p_ply ply, double *value)
Definition: rply.hpp:726
#define PLY_UINT32_MAX
Definition: rply.hpp:97
p_ply_ichunk ichunk
Definition: rply.hpp:527
long wlength
Definition: rply.hpp:583
static t_ply_idriver ply_idriver_binary_reverse
Definition: rply.hpp:947
long wvalue_index
Definition: rply.hpp:583
e_ply_storage_mode storage_mode
Definition: rply.hpp:568
size_t buffer_token
Definition: rply.hpp:578
#define PLY_INT32_MIN
Definition: rply.hpp:93
FILE * fp
Definition: rply.hpp:575
e_ply_type
Definition: rply.hpp:120
long length
Definition: rply.hpp:475
static const char *const ply_type_list[]
Definition: rply.hpp:449
static int oascii_uint16(p_ply ply, double value)
Definition: rply.hpp:853
long idata
Definition: rply.hpp:478
int ply_add_property(p_ply ply, const char *name, e_ply_type type, e_ply_type length_type, e_ply_type value_type)
Definition: rply.hpp:1179
int ply_read_header(p_ply ply)
Definition: rply.hpp:1022
static int ibinary_int16(p_ply ply, double *value)
Definition: rply.hpp:796
p_ply_odriver odriver
Definition: rply.hpp:580
static int ply_read_element(p_ply ply, p_ply_element element, p_ply_argument argument)
Definition: rply.hpp:1505
static int oascii_float64(p_ply ply, double value)
Definition: rply.hpp:873
static int ibinary_int8(p_ply ply, double *value)
Definition: rply.hpp:782
static p_ply_property ply_find_property(p_ply_element element, const char *name)
Definition: rply.hpp:1545
e_ply_io_mode
Definition: rply.hpp:440
static void ply_error_cb(p_ply ply, const char *message)
Definition: rply.hpp:1897
int16_t t_ply_int16
Definition: rply.hpp:58
p_ply_element element
Definition: rply.hpp:472
long ninstances
Definition: rply.hpp:511
long ply_set_read_cb(p_ply ply, const char *element_name, const char *property_name, p_ply_read_cb read_cb, void *pdata, long idata)
Definition: rply.hpp:1051
int ply_get_element_info(p_ply_element element, const char **name, long *ninstances)
Definition: rply.hpp:1344
static int ply_write_chunk(p_ply ply, void *anybuffer, size_t size)
Definition: rply.hpp:1682
static int ply_find_string(const char *item, const char *const list[])
Definition: rply.hpp:1524
static int ply_check_line(p_ply ply)
Definition: rply.hpp:1620
#define PLY_INT8_MAX
Definition: rply.hpp:90
static int ply_read_property(p_ply ply, p_ply_element element, p_ply_property property, p_ply_argument argument)
Definition: rply.hpp:1497
static t_ply_odriver ply_odriver_binary
Definition: rply.hpp:967
e_ply_storage_mode
Definition: rply.hpp:112
const char * name
Definition: rply.hpp:537
#define BSIZE(p)
Definition: rply.hpp:667
p_ply_element ply_get_next_element(p_ply ply, p_ply_element last)
Definition: rply.hpp:1335
p_ply_property property
Definition: rply.hpp:474
static int iascii_uint32(p_ply ply, double *value)
Definition: rply.hpp:758
static int obinary_float64(p_ply ply, double value)
Definition: rply.hpp:920
t_ply_idriver * p_ply_idriver
Definition: rply.hpp:530
long idata
Definition: rply.hpp:586
int(* p_ply_ohandler)(p_ply ply, double value)
Definition: rply.hpp:532
static int ply_read_header_format(p_ply ply)
Definition: rply.hpp:1809
#define BFIRST(p)
Definition: rply.hpp:664
static int oascii_uint32(p_ply ply, double value)
Definition: rply.hpp:863
static int ply_read_header_obj_info(p_ply ply)
Definition: rply.hpp:1834
int ply_get_argument_element(p_ply_argument argument, p_ply_element *element, long *instance_index)
Definition: rply.hpp:1391
p_ply_ohandler ohandler[16]
Definition: rply.hpp:535
int rn
Definition: rply.hpp:576
static int ply_read_scalar_property(p_ply ply, p_ply_element element, p_ply_property property, p_ply_argument argument)
Definition: rply.hpp:1478
static int iascii_float32(p_ply ply, double *value)
Definition: rply.hpp:766
static int obinary_float32(p_ply ply, double value)
Definition: rply.hpp:914
int ply_add_comment(p_ply ply, const char *comment)
Definition: rply.hpp:1187
static int oascii_uint8(p_ply ply, double value)
Definition: rply.hpp:843
e_ply_io_mode io_mode
Definition: rply.hpp:567
const char * name
Definition: rply.hpp:528
long nproperties
Definition: rply.hpp:513
long idata
Definition: rply.hpp:496
static void ply_ferror(p_ply ply, const char *fmt,...)
Definition: rply.hpp:1902
static int ply_read_header_element(p_ply ply)
Definition: rply.hpp:1871
long nelements
Definition: rply.hpp:570