robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

bfredlMerge pull request #35206 from bfredl/nopreproc_cleanup38986188ba

master
2.0 KiB56 linesraw
1#pragma once
2
3#include <stdint.h>  // IWYU pragma: keep
4#include <stdio.h>  // IWYU pragma: keep
5#include <time.h>  // IWYU pragma: keep
6
7#include "nvim/eval/typval_defs.h"
8#include "nvim/ex_cmds_defs.h"  // IWYU pragma: keep
9#include "nvim/garray_defs.h"  // IWYU pragma: keep
10#include "nvim/os/fs_defs.h"  // IWYU pragma: keep
11#include "nvim/os/os_defs.h"  // IWYU pragma: keep
12#include "nvim/pos_defs.h"  // IWYU pragma: keep
13#include "nvim/types_defs.h"  // IWYU pragma: keep
14
15/// Values for readfile() flags
16enum {
17  READ_NEW        = 0x01,   ///< read a file into a new buffer
18  READ_FILTER     = 0x02,   ///< read filter output
19  READ_STDIN      = 0x04,   ///< read from stdin
20  READ_BUFFER     = 0x08,   ///< read from curbuf (converting stdin)
21  READ_DUMMY      = 0x10,   ///< reading into a dummy buffer
22  READ_KEEP_UNDO  = 0x20,   ///< keep undo info
23  READ_FIFO       = 0x40,   ///< read from fifo or socket
24  READ_NOWINENTER = 0x80,   ///< do not trigger BufWinEnter
25  READ_NOFILE     = 0x100,  ///< do not read a file, do trigger BufReadCmd
26};
27
28typedef varnumber_T (*CheckItem)(void *expr, const char *name);
29
30enum {
31  FIO_LATIN1 = 0x01,       ///< convert Latin1
32  FIO_UTF8 = 0x02,         ///< convert UTF-8
33  FIO_UCS2 = 0x04,         ///< convert UCS-2
34  FIO_UCS4 = 0x08,         ///< convert UCS-4
35  FIO_UTF16 = 0x10,        ///< convert UTF-16
36  FIO_ENDIAN_L = 0x80,     ///< little endian
37  FIO_NOCONVERT = 0x2000,  ///< skip encoding conversion
38  FIO_UCSBOM = 0x4000,     ///< check for BOM at start of file
39  FIO_ALL = -1,            ///< allow all formats
40};
41
42enum {
43  /// When converting, a read() or write() may leave some bytes to be converted
44  /// for the next call.  The value is guessed...
45  CONV_RESTLEN = 30,
46};
47
48enum { WRITEBUFSIZE = 8192, };  ///< size of normal write buffer
49
50enum {
51  /// We have to guess how much a sequence of bytes may expand when converting
52  /// with iconv() to be able to allocate a buffer.
53  ICONV_MULT = 8,
54};
55
56#include "fileio.h.generated.h"