Everything 1.5 Plugin SDK

Plug-in and third party software discussion.
Post Reply
void
Developer
Posts: 18581
Joined: Fri Oct 16, 2009 11:31 pm

Everything 1.5 Plugin SDK

Post by void »

Download
Purpose
Samples
DLL Export
API
Plugin Messages
Future plans



Download
Everything-1.5-Plugin-SDK.zip



Purpose
The purpose of plugins is to move the ETP, FTP, HTTP and Everything servers out of the main program and into optional plugins.



Samples
ETP/FTP Server Source Code
HTTP Server Source Code



DLL Export

Your plugin should export the everything_plugin_proc function.

For example:

Code: Select all

__declspec( dllexport) void * EVERYTHING_PLUGIN_API everything_plugin_proc(DWORD msg,void *data)
{
	// msg is a EVERYTHING_PLUGIN_PM_* message.
	// data will depend on the EVERYTHING_PLUGIN_PM_* message.
	
	switch(msg)
	{
		...
	}
	
	// return data based on the EVERYTHING_PLUGIN_PM_* message.
	return (void *)0;
}
Everything will call this function with plugin messages.



API

Exported Everything plugin functions.

These functions can be retrived in EVERYTHING_PLUGIN_PM_INIT.

ansi_buf_copy_utf8_string
ansi_buf_init
ansi_buf_kill
config_get_int_value
config_set_int_value
db_add_local_ref
db_file_exists
db_find_close
db_find_first_file
db_find_get_count
db_find_next_file
db_folder_exists
db_get_indexed_fd
db_is_index_folder_size
db_journal_file_close
db_journal_file_open
db_journal_file_read
db_journal_file_would_block
db_journal_notification_register
db_journal_notification_unregister
db_onready_add
db_onready_remove
db_query_cancel
db_query_create
db_query_destroy
db_query_get_result_count
db_query_get_result_date_recently_changed
db_query_get_result_file_list_filename
db_query_get_result_indexed_fd
db_query_get_result_name
db_query_get_result_path
db_query_is_fast_sort
db_query_is_folder_result
db_query_search
db_query_search2
db_query_sort
db_release
db_remap_array_create
db_remap_array_destroy
db_remap_array_get_hashcode
db_remap_list_add
db_remap_list_create
db_remap_list_destroy
db_snapshot_create
db_snapshot_destroy
db_snapshot_file_close
db_snapshot_file_open
db_snapshot_file_read
db_snapshot_get_size
db_snapshot_is_out_of_date
db_would_block
debug_color_printf
debug_error_printf
debug_fatal2
debug_is_verbose
debug_printf
event_post
event_remove
ini_close
ini_find_keyvalue
ini_open
interlocked_dec
interlocked_get
interlocked_inc
interlocked_set
localization_get_en_us_string
localization_get_string
mem_alloc
mem_calloc
mem_free
network_recv
network_send
network_set_keepalive
network_set_nonblocking
network_set_tcp_nodelay
os_add_listbox_string_and_data
os_add_tooltip
os_browse_for_folder
os_center_dialog
os_clear_listbox
os_copy_memory
os_create_blank_dialog
os_create_button
os_create_checkbox
os_create_edit
os_create_group_box
os_create_listbox
os_create_number_edit
os_create_password_edit
os_create_static
os_create_tooltip
os_create_window
os_enable_or_disable_dlg_item
os_event_create
os_event_is_set
os_expand_dialog_text_logical_wide_no_prefix
os_filetime_to_localtime
os_force_ltr_edit
os_get_app_data_path_cat_filename
os_get_dlg_text
os_get_listbox_cur_sel
os_get_listbox_data
os_get_local_app_data_path_cat_filename
os_get_local_app_data_path_cat_make_filename
os_get_logical_high
os_get_logical_wide
os_get_open_file_name
os_get_save_file_name
os_get_system_time_as_file_time
os_get_volume_label
os_get_window_user_data
os_load_system_library
os_make_sure_path_to_file_exists
os_move_memory
os_open_file
os_open_url
os_register_class
os_registry_get_string
os_resize_file
os_set_default_button
os_set_dlg_rect
os_set_dlg_redraw
os_set_dlg_text
os_set_file_pointer
os_set_listbox_cur_sel
os_set_window_user_data
os_sort_MT
os_thread_cancel_synchronous_io
os_thread_create
os_thread_wait_and_close
os_winsock_WSAAsyncSelect
os_winsock_WSACleanup
os_winsock_WSACloseEvent
os_winsock_WSACreateEvent
os_winsock_WSAEnumNetworkEvents
os_winsock_WSAEventSelect
os_winsock_WSAGetLastError
os_winsock_WSARecv
os_winsock_WSAResetEvent
os_winsock_WSASend
os_winsock_WSASetEvent
os_winsock_WSAStartup
os_winsock_WSAWaitForMultipleEvents
os_winsock_accept
os_winsock_bind
os_winsock_closesocket
os_winsock_connect
os_winsock_freeaddrinfo
os_winsock_getaddrinfo
os_winsock_getpeername
os_winsock_getsockname
os_winsock_listen
os_winsock_ntohs
os_winsock_shutdown
os_winsock_socket
os_zero_memory
output_stream_append_file
output_stream_close
output_stream_write_printf
plugin_get_setting_int
plugin_get_setting_string
plugin_get_version
plugin_set_setting_int
plugin_set_setting_string
property_get_builtin_type
property_get_type
safe_uintptr_add
safe_uintptr_mul_sizeof_pointer
timer_create
timer_destroy
ui_options_add_plugin_page
ui_task_dialog_show
unicode_base64_index
unicode_hex_char
unicode_is_ascii_ws
unicode_is_digit
utf8_basic_string_free
utf8_basic_string_get_text_plain_file
utf8_buf_cat_c_list_utf8_string
utf8_buf_cat_utf8_string
utf8_buf_copy_utf8_string
utf8_buf_copy_utf8_string_n
utf8_buf_empty
utf8_buf_escape_html
utf8_buf_format_filetime
utf8_buf_format_peername
utf8_buf_format_qword
utf8_buf_format_size
utf8_buf_format_title
utf8_buf_grow_length
utf8_buf_init
utf8_buf_kill
utf8_buf_path_canonicalize
utf8_buf_path_cat_filename
utf8_buf_printf
utf8_buf_vprintf
utf8_string_alloc_utf8_string
utf8_string_alloc_utf8_string_n
utf8_string_compare
utf8_string_compare_nice_n_n
utf8_string_compare_nocase_n_n
utf8_string_compare_nocase_s_sla
utf8_string_copy_utf8_string
utf8_string_get_extension
utf8_string_get_length_in_bytes
utf8_string_get_path_part
utf8_string_get_win32_file_namespace
utf8_string_icompare
utf8_string_is_url_scheme_name_with_double_forward_slash
utf8_string_parse_c_item
utf8_string_parse_check
utf8_string_parse_csv_item
utf8_string_parse_qword
utf8_string_parse_sockaddr_in
utf8_string_parse_sockaddr_in6
utf8_string_realloc_utf8_string
utf8_string_realloc_utf8_string_n
utf8_string_skip_ascii_ws
utf8_string_to_dword
utf8_string_to_int
utf8_string_to_qword
version_get_build
version_get_major
version_get_minor
version_get_revision
version_get_text
wchar_buf_copy_utf8_string
wchar_buf_init
wchar_buf_kill



Plugin Messages

EVERYTHING_PLUGIN_PM_INIT
EVERYTHING_PLUGIN_PM_GET_PLUGIN_VERSION
EVERYTHING_PLUGIN_PM_GET_NAME
EVERYTHING_PLUGIN_PM_GET_DESCRIPTION
EVERYTHING_PLUGIN_PM_GET_AUTHOR
EVERYTHING_PLUGIN_PM_GET_VERSION
EVERYTHING_PLUGIN_PM_GET_LINK
EVERYTHING_PLUGIN_PM_START
EVERYTHING_PLUGIN_PM_STOP
EVERYTHING_PLUGIN_PM_KILL
EVERYTHING_PLUGIN_PM_UNINSTALL
EVERYTHING_PLUGIN_PM_ADD_OPTIONS_PAGES
EVERYTHING_PLUGIN_PM_LOAD_OPTIONS_PAGE
EVERYTHING_PLUGIN_PM_SAVE_OPTIONS_PAGE
EVERYTHING_PLUGIN_PM_GET_OPTIONS_PAGE_MINMAX
EVERYTHING_PLUGIN_PM_SIZE_OPTIONS_PAGE
EVERYTHING_PLUGIN_PM_OPTIONS_PAGE_PROC
EVERYTHING_PLUGIN_PM_KILL_OPTIONS_PAGE
EVERYTHING_PLUGIN_PM_SAVE_SETTINGS



Future plans

SQL Server
void
Developer
Posts: 18581
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 Plugin SDK

Post by void »

ansi_buf_copy_utf8_string

void ansi_buf_copy_utf8_string(everything_plugin_ansi_buf_t *acbuf,const utf8_t *s)


Copy a UTF-8 string into an ansi buf.

acbuf must be initialized with ansi_buf_init.

See also:
ansi_buf_init




ansi_buf_init

void ansi_buf_init(everything_plugin_ansi_buf_t *acbuf)


Initialize an ansi buf with an empty string.

The ansi buf must be killed with ansi_buf_kill.



ansi_buf_kill

void ansi_buf_kill(everything_plugin_ansi_buf_t *acbuf)


Kill an ansi buffer that was initialized with ansi_buf_init.
Frees any allocated memory back to the system.

See also:
ansi_buf_init



config_get_int_value

int config_get_int_value(const everything_plugin_utf8_t *name)


Get an Everything setting value by setting name.

Returns the integer value of the setting.

Example:
app_data = config_get_int_value("app_data");




