mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 18:21:16 -03:00
Apply new indentation, brace, and whitespace style
This commit is contained in:
@@ -42,11 +42,11 @@
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SET,
|
||||
SET_EXPORT,
|
||||
ERASE,
|
||||
BARRIER,
|
||||
BARRIER_REPLY,
|
||||
SET,
|
||||
SET_EXPORT,
|
||||
ERASE,
|
||||
BARRIER,
|
||||
BARRIER_REPLY,
|
||||
} fish_message_type_t;
|
||||
|
||||
/**
|
||||
@@ -59,15 +59,15 @@ typedef enum
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
/**
|
||||
Number of queues that contain this message. Once this reaches zero, the message should be deleted
|
||||
*/
|
||||
int count;
|
||||
/**
|
||||
Number of queues that contain this message. Once this reaches zero, the message should be deleted
|
||||
*/
|
||||
int count;
|
||||
|
||||
/**
|
||||
Message body. The message must be allocated using enough memory to actually contain the message.
|
||||
*/
|
||||
std::string body;
|
||||
/**
|
||||
Message body. The message must be allocated using enough memory to actually contain the message.
|
||||
*/
|
||||
std::string body;
|
||||
|
||||
} message_t;
|
||||
|
||||
@@ -78,66 +78,66 @@ typedef std::queue<message_t *> message_queue_t;
|
||||
*/
|
||||
typedef struct connection
|
||||
{
|
||||
/**
|
||||
The file descriptor this socket lives on
|
||||
*/
|
||||
int fd;
|
||||
/**
|
||||
Queue of onsent messages
|
||||
*/
|
||||
/**
|
||||
The file descriptor this socket lives on
|
||||
*/
|
||||
int fd;
|
||||
/**
|
||||
Queue of onsent messages
|
||||
*/
|
||||
message_queue_t *unsent;
|
||||
/**
|
||||
Set to one when this connection should be killed
|
||||
*/
|
||||
int killme;
|
||||
/**
|
||||
The input string. Input from the socket goes here. When a
|
||||
newline is encountered, the buffer is parsed and cleared.
|
||||
*/
|
||||
std::vector<char> input;
|
||||
/**
|
||||
Set to one when this connection should be killed
|
||||
*/
|
||||
int killme;
|
||||
/**
|
||||
The input string. Input from the socket goes here. When a
|
||||
newline is encountered, the buffer is parsed and cleared.
|
||||
*/
|
||||
std::vector<char> input;
|
||||
|
||||
/**
|
||||
The read buffer.
|
||||
*/
|
||||
char buffer[ENV_UNIVERSAL_BUFFER_SIZE];
|
||||
/**
|
||||
The read buffer.
|
||||
*/
|
||||
char buffer[ENV_UNIVERSAL_BUFFER_SIZE];
|
||||
|
||||
/**
|
||||
Number of bytes that have already been consumed.
|
||||
*/
|
||||
size_t buffer_consumed;
|
||||
/**
|
||||
Number of bytes that have already been consumed.
|
||||
*/
|
||||
size_t buffer_consumed;
|
||||
|
||||
/**
|
||||
Number of bytes that have been read into the buffer.
|
||||
*/
|
||||
size_t buffer_used;
|
||||
/**
|
||||
Number of bytes that have been read into the buffer.
|
||||
*/
|
||||
size_t buffer_used;
|
||||
|
||||
|
||||
/**
|
||||
Link to the next connection
|
||||
*/
|
||||
struct connection *next;
|
||||
/**
|
||||
Link to the next connection
|
||||
*/
|
||||
struct connection *next;
|
||||
}
|
||||
connection_t;
|
||||
connection_t;
|
||||
|
||||
/**
|
||||
Read all available messages on this connection
|
||||
*/
|
||||
void read_message( connection_t * );
|
||||
void read_message(connection_t *);
|
||||
|
||||
/**
|
||||
Send as many messages as possible without blocking to the connection
|
||||
*/
|
||||
void try_send_all( connection_t *c );
|
||||
void try_send_all(connection_t *c);
|
||||
|
||||
/**
|
||||
Create a messge with the specified properties
|
||||
*/
|
||||
message_t *create_message( fish_message_type_t type, const wchar_t *key, const wchar_t *val );
|
||||
message_t *create_message(fish_message_type_t type, const wchar_t *key, const wchar_t *val);
|
||||
|
||||
/**
|
||||
Init the library
|
||||
*/
|
||||
void env_universal_common_init(void (*cb)(fish_message_type_t type, const wchar_t *key, const wchar_t *val ) );
|
||||
void env_universal_common_init(void (*cb)(fish_message_type_t type, const wchar_t *key, const wchar_t *val));
|
||||
|
||||
/**
|
||||
Destroy library data
|
||||
@@ -150,9 +150,9 @@ void env_universal_common_destroy();
|
||||
This function operate agains the local copy of all universal
|
||||
variables, it does not communicate with any other process.
|
||||
*/
|
||||
void env_universal_common_get_names( wcstring_list_t &lst,
|
||||
int show_exported,
|
||||
int show_unexported );
|
||||
void env_universal_common_get_names(wcstring_list_t &lst,
|
||||
int show_exported,
|
||||
int show_unexported);
|
||||
|
||||
/**
|
||||
Perform the specified variable assignment.
|
||||
@@ -163,7 +163,7 @@ void env_universal_common_get_names( wcstring_list_t &lst,
|
||||
Do not call this function. Create a message to do it. This function
|
||||
is only to be used when fishd is dead.
|
||||
*/
|
||||
void env_universal_common_set( const wchar_t *key, const wchar_t *val, int exportv );
|
||||
void env_universal_common_set(const wchar_t *key, const wchar_t *val, int exportv);
|
||||
|
||||
/**
|
||||
Remove the specified variable.
|
||||
@@ -174,7 +174,7 @@ void env_universal_common_set( const wchar_t *key, const wchar_t *val, int expor
|
||||
Do not call this function. Create a message to do it. This function
|
||||
is only to be used when fishd is dead.
|
||||
*/
|
||||
void env_universal_common_remove( const wcstring &key );
|
||||
void env_universal_common_remove(const wcstring &key);
|
||||
|
||||
/**
|
||||
Get the value of the variable with the specified name
|
||||
@@ -182,7 +182,7 @@ void env_universal_common_remove( const wcstring &key );
|
||||
This function operate agains the local copy of all universal
|
||||
variables, it does not communicate with any other process.
|
||||
*/
|
||||
wchar_t *env_universal_common_get( const wcstring &name );
|
||||
wchar_t *env_universal_common_get(const wcstring &name);
|
||||
|
||||
/**
|
||||
Get the export flag of the variable with the specified
|
||||
@@ -191,24 +191,24 @@ wchar_t *env_universal_common_get( const wcstring &name );
|
||||
This function operate agains the local copy of all universal
|
||||
variables, it does not communicate with any other process.
|
||||
*/
|
||||
int env_universal_common_get_export( const wcstring &name );
|
||||
int env_universal_common_get_export(const wcstring &name);
|
||||
|
||||
/**
|
||||
Add messages about all existing variables to the specified connection
|
||||
*/
|
||||
void enqueue_all( connection_t *c );
|
||||
void enqueue_all(connection_t *c);
|
||||
|
||||
/**
|
||||
Fill in the specified connection_t struct. Use the specified file
|
||||
descriptor for communication.
|
||||
*/
|
||||
void connection_init( connection_t *c, int fd );
|
||||
void connection_init(connection_t *c, int fd);
|
||||
|
||||
/**
|
||||
Close and destroy the specified connection struct. This frees
|
||||
allstructures allocated by the connection, such as ques of unsent
|
||||
messages.
|
||||
*/
|
||||
void connection_destroy( connection_t *c);
|
||||
void connection_destroy(connection_t *c);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user