mirror of
https://github.com/Fishwaldo/libzwaveip.git
synced 2025-03-15 19:31:31 +00:00
Fix up builds on OSX
This commit is contained in:
parent
6ceacedca1
commit
ae11b1ac6c
8 changed files with 30 additions and 8 deletions
|
@ -9,8 +9,12 @@ add_executable(reference_client reference_client.c tokenizer.c
|
|||
hexchar.c command_completion.c util.c tokquote/tokquote.c)
|
||||
add_executable(reference_listener reference_listener.c util.c)
|
||||
|
||||
target_link_libraries(reference_client zwaveip edit parse_xml xml2 zw_cmd_tool -lbsd -ltermcap ${MDNS_LIBS})
|
||||
target_link_libraries(reference_listener zwaveip parse_xml xml2)
|
||||
if (APPLE)
|
||||
target_link_libraries(reference_client zwaveip edit parse_xml xml2 zw_cmd_tool -ltermcap ${MDNS_LIBS} ${OPENSSL_LIBRARIES})
|
||||
elseif(UNIX)
|
||||
target_link_libraries(reference_client zwaveip edit parse_xml xml2 zw_cmd_tool -lbsd -ltermcap ${MDNS_LIBS} ${OPENSSL_LIBRARIES})
|
||||
endif ()
|
||||
target_link_libraries(reference_listener zwaveip parse_xml xml2 ${OPENSSL_LIBRARIES})
|
||||
|
||||
add_custom_command(TARGET reference_client PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_SOURCE_DIR}/config $<TARGET_FILE_DIR:reference_client>)
|
||||
|
|
|
@ -145,7 +145,7 @@ int static parse_token(const char* token) {
|
|||
case DESTINATION: {
|
||||
rl_basic_word_break_characters = "\"";
|
||||
rl_quote_completion = 1;
|
||||
struct zip_service* s = zresource_services;
|
||||
struct zip_service* s = zresource_get();
|
||||
for (; s; s = s->next) {
|
||||
if (strcmp(s->service_name, token) == 0) {
|
||||
parser.state = COMMAND_CLASS;
|
||||
|
@ -271,7 +271,7 @@ static char* operation_generator(const char* text, int state) {
|
|||
}
|
||||
break;
|
||||
case DESTINATION: {
|
||||
struct zip_service* s = zresource_services;
|
||||
struct zip_service* s = zresource_get();
|
||||
int n = 0;
|
||||
char buf[512];
|
||||
|
||||
|
|
|
@ -436,7 +436,7 @@ static void cmd_send(const char *input) {
|
|||
service_name++; /* strip opening quote */
|
||||
service_name[strlen(service_name) - 1] = 0; /* strip closing quote */
|
||||
}
|
||||
for (n = zresource_services; n; n = n->next) {
|
||||
for (n = zresource_get(); n; n = n->next) {
|
||||
if (0 == strcmp(n->service_name, service_name)) {
|
||||
const char *result;
|
||||
/* Try connecting via IPv6 first */
|
||||
|
@ -484,7 +484,7 @@ static void cmd_list_service(void) {
|
|||
;
|
||||
|
||||
printf("List of discovered Z/IP services:\n");
|
||||
for (n = zresource_services; n; n = n->next) {
|
||||
for (n = zresource_get(); n; n = n->next) {
|
||||
printf("--- %20s: \"%s\"\n", n->host_name, n->service_name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,7 +100,9 @@ struct zip_service
|
|||
* }
|
||||
* @endcode
|
||||
*/
|
||||
extern struct zip_service* zresource_services;
|
||||
//extern struct zip_service* zresource_services;
|
||||
|
||||
struct zip_service* zresource_get();
|
||||
|
||||
/**
|
||||
* Thread function of the mdns listner. This is the main loop of the mdns thread. This should normally be run
|
||||
|
|
|
@ -32,7 +32,11 @@
|
|||
|
||||
/* Define to 1 if you have getpwnam_r and getpwuid_r that are POSIX.1
|
||||
compatible. */
|
||||
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
#undef HAVE_GETPW_R_POSIX
|
||||
#else
|
||||
#define HAVE_GETPW_R_POSIX 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
|
|
@ -48,7 +48,11 @@ __RCSID("$NetBSD: history.c,v 1.57 2016/04/11 18:56:31 christos Exp $");
|
|||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
#include <vis.h>
|
||||
#else
|
||||
#include <bsd/vis.h>
|
||||
#endif
|
||||
|
||||
static const char hist_cookie[] = "_HiStOrY_V2_\n";
|
||||
|
||||
|
|
|
@ -48,8 +48,11 @@ __RCSID("$NetBSD: readline.c,v 1.138 2016/09/01 13:23:44 mbalmer Exp $");
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||
#include <vis.h>
|
||||
#else
|
||||
#include <bsd/vis.h>
|
||||
|
||||
#endif
|
||||
#include "readline/readline.h"
|
||||
#include "el.h"
|
||||
#include "fcns.h"
|
||||
|
|
|
@ -27,6 +27,11 @@
|
|||
#include <arpa/inet.h>
|
||||
struct zip_service* zresource_services;
|
||||
|
||||
struct zip_service* zresource_get() {
|
||||
return zresource_services;
|
||||
}
|
||||
|
||||
|
||||
struct zip_service* find_service(const char* name) {
|
||||
struct zip_service* n;
|
||||
for (n = zresource_services; n; n = n->next) {
|
||||
|
|
Loading…
Add table
Reference in a new issue