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>
26 static void init(void)
28 /* init socket connection */
38 struct sockaddr_un addr
;
39 addr
.sun_family
= AF_LOCAL
;
40 sprintf(addr
.sun_path
, "/run/user/1000/tomd/socket");
42 if(connect(sfd
, (struct sockaddr
*) &addr
, SUN_LEN(&addr
)) != 0){
48 #define HALLO "hallo there from dumb-client"
50 void write_hallo(void)
52 printf("writing hallo\n");
54 write(sfd
, HALLO
, sizeof HALLO
);
55 printf("wrote %d bytes.\n", wrote
);
58 static void header(void)
60 tomd_p("Tom's Client, Copyright (C) 2018 Thomas Balzer");
61 tomd_p("GPL v3 or later license.");
64 int main(int argc
, char **argv
)