| 1 | /* |
| 2 | * This file is part of DisOrder. |
| 3 | * Copyright (C) 2004-2008 Richard Kettlewell |
| 4 | * |
| 5 | * This program is free software: you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation, either version 3 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | /** @file lib/client.h |
| 19 | * @brief Simple C client |
| 20 | * |
| 21 | * See @ref lib/client-stubs.h for the (generated) per-command entry |
| 22 | * points. |
| 23 | * |
| 24 | * See @ref lib/eclient.h for an asynchronous-capable client |
| 25 | * implementation. |
| 26 | */ |
| 27 | |
| 28 | #ifndef CLIENT_H |
| 29 | #define CLIENT_H |
| 30 | |
| 31 | #include <time.h> |
| 32 | #include "configuration.h" |
| 33 | |
| 34 | /** @brief Client data */ |
| 35 | typedef struct disorder_client disorder_client; |
| 36 | |
| 37 | struct queue_entry; |
| 38 | struct kvp; |
| 39 | struct sink; |
| 40 | |
| 41 | disorder_client *disorder_new(int verbose); |
| 42 | void disorder_force_unpriv(disorder_client *c); |
| 43 | int disorder_client_sockname(disorder_client *c, |
| 44 | struct sockaddr *sa, socklen_t *len_inout); |
| 45 | int disorder_client_peername(disorder_client *c, |
| 46 | struct sockaddr *sa, socklen_t *len_inout); |
| 47 | int disorder_connect(disorder_client *c); |
| 48 | int disorder_connect_user(disorder_client *c, |
| 49 | const char *username, |
| 50 | const char *password); |
| 51 | int disorder_connect_cookie(disorder_client *c, const char *cookie); |
| 52 | int disorder_connect_generic(struct config *conf, |
| 53 | disorder_client *c, |
| 54 | const char *username, |
| 55 | const char *password, |
| 56 | const char *cookie); |
| 57 | int disorder_close(disorder_client *c); |
| 58 | char *disorder_user(disorder_client *c); |
| 59 | int disorder_log(disorder_client *c, struct sink *s); |
| 60 | const char *disorder_last(disorder_client *c); |
| 61 | |
| 62 | #include "client-stubs.h" |
| 63 | |
| 64 | #endif /* CLIENT_H */ |
| 65 | |
| 66 | /* |
| 67 | Local Variables: |
| 68 | c-basic-offset:2 |
| 69 | comment-column:40 |
| 70 | End: |
| 71 | */ |