Lines Matching +defs:buffer +defs:file +defs:name
30 // Buffer to load bi from a file . A static field is used, this should not be
33 static char buffer[BUFFER_SIZE]; // used for loading bi
45 // do not used it in the same call, as a static buffer is used
53 buffer[j] = str[0];
54 buffer[j+1] = str[1];
57 buffer[j] = 0;
58 return buffer;
172 /* load an big integer from an open file handler */
173 void bi_load( bi_ptr bi, FILE *file) {
177 fgets( buffer, BUFFER_SIZE, file);
179 c = buffer[i];
182 buffer[i-1] = 0;
183 bi_set_as_hex( bi, buffer);
186 /* load an big integer array from an open file handler */
187 void bi_load_array( bi_array_ptr array, FILE *file) {
191 fgets( buffer, BUFFER_SIZE, file);
193 c = buffer[ j];
196 buffer[ j -1] = 0;
197 sscanf( buffer, "%d", &length);
200 bi_load( array->array[i], file);
204 /* save an big integer to an open file handler */
205 void bi_save( const bi_ptr bi, const char *name, FILE *file) {
206 fprintf( file, "%s # %s [%ld]\n", bi_2_hex_char( bi), name, bi_nbin_size( bi));
209 /* save an big integer array to an open file handler */
210 void bi_save_array( const bi_array_ptr array, const char *name, FILE *file) {
214 fprintf(file, "%d # %s.length\n", array->length, name);
216 sprintf( new_name, "%s[%d]", name, i);
217 bi_save( array->array[i], new_name, file);
222 /* this buffer is feel with '0' if needed */
226 bi_2_nbin1( &result_length, buffer, bi);
236 for( ; i<length; i++) result[ i] = buffer[ i - delta];