htbuffer stuff
This commit is contained in:
@ -22,13 +22,14 @@
|
||||
#include <syslog.h>
|
||||
#include "containers_public.h"
|
||||
#include "htmalloc.h"
|
||||
#include "htbuffer.h"
|
||||
|
||||
|
||||
int test_worker1_init(cfgl_t *cfg, void **handle);
|
||||
int test_worker1_setup(void *handle, void **work_handle);
|
||||
int test_worker1_destroy(void *handle, void *work_handle);
|
||||
int test_worker1_work(void *handle, void *work_handle, char *input, char *output);
|
||||
int test_worker2_work(void *handle, void *work_handle, char *input, char *output);
|
||||
int test_worker1_work(void *handle, void *work_handle, char *input, htbuffer_t *output);
|
||||
int test_worker2_work(void *handle, void *work_handle, char *input, htbuffer_t *output);
|
||||
|
||||
class_descriptor_t test_worker1 = {
|
||||
"test_worker1",
|
||||
@ -76,14 +77,18 @@ int test_worker1_destroy(void *handle, void *work_handle) {
|
||||
free(work_handle);
|
||||
}
|
||||
|
||||
int test_worker1_work(void *handle, void *work_handle, char *input, char *output) {
|
||||
sprintf(output, "Test-Worker 1 receives %s (handle %s) (called %d)\n",
|
||||
int test_worker1_work(void *handle, void *work_handle, char *input, htbuffer_t *output) {
|
||||
char o[1024];
|
||||
sprintf(o, "Test-Worker 1 receives %s (handle %s) (called %d)\n",
|
||||
input, (char*)handle, (((test_worker1_handle_t*)work_handle)->counter)++);
|
||||
htbuffer_strcpy(output, o);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int test_worker2_work(void *handle, void *work_handle, char *input, char *output) {
|
||||
sprintf(output, "Test-Worker 2 receives %s\n", input);
|
||||
int test_worker2_work(void *handle, void *work_handle, char *input, htbuffer_t *output) {
|
||||
htbuffer_strcpy(output, "Test-Worker 2 receives");
|
||||
htbuffer_strcat(output, input);
|
||||
htbuffer_strcat(output, "\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user