Skip to content

Commit 93dcaf0

Browse files
committed
Move prototypes to separate header file
1 parent ef6b5da commit 93dcaf0

File tree

3 files changed

+91
-61
lines changed

3 files changed

+91
-61
lines changed

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

Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "stdlib/ndarray/orders.h"
2727
#include "ctor/get.h"
2828
#include "ctor/get_ptr.h"
29+
#include "ctor/iget.h"
2930
#include "ctor/macros.h"
3031
#include "ctor/ndarray.h"
3132

@@ -129,66 +130,6 @@ int8_t stdlib_ndarray_enable_flags( struct ndarray *arr, const int64_t flags );
129130
*/
130131
int8_t stdlib_ndarray_disable_flags( struct ndarray *arr, const int64_t flags );
131132

132-
/**
133-
* Returns an underlying byte array pointer to an ndarray data element located at a specified linear index.
134-
*/
135-
uint8_t * stdlib_ndarray_iget_ptr( const struct ndarray *arr, const int64_t idx );
136-
137-
/**
138-
* Returns an ndarray data element located at a specified linear index.
139-
*/
140-
int8_t stdlib_ndarray_iget( const struct ndarray *arr, const int64_t idx, void *out );
141-
142-
/**
143-
* Returns a double-precision floating-point ndarray data element located at a specified linear index.
144-
*/
145-
int8_t stdlib_ndarray_iget_float64( const struct ndarray *arr, const int64_t idx, double *out );
146-
147-
/**
148-
* Returns a single-precision floating-point ndarray data element located at a specified linear index.
149-
*/
150-
int8_t stdlib_ndarray_iget_float32( const struct ndarray *arr, const int64_t idx, float *out );
151-
152-
/**
153-
* Returns an unsigned 64-bit integer ndarray data element located at a specified linear index.
154-
*/
155-
int8_t stdlib_ndarray_iget_uint64( const struct ndarray *arr, const int64_t idx, uint64_t *out );
156-
157-
/**
158-
* Returns a signed 64-bit integer ndarray data element located at a specified linear index.
159-
*/
160-
int8_t stdlib_ndarray_iget_int64( const struct ndarray *arr, const int64_t idx, int64_t *out );
161-
162-
/**
163-
* Returns an unsigned 32-bit integer ndarray data element located at a specified linear index.
164-
*/
165-
int8_t stdlib_ndarray_iget_uint32( const struct ndarray *arr, const int64_t idx, uint32_t *out );
166-
167-
/**
168-
* Returns a signed 32-bit integer ndarray data element located at a specified linear index.
169-
*/
170-
int8_t stdlib_ndarray_iget_int32( const struct ndarray *arr, const int64_t idx, int32_t *out );
171-
172-
/**
173-
* Returns an unsigned 16-bit integer ndarray data element located at a specified linear index.
174-
*/
175-
int8_t stdlib_ndarray_iget_uint16( const struct ndarray *arr, const int64_t idx, uint16_t *out );
176-
177-
/**
178-
* Returns a signed 16-bit integer ndarray data element located at a specified linear index.
179-
*/
180-
int8_t stdlib_ndarray_iget_int16( const struct ndarray *arr, const int64_t idx, int16_t *out );
181-
182-
/**
183-
* Returns an unsigned 8-bit integer ndarray data element located at a specified linear index.
184-
*/
185-
int8_t stdlib_ndarray_iget_uint8( const struct ndarray *arr, const int64_t idx, uint8_t *out );
186-
187-
/**
188-
* Returns a signed 8-bit integer ndarray data element located at a specified linear index.
189-
*/
190-
int8_t stdlib_ndarray_iget_int8( const struct ndarray *arr, const int64_t idx, int8_t *out );
191-
192133
/**
193134
* Sets an ndarray data element specified by a byte array pointer.
194135
*/
Lines changed: 85 additions & 0 deletions
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_IGET_H
20+
#define STDLIB_NDARRAY_CTOR_IGET_H
21+
22+
#include <stdint.h>
23+
#include "ndarray.h"
24+
25+
/**
26+
* Returns an underlying byte array pointer to an ndarray data element located at a specified linear index.
27+
*/
28+
uint8_t * stdlib_ndarray_iget_ptr( const struct ndarray *arr, const int64_t idx );
29+
30+
/**
31+
* Returns an ndarray data element located at a specified linear index.
32+
*/
33+
int8_t stdlib_ndarray_iget( const struct ndarray *arr, const int64_t idx, void *out );
34+
35+
/**
36+
* Returns a double-precision floating-point ndarray data element located at a specified linear index.
37+
*/
38+
int8_t stdlib_ndarray_iget_float64( const struct ndarray *arr, const int64_t idx, double *out );
39+
40+
/**
41+
* Returns a single-precision floating-point ndarray data element located at a specified linear index.
42+
*/
43+
int8_t stdlib_ndarray_iget_float32( const struct ndarray *arr, const int64_t idx, float *out );
44+
45+
/**
46+
* Returns an unsigned 64-bit integer ndarray data element located at a specified linear index.
47+
*/
48+
int8_t stdlib_ndarray_iget_uint64( const struct ndarray *arr, const int64_t idx, uint64_t *out );
49+
50+
/**
51+
* Returns a signed 64-bit integer ndarray data element located at a specified linear index.
52+
*/
53+
int8_t stdlib_ndarray_iget_int64( const struct ndarray *arr, const int64_t idx, int64_t *out );
54+
55+
/**
56+
* Returns an unsigned 32-bit integer ndarray data element located at a specified linear index.
57+
*/
58+
int8_t stdlib_ndarray_iget_uint32( const struct ndarray *arr, const int64_t idx, uint32_t *out );
59+
60+
/**
61+
* Returns a signed 32-bit integer ndarray data element located at a specified linear index.
62+
*/
63+
int8_t stdlib_ndarray_iget_int32( const struct ndarray *arr, const int64_t idx, int32_t *out );
64+
65+
/**
66+
* Returns an unsigned 16-bit integer ndarray data element located at a specified linear index.
67+
*/
68+
int8_t stdlib_ndarray_iget_uint16( const struct ndarray *arr, const int64_t idx, uint16_t *out );
69+
70+
/**
71+
* Returns a signed 16-bit integer ndarray data element located at a specified linear index.
72+
*/
73+
int8_t stdlib_ndarray_iget_int16( const struct ndarray *arr, const int64_t idx, int16_t *out );
74+
75+
/**
76+
* Returns an unsigned 8-bit integer ndarray data element located at a specified linear index.
77+
*/
78+
int8_t stdlib_ndarray_iget_uint8( const struct ndarray *arr, const int64_t idx, uint8_t *out );
79+
80+
/**
81+
* Returns a signed 8-bit integer ndarray data element located at a specified linear index.
82+
*/
83+
int8_t stdlib_ndarray_iget_int8( const struct ndarray *arr, const int64_t idx, int8_t *out );
84+
85+
#endif // !STDLIB_NDARRAY_CTOR_IGET_H

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818

1919
#include <stdlib.h>
2020
#include <stdint.h>
21+
#include "stdlib/ndarray/base/bytes_per_element.h"
2122
#include "stdlib/ndarray/base/ind.h"
2223
#include "stdlib/ndarray/base/iteration_order.h"
23-
#include "stdlib/ndarray/ctor.h"
24+
#include "stdlib/ndarray/orders.h"
25+
#include "stdlib/ndarray/ctor/get_ptr.h"
26+
#include "stdlib/ndarray/ctor/ndarray.h"
27+
#include "stdlib/ndarray/ctor/iget.h"
2428

2529
/**
2630
* Returns an underlying byte array pointer to an ndarray data element located at a specified linear index.

0 commit comments

Comments
 (0)