config_set_int_value

int config_set_int_value(const everything_plugin_utf8_t *name,int value)


Set an Everything setting value by setting name.

Returns 1 if the setting was changed.
Returns 0 if the setting remains the same.

Example:
config_set_int_value("always_keep_sort",1);




db_add_local_ref

everything_plugin_db_t *db_add_local_ref(void)


Add a reference to the local database.
Call db_release to release the reference.

Must be called from the main thread.



db_file_exists

int db_file_exists(everything_plugin_db_t *db,const everything_plugin_utf8_t *filename)


Check if a file exists by full path and filename.
returns 1 if the file exists.
returns 0 if the file was not found.

Must be called from the main thread.

See also:
db_folder_exists



db_find_close

void db_find_close(everything_plugin_db_find_t *fh)


Close the find handle.
Call after a successful db_find_first_file call.

See also:
db_find_first_file
db_find_get_count
db_find_next_file



db_find_first_file

everything_plugin_db_find_t *db_find_first_file(everything_plugin_db_t *db,const everything_plugin_utf8_t *path,everything_plugin_utf8_buf_t *filename_cbuf,everything_plugin_fileinfo_fd_t *fd)


Search for files and folders in the specified folder path.
Returns a find handle if successful with information about the first file or folder.
Returns NULL if no file or folder was found.
Does not find . or .. folders.

Call db_find_close to release the find handle.
Call db_find_next_file to get the next file or folder information.

cbuf must be initialized with utf8_buf_init.

Example:

Code: Select all

everything_plugin_utf8_buf_t filename_cbuf;
everything_plugin_db_find_t *db_find;
everything_plugin_fileinfo_fd_t fileinfo_fd;

utf8_buf_init(&filename_cbuf);

db_find = db_find_first_file(db,"C:\\Windows",&filename_cbuf,&fileinfo_fd);
if (db_find)
{
	for(;;)
	{
		// do something with filename_cbuf.buf and fileinfo_fd.

		if (!db_find_next_file(db_find,&filename_cbuf,&fileinfo_fd))
		{
			break;
		}
	}

	db_find_close(db_find);
}

utf8_buf_kill(&filename_cbuf);
See also:
db_find_close
db_find_get_count
db_find_next_file
utf8_buf_init



db_find_get_count

uintptr_t db_find_get_count(everything_plugin_db_find_t *fh)


Return the number of found files and found folders.

See also:
db_find_close
db_find_first_file
db_find_next_file



db_find_next_file

int db_find_next_file(everything_plugin_db_find_t *fh,everything_plugin_utf8_buf_t *filename_cbuf,everything_plugin_fileinfo_fd_t *fd)


Find the next file.
Returns 1 if a file or folder is found.
Returns 0 if there are no more files or folders.

See also:
db_find_close
db_find_first_file
db_find_get_count



db_folder_exists

int db_folder_exists(everything_plugin_db_t *db,const everything_plugin_utf8_t *filename)


Check if a folder exists by full path and filename.
returns 1 if the folder exists.
returns 0 if the folder was not found.

Must be called from the main thread.

See also:
db_file_exists



db_get_indexed_fd

int db_get_indexed_fd(everything_plugin_db_t *db,const everything_plugin_utf8_t *filename,everything_plugin_fileinfo_fd_t *fd)


Lookup indexed file or folder information from the specified filename.
returns 1 if the file or folder exists.
returns 0 if the file or folder was not found.

Must be called from the main thread.



db_is_index_folder_size

int _plugin_db_is_index_folder_size(everything_plugin_db_t *db)


returns 1 if folder size indexing is enabled.
returns 0 if folder size indexing is disabled.

Must be called from the main thread.



db_journal_file_close

void db_journal_file_close(everything_plugin_db_journal_file_t *journal_file)


Close a journal file from a successful db_journal_file_open call.

Must be called from the main thread.

See also:
db_journal_file_open
db_journal_file_read
db_journal_file_would_block



db_journal_file_open

everything_plugin_db_journal_file_t *_plugin_db_journal_file_open(struct db_s *db,const struct db_remap_array_s *remap_array,EVERYTHING_PLUGIN_QWORD journal_id,EVERYTHING_PLUGIN_QWORD first_item_index)


Open a journal file with the specified remapping, journal id and first item index.

Returns a handle to a journal file.
Returns NULL if the journal id or first item index has been deleted.

Must be called from the main thread.

Example:

Code: Select all

everything_plugin_db_journal_file_t *journal_file;

journal_file = db_journal_file_open(db,remap_array,journal_id,first_item_index);
if (journal_file)
{
	db_journal_file_read(...);

	db_journal_file_close(journal_file);
}
See also:
db_journal_file_close
db_journal_file_read
db_journal_file_would_block



db_journal_file_read

int db_journal_file_read(everything_plugin_db_journal_file_t *journal_file,void *buf,uintptr_t len,uintptr_t *pnumread)


Return from the journal file.

Returns 1 if the read was successful.
Returns 0 if the journal or current read position was deleted.

Must be called from the main thread.

See also:
db_journal_file_close
db_journal_file_open
db_journal_file_would_block



db_journal_file_would_block

int db_journal_file_would_block(everything_plugin_db_journal_file_t *journal_file)


Returns 1 if reading from the journal file would block.
Returns 0 if more data is available for reading.

Must be called from the main thread.

See also:
db_journal_file_close
db_journal_file_open
db_journal_file_read



db_journal_notification_register

everything_plugin_db_journal_notification_t *db_journal_notification_register(everything_plugin_db_t *db,void *user_data,void (*callback_proc)(void *user_data))


Register for journal notifications.

Returns a journal notification handle.
Returns NULL if not enough memory.
The handle must be released with db_journal_notification_register

callback_proc is called from the main thread when a journal event occurs.
The supplied user_data is passed in the callback.

Must be called from the main thread.

See also:
db_journal_notification_register



db_journal_notification_unregister

void db_journal_notification_unregister(everything_plugin_db_journal_notification_t *journal_notification)


Unregister for journal notifications.

Must be called from the main thread.

See also:
db_journal_notification_register



db_onready_add

void db_onready_add(struct db_s *db,void (*callback_proc)(void *user_data),void *user_data)


Add a callback when the database is ready.

Must be called from the main thread.
The callback_proc is called from the main thread.

See also:
db_would_block



db_onready_remove

void db_onready_remove(struct db_s *db,void (*callback_proc)(void *user_data),void *user_data)


Remove an onready callback (if exists)

Must be called from the main thread.

See also:
db_onready_add



db_query_cancel

int db_query_cancel(everything_plugin_db_query_t *q)


Cancel a search, sort, read extended information or background content search.

Returns 1 if a query was canceled.
Returns 0 if there was nothing to cancel.

Any action in progress is cancelled before the call returns.
Returns immediately.

Must be called from the main thread.



db_query_create

everything_plugin_db_query_t *db_query_create(everything_plugin_db_t *db,void (*event_proc)(void *user_data,int type),void *user_data)


Create a query handler.

Supply an event_proc callback for query events.
Set to NULL if you don't want any callbacks.

Returns a pointer to a new query handler.
Returns NULL on error.

Must be called from the main thread.
Destroy the handler with db_query_destroy



db_query_destroy

void db_query_destroy(everything_plugin_db_query_t *q)


Destroy a query handler.

Must be called from the main thread.

See also:
db_query_create



db_query_get_result_count

uintptr_t db_query_get_result_count(const everything_plugin_db_query_t *q)


Returns the total number of results.

Must be called from the main thread.
The result list will be empty until a search is performed.



db_query_get_result_date_recently_changed

EVERYTHING_PLUGIN_QWORD db_query_get_result_date_recently_changed(everything_plugin_db_query_t *q,uintptr_t index)


Return the date recently changed as a FILETIME for the specified result index.
Returns EVERYTHING_PLUGIN_QWORD_MAX if unknown or if the index is invalid.

Must be called from the main thread.



db_query_get_result_file_list_filename

void db_query_get_result_file_list_filename(everything_plugin_db_query_t *q,uintptr_t index,everything_plugin_utf8_buf_t *cbuf)


Get the file list filename for the specified result index.
The cbuf will be set to an empty string if unknown or if the index is invalid.

Must be called from the main thread.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



db_query_get_result_indexed_fd

void db_query_get_result_indexed_fd(everything_plugin_db_query_t *q,uintptr_t index,everything_plugin_fileinfo_fd_t *fd)


Get the file information for the specified result index.
The file information is set to the invalid state if unknown or if the index is invalid.

Must be called from the main thread.



db_query_get_result_name

void db_query_get_result_name(everything_plugin_db_query_t *q,uintptr_t index,everything_plugin_utf8_buf_t *cbuf)


Get the name part for the specified result index.
The cbuf will be set to an empty string if unknown or if the index is invalid.

Must be called from the main thread.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



db_query_get_result_path

void db_query_get_result_path(everything_plugin_db_query_t *q,uintptr_t index,everything_plugin_utf8_buf_t *cbuf)


Get the path part for the specified result index.
The cbuf will be set to an empty string if unknown or if the index is invalid.

Must be called from the main thread.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



db_query_is_fast_sort

int db_query_is_fast_sort(everything_plugin_db_query_t *q,const everything_plugin_property_t *property_type)


Check if the specified property is fast sorted.

Returns 1 if fast sort is available.
Returns 0 if the sort would be slow.

Must be called from the main thread.



db_query_is_folder_result

int db_query_is_folder_result(everything_plugin_db_query_t *q,uintptr_t index)


Check if the specified result index is a folder.

Returns 1 if the result is a folder.
Returns 0 if the result is a file or if the index is invalid.

Must be called from the main thread.



db_query_search

