Obsolete
/
libipc-old
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
libipc-old/tests/unit_01_service-path.c

29 lines
529 B
C
Raw Normal View History

2019-07-27 15:48:56 +02:00
#include "../src/ipc.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SERVICE_NAME "example"
int main(int argc, char * argv[])
{
char path[PATH_MAX];
char * sname = SERVICE_NAME;
2020-07-04 11:01:24 +02:00
if (argc == 2) {
2019-07-27 15:48:56 +02:00
sname = argv[1];
}
else if (argc != 1) {
fprintf (stderr, "usage: %s [service-name index version]\n", argv[0]);
return EXIT_FAILURE;
}
2020-07-04 11:01:24 +02:00
service_path (path, sname);
2019-07-27 15:48:56 +02:00
// printf ("servicename: %s, index: %d, version: %d\n", sname, index, version);
printf ("%s\n", path);
return EXIT_SUCCESS;
}