Permalink
Browse files

First bits of file requesting functionality

  • Loading branch information...
1 parent 7681966 commit b438d87f8c0cdb7e16c7283ce2d447e4679d0eda @yrashk committed Apr 25, 2012
Showing with 14 additions and 2 deletions.
  1. +2 −0 c_src/hypnotoad.h
  2. +4 −2 c_src/main.c
  3. +8 −0 c_src/user.c
View
@@ -0,0 +1,2 @@
+extern void *zmq;
+extern void *pub;
View
@@ -1,8 +1,10 @@
#include <stdio.h>
#include "zmq.h"
#include "clips.h"
+#include "hypnotoad.h"
-static void *zmq;
+void * zmq;
+void * pub;
int main(int argc, char **argv) {
InitializeEnvironment();
@@ -14,7 +16,7 @@ int main(int argc, char **argv) {
UserFunctions();
zmq = zmq_init(1);
- void * pub = zmq_socket(zmq, ZMQ_PUB);
+ pub = zmq_socket(zmq, ZMQ_PUB);
zmq_bind(pub, "tcp://*:5554");
void * sub = zmq_socket(zmq, ZMQ_SUB);
View
@@ -1,4 +1,6 @@
#include "clips.h"
+#include "zmq.h"
+#include "hypnotoad.h"
void UserFunctions(void);
void EnvUserFunctions(void *);
@@ -12,6 +14,12 @@ void * remote_retr_file()
printf("Fetching %s\n", filename);
+ zmq_msg_t message;
+ zmq_msg_init_size (&message, strlen(filename));
+ memcpy (zmq_msg_data (&message), filename, strlen(filename));
+ zmq_send (pub, &message, 0);
+ zmq_msg_close (&message);
+
void * result = AddSymbol(filename);
return result;

0 comments on commit b438d87

Please sign in to comment.