void db_query_search(everything_plugin_db_query_t *q,int match_case,int match_whole_word,int match_path,int match_diacritics,int match_prefix,int match_suffix,int ignore_punctuation,int ignore_whitespace,int match_regex,int hide_empty_search_results,int clear_selection,int clear_item_refs,const everything_plugin_utf8_t *search_string,int fast_sort_only,const everything_plugin_property_t *sort_property_type,int sort_ascending,const everything_plugin_property_t *sort_property_type2,int sort_ascending2,const everything_plugin_property_t *sort_property_type3,int sort_ascending3,int folders_first,int track_selected_and_total_file_size,int track_selected_folder_size,int force,int allow_query_access,int allow_read_access,int allow_disk_access,int hide_omit_results,int size_standard,int sort_mix)


Execute a search with the specified search options.

clear_item_refs = clear focus and selection mark.
fast_sort_only = sort by name ascending if the specified sort is a slow sort.
sort_property_type = the sort property. Set to NULL to sort by Name ascending.
force = never use the existing results to perform a fast research.
allow_query_access = allow query access to files in the index.
allow_read_access = allow read access to files in the index.
allow_disk_access = allow read access to files outside the index.
size_standard = size standard for size: search.

Must be called from the main thread.



db_query_search2

void db_query_search2(everything_plugin_db_query_t *q,int match_case,int match_whole_word,int match_path,int match_diacritics,int match_prefix,int match_suffix,int ignore_punctuation,int ignore_whitespace,int match_regex,int hide_empty_search_results,int clear_selection,int clear_item_refs,const everything_plugin_utf8_t *search_string,DWORD filter_flags,const utf8_t *filter,const everything_plugin_utf8_t *filter_columns,const everything_plugin_property_t *filter_sort,int filter_sort_ascending,int filter_view,int fast_sort_only,const everything_plugin_property_t *sort_property_type,int sort_ascending,const everything_plugin_property_t *sort_property_type2,int sort_ascending2,const everything_plugin_property_t *sort_property_type3,int sort_ascending3,int folders_first,int dialog_center_x,int dialog_center_y,int track_selected_and_total_file_size,int track_selected_folder_size,int force,int allow_query_access,int allow_read_access,int allow_disk_access,int hide_omit_results,int size_standard,int match_treeview,int treeview_subfolders,int sort_mix)


Execute a search with the specified search options.

Same as db_query_search.

Except also supports treeview filtering.

Must be called from the main thread.



db_query_sort

void db_query_sort(everything_plugin_db_query_t *q,const everything_plugin_property_t *column_type,int ascending,const everything_plugin_property_t *column_type2,int ascending2,const everything_plugin_property_t *column_type3,int ascending3,int folders_first,int force,int find_duplicate_type,int sort_mix)


Sort results.

Must be called from the main thread.



db_release

uintptr_t db_release(everything_plugin_db_t *db)


Release a reference to a db.

Returns the reference count after releasing.

Must be called from the main thread.



db_remap_array_create

everything_plugin_db_remap_array_t *db_remap_array_create(everything_plugin_db_remap_list_t *remap_list)


Create a remap array from a remap list.

Returns a pointer to a remap array.
Returns NULL on error.



db_remap_array_destroy

void db_remap_array_destroy(everything_plugin_db_remap_array_t *remap_array)


Destroy a remap array created with db_remap_array_create.



db_remap_array_get_hashcode

EVERYTHING_PLUGIN_QWORD db_remap_array_get_hashcode(const everything_plugin_db_remap_array_t *remap_array)


Get the FNV-1a hash of a remap array.



db_remap_list_add

void db_remap_list_add(everything_plugin_db_remap_list_t *remap_list,const everything_plugin_utf8_t *path,uintptr_t path_len,const everything_plugin_utf8_t *mount,uintptr_t mount_len)


Add a path remapping to a remap list.

See also:
db_remap_list_create



db_remap_list_create

everything_plugin_db_remap_list_t *db_remap_list_create(void)


Create a remap list.

Returns a pointer to a remap list.
Returns NULL on error.

Call db_remap_list_destroy to destroy the remap list.

See also:
db_remap_list_add
db_remap_list_destroy



db_snapshot_create

everything_plugin_db_snapshot_t *db_snapshot_create(everything_plugin_db_t *db,const everything_plugin_db_remap_array_t *remap_array)


Create an index snapshot.

Returns a pointer to a snapshot.
Returns NULL on error.

Must be called from the main thread.
Call db_snapshot_destroy to destroy the snapshot.

See also:
db_snapshot_file_open
db_snapshot_get_size
db_snapshot_is_out_of_date



db_snapshot_destroy

void db_snapshot_destroy(everything_plugin_db_snapshot_t *snapshot)


Destroy a snapshot created with db_snapshot_create.

See also:
db_snapshot_create



db_snapshot_file_close

void db_snapshot_file_close(everything_plugin_db_snapshot_file_t *snapshot_file)


Close a snapshot file opened with db_snapshot_file_open.

See also:
db_snapshot_file_open



db_snapshot_file_open

everything_plugin_db_snapshot_file_t *db_snapshot_file_open(everything_plugin_db_snapshot_t *snapshot)


Open a file handle to a snapshot for reading.
After reading the snapshot, the file handle must be closed with db_snapshot_file_close.

See also:
db_snapshot_file_close
db_snapshot_create



db_snapshot_file_read

uintptr_t db_snapshot_file_read(everything_plugin_db_snapshot_file_t *snapshot_file,void *buf,uintptr_t len)


Read data from a snapshot.

Returns the number of bytes read.
Returns 0 if no more data is available.

See also:
db_snapshot_file_open



db_snapshot_get_size

uintptr_t db_snapshot_get_size(everything_plugin_db_snapshot_t *snapshot)


Get the size of the snapshot.

Returns the size of the snapshot in bytes.

See also:
db_snapshot_create



db_snapshot_is_out_of_date

int db_snapshot_is_out_of_date(const everything_plugin_db_snapshot_t *snapshot,struct db_s *db,const everything_plugin_db_remap_array_t *remap_array)


Check if a snapshot is out of date.

Returns 1 if out of date (Journal ID was deleted, journal item was deleted or remapping changed)
Returns 0 if the snapshot is still current.

See also:
db_snapshot_create



db_would_block

int db_would_block(everything_plugin_db_t *db)


Check if the database is busy.

Returns 1 if the database is busy and performing a db action would block.
Returns 0 if the database is ready.

Must be called from the main thread.
void
Developer
Posts: 18581
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 Plugin SDK

Post by void »

debug_color_printf

void debug_color_printf(DWORD color,const everything_plugin_utf8_t *format,...)


Print to the debug console.
Does nothing if the debug console is not shown.
Toggle the debug console under Tools -> Debug -> Console.

color format is: 0xAARRGGBB



debug_error_printf

void debug_error_printf(const everything_plugin_utf8_t *format,...)


Print an error message to the debug console.
Does nothing if the debug console is not shown.
Toggle the debug console under Tools -> Debug -> Console.



debug_fatal2

void debug_fatal2(const utf8_t *file,int line,const everything_plugin_utf8_t *function,const everything_plugin_utf8_t *format,...)


Terminate Everything with the specified message.
Does not return.

Code: Select all

#define DEBUG_FATAL(...) debug_fatal2((const everything_plugin_utf8_t *)__FILE__,__LINE__,(const everything_plugin_utf8_t *)__FUNCTION__,__VA_ARGS__)


debug_is_verbose

int debug_is_verbose(void)


Check if verbose debug messages should be printed.

Returns 1 if in verbose debug mode.
Returns 0 if in normal debug mode.



debug_printf

void debug_printf(const everything_plugin_utf8_t *format,...)


Print a message to the debug console.
Does nothing if the debug console is not shown.
Toggle the debug console under Tools -> Debug -> Console.



event_post

void event_post(void (*callback_proc)(void *user_data),void *user_data)


Add an event to be called back from the main thread.

event_post can be called from any thread.
The callback_proc is always called back from the main thread.

Only one event can be added for callback_proc and user_data.
Does nothing if a pending event already exists with callback_proc and user_data.

See also event_remove



event_remove

void event_remove(void (*callback_proc)(void *user_data),void *user_data)


Remove an event added with event_post.
Does nothing if the event doesn't exist.

Can be called from any thread.
If called from main thread, the callback_proc is guaranteed NOT to be called.
If called from non-main thread, the callback_proc might be called after being removed.

See also event_post



ini_close

void ini_close(everything_plugin_ini_t *ini)


Close an ini handle from a successful ini_open call.

See also ini_open



ini_find_keyvalue

int ini_find_keyvalue(ini_t *ini,const everything_plugin_utf8_t *nocase_ascii_key,everything_plugin_utf8_const_string_t *value_string)


Get a key/value pair from the specified ini.

Returns 1 if the key was found.
Returns 0 if the key was not found.

The key is case sensitive.

See also ini_open



ini_open

ini_t *ini_open(everything_plugin_utf8_t *s,const everything_plugin_utf8_t *lowercase_ascii_section)


Open an ini from the specified string and section.

Returns a pointer to an ini handle.
Returns NULL if section was not found.

The section must be specified in lowercase and with ASCII characters only.
The ini handle must be freed with ini_close

See also ini_find_keyvalue
See also ini_close



interlocked_dec

uintptr_t interlocked_dec(everything_plugin_interlocked_t *interlocked)


Decrement a uintptr_t value by one.
The function prevents more than one thread from using the same variable simultaneously.

Returns the decremented value.



interlocked_inc

uintptr_t _plugin_interlocked_inc(everything_plugin_interlocked_t *interlocked)


Increment a uintptr_t value by one.
The function prevents more than one thread from using the same variable simultaneously.

Returns the incremented value.



interlocked_get

uintptr_t _plugin_interlocked_get(everything_plugin_interlocked_t *interlocked)


