Files
neovim/src/mbyte.h
scott-linder 0ef90c13b7 Removes 'proto' dir
See #137 for the issue.

Every header in the proto directory was:

* Given include guards in the form

    #ifndef NEOVIM_FILENAME_H
    #define NEOVIM_FILENAME_H
        ...
    #endif /* NEOVIM_FILENAM_H */

* Renamed from *.pro -> *.h
* Moved from src/proto/ to src/

This would have caused conficts with some existing headers in src/;
rather than merge these conflicts now (which is a whole other can of
worms involving multiple and conditional inclusion), any header in src/
with a conflicting name was renamed from *.h -> *_defs.h (which may or
may not actually describe its purpose, the change is purely a
namespacing issue).

Once all of these changes were made a script was developed to determine
what #includes needed to be added to each source file to describe its
dependencies and allow it to compile; because the script is so short
and I'll just list it here:

    #! /bin/bash

    cd $(dirname $0)

    # Scrapes `make` output for provided error messages and outputs #includes
    # needed to resolve them.
    #   $1 : part of the clang error message between filename and identifier
    list_missing_includes() {
        for file_missing_pair in $(CC=clang make 2>&1 >/dev/null | sed -n "s/\/\(.*\.[hc]\).*$1.*'\(.*\)'.*/\1:\2/p"); do
            fields=(${file_missing_pair//:/ })
            source_file=${fields[0]}
            missing_func=${fields[1]}
            # Try to find the declaration of the missing function.
            echo $(basename $source_file) \
                \#include \"$(grep -r "\b$missing_func __ARGS" | sed -n "s/.*\/\(.*\)\:.*/\1/p")\"
        # Remove duplicates
        done | sort | uniq
    }

    echo "Finding missing function prototypes..."
    list_missing_includes "implicit declaration of function"
    echo "Finding missing identifier declarations..."
    list_missing_includes "use of undeclared identifier"

Each list of required headers was added by hand in the following format:

    #include "vim.h"
    #include "*_defs.h"
    #include "filename.h"
    /* All other includes in same module here, in alphabetical order. */
    /* All includes from other modules (e.g. "os/*.h") here in alphabetical
     * order. */
2014-02-26 04:17:27 -03:00

104 lines
4.5 KiB
C

#ifndef NEOVIM_MBYTE_H
#define NEOVIM_MBYTE_H
/* mbyte.c */
int enc_canon_props __ARGS((char_u *name));
char_u *mb_init __ARGS((void));
int bomb_size __ARGS((void));
void remove_bom __ARGS((char_u *s));
int mb_get_class __ARGS((char_u *p));
int mb_get_class_buf __ARGS((char_u *p, buf_T *buf));
int dbcs_class __ARGS((unsigned lead, unsigned trail));
int latin_char2len __ARGS((int c));
int latin_char2bytes __ARGS((int c, char_u *buf));
int latin_ptr2len __ARGS((char_u *p));
int latin_ptr2len_len __ARGS((char_u *p, int size));
int utf_char2cells __ARGS((int c));
int latin_ptr2cells __ARGS((char_u *p));
int utf_ptr2cells __ARGS((char_u *p));
int dbcs_ptr2cells __ARGS((char_u *p));
int latin_ptr2cells_len __ARGS((char_u *p, int size));
int latin_char2cells __ARGS((int c));
int mb_string2cells __ARGS((char_u *p, int len));
int latin_off2cells __ARGS((unsigned off, unsigned max_off));
int dbcs_off2cells __ARGS((unsigned off, unsigned max_off));
int utf_off2cells __ARGS((unsigned off, unsigned max_off));
int latin_ptr2char __ARGS((char_u *p));
int utf_ptr2char __ARGS((char_u *p));
int mb_ptr2char_adv __ARGS((char_u **pp));
int mb_cptr2char_adv __ARGS((char_u **pp));
int arabic_combine __ARGS((int one, int two));
int arabic_maycombine __ARGS((int two));
int utf_composinglike __ARGS((char_u *p1, char_u *p2));
int utfc_ptr2char __ARGS((char_u *p, int *pcc));
int utfc_ptr2char_len __ARGS((char_u *p, int *pcc, int maxlen));
int utfc_char2bytes __ARGS((int off, char_u *buf));
int utf_ptr2len __ARGS((char_u *p));
int utf_byte2len __ARGS((int b));
int utf_ptr2len_len __ARGS((char_u *p, int size));
int utfc_ptr2len __ARGS((char_u *p));
int utfc_ptr2len_len __ARGS((char_u *p, int size));
int utf_char2len __ARGS((int c));
int utf_char2bytes __ARGS((int c, char_u *buf));
int utf_iscomposing __ARGS((int c));
int utf_printable __ARGS((int c));
int utf_class __ARGS((int c));
int utf_fold __ARGS((int a));
int utf_toupper __ARGS((int a));
int utf_islower __ARGS((int a));
int utf_tolower __ARGS((int a));
int utf_isupper __ARGS((int a));
int mb_strnicmp __ARGS((char_u *s1, char_u *s2, size_t nn));
void show_utf8 __ARGS((void));
int latin_head_off __ARGS((char_u *base, char_u *p));
int dbcs_head_off __ARGS((char_u *base, char_u *p));
int dbcs_screen_head_off __ARGS((char_u *base, char_u *p));
int utf_head_off __ARGS((char_u *base, char_u *p));
void mb_copy_char __ARGS((char_u **fp, char_u **tp));
int mb_off_next __ARGS((char_u *base, char_u *p));
int mb_tail_off __ARGS((char_u *base, char_u *p));
void utf_find_illegal __ARGS((void));
int utf_valid_string __ARGS((char_u *s, char_u *end));
int dbcs_screen_tail_off __ARGS((char_u *base, char_u *p));
void mb_adjust_cursor __ARGS((void));
void mb_adjustpos __ARGS((buf_T *buf, pos_T *lp));
char_u *mb_prevptr __ARGS((char_u *line, char_u *p));
int mb_charlen __ARGS((char_u *str));
int mb_charlen_len __ARGS((char_u *str, int len));
char_u *mb_unescape __ARGS((char_u **pp));
int mb_lefthalve __ARGS((int row, int col));
int mb_fix_col __ARGS((int col, int row));
char_u *enc_skip __ARGS((char_u *p));
char_u *enc_canonize __ARGS((char_u *enc));
char_u *enc_locale __ARGS((void));
int encname2codepage __ARGS((char_u *name));
void *my_iconv_open __ARGS((char_u *to, char_u *from));
int iconv_enabled __ARGS((int verbose));
void iconv_end __ARGS((void));
void im_set_active __ARGS((int active));
void xim_set_focus __ARGS((int focus));
void im_set_position __ARGS((int row, int col));
void xim_set_preedit __ARGS((void));
int im_get_feedback_attr __ARGS((int col));
void xim_init __ARGS((void));
void im_shutdown __ARGS((void));
int im_xim_isvalid_imactivate __ARGS((void));
void xim_reset __ARGS((void));
int xim_queue_key_press_event __ARGS((GdkEventKey *event, int down));
int im_get_status __ARGS((void));
int preedit_get_status __ARGS((void));
int im_is_preediting __ARGS((void));
void xim_set_status_area __ARGS((void));
int xim_get_status_area_height __ARGS((void));
int convert_setup __ARGS((vimconv_T *vcp, char_u *from, char_u *to));
int convert_setup_ext __ARGS((vimconv_T *vcp, char_u *from,
int from_unicode_is_utf8, char_u *to,
int to_unicode_is_utf8));
int convert_input __ARGS((char_u *ptr, int len, int maxlen));
int convert_input_safe __ARGS((char_u *ptr, int len, int maxlen, char_u **restp,
int *restlenp));
char_u *string_convert __ARGS((vimconv_T *vcp, char_u *ptr, int *lenp));
char_u *string_convert_ext __ARGS((vimconv_T *vcp, char_u *ptr, int *lenp,
int *unconvlenp));
/* vim: set ft=c : */
#endif /* NEOVIM_MBYTE_H */