c0325eef0e08e0c57da9f090254033a37c439828
1 /* Copyright (C) 2018 Thomas Balzer */
3 /* This file is part of tomd. */
5 /* tomd 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. */
10 /* tomd 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. */
15 /* You should have received a copy of the GNU General Public License */
16 /* along with tomd. If not, see <http://www.gnu.org/licenses/>. */
21 #include <sys/socket.h>
24 #include "../../include/macros.h"
28 static void init(void)
30 /* init socket connection */
40 struct sockaddr_un addr
;
41 addr
.sun_family
= AF_LOCAL
;
42 sprintf(addr
.sun_path
, "/run/user/1000/tomd/socket");
44 if(connect(sfd
, (struct sockaddr
*) &addr
, SUN_LEN(&addr
)) != 0){
50 #define HALLO "hallo there from dumb-client"
52 void write_hallo(void)
54 printf("writing hallo\n");
56 write(sfd
, HALLO
, sizeof HALLO
);
57 printf("wrote %d bytes.\n", wrote
);
60 static void header(void)
62 tomd_p("Tom's Client, Copyright (C) 2018 Thomas Balzer");
63 tomd_p("GPL v3 or later license.");
66 int main(int argc
, char **argv
)