Skip to content

Commit ef6b5da

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

3 files changed

Lines changed: 83 additions & 56 deletions

File tree

  • lib/node_modules/@stdlib/ndarray/ctor

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

Lines changed: 1 addition & 55 deletions
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.h"
2728
#include "ctor/get_ptr.h"
2829
#include "ctor/macros.h"
2930
#include "ctor/ndarray.h"
@@ -128,61 +129,6 @@ int8_t stdlib_ndarray_enable_flags( struct ndarray *arr, const int64_t flags );
128129
*/
129130
int8_t stdlib_ndarray_disable_flags( struct ndarray *arr, const int64_t flags );
130131

131-
/**
132-
* Returns an ndarray data element.
133-
*/
134-
int8_t stdlib_ndarray_get( const struct ndarray *arr, const int64_t *sub, void *out );
135-
136-
/**
137-
* Returns a double-precision floating-point ndarray data element.
138-
*/
139-
int8_t stdlib_ndarray_get_float64( const struct ndarray *arr, const int64_t *sub, double *out );
140-
141-
/**
142-
* Returns a single-precision floating-point ndarray data element.
143-
*/
144-
int8_t stdlib_ndarray_get_float32( const struct ndarray *arr, const int64_t *sub, float *out );
145-
146-
/**
147-
* Returns an unsigned 64-bit integer ndarray data element.
148-
*/
149-
int8_t stdlib_ndarray_get_uint64( const struct ndarray *arr, const int64_t *sub, uint64_t *out );
150-
151-
/**
152-
* Returns a signed 64-bit integer ndarray data element.
153-
*/
154-
int8_t stdlib_ndarray_get_int64( const struct ndarray *arr, const int64_t *sub, int64_t *out );
155-
156-
/**
157-
* Returns an unsigned 32-bit integer ndarray data element.
158-
*/
159-
int8_t stdlib_ndarray_get_uint32( const struct ndarray *arr, const int64_t *sub, uint32_t *out );
160-
161-
/**
162-
* Returns a signed 32-bit integer ndarray data element.
163-
*/
164-
int8_t stdlib_ndarray_get_int32( const struct ndarray *arr, const int64_t *sub, int32_t *out );
165-
166-
/**
167-
* Returns an unsigned 16-bit integer ndarray data element.
168-
*/
169-
int8_t stdlib_ndarray_get_uint16( const struct ndarray *arr, const int64_t *sub, uint16_t *out );
170-
171-
/**
172-
* Returns a signed 16-bit integer ndarray data element.
173-
*/
174-
int8_t stdlib_ndarray_get_int16( const struct ndarray *arr, const int64_t *sub, int16_t *out );
175-
176-
/**
177-
* Returns an unsigned 8-bit integer ndarray data element.
178-
*/
179-
int8_t stdlib_ndarray_get_uint8( const struct ndarray *arr, const int64_t *sub, uint8_t *out );
180-
181-
/**
182-
* Returns a signed 8-bit integer ndarray data element.
183-
*/
184-
int8_t stdlib_ndarray_get_int8( const struct ndarray *arr, const int64_t *sub, int8_t *out );
185-
186132
/**
187133
* Returns an underlying byte array pointer to an ndarray data element located at a specified linear index.
188134
*/
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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_H
20+
#define STDLIB_NDARRAY_CTOR_GET_H
21+
22+
#include <stdint.h>
23+
#include "ndarray.h"
24+
25+
/**
26+
* Returns an ndarray data element.
27+
*/
28+
int8_t stdlib_ndarray_get( const struct ndarray *arr, const int64_t *sub, void *out );
29+
30+
/**
31+
* Returns a double-precision floating-point ndarray data element.
32+
*/
33+
int8_t stdlib_ndarray_get_float64( const struct ndarray *arr, const int64_t *sub, double *out );
34+
35+
/**
36+
* Returns a single-precision floating-point ndarray data element.
37+
*/
38+
int8_t stdlib_ndarray_get_float32( const struct ndarray *arr, const int64_t *sub, float *out );
39+
40+
/**
41+
* Returns an unsigned 64-bit integer ndarray data element.
42+
*/
43+
int8_t stdlib_ndarray_get_uint64( const struct ndarray *arr, const int64_t *sub, uint64_t *out );
44+
45+
/**
46+
* Returns a signed 64-bit integer ndarray data element.
47+
*/
48+
int8_t stdlib_ndarray_get_int64( const struct ndarray *arr, const int64_t *sub, int64_t *out );
49+
50+
/**
51+
* Returns an unsigned 32-bit integer ndarray data element.
52+
*/
53+
int8_t stdlib_ndarray_get_uint32( const struct ndarray *arr, const int64_t *sub, uint32_t *out );
54+
55+
/**
56+
* Returns a signed 32-bit integer ndarray data element.
57+
*/
58+
int8_t stdlib_ndarray_get_int32( const struct ndarray *arr, const int64_t *sub, int32_t *out );
59+
60+
/**
61+
* Returns an unsigned 16-bit integer ndarray data element.
62+
*/
63+
int8_t stdlib_ndarray_get_uint16( const struct ndarray *arr, const int64_t *sub, uint16_t *out );
64+
65+
/**
66+
* Returns a signed 16-bit integer ndarray data element.
67+
*/
68+
int8_t stdlib_ndarray_get_int16( const struct ndarray *arr, const int64_t *sub, int16_t *out );
69+
70+
/**
71+
* Returns an unsigned 8-bit integer ndarray data element.
72+
*/
73+
int8_t stdlib_ndarray_get_uint8( const struct ndarray *arr, const int64_t *sub, uint8_t *out );
74+
75+
/**
76+
* Returns a signed 8-bit integer ndarray data element.
77+
*/
78+
int8_t stdlib_ndarray_get_int8( const struct ndarray *arr, const int64_t *sub, int8_t *out );
79+
80+
#endif // !STDLIB_NDARRAY_CTOR_GET_H

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
#include <stdlib.h>
2020
#include <stdint.h>
21-
#include "stdlib/ndarray/ctor.h"
21+
#include "stdlib/ndarray/ctor/get_ptr.h"
22+
#include "stdlib/ndarray/ctor/get.h"
2223

2324
/**
2425
* Returns an ndarray data element.

0 commit comments

Comments
 (0)