diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-26 01:07:43 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-26 01:07:43 +0200 |
commit | e14688c0cbe1176ae1699e97a523cfd3be058c0a (patch) | |
tree | 4d1db14440da45979d397ab66609a7f3e05c57f2 /src/libmdsclient/address.c | |
parent | mds-base: missed to change this earlier, protocol family is PF_, not AF_, which would be address family (diff) | |
download | mds-e14688c0cbe1176ae1699e97a523cfd3be058c0a.tar.gz mds-e14688c0cbe1176ae1699e97a523cfd3be058c0a.tar.bz2 mds-e14688c0cbe1176ae1699e97a523cfd3be058c0a.tar.xz |
libmdsclient: connect to the display (parsing is not yet implemented)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/libmdsclient/address.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/libmdsclient/address.c b/src/libmdsclient/address.c new file mode 100644 index 0000000..3a7aba3 --- /dev/null +++ b/src/libmdsclient/address.c @@ -0,0 +1,46 @@ +/** + * mds — A micro-display server + * Copyright © 2014, 2015 Mattias Andrée (maandree@member.fsf.org) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ +#include "address.h" + +#include <sys/un.h> +#include <limits.h> + + + +/** + * Parse a display address string + * + * @param display The address in MDS_DISPLAY-formatting, must not be `NULL` + * @param address Output parameter for parsed address, must not be `NULL` + * @return Zero on success, even if parsing failed, -1 on error, + * `errno` will have been set accordinly on error + * + * @throws ENOMEM Out of memory. Possibly, the application hit the + * RLIMIT_AS or RLIMIT_DATA limit described in getrlimit(2). + */ +int libmds_parse_display_adress(const char* restrict display, libmds_display_address_t* restrict address) +{ + address->domain = -1; + address->type = -1; + address->protocol = -1; + address->address = NULL; + address->address_len = 0; + + return (void) display, 0; /* TODO */ +} + |