aboutsummaryrefslogtreecommitdiff
path: root/src/mapgen/mg_biome.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapgen/mg_biome.cpp')
0 files changed, 0 insertions, 0 deletions
href='#n48'>48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
# serialize_lib API

## Serialization Library (serialize.lua)

### config table

Serialization functions accept a config table. Currently only one configuration option is defined.

    config = {
        	skip_empty_tables = false
        	-- used for write_to_fd/write_to_file
        	-- if true, does not store empty tables
        	-- On next read, keys that mapped to empty tables resolve to nil
    }

If you want to use all-default config options, you can pass `nil` as the config parameter.

### Serialization limits

  * Only strings, booleans, numbers and tables can be serialized, no functions or userdata
  * serialize_lib requires that no reference loops are present in the table to be serialized. Currently, when passing a table that has a reference loop, serialize_lib will produce a stack overflow.

### Functions

All of these functions call `error(<message>)` if an error occurs. Errors can be caught with `pcall()`.

#### write_to_fd(root_table, file, config)
Writes the contents of `root_table` to the file from the file handle given by `file`, and closes the file descriptor afterwards.