source: soft/giet_vm/applications/rosenfeld/nrc2/src/nrio1xf.c @ 792

Last change on this file since 792 was 772, checked in by meunier, 9 years ago
  • Ajout de l'application rosenfeld
  • Changement du nom du flag O_CREATE en O_CREAT
File size: 1.0 KB
Line 
1/* ----------------- */
2/* --- nrio1fx.c --- */
3/* ----------------- */
4
5/*
6 * Copyright (c) 2000-2014, Lionel Lacassagne, All rights reserved
7 * Univ Paris Sud XI, CNRS
8 */
9
10#include <stdlib.h>
11#include <stdio.h>
12
13#include "mypredef.h"
14#include "nrtype.h"
15#include "nrdef.h"
16#include "nrkernel.h"
17#include "nrmacro.h"
18
19#include "nralloc1.h"
20#include "nrio1xf.h"
21
22
23/* --------------------------- */
24/* -- write_vector_circular -- */
25/* --------------------------- */
26/* ------------------------------------------------------------------------------------------------------------ */
27IMAGE_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
33  f = fopen(filename, "wt");
34  if(f == NULL) { nrerror("Can't open file in write_bvector_circular"); }
35
36  for(i=c0; i<=c1; i++) { fprintf(f, format, v[i%n+nl]);} fputc('\n', f);
37  fclose(f);
38}
Note: See TracBrowser for help on using the repository browser.