Get the value from an interlocked value.
The function prevents more than one thread from using the same variable simultaneously.

Returns the interlocked value.



interlocked_set

void interlocked_set(everything_plugin_interlocked_t *interlocked,uintptr_t value)


Initialize an interlocked value with the specified value.
The function prevents more than one thread from using the same variable simultaneously.



localization_get_en_us_string

const everything_plugin_utf8_t *localization_get_en_us_string(int id)


Get the English (US) localization string from the specified localization ID.

Returns the English (US) UTF-8 string.
Returns an empty string if the specified localization ID is invalid.

See also localization_get_string



localization_get_string

const everything_plugin_utf8_t *localization_get_string(int id)


Get the localization string from the specified localization ID.

Returns the localized UTF-8 string.
Returns an empty string if the specified localization ID is invalid.



mem_alloc

void *mem_alloc(uintptr_t size)


Allocate memory from system.

Returns a pointer to the allocated memory..

size should be 65536 or less.
Everything will terminate if there is not enough memory available.
Everything will terminate if size is EVERYTHING_PLUGIN_UINTPTR_MAX
Free the allocated memory with mem_free.
Use safe uintptr arithmatic on size.

See also mem_free
See also safe_uintptr_add



mem_calloc

void *mem_calloc(uintptr_t size)


Allocate and clear memory from system.

Returns a pointer to the allocated memory..

size should be 65536 or less.
Everything will terminate if there is not enough memory available.
Everything will terminate if size is EVERYTHING_PLUGIN_UINTPTR_MAX
Free the allocated memory with mem_free.
Use safe uintptr arithmatic on size.

See also mem_alloc
See also mem_free
See also safe_uintptr_add



mem_free

void mem_free(void *ptr)


Return allocated memory back to the system.

See also mem_alloc
See also mem_calloc



network_recv

int network_recv(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,void *buf,uintptr_t len)


Receive data from a socket.

Returns 1 if all data was read successfully.
Returns 0 on failure.

Blocks until all data is read.



network_send

int network_send(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,const void *data,uintptr_t len)


Send data to a socket.

Returns 1 if all data was sent successfully.
Returns 0 on failure.

Blocks until all data is sent.



network_set_keepalive

void network_set_keepalive(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET socket_handle)


Enable TCP/IP keepalive on the specified socket.



network_set_nonblocking

int network_set_nonblocking(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET socket_handle)


Set the specified socket to nonblocking mode.

Returns 1 if successful.
Returns 0 on failure.



network_set_tcp_nodelay

void network_set_tcp_nodelay(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET socket_handle)


Enable TCP/IP no delay on the specified socket.
void
Developer
Posts: 18581
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 Plugin SDK

Post by void »

os_add_listbox_string_and_data

int os_add_listbox_string_and_data(HWND parent_hwnd,int id,const everything_plugin_utf8_t *s,const void *data)


Add a string with reference data to a listbox.

Returns the index of the added string.
Returns LB_ERR on failure.

Updates the horizontal extent.



os_add_tooltip

void os_add_tooltip(HWND tooltip_hwnd,HWND parent_hwnd,int id,const everything_plugin_utf8_t *text)


Add a tooltip to a tooltip window.



os_browse_for_folder

int os_browse_for_folder(HWND parent_hwnd,const everything_plugin_utf8_t *title,const everything_plugin_utf8_t *default_folder,everything_plugin_utf8_buf_t *cbuf)


Show the modern system browse for folder dialog.

Returns 1 if a folder is selected successful.
Returns 0 if cancelled by the user.

title can be NULL.
default_folder can be NULL.
The selected folder path is stored in cbuf.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init


os_center_dialog

void os_center_dialog(HWND parent_hwnd,HWND hwnd,int client_logical_wide,int client_logical_high)


Center the specified window relative to parent_hwnd.

If parent_hwnd is NULL the primary desktop is used.



os_clear_listbox

void os_clear_listbox(HWND parent_hwnd,int id)


Clear all items in a listbox.
Also resets the horizontal extent.



os_copy_memory

void os_copy_memory(void *dst,const void *src,uintptr_t size)


Copy memory from one location to another.

CopyMemory wrapper.


os_create_blank_dialog

void *os_create_blank_dialog(HWND parent_hwnd,const everything_plugin_utf8_t *class_name,const everything_plugin_utf8_t *title,int resizable,int modeless,DWORD extra_ex_style,DWORD extra_style,DLGPROC proc,void *param)


Create a blank dialog.

Returns the window handle if modeless.
Otherwise, returns the result from EndDialog.

class_name can be NULL.



os_create_button

HWND os_create_button(HWND parent_hwnd,int id,DWORD extra_window_style,const everything_plugin_utf8_t *text)


Creates a button dialog control.

Returns the button control window handle.

Sets the default dialog font.



os_create_edit

HWND os_create_edit(HWND parent_hwnd,int id,DWORD extra_style,const everything_plugin_utf8_t *text)


Creates an edit dialog control.

Returns the edit control window handle.

Sets the default dialog font.



os_create_group_box

HWND os_create_group_box(HWND parent_hwnd,int id,const everything_plugin_utf8_t *text)


Creates an group box dialog control.

Returns the group box control window handle.

Sets the default dialog font.



os_create_listbox

HWND os_create_listbox(HWND parent_hwnd,int id,DWORD extra_style)


Creates an listbox dialog control.

Returns the listbox control window handle.

Sets the default dialog font.


os_create_number_edit

HWND os_create_number_edit(HWND parent_hwnd,int id,DWORD extra_style,__int64 number)


Creates an edit dialog control with the ES_NUMBER style.

Returns the edit control window handle.

Sets the default dialog font.



os_create_password_edit

HWND os_create_password_edit(HWND parent_hwnd,int id,DWORD extra_style,const everything_plugin_utf8_t *text)


Creates an edit dialog control with the ES_PASSWORD style.

Returns the edit control window handle.

Sets the default dialog font.



os_create_static

HWND os_create_static(HWND parent_hwnd,int id,DWORD extra_window_style,const everything_plugin_utf8_t *text)


Creates a static text dialog control.

Returns the static control window handle.

Sets the default dialog font.



os_create_tooltip

HWND os_create_tooltip(void)


Creates a tooltip dialog control.

Returns the tooltip control window handle.

Sets the default dialog font.

See also:
os_add_tooltip



os_create_window

HWND os_create_window(DWORD dwExStyle,const everything_plugin_utf8_t *lpClassName,const everything_plugin_utf8_t *lpWindowName,DWORD dwStyle,int x,int y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam)


Creates a window.

Returns the window handle.



os_enable_or_disable_dlg_item

void os_enable_or_disable_dlg_item(HWND parent_hwnd,int id,int enable)


Enable or disable a dialog control.



os_event_create

HANDLE os_event_create(void)


Creates an unnamed event with manual reset and the initial state set to FALSE.

Returns the event handle.

The handle is always created.
Otherwise, Everything will exit with a fatal error.



os_event_is_set

int os_event_is_set(HANDLE h)


Check if an event has been set.

Returns 1 if the event is set.
Returns 0 if the event is not set.



os_expand_dialog_text_logical_wide_no_prefix

int os_expand_dialog_text_logical_wide_no_prefix(HWND parent_hwnd,const utf8_t *text,int wide)(HANDLE h)


Expands wide in logical pixels to accommodate room for the specified text using the default dialog font.

Returns the new width in logical pixels.

Use to keep dialog buttons widths consistent.



os_filetime_to_localtime

int os_filetime_to_localtime(SYSTEMTIME *localst,EVERYTHING_PLUGIN_QWORD ft)


Convert a filetime to a local system time using the correct day light savings.

Returns 1 if the conversion was successful.
Returns 0 on failure.



os_force_ltr_edit

void os_force_ltr_edit(HWND parent_hwnd,int id)


Force an edit dialog control to read left to right, even for RTL windows.

Ideal for edit boxes that specify paths.



os_get_app_data_path_cat_filename

void os_get_app_data_path_cat_filename(const everything_plugin_utf8_t *filename,everything_plugin_utf8_buf_t *cbuf)


Build the setting or data full path using the specified filename.

The full path is stored in cbuf.
This will either be %APPDATA%\Everything\filename or filename in the same location as your Everything.exe
Depending on your app_data setting.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init


os_get_dlg_text

void os_get_dlg_text(HWND parent_hwnd,int id,everything_plugin_utf8_buf_t *cbuf)


Get the text from the specified dialog control.

The text is stored in cbuf.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init


os_get_listbox_cur_sel

int os_get_listbox_cur_sel(HWND parent_hwnd,int id)


Get the current selection from the specified listbox dialog control.

Returns the current selection index.
Otherwise returns LB_ERR.



os_get_listbox_data

void *os_get_listbox_data(HWND parent_hwnd,int id,int index)


Get the user data associated with a listbox item.

Returns a pointer to the user data.
Returns NULL if index was not valid.



os_get_local_app_data_path_cat_filename

int os_get_local_app_data_path_cat_filename(const everything_plugin_utf8_t *filename,everything_plugin_utf8_buf_t *cbuf)


Build the data full path using the specified filename.

The full path is stored in cbuf.
This will either be %LOCALAPPDATA%\Everything\filename or filename in the same location as your Everything.exe
Depending on your app_data setting.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



os_get_local_app_data_path_cat_make_filename

void os_get_local_app_data_path_cat_make_filename(const everything_plugin_utf8_t *stem,const everything_plugin_utf8_t *extension,everything_plugin_utf8_buf_t *cbuf)


Build the data full path using the specified stem and extension.

The full path is stored in cbuf.
This will either be %LOCALAPPDATA%\Everything\stem.extension or stem.extension in the same location as your Everything.exe
Depending on your app_data setting.
extension should include the dot (.)
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



os_get_logical_high

int os_get_logical_high(void)


