Commit 47c03b4e authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

started moving pragma declarations t pragma.h

parent 63933cfd
......@@ -39,6 +39,8 @@
struct labcomm_encoder;
struct labcomm_decoder;
#include "labcomm_pragma.h"
/*
* Signature entry
*/
......@@ -125,26 +127,6 @@ int labcomm_decoder_ioctl(struct labcomm_decoder *decoder,
uint32_t ioctl_action,
...);
/* pragma */
struct labcomm_encoder *labcomm_pragma_builder_new(
struct labcomm_encoder *e,
char * pragma_type) ;
int labcomm_pragma_send(struct labcomm_encoder* e);
struct labcomm_pragma_handler {
//struct labcomm_decoder_registry *registry;
//TODO: implement map (char * pragma_type) --> decoder_registry *
//to allow having different sets of handlers for different pragma types
int foo;
};
typedef int (*labcomm_pragma_handler_callback)(
struct labcomm_decoder *decoder,
struct labcomm_decoder *registry,
char *pragma_type);
void labcomm_decoder_register_pragma_handler(struct labcomm_decoder *d,
labcomm_pragma_handler_callback pragma_dispatcher);
/*
* Encoder
*/
......
......@@ -39,8 +39,6 @@ static int internal_decoder_run(struct labcomm_decoder *d,
struct labcomm_decoder *registry);
static int internal_decode_one(struct labcomm_decoder *d,
struct labcomm_decoder *registry);
//XXX move to pragma.ch
//int default_pragma_handler(struct labcomm_decoder *d, char *pragma_type);
int default_pragma_handler(struct labcomm_decoder *d,
struct labcomm_decoder *registry,
char *pragma_type)
......
/*
labcomm_pragma.h -- user interface for handling labcomm pragma packets.
Copyright 2014 Sven Gestegård Robertz <sven.robertz@cs.lth.se>
This file is part of LabComm.
LabComm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LabComm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _LABCOMM_PRAGMA_H
#define _LABCOMM_PRAGMA_H
typedef int (*labcomm_pragma_handler_callback)(
struct labcomm_decoder *decoder,
struct labcomm_decoder *registry,
char *pragma_type);
void labcomm_decoder_register_pragma_handler(struct labcomm_decoder *d,
labcomm_pragma_handler_callback pragma_dispatcher);
int default_pragma_handler(struct labcomm_decoder *d,
struct labcomm_decoder *registry,
char *pragma_type);
struct labcomm_encoder *labcomm_pragma_builder_new(
struct labcomm_encoder *e,
char * pragma_type) ;
int labcomm_pragma_send(struct labcomm_encoder* e);
struct labcomm_pragma_handler {
//struct labcomm_decoder_registry *registry;
//TODO: implement map (char * pragma_type) --> decoder_registry *
//to allow having different sets of handlers for different pragma types
int foo;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment