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

◆ 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

Definition at line 231 of file enough.c.

◆ done

struct tab* done

Definition at line 233 of file enough.c.

◆ 

struct { ... } g

◆ large

int large

Definition at line 227 of file enough.c.

◆ max

int max

◆ num

big_t* num

◆ out

string_t out

◆ root

int root

◆ 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().