Returns the logical high multiplier.

Multiply by this number and divide by 96 to convert logical pixels to device pixels.



os_get_logical_wide

int os_get_logical_wide(void)


Returns the logical wide multiplier.

Multiply by this number and divide by 96 to convert logical pixels to device pixels.



os_get_open_file_name

int os_get_open_file_name(HWND parent_hwnd,const everything_plugin_utf8_t *title,const everything_plugin_utf8_t *initial_file,const everything_plugin_utf8_t *filter,uintptr_t filter_len,DWORD filter_index,const everything_plugin_utf8_t *default_extension,DWORD *out_filter_index,everything_plugin_utf8_buf_t *cbuf)


Show the modern system open file dialog.

Returns 1 if the user selected a file and clicked Open.
Returns 0 if the user cancelled the dialog.

title can be NULL.
initial_file can be NULL.
filter_len is the length of filter in UTF-8 bytes.
default_extension can be NULL.
default_extension should not include the dot (.)
The selected filename is stored in cbuf.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



os_get_open_file_name

int _plugin_os_get_save_file_name(HWND parent_hwnd,const everything_plugin_utf8_t *title,const everything_plugin_utf8_t *initial_file,everything_plugin_utf8_t *filter,uintptr_t filter_len,DWORD filter_index,const everything_plugin_utf8_t *default_extension,DWORD *out_filter_index,everything_plugin_utf8_buf_t *cbuf)


Show the modern system save as dialog.

Returns 1 if the user chose a filename and clicked Save.
Returns 0 if the user cancelled the dialog.

title can be NULL.
initial_file can be NULL.
filter_len is the length of filter in UTF-8 bytes.
default_extension can be NULL.
default_extension should not include the dot (.)
The selected filename is stored in cbuf.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



os_get_system_time_as_file_time

EVERYTHING_PLUGIN_QWORD os_get_system_time_as_file_time(void)


Returns the current system time as a filetime.



os_get_volume_label

void os_get_volume_label(const everything_plugin_utf8_t *volume_path,everything_plugin_utf8_buf_t *cbuf)


Gets the volume label from the specified volume path.

The volume label is stored in cbuf.
If there is no label, the default label based on the drive type is return. (for example: Local Disk)
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



os_get_window_user_data

void *os_get_window_user_data(HWND hwnd)


Return a pointer to user data from the specified window handle.



os_load_system_library

HMODULE os_load_system_library(const utf8_t *filename)


Safely load a system DLL.

Returns a module handle to the specified DLL.



os_make_sure_path_to_file_exists

void os_make_sure_path_to_file_exists(const everything_plugin_utf8_t *file_name)


Make sure the path to filename exists.
Any missing folders are created.



os_move_memory

void os_move_memory(void *dst,const void *src,uintptr_t size)


Copy memory with possible overlap.

MoveMemory wrapper.



os_open_file

HANDLE os_open_file(const everything_plugin_utf8_t *filename)


Open a file handle to the specified file.

Returns a handle to a file.
Returns INVALID_FILE_HANDLE if the file was not found.

The file is opened with GENERIC_READ access.
The file is opened with FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE sharing.
The file is opened with FILE_FLAG_SEQUENTIAL_SCAN.



os_open_url

void os_open_url(const everything_plugin_utf8_t *url)


Open the specified url in the default web browser.

http:// links are converted to https:// links.
https:// is added if not specified.



os_register_class

void os_register_class(UINT style,const everything_plugin_utf8_t *lpszClassName,WNDPROC lpfnWndProc,uintptr_t window_extra,HICON hIcon,HICON hIconSm,HCURSOR hcursor)


Register a window class name.



os_registry_get_string

int os_registry_get_string(HKEY root,const everything_plugin_utf8_t *key,const everything_plugin_utf8_t *value,everything_plugin_utf8_buf_t *cbuf)


Get a string value from the Windows registry.

Returns 1 if successful.
Returns 0 on failure.

The resulting value is stored in cbuf.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



os_resize_file

void os_resize_file(const everything_plugin_utf8_t *filename,uintptr_t max_size,uintptr_t delta_size)


Resize a log file.

If the file is larger than max_size, delta_size is removed from the start of the file.
Only whole lines are removed. Slightly more than delta_size can be removed from the start of the file.



os_set_default_button

void os_set_default_button(HWND parent_hwnd,int id)


Set the default dialog control.



os_set_default_button

void os_set_default_button(HWND parent_hwnd,int id)


Set the default dialog control.



os_set_dlg_rect

void os_set_dlg_rect(HWND parent_hwnd,int id,int x,int y,int wide,int high)


Set the default dialog control size and position in logical pixels.



os_set_dlg_redraw

void os_set_dlg_redraw(HWND parent_hwnd,int id,BOOL redraw)


Enable or disable redrawing for the specified dialog control.
If enabling redraw, the window and all child windows are invalidated.



os_set_dlg_text

int os_set_dlg_text(HWND hDlg,int nIDDlgItem,const everything_plugin_utf8_t *s)


Set the dialog control text field.

Returns 1 if successful.
Returns 0 on failure.



os_set_file_pointer

int os_set_file_pointer(HANDLE h,EVERYTHING_PLUGIN_QWORD position,int move_method)


Set the file read position.

Returns 1 if successful.
Returns 0 on failure.

move_method can be one of the following:
FILE_BEGIN0The starting point is 0 (zero) or the beginning of the file.
FILE_CURRENT1The starting point is the current value of the file pointer.
FILE_END2The starting point is the current end-of-file position.


os_set_listbox_cur_sel

void os_set_listbox_cur_sel(HWND parent_hwnd,int id,int index)


Set the listbox dialog control current selection.



os_set_window_user_data

void os_set_window_user_data(HWND hwnd,void *user_data)


Set the window user data pointer.



os_sort_MT

void os_sort_MT(void **indexes,uintptr_t count,int (*compare_proc)(const void *,const void *))


Perform a multi-threaded (MT) sort.

Like qsort, except indexes are used instead of data.



os_thread_cancel_synchronous_io

void os_thread_cancel_synchronous_io(everything_plugin_os_thread_t *thread)


Cancel any synchronous IO in progress.

A CancelSynchronousIo wrapper.



os_thread_create

everything_plugin_os_thread_t *os_thread_create(DWORD (WINAPI *thread_proc)(void *),void *param)


Create a thread.

Returns a pointer to the thread handle.

Everything will throw a fatal error if there is not enough system resources.

Threads are allocated from a pool of threads.
The returned thread will always start with THREAD_PRIORITY_NORMAL priority.
The thread is initialized with CoInitializeEx(NULL,COINIT_APARTMENTTHREADED);

Closing a thread will add it back to the pool of threads.

See also:
os_thread_wait_and_close



os_thread_wait_and_close

void os_thread_wait_and_close(everything_plugin_os_thread_t *t)


Wait for the thread to complete and close the thread handle.
The thread is added to the thread pool to be reused.
The thread priority is reset.



os_winsock_WSAAsyncSelect

int os_winsock_WSAAsyncSelect(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,HWND hWnd,unsigned int wMsg,long lEvent)


WSAAsyncSelect wrapper.



os_winsock_WSACleanup

int os_winsock_WSACleanup(void)


WSACleanup wrapper.



os_winsock_WSACloseEvent

BOOL os_winsock_WSACloseEvent(EVERYTHING_PLUGIN_OS_WINSOCK_WSAEVENT hEvent)


WSACloseEvent wrapper.



os_winsock_WSACreateEvent

EVERYTHING_PLUGIN_OS_WINSOCK_WSAEVENT os_winsock_WSACreateEvent(void)


WSACreateEvent wrapper.



os_winsock_WSAEnumNetworkEvents

int os_winsock_WSAEnumNetworkEvents(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,EVERYTHING_PLUGIN_OS_WINSOCK_WSAEVENT hEventObject,EVERYTHING_PLUGIN_OS_WINSOCK_WSANETWORKEVENTS *lpNetworkEvents)


WSAEnumNetworkEvents wrapper.



os_winsock_WSAEventSelect

int os_winsock_WSAEventSelect(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,EVERYTHING_PLUGIN_OS_WINSOCK_WSAEVENT hEventObject,long lNetworkEvents)


WSAEventSelect wrapper.



os_winsock_WSAGetLastError

int os_winsock_WSAGetLastError(void)


WSAGetLastError wrapper.



os_winsock_WSARecv

int os_winsock_WSARecv(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,EVERYTHING_PLUGIN_OS_WINSOCK_WSABUF *lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesRecvd,DWORD *lpFlags,EVERYTHING_PLUGIN_OS_WINSOCK_LPWSAOVERLAPPED lpOverlapped,EVERYTHING_PLUGIN_OS_WINSOCK_LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)


WSARecv wrapper.



os_winsock_WSAResetEvent

BOOL os_winsock_WSAResetEvent(EVERYTHING_PLUGIN_OS_WINSOCK_WSAEVENT hEvent)


WSAResetEvent wrapper.



os_winsock_WSASend

int os_winsock_WSASend(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,EVERYTHING_PLUGIN_OS_WINSOCK_WSABUF *lpBuffers,DWORD dwBufferCount,LPDWORD lpNumberOfBytesSent,DWORD dwFlags,EVERYTHING_PLUGIN_OS_WINSOCK_LPWSAOVERLAPPED lpOverlapped,EVERYTHING_PLUGIN_OS_WINSOCK_LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)


WSASend wrapper.



os_winsock_WSASetEvent

BOOL os_winsock_WSASetEvent(EVERYTHING_PLUGIN_OS_WINSOCK_WSAEVENT hEvent)


WSASetEvent wrapper.



os_winsock_WSAStartup

int os_winsock_WSAStartup(WORD wVersionRequested,EVERYTHING_PLUGIN_OS_WINSOCK_WSADATA *lpWSAData)


