Ruby: ext/zlib/zlib-1.2.13/examples/enough.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Typedefs | Functions | Variables
enough.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <stdarg.h>`
`#include <stdint.h>`
`#include <assert.h>`

Go to the source code of this file.

## Data Structures
struct | tab
struct | string_t

## Macros
#define | local static
#define | PRIbig "ju"

## Typedefs
typedef uintmax_t | big_t
typedef uintmax_t | code_t

## Functions
void | string_clear (string_t *s)
void | string_init (string_t *s)
void | string_free (string_t *s)
void | string_printf (string_t *s, char *fmt,...)
size_t | map (int syms, int left, int len)
void | cleanup (void)
big_t | count (int syms, int left, int len)
int | been_here (int syms, int left, int len, int mem, int rem)
void | examine (int syms, int left, int len, int mem, int rem)
void | enough (int syms)
int | main (int argc, char **argv)

## Variables
struct {
int max
int root
int large
size_t size
big_t tot
string_t out
int * code
big_t * num
struct tab * done
} | g

## Macro Definition Documentation

## ◆ local

#define local static

Definition at line 112 of file enough.c.

## ◆ PRIbig

#define PRIbig "ju"

Definition at line 116 of file enough.c.

## Typedef Documentation

## ◆ big_t

typedef uintmax_t big_t

Definition at line 115 of file enough.c.

## ◆ code_t

typedef uintmax_t code_t

Definition at line 117 of file enough.c.

## Function Documentation

## ◆ been_here()

int been_here | ( | int | syms,
|  | int | left,
|  | int | len,
|  | int | mem,
|  | int | rem
| ) |  |

Definition at line 308 of file enough.c.

References assert, calloc, g, len, map(), NULL, and realloc.

Referenced by examine().

## ◆ cleanup()

void cleanup | ( | void |  | ) |

Definition at line 244 of file enough.c.

References free, g, NULL, and string_free().

Referenced by main().

## ◆ count()

big_t count | ( | int | syms,
|  | int | left,
|  | int | len
| ) |  |

Definition at line 261 of file enough.c.

References assert, count, g, len, and map().

## ◆ enough()

void enough | ( | int | syms | ) |

Definition at line 454 of file enough.c.

References examine(), g, map(), and string_clear().

Referenced by main().

## ◆ examine()

void examine | ( | int | syms,
|  | int | left,
|  | int | len,
|  | int | mem,
|  | int | rem
| ) |  |

Definition at line 361 of file enough.c.

References assert, been_here(), bits(), examine(), g, len, string_clear(), and string_printf().

Referenced by enough(), and examine().

## ◆ main()

int main | ( | int argc | ,
|  | char ** | argv
| ) |  |

Definition at line 498 of file enough.c.

References argc, argv, assert, bits(), calloc, cleanup(), count, enough(), g, NULL, PRIbig, and string_init().

## ◆ map()

size_t map | ( | int | syms,
|  | int | left,
|  | int | len
| ) |  |
| inline

Definition at line 237 of file enough.c.

References g, and len.

Referenced by been_here(), count(), enough(), onig_renumber_name_table(), onigenc_apply_all_case_fold_with_map(), onigenc_get_case_fold_codes_by_str_with_map(), and rb_vm_bugreport().

## ◆ string_clear()

void string_clear | ( | string_t * | s | ) |

Definition at line 181 of file enough.c.

References string_t::len, and string_t::str.

Referenced by enough(), examine(), and string_init().

## ◆ string_free()

void string_free | ( | string_t * | s | ) |

Definition at line 195 of file enough.c.

References free, string_t::len, NULL, string_t::size, and string_t::str.

Referenced by cleanup().

## ◆ string_init()

void string_init | ( | string_t * | s | ) |

Definition at line 187 of file enough.c.

References assert, malloc, NULL, string_t::size, string_t::str, and string_clear().

Referenced by main().

## ◆ string_printf()

void string_printf | ( | string_t * | s,
|  | char * | fmt,
|  |  | ...
| ) |  |

Definition at line 204 of file enough.c.

References assert, len, string_t::len, NULL, realloc, string_t::size, string_t::str, and vsnprintf.

Referenced by examine().

## Variable Documentation

## ◆ code

int* code

Definition at line 231 of file enough.c.

## ◆ done

struct tab* done

Definition at line 233 of file enough.c.

## ◆

struct { ... } g

Referenced by __attribute__(), bar(), been_here(), cleanup(), count(), enough(), examine(), Init_ossl_dh(), Init_ossl_dsa(), main(), map(), rb_thread_create_ractor(), SHA256_Transform(), and SHA512_Transform().

## ◆ large

int large

Definition at line 227 of file enough.c.

## ◆ max

int max

Definition at line 225 of file enough.c.

Referenced by compress2(), gz_comp(), gz_load(), inflate_table(), inflate_table9(), log_compress(), lunpipe(), PACKED_STRUCT_UNALIGNED(), rb_block_arity(), rb_block_min_max_arity(), rb_block_pair_yield_optimizable(), rb_error_arity(), rb_method_entry_arity(), rb_obj_gc_flags(), rb_proc_arity(), rb_thread_fd_select(), rb_w32_fd_copy(), ruby_setenv(), and uncompress2().

## ◆ num

big_t* num

Definition at line 232 of file enough.c.

Referenced by asn1integer_to_num(), date_zone_to_diff(), gzip_normalize(), onig_scan_unsigned_number(), ossl_time_split(), rb_big2long(), rb_big2ulong(), rb_big_even_p(), rb_big_odd_p(), rb_cstr_to_rat(), rb_fix2short(), rb_fix2ushort(), rb_flo_div_flo(), rb_flo_is_finite_p(), rb_flo_is_infinite_p(), rb_float_ceil(), rb_float_div(), rb_float_floor(), rb_int_abs(), rb_int_bit_length(), rb_int_comp(), rb_int_even_p(), rb_int_negative_p(), rb_int_odd_p(), rb_int_positive_p(), rb_int_powm(), rb_int_succ(), rb_int_truncate(), rb_int_uminus(), rb_int_zero_p(), rb_ivar_count(), rb_nmin_run(), rb_num2short(), rb_num2ushort(), rb_num_negative_p(), rb_out_of_int(), rb_rational_abs(), rb_rational_pow(), rb_str_concat_literals(), rb_str_format(), rb_sym2id(), rb_time_interval(), rb_time_timespec_interval(), rb_w32_get_environ(), rb_w32_getprotobynumber(), and yyparse().

## ◆ out

string_t out

Definition at line 230 of file enough.c.

Referenced by def(), deflate_index_extract(), ffi_prep_closure_loc(), gunpipe(), gzcopy(), gzinit(), gzip_normalize(), gztack(), inf(), inflate(), inflate_fast(), inflateBack(), inflateBack9(), inflateSync(), lunpipe(), ossl_bin2hex(), permute(), put4(), rb_assert_failure(), rb_io_print(), rb_io_printf(), rb_io_puts(), and rb_ractor_stdout_set().

## ◆ root

int root

Definition at line 226 of file enough.c.

Referenced by getifaddrs(), inflate_table(), inflate_table9(), onig_compile_ruby(), onig_parse_make_tree(), rb_file_dirname(), rb_file_expand_path_internal(), and ruby_enc_find_basename().

## ◆ size

size_t size

Definition at line 228 of file enough.c.

## ◆ tot

big_t tot

Definition at line 229 of file enough.c.

Referenced by gzcopy(), gzinit(), gzscan(), and main().