Commit Graph

25 Commits

Author SHA1 Message Date
Avuton Olrich
9d3865cb95 Update copyright notices. 2009-12-31 20:58:43 -08:00
Avuton Olrich
215cdda08d client: client_write() does not necessary for export. 2009-03-30 19:21:41 +02:00
Avuton Olrich
0aee49bdf8 all: Update copyright header.
This updates the copyright header to all be the same, which is
pretty much an update of where to mail request for a copy of the GPL
and the years of the MPD project. This also puts all committers under
'The Music Player Project' umbrella. These entries should go
individually in the AUTHORS file, for consistancy.
2009-03-13 11:51:55 -07:00
Max Kellermann
5c10d2ded7 client: use sockaddr_to_string()
Removed the sockaddr_to_tmp_string() hack, use
the new function sockaddr_to_string() instead.
2009-02-28 15:20:35 +01:00
Max Kellermann
3cd0b90ff6 client: run client_manager_expire() in an idle event
With the GLib main loop, the client manager can install its own event
in case a client is expired.  No need for main.c to call
client_manager_expire() manually.
2008-12-31 14:30:03 +01:00
Max Kellermann
71e7ce5d8e main: use the GLib main loop
This is a rather huge patch, which unfortunately cannot be splitted.

Instead of using our custom ioops.h library, convert everything to use
the GLib main loop.
2008-12-30 19:24:39 +01:00
Max Kellermann
3c9992aead client: include winsock headers on WIN32
On Windows, socket declarations reside in winsock.h and ws2tcpip.h.
The POSIX headers sys/socket.h etc. are not available.
2008-12-29 17:42:43 +01:00
Thomas Jansen
c06ce44768 replaced mpd_printf etc by G_GNUC_PRINTF
We want to remove gcc.h eventually. This takes care of all the G_GNUC_PRINTF
macros.
2008-12-02 03:00:02 +01:00
Marc Pavot
0bad84066b command: allow clients to subscribe to specific idle events
The client may provide the names of idle events as arguments to the
"idle" command to inform MPD that it is only interested in these
events.
2008-11-22 13:26:21 +01:00
Max Kellermann
a92903983d client: use bool
Return bool instead of int.
2008-10-31 13:58:00 +01:00
Max Kellermann
ea515494cb added prefix to header macros
"LOG_H" is a macro which is also used by ffmpeg/log.h.  This is
ffmpeg's fault, because short macros should be reserved for
applications, but since it's always a good idea to choose prefixed
macro names, even for applications, we are going to do that in MPD.
2008-10-31 09:19:53 +01:00
Max Kellermann
02a2a407c1 client: converted permissions to unsigned
client->permission is a bit set, and should be unsigned.
2008-10-17 23:53:28 +02:00
Max Kellermann
4a7ad5b618 listen, client: enable SO_PASSCRED, get client's uid
Enable authentication over unix sockets.  Store the client's uid in
the client struct.
2008-10-15 22:34:21 +02:00
Max Kellermann
a3e3d2c950 command: added command "idle"
"idle" waits until something noteworthy happens on the server,
e.g. song change, playlist modified, database updated.  This allows
clients to keep up to date without polling.
2008-10-14 22:38:14 +02:00
Max Kellermann
71351160b1 don't include os_compat.h
When there are standardized headers, use these instead of the bloated
os_compat.h.
2008-10-08 10:49:29 +02:00
Max Kellermann
2835e37684 client: added client_[gs]et_permission()
The code in command.c shouldn't mess with a pointer to
client->permission.  Provide an API for accessing this value.
2008-09-07 19:16:34 +02:00
Max Kellermann
86d261bdb5 removed fdprintf() and client_print()
All callers of fdprintf() have been converted to client_printf() or
fprintf(); it is time to remove this clumsy hack now.  We can also
remove client_print() which took a file descriptor as parameter.
2008-09-07 14:08:37 +02:00
Max Kellermann
322e908893 client: removed client_get_fd()
Now that we have removed all invocations of client_get_fd(), we can
safely remove this transitional function.  All access to the file
descriptor is now hidden behind the interface declared in client.h.
2008-09-07 14:05:02 +02:00
Max Kellermann
f73319c048 client: added client_printf()
Based on client_puts(), client_printf() is the successor of
fdprintf().  As soon as all fdprintf() callers have been rewritten to
use client_printf(), we can remove fdprintf().
2008-09-07 13:25:54 +02:00
Max Kellermann
33aec0d673 client: added client_write() and client_puts()
client_write() writes a buffer to the client and buffers it if
required.  client_puts() does the same for a C string.  The next patch
will add more tools which will replace fdprintf() later.
2008-09-07 13:24:51 +02:00
Max Kellermann
8811c0e059 export the function client_is_expired()
Instead of passing the pointer to the "expired" flag to
processListOfCommands(), this function should use the client API to
check this flag.  We can now remove the "global_expired" hack
introduced recently.
2008-08-29 09:37:11 +02:00
Max Kellermann
8b1b82b363 client: pass the client struct to processCommand()
Start exporting the client struct as an opaque struct.  For now, pass
it only to processCommand() and processListOfCommands(), and provide a
function to extract the socket handle.  Later, we will propagate the
pointer to all command implementations, and of course to
client_print() etc.
2008-08-29 09:36:42 +02:00
Max Kellermann
2c8aa8efde client: reorder function declarations
Change the order of function declarations in client.h, to make it well
arranged and readable.
2008-08-29 09:36:40 +02:00
Max Kellermann
c0197c58ba client: renamed all public functions
Functions which operate on the whole client list are prefixed with
"client_manager_", and functions which handle just one client just get
"client_".
2008-08-28 20:03:02 +02:00
Max Kellermann
deb29e0884 renamed interface.c to client.c
I don't believe "interface" is a good name for something like
"connection by a client to MPD", let's call it "client".  This is the
first patch in the series which changes the name, beginning with the
file name.
2008-08-28 20:02:43 +02:00