WSAStartup wrapper.

1.1 for wVersionRequested is recommended for the best compatibility with other plugins.



os_winsock_WSAWaitForMultipleEvents

DWORD os_winsock_WSAWaitForMultipleEvents(DWORD cEvents,const EVERYTHING_PLUGIN_OS_WINSOCK_WSAEVENT *lphEvents,BOOL fWaitAll,DWORD dwTimeout,BOOL fAlertable)


WSAWaitForMultipleEvents wrapper.



os_winsock_accept

EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET os_winsock_accept(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,struct everything_plugin_os_winsock_sockaddr *addr,int *addrlen)


accept wrapper.



os_winsock_bind

int os_winsock_bind(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,const struct everything_plugin_os_winsock_sockaddr *name,int namelen)


bind wrapper.



os_winsock_closesocket

int os_winsock_closesocket(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s)


closesocket wrapper.



os_winsock_connect

int os_winsock_connect(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,const struct everything_plugin_os_winsock_sockaddr *name,int namelen)


connect wrapper.



os_winsock_freeaddrinfo

void os_winsock_freeaddrinfo(struct everything_plugin_os_addrinfo *ai)


freeaddrinfo wrapper.



os_winsock_getaddrinfo

int os_winsock_getaddrinfo(const char *nodename,const char *servname,const struct everything_plugin_os_addrinfo *hints,struct everything_plugin_os_addrinfo **res)


getaddrinfo wrapper.



os_winsock_getpeername

int os_winsock_getpeername(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,struct everything_plugin_os_winsock_sockaddr *name,int *namelen)


getpeername wrapper.



os_winsock_getsockname

int os_winsock_getsockname(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,struct everything_plugin_os_winsock_sockaddr *name,int *namelen)


getsockname wrapper.



os_winsock_listen

int os_winsock_listen(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,int backlog)


listen wrapper.



os_winsock_ntohs

unsigned short os_winsock_ntohs(unsigned short netshort)


ntohs wrapper.



os_winsock_shutdown

int os_winsock_shutdown(EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET s,int how)


shutdown wrapper.



os_winsock_socket

EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET os_winsock_socket(int af,int type,int protocol)


socket wrapper.



os_zero_memory

void os_zero_memory(void *ptr,uintptr_t size)


Zero memory at the specified address with the specified size.

ZeroMemory wrapper.
void
Developer
Posts: 18581
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 Plugin SDK

Post by void »

output_stream_append_file

everything_plugin_output_stream_t *output_stream_append_file(const everything_plugin_utf8_t *filename)


Create an output stream that is appended to the specified file by filename.

Returns a pointer to an output stream.

Close the stream with output_stream_close

See also:
output_stream_write_printf
output_stream_close



output_stream_close

void output_stream_close(everything_plugin_output_stream_t *s)


Close an output stream created with output_stream_append_file.



output_stream_write_printf

void output_stream_write_printf(everything_plugin_output_stream_t *output_stream,const everything_plugin_utf8_t *format,...)


Write formatted text to an output stream.

See also:
output_stream_append_file
utf8_buf_printf



plugin_get_setting_int

int plugin_get_setting_int(struct everything_plugin_sorted_list_s *sorted_list,const everything_plugin_utf8_t *name,int current_value)


Get an int setting value by name from the specified setting sorted list.

Returns the int value.

current_value is returned if the setting value was not found.



plugin_get_setting_string

everything_plugin_utf8_t *plugin_get_setting_string(struct everything_plugin_sorted_list_s *sorted_list,const everything_plugin_utf8_t *name,everything_plugin_utf8_t *current_string)


Get an string setting value by name from the specified setting sorted list.

Returns a pointer to the string value.

current_value is returned if the setting value was not found.



get_version

DWORD get_version(void)


Returns the plugin version. (Version 1)



plugin_set_setting_int

void plugin_set_setting_int(everything_plugin_output_stream_t *output_stream,const everything_plugin_utf8_t *name,int value)


Writes an int setting value with the specified name to the specified output stream.



plugin_set_setting_string

plugin_set_setting_string(everything_plugin_output_stream_t *output_stream,const everything_plugin_utf8_t *name,const everything_plugin_utf8_t *value)


Writes a string setting value with the specified name to the specified output stream.



property_get_builtin_type

const everything_plugin_property_t *property_get_builtin_type(int property_id)


Returns a pointer to a built-in property type from the specified property ID.
Returns NULL if property ID is invalid.

See also:
Property IDs.



property_get_type

int property_get_type(const everything_plugin_property_t *property_type)


Return the property ID from the specified property type.

See also:
Property IDs.



safe_uintptr_add

uintptr_t safe_uintptr_add(uintptr_t a,uintptr_t b)


Returns a + b
Returns EVERYTHING_PLUGIN_UINTPTR_MAX if an overflow occurs.

A value of EVERYTHING_PLUGIN_UINTPTR_MAX should be treated as an error.



safe_uintptr_mul_sizeof_pointer

uintptr_t safe_uintptr_mul_sizeof_pointer(uintptr_t a)


Returns a * sizeof(void *)
Returns EVERYTHING_PLUGIN_UINTPTR_MAX if an overflow occurs.

A value of EVERYTHING_PLUGIN_UINTPTR_MAX should be treated as an error.



timer_create

everything_plugin_timer_t *timer_create(void (*callback_proc)(void *user_data),void *user_data,DWORD elapsed_milliseconds)


Returns a pointer to a new timer handle.

Everything will exit with a fatal message if there is not enough memory.
After elapsed_milliseconds has elapsed, the callback_proc is called from the main thread.
timer_create can be called from any thread.
Destroy the timer with timer_destroy.
Destroying the timer will cancel any pending callback.

See also:
timer_destroy



timer_destroy

void timer_destroy(everything_plugin_timer_t *timer)


Destroy a timer created with timer_create.

If called from the MAIN thread, the timer callback_proc is NEVER called.
If called from a non-MAIN thread, the timer callback_proc might be called after being destroyed.

See also:
timer_create



ui_options_add_plugin_page

struct _ui_options_page_s *ui_options_add_plugin_page(struct _ui_options_add_custom_page_s *add_custom_page,void *user_data,const everything_plugin_utf8_t *name)


Add a custom option page.

Call while inside EVERYTHING_PLUGIN_PM_ADD_OPTIONS_PAGES.

See also:
EVERYTHING_PLUGIN_PM_ADD_OPTIONS_PAGES



ui_task_dialog_show

int ui_task_dialog_show(HWND parent_hwnd,UINT flags,const everything_plugin_utf8_t *caption,const everything_plugin_utf8_t *main_task,const everything_plugin_utf8_t *format,...)


Returns the button ID of the button clicked.
Returns IDCANCEL if the user cancelled the dialog.

Show a Yes/No/Cancel dialog.
flags can be one or more of the MessageBox flags.



unicode_base64_index

int unicode_base64_index(int c)


Returns the base64 value for the specified character.
Returns 0 for unknown characters.

Supports +/ and -_ variants.



unicode_hex_char

int unicode_hex_char(int value)


Returns the hex character for the specified hex value (0-15).

Uppercase letters are used.



unicode_is_ascii_ws

int unicode_is_ascii_ws(int c)


Returns 1 if Unicode c is a ASCII whitespace.
Otherwise, returns 0.



unicode_is_digit

int unicode_is_digit(int c)


Returns 1 if c is '0' - '9'
Otherwise, returns 0.
void
Developer
Posts: 18581
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 Plugin SDK

Post by void »

utf8_basic_string_free

void utf8_basic_string_free(everything_plugin_utf8_basic_string_t *s)


Free a basic string allocated with utf8_basic_string_get_text_plain_file.

See also:
utf8_basic_string_get_text_plain_file



utf8_basic_string_get_text_plain_file

everything_plugin_utf8_basic_string_t *utf8_basic_string_get_text_plain_file(const everything_plugin_utf8_t *filename)


Returns a pointer to a basic string that contains the content of the specified file.
Returns NULL if the file was not found.

Free the basic string with utf8_basic_string_free.

Code: Select all

#define EVERYTHING_PLUGIN_UTF8_BASIC_STRING_TEXT(s)					((everything_plugin_utf8_t *)(((everything_plugin_utf8_basic_string_t *)(s)) + 1))

typedef struct everything_plugin_utf8_basic_string_s
{
	// length of string in bytes.
	uintptr_t len;

	// NULL terminated text follows.
	// utf8_t text[len+1];
	
}everything_plugin_utf8_basic_string_t;
See also:
utf8_basic_string_free



utf8_buf_cat_c_list_utf8_string

void utf8_buf_cat_c_list_utf8_string(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *s)


Add a string to a C string list.

