Changeset 822 for soft/giet_vm/applications/rosenfeld/nrc2/src/nrio1xf.c
- Timestamp:
- Jun 1, 2016, 10:25:43 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/src/nrio1xf.c
r772 r822 11 11 #include <stdio.h> 12 12 13 #include "nrc_os_config.h" 13 14 #include "mypredef.h" 14 15 #include "nrtype.h" … … 18 19 19 20 #include "nralloc1.h" 20 #include "nrio1x f.h"21 #include "nrio1x.h" 21 22 22 23 … … 24 25 /* -- write_vector_circular -- */ 25 26 /* --------------------------- */ 26 /* ------------------------------------------------------------------------------------------------------------ */27 IMAGE_EXPORT(void) write_bvector_circular(byte *v,long nl,long nh, long c0, long c1, char *format, char *filename)28 /* ------------------------------------------------------------------------------------------------------------ */29 {30 long i, n=nh-nl+1;31 FILE *f;32 27 33 f = fopen(filename, "wt"); 34 if(f == NULL) { nrerror("Can't open file in write_bvector_circular"); } 28 #undef write_type_vector_circular 29 #define write_type_vector_circular(t) \ 30 void short_name(t,write_,vector_circular)(t * v, int32_t nl, int32_t nh, int32_t c0, int32_t c1, char * format, char * filename) \ 31 { \ 32 int32_t n = nh - nl + 1; \ 33 FILE * f = fopen(filename, "wt"); \ 34 if (f == NULL) { \ 35 nrerror("Can't open file %s in %s\n", filename, __func__); \ 36 } \ 37 for (int32_t i = c0; i <= c1; i++) { \ 38 fprintf(f, format, v[i % n + nl]); \ 39 } \ 40 fprintf(f, "\n"); \ 41 fclose(f); \ 42 } 35 43 36 for(i=c0; i<=c1; i++) { fprintf(f, format, v[i%n+nl]);} fputc('\n', f); 37 fclose(f); 38 } 44 write_type_vector_circular(int8_t); 45 write_type_vector_circular(uint8_t); 46 write_type_vector_circular(int16_t); 47 write_type_vector_circular(uint16_t); 48 write_type_vector_circular(int32_t); 49 write_type_vector_circular(uint32_t); 50 write_type_vector_circular(int64_t); 51 write_type_vector_circular(uint64_t); 52 write_type_vector_circular(float); 53 write_type_vector_circular(double); 54 55 56 57 // Local Variables: 58 // tab-width: 4 59 // c-basic-offset: 4 60 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 61 // indent-tabs-mode: nil 62 // End: 63 64 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 65
Note: See TracChangeset
for help on using the changeset viewer.