Skip to content

Commit

Permalink
Renamed struct and made hpdREST install alongside homeport with 'make…
Browse files Browse the repository at this point in the history
… install'
  • Loading branch information
eudyptula committed Dec 17, 2015
1 parent 07d0a4c commit 9272a92
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ include_directories(${PROJECT_SOURCE_DIR}/REST/hpdREST/include)
add_executable(hpd_example_easy EXCLUDE_FROM_ALL
hpd_example_easy.c
)
target_link_libraries(hpd_example_easy hpd ev hpdREST)
target_link_libraries(hpd_example_easy hpd ev hpd_rest)
add_dependencies(example hpd_example_easy)
2 changes: 1 addition & 1 deletion Examples/hpd_example_easy.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ static int init(HomePort *homeport, void *data)
int
main()
{
struct hpd_lr data;
struct hpd_rest data;

/** Starts the hpdaemon. If using avahi-core pass a host name for the server, otherwise pass NULL */
return homePortEasy(init, deinit, &data);
Expand Down
1 change: 1 addition & 0 deletions REST/hpdREST/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ include_directories(${PROJECT_SOURCE_DIR}/REST/http-webserver/include)
include_directories(${PROJECT_SOURCE_DIR}/REST/libREST/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

add_subdirectory(include)
add_subdirectory(src)
31 changes: 31 additions & 0 deletions REST/hpdREST/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Copyright 2013 Aalborg University. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY Aalborg University ''AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Aalborg University OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# The views and conclusions contained in the software and
# documentation are those of the authors and should not be interpreted
# as representing official policies, either expressed.

install (FILES hpd_rest.h DESTINATION include/hpdaemon)
6 changes: 3 additions & 3 deletions REST/hpdREST/include/hpd_rest.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@

#include "homeport.h"

struct hpd_lr {
struct hpd_rest {
struct lr *lr;
Listener *dev_listener;
};

int hpd_rest_init(struct hpd_lr *data, HomePort *hp, int port);
int hpd_rest_deinit(struct hpd_lr *data, HomePort *hp);
int hpd_rest_init(struct hpd_rest *data, HomePort *hp, int port);
int hpd_rest_deinit(struct hpd_rest *data, HomePort *hp);

#endif //HOMEPORT_HPD_REST_H
6 changes: 4 additions & 2 deletions REST/hpdREST/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
# as representing official policies, either expressed.

# Main library
add_library(hpdREST
add_library(hpd_rest SHARED
lr_interface.c
hpd_rest.c
json.c
xml.c
)
target_link_libraries(hpdREST libREST)
target_link_libraries(hpd_rest libREST)
install (TARGETS hpd_rest DESTINATION lib)
set_target_properties(hpd_rest PROPERTIES VERSION 0.0.0 SOVERSION 0)
4 changes: 2 additions & 2 deletions REST/hpdREST/src/hpd_rest.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static void on_dev_detach(void *data, Device *device) {
}
}

int hpd_rest_init(struct hpd_lr *data, HomePort *hp, int port)
int hpd_rest_init(struct hpd_rest *data, HomePort *hp, int port)
{
// Create settings
struct lr_settings settings = LR_SETTINGS_DEFAULT;
Expand Down Expand Up @@ -76,7 +76,7 @@ int hpd_rest_init(struct hpd_lr *data, HomePort *hp, int port)
return 0;
}

int hpd_rest_deinit(struct hpd_lr *data, HomePort *hp)
int hpd_rest_deinit(struct hpd_rest *data, HomePort *hp)
{
lr_stop(data->lr);

Expand Down

0 comments on commit 9272a92

Please sign in to comment.