-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuarray2.h
38 lines (30 loc) · 837 Bytes
/
uarray2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* COMP 40 HW 2
*
* X. Victor Gao and Yifan Yang
*
* uarray2.h : interface of uarray2
*/
#include <stdio.h>
#include <stdlib.h>
#include "assert.h"
#include "except.h"
#include "uarray.h"
#ifndef UARRAY2_INCLUDED
#define UARRAY2_INCLUDED
#define T UArray2_T
typedef struct T *T;
extern T UArray2_new (int width, int height, int size);
extern void UArray2_free (T *uarray2);
extern int UArray2_width (T uarray2);
extern int UArray2_height (T uarray2);
extern int UArray2_size (T uarray2);
extern void *UArray2_at (T uarray2, int col, int row);
extern void UArray2_map_row_major (T uarray2,
void apply (int i, int j, T uarray2, void *elem, void *cl),
void *cl);
extern void UArray2_map_col_major (T uarray2,
void apply (int i, int j, T uarray2, void *elem, void *cl),
void *cl);
#undef T
#endif