~libecbufr-dev/libecbufr/trunk

« back to all changes in this revision

Viewing changes to API/Sources/array.c

  • Committer: Michel Van Eeckhout
  • Date: 2010-03-12 16:37:56 UTC
  • mto: This revision was merged to the branch mainline in revision 109.
  • Revision ID: afsmmve@corbeau-20100312163756-n9fpy2r26y19ttxr
Modified sources for internationalisation + added m4 and po directories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <string.h>
23
23
 
24
24
#include "bufr_array.h"
 
25
#include "bufr_i18n.h"
25
26
 
26
27
 typedef struct { char *eles;  /* pointer to the elements               */
27
28
                  int   size;  /* size of each element in the array     */
62
63
       if (arr->grow > 0)
63
64
         arr_allocate( arr, arr->total+arr->grow );
64
65
       else {
65
 
         fprintf( stderr, "Warning: initial array size too small: %d\n", 
 
66
         fprintf( stderr, _("Warning: initial array size too small: %d\n"), 
66
67
              arr->total );
67
 
         fprintf( stderr, "Warning: item can't be added\n" );
 
68
         fprintf( stderr, _("Warning: item can't be added\n") );
68
69
         return arr->count;
69
70
       }
70
71
    }
97
98
 
98
99
    if( arr->eles == NULL )
99
100
      {
100
 
      printf(" error arr_allocate no more memory: %d\n", len);
 
101
      printf(_(" error arr_allocate no more memory: %d\n"), len);
101
102
      exit(1);
102
103
      }
103
104
 
149
150
 
150
151
      if( arr == NULL )
151
152
      {
152
 
      printf(" error arr_create no more memory\n");
 
153
      printf(_(" error arr_create no more memory\n"));
153
154
      exit(1);
154
155
      }
155
156
 
687
688
 
688
689
    arr_sort( arr, arrcmp );
689
690
    arr_del( arr, 128 );
690
 
    if( arr_count(arr) != 128 ) printf("Error in array count\n");
 
691
    if( arr_count(arr) != 128 ) printf(_("Error in array count\n"));
691
692
    for( i = 0 ; i < 128 ; i++ )
692
693
       {
693
694
       pele = (dummy *)arr_get( arr, i ); 
694
695
       if((pele->pos != i)||(pele->v!=i*10))
695
 
         printf("Error in array\n");
 
696
         printf(_("Error in array\n"));
696
697
       }
697
698
 
698
699
    arr_inc( arr, 128 );
699
 
    if( arr_count(arr) != 256) printf("Error in array count\n");
 
700
    if( arr_count(arr) != 256) printf(_("Error in array count\n"));
700
701
 
701
702
    arr_free( &arr );
702
703
    }