The list is comma (,) separated.
\ inside double quotes (") can be used to escape special characters.
Characters (except ,) outside of double quotes (") are treated literally.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_cat_utf8_string

void utf8_buf_cat_utf8_string(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *s)


Add a string to the end of a cbuf.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_copy_utf8_string

void utf8_buf_copy_utf8_string(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *s)


Copy a string to a cbuf.
The existing string is cleared.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_copy_utf8_string_n

void utf8_buf_copy_utf8_string_n(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *s,uintptr_t slen)


Copy a string with the specified length in UTF-8 bytes to a cbuf.
The existing string is cleared.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_empty

void utf8_buf_empty(utf8_buf_t *cbuf)


Empty a cbuf, setting the cbuf to an empty string.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_escape_html

void utf8_buf_escape_html(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *str)


Escape special HTML characters in a string and store the result in cbuf.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_format_filetime

void utf8_buf_format_filetime(everything_plugin_utf8_buf_t *cbuf,EVERYTHING_PLUGIN_QWORD ft)


Format a filetime and store the result in cbuf.

The filetime is converted to the local time with the correct daylight savings mode and formatted with GetDateFormat and GetTimeFormat using the system defaults.
The format can be changed in date_format and time_format.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_format_peername

void utf8_buf_format_peername(everything_plugin_utf8_buf_t *cbuf,EVERYTHING_PLUGIN_OS_WINSOCK_SOCKET socket_handle)


Format an ipv4 or ipv6 peername.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_format_qword

void utf8_buf_format_qword(everything_plugin_utf8_buf_t *cbuf,EVERYTHING_PLUGIN_QWORD number)


Format an unsigned __int64 value.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_format_size

void utf8_buf_format_size(everything_plugin_utf8_buf_t *cbuf,EVERYTHING_PLUGIN_QWORD number)


Format a number as a file size and store the result in cbuf.

The default is JEDEC KB.
The format can be customized under Everything -> Tools -> Options -> View -> Size standard.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_format_title

void utf8_buf_format_title(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *program_name,const everything_plugin_utf8_t *search,const everything_plugin_utf8_t *setting_format)


Format a window title and store the result in cbuf.

settings_format can be NULL to use the default format.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_grow_length

void utf8_buf_grow_length(everything_plugin_utf8_buf_t *cbuf,uintptr_t length_in_bytes)


Allocate enough room for length_in_bytes and a NULL terminator.
Everything will exit with a fatal error if there is not enough memory.

The cbuf->length_in_bytes is set to the specified length_in_bytes.
The cbuf data is not preserved.
cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_init

void utf8_buf_init(everything_plugin_utf8_buf_t *cbuf)


Initialize a cbuf with an empty string.

The cbuf must be killed with utf8_buf_kill

See also
utf8_buf_kill



utf8_buf_kill

void utf8_buf_kill(utf8_buf_t *cbuf)


Kill a cbuf initialized with utf8_buf_init.

Any allocated memory is returned to the system.

See also
utf8_buf_init



utf8_buf_path_canonicalize

void utf8_buf_path_canonicalize(everything_plugin_utf8_buf_t *cbuf)


Resolves . and .. from cbuf and store the result in cbuf.
For example:
C:\Windows\system32\..
=>
C:\Windows

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_path_cat_filename

void utf8_buf_path_cat_filename(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *path,const everything_plugin_utf8_t *filename)


Combine an absolute path with a relative filename and store the result in cbuf.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_printf

void utf8_buf_printf(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *format,...)


print to the cbuf with formatting.

Supports the printf standard with the additional formats:

%t = pointer to UTF-8 string and uintptr_t length in bytes.
%T = pointer to a wchar_t string and uintptr_t length in wchars.
%f = Q1M fixed point number.
%c = a single UTF-8 byte.
%C = a wchar_t.
%s = a UTF-8 string.
%S = a wchar_t string.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_buf_vprintf

void utf8_buf_vprintf(everything_plugin_utf8_buf_t *cbuf,const everything_plugin_utf8_t *format,va_list argptr)


Print to the cbuf with formatting and a variable argument list.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_printf
utf8_buf_init



utf8_string_alloc_utf8_string

everything_plugin_utf8_t *utf8_string_alloc_utf8_string(const everything_plugin_utf8_t *s)


Allocate a UTF-8 string and initialize the string with a copy of the specified string.

Returns a pointer the new UTF-8 string.
Everything will exit with a fatal error if there is not enough memory.

Free the allocated string with mem_free.

See also:
mem_free



utf8_string_alloc_utf8_string_n

everything_plugin_utf8_t *utf8_string_alloc_utf8_string_n(const everything_plugin_utf8_t *s,uintptr_t slen)


Allocate a copy of the specified UTF-8 string with the specified length.

Returns a pointer the new UTF-8 string.
Everything will exit with a fatal error if there is not enough memory.

Free the allocated string with mem_free.

See also:
mem_free



utf8_string_compare

int utf8_string_compare(const everything_plugin_utf8_t *a,const everything_plugin_utf8_t *b)


Compare two UTF-8 strings.

Returns -1 if a < b
Returns 1 if a > b
Returns 0 if a == b

See also:
utf8_string_icompare



utf8_string_compare_nice_n_n

int utf8_string_compare_nice_n_n(const everything_plugin_utf8_t *a,uintptr_t a_len,const everything_plugin_utf8_t *b,uintptr_t b_len)


Compare two UTF-8 strings with specified lengths, natural sorting, decomposition, ignoring diacritics and ignoring case.

Returns -1 if a < b
Returns 1 if a > b
Returns 0 if a == b



utf8_string_compare_nocase_n_n

int utf8_string_compare_nocase_n_n(const everything_plugin_utf8_t *a,uintptr_t a_len,const everything_plugin_utf8_t *b,uintptr_t b_len)


Compare two UTF-8 strings with specified lengths and ignoring case.

Returns -1 if a < b
Returns 1 if a > b
Returns 0 if a == b



utf8_string_compare_nocase_s_sla

int utf8_string_compare_nocase_s_sla(const everything_plugin_utf8_t *a,const everything_plugin_utf8_t *lowercase_ascii_b)


Compare two UTF-8 strings and ignore case.

Returns -1 if a < b
Returns 1 if a > b
Returns 0 if a == b

The b string MUST be in lowercase and all ASCII characters.



utf8_string_copy_utf8_string

everything_plugin_utf8_t *utf8_string_copy_utf8_string(everything_plugin_utf8_t *buf,const everything_plugin_utf8_t *s)


Copy a UTF-8 string into a UTF-8 buffer.

The buffer MUST contain enough room for the string and NULL terminator.



utf8_string_get_extension

everything_plugin_utf8_t utf8_string_get_extension(const everything_plugin_utf8_t *filename)


Return a pointer to the extension part of the specified filename.

The returned extension does not include the dot (.)



utf8_string_get_length_in_bytes

uintptr_t utf8_string_get_length_in_bytes(const everything_plugin_utf8_t *string)


Return the length of the specified string in UTF-8 bytes.



utf8_string_get_path_part

void utf8_string_get_path_part(const everything_plugin_utf8_t *file_name,everything_plugin_utf8_buf_t *cbuf)


Copy the path part from the specified filename into cbuf.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_string_get_win32_file_namespace

void utf8_string_get_win32_file_namespace(const everything_plugin_utf8_t *path,everything_plugin_utf8_buf_t *cbuf)


Convert a file system path into a win32 file namespace.

For example:
C:\Windows\System32
=>
\\?\C:\Windows\System32

\\server\share
=>
\\?\UNC\server\share
[c]\\?\C:\Windows\System32
=>
\\?\C:\Windows\System32


cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_string_icompare

int utf8_string_icompare(const everything_plugin_utf8_t *s1start,const everything_plugin_utf8_t *s2start)


Compare two UTF-8 strings and ignore case.

Returns -1 if a < b
Returns 1 if a > b
Returns 0 if a == b

See also:
utf8_string_compare



utf8_string_is_url_scheme_name_with_double_forward_slash

int utf8_string_is_url_scheme_name_with_double_forward_slash(const everything_plugin_utf8_t *s)


Check if the specified UTF-8 string starts with a URL scheme name with a // suffix.

Returns 1 if the string has a URL scheme name with a // suffix.
Otherwise, returns 0.

For example:
es://something
=> 1
es:something
=> 0



utf8_string_parse_c_item

const everything_plugin_utf8_t *utf8_string_parse_c_item(const everything_plugin_utf8_t *s,everything_plugin_utf8_buf_t *cbuf)


Parse a string from a C string list and store the item in cbuf.

Returns a pointer to the next item in the list.
Returns NULL if no item was parsed.

The list is comma (,) separated.
\ inside double quotes (") can be used to escape special characters.
Characters (except ,) outside of double quotes (") are treated literally.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_string_parse_check

int utf8_string_parse_check(const everything_plugin_utf8_t **pp,const everything_plugin_utf8_t *string)


Check if *pp starts with the specified string.

Returns 1 if it matches.
Returns 0 if there is no match.

If the string matches the pointer in *pp is updated to skip pass the matched string.



utf8_string_parse_csv_item

const everything_plugin_utf8_t *utf8_string_parse_csv_item(const everything_plugin_utf8_t *s,everything_plugin_utf8_buf_t *cbuf)


Parse a CSV item from the specified string and store the item in cbuf.

Returns a pointer to the next item.
Returns NULL if no item was parsed.

cbuf must be initialized with utf8_buf_init

See also:
utf8_buf_init



utf8_string_parse_qword

EVERYTHING_PLUGIN_QWORD utf8_string_parse_qword(const everything_plugin_utf8_t **pp)


Parse an unsigned __int64 value from the specified string.

Returns the unsigned __int64 value.
Returns 0 if no number was parsed.

The pointer in *pp is updated to skip pass the matched number.



utf8_string_parse_sockaddr_in

void utf8_string_parse_sockaddr_in(const everything_plugin_utf8_t *s,struct os_sockaddr_in *addr)


Parse an ipv4 address and store the address in addr.



utf8_string_parse_sockaddr_in6

void utf8_string_parse_sockaddr_in6(const everything_plugin_utf8_t *s,struct os_winsock_sockaddr_in6 *addr)


Parse an ipv6 address and store the address in addr.



utf8_string_realloc_utf8_string

everything_plugin_utf8_t *utf8_string_realloc_utf8_string(everything_plugin_utf8_t *ptr,const everything_plugin_utf8_t *s)


Reallocate a UTF-8 string with a copy of the specified UTF-8 string.

Returns a pointer to the new string.

Free the allocated string with mem_free.
ptr can be NULL.
ptr is freed if it is non-NULL.

See also:
mem_free.



utf8_string_realloc_utf8_string_n

everything_plugin_utf8_t *utf8_string_realloc_utf8_string_n(everything_plugin_utf8_t *ptr,const everything_plugin_utf8_t *s,uintptr_t slen)


Reallocate a UTF-8 string with a copy of the specified UTF-8 string and specified length in UTF-8 bytes.

Returns a pointer to the new string.

Free the allocated string with mem_free.
ptr can be NULL.
ptr is freed if it is non-NULL.

See also:
mem_free.



utf8_string_skip_ascii_ws

everything_plugin_utf8_t *utf8_string_skip_ascii_ws(const everything_plugin_utf8_t *p)


Skips over white spaces in the specified string and returns a pointer to the next available character.

Returns a pointer to the first non-whitespace character.



utf8_string_to_dword

DWORD utf8_string_to_dword(const everything_plugin_utf8_t *s)


Convert a UTF-8 string to a DWORD.

Returns the DWORD value.
Returns 0 if not a valid string.

Supports hex with a 0x or 0X prefix.
Supports negative numbers. (-1 == 0xffffffff)



utf8_string_to_int

int utf8_string_to_int(const everything_plugin_utf8_t *str)


Convert a UTF-8 string to an int.

Returns the int value.
Returns 0 if not a valid string.

Supports hex with a 0x or 0X prefix.



utf8_string_to_qword

EVERYTHING_PLUGIN_QWORD utf8_string_to_qword(const everything_plugin_utf8_t *s)


Convert a UTF-8 string to an unsigned __int64.

Returns the unsigned __int64 value.
Returns 0 if not a valid string.

Supports hex with a 0x or 0X prefix.
Supports negative numbers. (-1 == 0xffffffffffffffff)
void
Developer
Posts: 18581
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 Plugin SDK

Post by void »

version_get_build

DWORD version_get_build(void)


Return the Everything build number.



version_get_major

DWORD version_get_major(void)


Return the Everything major version number.



version_get_minor

DWORD version_get_minor(void)


Return the Everything minor version number.



version_get_revision

DWORD version_get_revision(void)


Return the Everything revision number.



version_get_text

void version_get_text(everything_plugin_utf8_buf_t *cbuf)


Get the version text and store it in the specified cbuf.

The version is formatted as: major.minor.revision.build[a|b] (machine-target)[DEBUG]

cbuf must be initialized with utf8_buf_init.

See also:
utf8_buf_init



wchar_buf_copy_utf8_string

void wchar_buf_copy_utf8_string(everything_plugin_wchar_buf_t *wcbuf,const everything_plugin_utf8_t *s)


Copy the specified UTF-8 string into the specified wcbuf.

wcbuf must be initialized with wchar_buf_init.

See also:
wchar_buf_init



wchar_buf_init

void wchar_buf_init(everything_plugin_wchar_buf_t *wcbuf)


Initialize a wcbuf with an empty string.

The initialized wcbuf must be killed with wchar_buf_kill

See also:
wchar_buf_kill



wchar_buf_kill

void wchar_buf_kill(everything_plugin_wchar_buf_t *wcbuf)


Kill a wcbuf that was initialized with wchar_buf_init.

See also:
wchar_buf_init
void
Developer
Posts: 18581
Joined: Fri Oct 16, 2009 11:31 pm

Re: Everything 1.5 Plugin SDK

Post by void »

EVERYTHING_PLUGIN_PM_INIT

Everything has been initialized.
The plugin should initialize.
EVERYTHING_PLUGIN_PM_INIT is always the first message sent to the plugin.
The data parameter is an everything_plugin_get_proc_address_t that can be called to get proc addresses.
EVERYTHING_PLUGIN_PM_START will be sent after if the plugin is enabled.
Return (void *)1 if the plugin initialized successfully.
Return 0 if the plugin failed to initialized. No other messages will be sent on failure.

For example:

Code: Select all

DWORD (*MyVersionGetBuild)(void);

__declspec( dllexport) void * EVERYTHING_PLUGIN_API everything_plugin_proc(DWORD msg,void *data)
{
	switch(msg)
	{
		case EVERYTHING_PLUGIN_PM_INIT:
						
			MyVersionGetBuild = ((everything_plugin_get_proc_address_t)data)("version_get_build");
					
			if (!MyVersionGetBuild)
			{
				return (void *)0;
			}
			
			return (void *)1;
	}
}


EVERYTHING_PLUGIN_PM_GET_PLUGIN_VERSION

Get the plugin API version used by the plugin.
The data parameter is not used.

Return the used plugin API version.
For example:
return (void *)EVERYTHING_PLUGIN_VERSION;




EVERYTHING_PLUGIN_PM_GET_NAME

Get the name of the plugin.
The data parameter is not used.

Return a pointer to a UTF-8 string that contains the plugin name.
The plugin name is shown under Tools -> Options -> Plugins -> <your-plugin> -> Name.



EVERYTHING_PLUGIN_PM_GET_DESCRIPTION

Get the description of the plugin.
The data parameter is not used.

Return a pointer to a UTF-8 string that contains the plugin description.
The plugin description is shown under Tools -> Options -> Plugins -> <your-plugin> -> Description.

The description should be brief one-line description of the plugin.



EVERYTHING_PLUGIN_PM_GET_AUTHOR

Get the author of the plugin.
The data parameter is not used.

Return a pointer to a UTF-8 string that contains the plugin author.
The plugin author is shown under Tools -> Options -> Plugins -> <your-plugin> -> Author.

Verified plugins are shown in blue and bold text.



EVERYTHING_PLUGIN_PM_GET_VERSION

Get the version of the plugin.
The data parameter is not used.

Return a pointer to a UTF-8 string that contains the plugin version.
The plugin version is shown under Tools -> Options -> Plugins -> <your-plugin> -> Version.



EVERYTHING_PLUGIN_PM_GET_LINK

Get the URL link of the plugin.
The data parameter is not used.

Return a pointer to a UTF-8 string that contains the plugin URL link.
The plugin version is shown under Tools -> Options -> Plugins -> <your-plugin> -> Link.



EVERYTHING_PLUGIN_PM_START

Everything has started.
Start the plugin.
For example: Start any services.
The data parameter is the setting sorted list to be passed to plugin_get_setting_int or plugin_get_setting_string.
Return (void *)1 if the plugin started successfully.
Return 0 if the plugin failed to start.



EVERYTHING_PLUGIN_PM_STOP

Everything is shutting down.
The database still exists and can be accessed.
Stop the plugin.
For example: Stop any services.
The data parameter is not used.



EVERYTHING_PLUGIN_PM_KILL

Everything has shutdown.
The database has been freed.
Kill the plugin.
For example: Free any allocated memory.
The data parameter is not used.
EVERYTHING_PLUGIN_PM_STOP is sent before EVERYTHING_PLUGIN_PM_KILL if the plugin was started.
EVERYTHING_PLUGIN_PM_KILL is always the last message sent to the plugin.



EVERYTHING_PLUGIN_PM_UNINSTALL

The plugin is being uninstalled.
Uninstall the plugin.
For example: Delete any custom user data or cache.
EVERYTHING_PLUGIN_PM_STOP is called before EVERYTHING_PLUGIN_PM_UNINSTALL.
EVERYTHING_PLUGIN_PM_KILL is called after EVERYTHING_PLUGIN_PM_UNINSTALL.
After EVERYTHING_PLUGIN_PM_KILL is sent, the library is freed and the plugin dll is deleted.
The data parameter is not used.



EVERYTHING_PLUGIN_PM_ADD_OPTIONS_PAGES

The Everything options window has been created.
Add the plugin options pages.
Call ui_options_add_plugin_page to add your custom options page.
The custom options page will appear under the Plugins section.
The data parameter is a pointer to an everything_plugin_ui_options_add_custom_page_s struct and must be passed to ui_options_add_plugin_page.
Return (void *)1 if you handle the message.



EVERYTHING_PLUGIN_PM_LOAD_OPTIONS_PAGE

The plugin options page has been shown.
Add your custom controls to your options page.
The data parameter is a pointer to an everything_plugin_load_options_page_t that contains the options page window information.
Return (void *)1 if you handle the message.



EVERYTHING_PLUGIN_PM_SAVE_OPTIONS_PAGE

The user has clicked Apply or OK in the options window.
Apply settings from your options page.
The data parameter is a pointer to an everything_plugin_save_options_page_t that contains the options page window information.
Return (void *)1 if you handle the message.



EVERYTHING_PLUGIN_PM_GET_OPTIONS_PAGE_MINMAX

The plugin options page is about to be resized.
Let Everything know the minimum size of your plugin options page.
The data parameter is a pointer to an everything_plugin_get_options_page_minmax_t.
Store the minimum width and height in logical pixels of the options page in this structure.
Return (void *)1 if you handle the message.



EVERYTHING_PLUGIN_PM_SIZE_OPTIONS_PAGE

The plugin options page was resized.
Reposition all your controls on your plugin options page.
The data parameter is a pointer to an everything_plugin_size_options_page_t that contains the options page window information.
Return (void *)1 if you handle the message.



EVERYTHING_PLUGIN_PM_OPTIONS_PAGE_PROC

A window message was sent to the plugin options page.
Do any custom message processing.
For example: a button was clicked.
The data parameter is a pointer to an everything_plugin_options_page_proc_t that contains the options page window information.
Set result and handled in this structure if you handle the window message.
Return (void *)1 if you handle the message.



EVERYTHING_PLUGIN_PM_KILL_OPTIONS_PAGE

The plugin options page is being closed.
Free any memory used by the options page.
The data parameter is the user_data passed to ui_options_add_plugin_page.
Return (void *)1 if you handle the message.



EVERYTHING_PLUGIN_PM_SAVE_SETTINGS

Everything is writing settings to disk.
Update Everything's copy of the plugin settings.
The data parameter is the output stream to pass to plugin_set_setting_int and plugin_set_setting_string
Return (void *)1 if you handle the message.
Post Reply