| 1 | /* block/gsl_block_ushort.h |
| 2 | * |
| 3 | * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Gerard Jungman, Brian Gough |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | |
| 20 | #ifndef __GSL_BLOCK_USHORT_H__ |
| 21 | #define __GSL_BLOCK_USHORT_H__ |
| 22 | |
| 23 | #include <stdlib.h> |
| 24 | #include <gsl/gsl_errno.h> |
| 25 | |
| 26 | #undef __BEGIN_DECLS |
| 27 | #undef __END_DECLS |
| 28 | #ifdef __cplusplus |
| 29 | # define __BEGIN_DECLS extern "C" { |
| 30 | # define __END_DECLS } |
| 31 | #else |
| 32 | # define __BEGIN_DECLS /* empty */ |
| 33 | # define __END_DECLS /* empty */ |
| 34 | #endif |
| 35 | |
| 36 | __BEGIN_DECLS |
| 37 | |
| 38 | struct gsl_block_ushort_struct |
| 39 | { |
| 40 | size_t size; |
| 41 | unsigned short *data; |
| 42 | }; |
| 43 | |
| 44 | typedef struct gsl_block_ushort_struct gsl_block_ushort; |
| 45 | |
| 46 | gsl_block_ushort *gsl_block_ushort_alloc (const size_t n); |
| 47 | gsl_block_ushort *gsl_block_ushort_calloc (const size_t n); |
| 48 | void gsl_block_ushort_free (gsl_block_ushort * b); |
| 49 | |
| 50 | int gsl_block_ushort_fread (FILE * stream, gsl_block_ushort * b); |
| 51 | int gsl_block_ushort_fwrite (FILE * stream, const gsl_block_ushort * b); |
| 52 | int gsl_block_ushort_fscanf (FILE * stream, gsl_block_ushort * b); |
| 53 | int gsl_block_ushort_fprintf (FILE * stream, const gsl_block_ushort * b, const char *format); |
| 54 | |
| 55 | int gsl_block_ushort_raw_fread (FILE * stream, unsigned short * b, const size_t n, const size_t stride); |
| 56 | int gsl_block_ushort_raw_fwrite (FILE * stream, const unsigned short * b, const size_t n, const size_t stride); |
| 57 | int gsl_block_ushort_raw_fscanf (FILE * stream, unsigned short * b, const size_t n, const size_t stride); |
| 58 | int gsl_block_ushort_raw_fprintf (FILE * stream, const unsigned short * b, const size_t n, const size_t stride, const char *format); |
| 59 | |
| 60 | size_t gsl_block_ushort_size (const gsl_block_ushort * b); |
| 61 | unsigned short * gsl_block_ushort_data (const gsl_block_ushort * b); |
| 62 | |
| 63 | __END_DECLS |
| 64 | |
| 65 | #endif /* __GSL_BLOCK_USHORT_H__ */ |
| 66 | |