Commit 4a48e736 authored by Alberto Miranda's avatar Alberto Miranda ♨️
Browse files

Add stubs for API functions

parent 01edca94
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -32,14 +32,17 @@ __BEGIN_DECLS
/* I/O task descriptor */
struct norns_iotd {
    int ni_tid;           /* task identifier */
    int ni_ibid;  /* input backend identifier */
    int ni_obid;  /* output backend identifier */
    int ni_type;  /* type of task */
    int ni_ibid;          /* source backend identifier */
    const char* ni_ipath; /* path to data source */
    int ni_obid;          /* destination backend identifier */
    const char* ni_opath; /* path to data destination */
    int ni_type;          /* operation to be performed */
};

/*   */
/* Task types */
enum {
    NORNS
    NORNS_COPY,
    NORNS_MOVE
};

void norns_init() __THROW __nonnull ((1));
@@ -53,6 +56,9 @@ ssize_t norns_cancel(struct norns_iotd* iotdp) __THROW __nonnull((1));
/* Retrieve return status associated with iotdp */
ssize_t norns_return(struct norns_iotd* iotdp) __THROW __nonnull((1));

/* Retrieve current status associated with iotdp */
ssize_t norns_progress(struct norns_iotd* iotdp) __THROW __nonnull((1));

/* Retrieve error status associated with iotdp */
int norns_error(struct norns_iotd* iotdp) __THROW __nonnull((1));

+38 −3
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@
#include <sys/types.h>
#include <stdlib.h>
#include <stdint.h>
#include <unistd.h>

#include <norns.h>

#define SOCKET_NAME "dloom_socket" 

@@ -63,3 +66,35 @@ void norns_init(){
        perror("writing on stream socket");
    close(sock);
}

/* Enqueue an asynchronous I/O task */
int norns_transfer(struct norns_iotd *iotdp) {
    (void) iotdp;
    return 0;
}

/* Try to cancel an asynchronous I/O task associated with iotdp */
ssize_t norns_cancel(struct norns_iotd *iotdp) { 
    (void) iotdp;
    return 0;
}

/* Retrieve return status associated with iotdp */
ssize_t norns_return(struct norns_iotd *iotdp) {
    (void) iotdp;
    return 0;
}

/* Retrieve current status associated with iotdp */
ssize_t norns_progress(struct norns_iotd *iotdp) {
    (void) iotdp;
    return 0;
}

/* Retrieve error status associated with iotdp */
int norns_error(struct norns_iotd *iotdp) {
    (void) iotdp;
    return 0;
}