Skip to content

Commit a453c61

Browse files
committed
Move prototypes to separate header file
1 parent 61b4944 commit a453c61

File tree

3 files changed

+87
-61
lines changed

3 files changed

+87
-61
lines changed

lib/node_modules/@stdlib/ndarray/ctor/include/stdlib/ndarray/ctor.h

+1-60
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "stdlib/ndarray/dtypes.h"
2525
#include "stdlib/ndarray/index_modes.h"
2626
#include "stdlib/ndarray/orders.h"
27+
#include "ctor/get_ptr.h"
2728
#include "ctor/macros.h"
2829
#include "ctor/ndarray.h"
2930

@@ -127,66 +128,6 @@ int8_t stdlib_ndarray_enable_flags( struct ndarray *arr, const int64_t flags );
127128
*/
128129
int8_t stdlib_ndarray_disable_flags( struct ndarray *arr, const int64_t flags );
129130

130-
/**
131-
* Returns a byte array pointer to an ndarray data element.
132-
*/
133-
uint8_t * stdlib_ndarray_get_ptr( const struct ndarray *arr, const int64_t *sub );
134-
135-
/**
136-
* Returns an ndarray data element specified by a byte array pointer.
137-
*/
138-
int8_t stdlib_ndarray_get_ptr_value( const struct ndarray *arr, const uint8_t *idx, void *out );
139-
140-
/**
141-
* Returns a double-precision floating-point ndarray data element specified by a byte array pointer.
142-
*/
143-
int8_t stdlib_ndarray_get_ptr_float64( const uint8_t *idx, double *out );
144-
145-
/**
146-
* Returns a single-precision floating-point ndarray data element specified by a byte array pointer.
147-
*/
148-
int8_t stdlib_ndarray_get_ptr_float32( const uint8_t *idx, float *out );
149-
150-
/**
151-
* Returns an unsigned 64-bit integer ndarray data element specified by a byte array pointer.
152-
*/
153-
int8_t stdlib_ndarray_get_ptr_uint64( const uint8_t *idx, uint64_t *out );
154-
155-
/**
156-
* Returns a signed 64-bit integer ndarray data element specified by a byte array pointer.
157-
*/
158-
int8_t stdlib_ndarray_get_ptr_int64( const uint8_t *idx, int64_t *out );
159-
160-
/**
161-
* Returns an unsigned 32-bit integer ndarray data element specified by a byte array pointer.
162-
*/
163-
int8_t stdlib_ndarray_get_ptr_uint32( const uint8_t *idx, uint32_t *out );
164-
165-
/**
166-
* Returns a signed 32-bit integer ndarray data element specified by a byte array pointer.
167-
*/
168-
int8_t stdlib_ndarray_get_ptr_int32( const uint8_t *idx, int32_t *out );
169-
170-
/**
171-
* Returns an unsigned 16-bit integer ndarray data element specified by a byte array pointer.
172-
*/
173-
int8_t stdlib_ndarray_get_ptr_uint16( const uint8_t *idx, uint16_t *out );
174-
175-
/**
176-
* Returns a signed 16-bit integer ndarray data element specified by a byte array pointer.
177-
*/
178-
int8_t stdlib_ndarray_get_ptr_int16( const uint8_t *idx, int16_t *out );
179-
180-
/**
181-
* Returns an unsigned 8-bit integer ndarray data element specified by a byte array pointer.
182-
*/
183-
int8_t stdlib_ndarray_get_ptr_uint8( const uint8_t *idx, uint8_t *out );
184-
185-
/**
186-
* Returns a signed 8-bit integer ndarray data element specified by a byte array pointer.
187-
*/
188-
int8_t stdlib_ndarray_get_ptr_int8( const uint8_t *idx, int8_t *out );
189-
190131
/**
191132
* Returns an ndarray data element.
192133
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2018 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
#ifndef STDLIB_NDARRAY_CTOR_GET_PTR_H
20+
#define STDLIB_NDARRAY_CTOR_GET_PTR_H
21+
22+
#include <stdint.h>
23+
#include "ndarray.h"
24+
25+
/**
26+
* Returns a byte array pointer to an ndarray data element.
27+
*/
28+
uint8_t * stdlib_ndarray_get_ptr( const struct ndarray *arr, const int64_t *sub );
29+
30+
/**
31+
* Returns an ndarray data element specified by a byte array pointer.
32+
*/
33+
int8_t stdlib_ndarray_get_ptr_value( const struct ndarray *arr, const uint8_t *idx, void *out );
34+
35+
/**
36+
* Returns a double-precision floating-point ndarray data element specified by a byte array pointer.
37+
*/
38+
int8_t stdlib_ndarray_get_ptr_float64( const uint8_t *idx, double *out );
39+
40+
/**
41+
* Returns a single-precision floating-point ndarray data element specified by a byte array pointer.
42+
*/
43+
int8_t stdlib_ndarray_get_ptr_float32( const uint8_t *idx, float *out );
44+
45+
/**
46+
* Returns an unsigned 64-bit integer ndarray data element specified by a byte array pointer.
47+
*/
48+
int8_t stdlib_ndarray_get_ptr_uint64( const uint8_t *idx, uint64_t *out );
49+
50+
/**
51+
* Returns a signed 64-bit integer ndarray data element specified by a byte array pointer.
52+
*/
53+
int8_t stdlib_ndarray_get_ptr_int64( const uint8_t *idx, int64_t *out );
54+
55+
/**
56+
* Returns an unsigned 32-bit integer ndarray data element specified by a byte array pointer.
57+
*/
58+
int8_t stdlib_ndarray_get_ptr_uint32( const uint8_t *idx, uint32_t *out );
59+
60+
/**
61+
* Returns a signed 32-bit integer ndarray data element specified by a byte array pointer.
62+
*/
63+
int8_t stdlib_ndarray_get_ptr_int32( const uint8_t *idx, int32_t *out );
64+
65+
/**
66+
* Returns an unsigned 16-bit integer ndarray data element specified by a byte array pointer.
67+
*/
68+
int8_t stdlib_ndarray_get_ptr_uint16( const uint8_t *idx, uint16_t *out );
69+
70+
/**
71+
* Returns a signed 16-bit integer ndarray data element specified by a byte array pointer.
72+
*/
73+
int8_t stdlib_ndarray_get_ptr_int16( const uint8_t *idx, int16_t *out );
74+
75+
/**
76+
* Returns an unsigned 8-bit integer ndarray data element specified by a byte array pointer.
77+
*/
78+
int8_t stdlib_ndarray_get_ptr_uint8( const uint8_t *idx, uint8_t *out );
79+
80+
/**
81+
* Returns a signed 8-bit integer ndarray data element specified by a byte array pointer.
82+
*/
83+
int8_t stdlib_ndarray_get_ptr_int8( const uint8_t *idx, int8_t *out );
84+
85+
#endif // !STDLIB_NDARRAY_CTOR_GET_PTR_H

lib/node_modules/@stdlib/ndarray/ctor/src/get_ptr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "stdlib/ndarray/base/ind.h"
2222
#include "stdlib/ndarray/dtypes.h"
2323
#include "stdlib/ndarray/index_modes.h"
24-
#include "stdlib/ndarray/ctor.h"
24+
#include "stdlib/ndarray/ctor/get_ptr.h"
2525

2626
/**
2727
* Returns a byte array pointer to an ndarray data element.

0 commit comments

Comments
 (0)