Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
CMAKE_MINIMUM_REQUIRED(VERSION 3.10)

PROJECT("libexword-re")

Expand All @@ -7,4 +7,9 @@ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/includes)
FILE(GLOB srcfile "databuffer.c" "dict.c" "exword.c" "obex.c" "util.c" )
ADD_EXECUTABLE(${BIN_NAME} main.c ${srcfile})

TARGET_LINK_LIBRARIES(exword usb-1.0 readline)
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_CHECK_MODULES(LIBUSB REQUIRED libusb-1.0)
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS})
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS})
TARGET_LINK_LIBRARIES(exword ${LIBUSB_LIBRARIES} readline iconv)
TARGET_LINK_LIBRARIES(exword usb-1.0 readline iconv)
2 changes: 1 addition & 1 deletion src/includes/obex.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ void obex_set_connect_info(obex_t *self, uint8_t ver, uint8_t locale);
void obex_register_callback(obex_t *self, obex_callback cb, void * userdata);
obex_object_t * obex_object_new(obex_t *self, uint8_t cmd);
int obex_object_delete(obex_t *self, obex_object_t *object);
int obex_object_add_header(obex_t *self, obex_object_t *object,
int obex_object_addheader(obex_t *self, obex_object_t *object,
uint8_t hi, obex_headerdata_t hv, uint32_t hv_size,
unsigned int flags);
int obex_object_getnextheader(obex_t *self, obex_object_t *object,
Expand Down
1 change: 1 addition & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ int dict_remove(exword_t *device, char *root, char *id);
int dict_decrypt(exword_t *device, char *root, char *id);
int dict_install(exword_t *device, char *root, char *id);
int dict_auth(exword_t *device, char *user, char *auth);
int dict_reset(exword_t*device, char *user);

void dict(struct state *s)
{
Expand Down
19 changes: 6 additions & 13 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,12 @@ const char * get_data_dir()
return NULL;
}
#elif defined(__APPLE__) && defined(__MACH__)
int length;
FSRef foundRef;
OSStatus validPath;
OSErr err = FSFindFolder(kUserDomain, kApplicationSupportFolderType, kCreateFolder, &foundRef);
if (err != noErr)
return NULL;
validPath = FSRefMakePath(&foundRef, data_dir, PATH_MAX);
if (validPath != noErr)
return NULL;
length = strlen(data_dir) + strlen("/exword");
if (length >= PATH_MAX)
return NULL;
strcat(data_dir, "/exword");
const char *home = getenv("HOME");
if (!home)
return NULL;
int length = snprintf(data_dir, PATH_MAX, "%s/Library/Application Support/exword", home);
if (length >= PATH_MAX)
return NULL;
#else
int length = 0;
const char * xdg_data_home;
Expand Down