Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

Commit

Permalink
move command answer definition
Browse files Browse the repository at this point in the history
to commands.h
  • Loading branch information
waynz0r committed Sep 14, 2023
1 parent 14cfba4 commit 7b925b1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* modified, or distributed except according to those terms.
*/

#include "device_driver.h"
#include "commands.h"
#include "json.h"

command_answer *send_accept_command(u16 port)
Expand Down
12 changes: 12 additions & 0 deletions commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
#ifndef commands_h
#define commands_h

#include "task_context.h"

typedef struct command_answer
{
char *error;
char *answer;
} command_answer;

void free_command_answer(command_answer *cmd_answer);

command_answer *send_command(char *name, char *data, task_context *context);

command_answer *send_accept_command(u16 port);
command_answer *send_connect_command(u16 port);

Expand Down
1 change: 1 addition & 0 deletions device_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "proxywasm.h"
#include "csr.h"
#include "runtime.h"
#include "commands.h"

/* Global variables are declared as static, so are global within the file. */

Expand Down
10 changes: 0 additions & 10 deletions device_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,12 @@
#include <linux/fs.h>

#include "runtime.h"
#include "task_context.h"

static int device_open(struct inode *, struct file *);
static int device_release(struct inode *, struct file *);
static ssize_t device_read(struct file *, char __user *, size_t, loff_t *);
static ssize_t device_write(struct file *, const char __user *, size_t, loff_t *);

typedef struct command_answer
{
char *error;
char *answer;
} command_answer;

void free_command_answer(command_answer *cmd_answer);

command_answer *send_command(char *name, char *data, task_context *context);
wasm_vm_result load_module(char *name, char *code, unsigned length, char *entrypoint);

#define SUCCESS 0
Expand Down

0 comments on commit 7b925b1

Please sign in to comment.