BRL-CAD
str.h
Go to the documentation of this file.
1 /* B N _ S T R . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2024 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 /*----------------------------------------------------------------------*/
22 /** @addtogroup bn_str
23  *
24  * @brief
25  * LIBBN encode/decode string routines.
26  *
27  */
28 /** @{ */
29 /** @file bn/str.h */
30 
31 #ifndef BN_STR_H
32 #define BN_STR_H
33 
34 #include "common.h"
35 
36 #include "vmath.h"
37 #include "bu/vls.h"
38 #include "bn/defines.h"
39 
40 __BEGIN_DECLS
41 
42 /**
43  * @brief Support routines for the math functions
44  */
45 
46 /* XXX Really need a decode_array function that uses atof(),
47  * XXX so that junk like leading { and commas between inputs
48  * XXX don't spoil the conversion.
49  */
50 
51 BN_EXPORT extern int bn_decode_angle(double *ang,
52  const char *str);
53 BN_EXPORT extern int bn_decode_mat(mat_t m,
54  const char *str);
55 BN_EXPORT extern int bn_decode_quat(quat_t q,
56  const char *str);
57 BN_EXPORT extern int bn_decode_vect(vect_t v,
58  const char *str);
59 BN_EXPORT extern int bn_decode_hvect(hvect_t v,
60  const char *str);
61 BN_EXPORT extern void bn_encode_mat(struct bu_vls *vp,
62  const mat_t m, int clamp);
63 BN_EXPORT extern void bn_encode_quat(struct bu_vls *vp,
64  const quat_t q, int clamp);
65 BN_EXPORT extern void bn_encode_vect(struct bu_vls *vp,
66  const vect_t v, int clamp);
67 BN_EXPORT extern void bn_encode_hvect(struct bu_vls *vp,
68  const hvect_t v, int clamp);
69 
70 
71 __END_DECLS
72 
73 #endif /* BN_STR_H */
74 /** @} */
75 /*
76  * Local Variables:
77  * mode: C
78  * tab-width: 8
79  * indent-tabs-mode: t
80  * c-file-style: "stroustrup"
81  * End:
82  * ex: shiftwidth=4 tabstop=8
83  */
Header file for the BRL-CAD common definitions.
int bn_decode_vect(vect_t v, const char *str)
int bn_decode_quat(quat_t q, const char *str)
int bn_decode_angle(double *ang, const char *str)
Support routines for the math functions.
void bn_encode_vect(struct bu_vls *vp, const vect_t v, int clamp)
int bn_decode_hvect(hvect_t v, const char *str)
void bn_encode_mat(struct bu_vls *vp, const mat_t m, int clamp)
void bn_encode_hvect(struct bu_vls *vp, const hvect_t v, int clamp)
void bn_encode_quat(struct bu_vls *vp, const quat_t q, int clamp)
int bn_decode_mat(mat_t m, const char *str)
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
Definition: vmath.h:349
fastf_t mat_t[ELEMENTS_PER_MAT]
4x4 matrix
Definition: vmath.h:370
fastf_t hvect_t[ELEMENTS_PER_HVECT]
4-tuple vector
Definition: vmath.h:361
hvect_t quat_t
4-element quaternion
Definition: vmath.h:364
Definition: vls.h:53
fundamental vector, matrix, quaternion math macros