2006-11-22 07:03:10 -06:00
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2006 by Dominic Rath *
|
|
|
|
* Dominic.Rath@gmx.de *
|
|
|
|
* *
|
|
|
|
* This program 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 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program 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, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
***************************************************************************/
|
|
|
|
#ifndef PLD_H
|
|
|
|
#define PLD_H
|
|
|
|
|
|
|
|
#include "command.h"
|
|
|
|
|
2009-11-13 10:15:00 -06:00
|
|
|
struct pld_device;
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2009-11-10 03:21:29 -06:00
|
|
|
#define __PLD_DEVICE_COMMAND(name) \
|
2009-11-13 10:15:00 -06:00
|
|
|
COMMAND_HELPER(name, struct pld_device *pld)
|
2009-11-10 03:21:29 -06:00
|
|
|
|
2009-11-13 10:14:52 -06:00
|
|
|
struct pld_driver
|
2006-11-22 07:03:10 -06:00
|
|
|
{
|
|
|
|
char *name;
|
2009-11-10 03:21:29 -06:00
|
|
|
__PLD_DEVICE_COMMAND((*pld_device_command));
|
2009-11-13 15:25:47 -06:00
|
|
|
int (*register_commands)(struct command_context *cmd_ctx);
|
2009-11-13 10:15:00 -06:00
|
|
|
int (*load)(struct pld_device *pld_device, const char *filename);
|
2009-11-13 10:14:52 -06:00
|
|
|
};
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2009-11-10 03:21:29 -06:00
|
|
|
#define PLD_DEVICE_COMMAND_HANDLER(name) static __PLD_DEVICE_COMMAND(name)
|
|
|
|
|
2009-11-13 10:15:00 -06:00
|
|
|
struct pld_device
|
2006-11-22 07:03:10 -06:00
|
|
|
{
|
2009-11-13 10:14:52 -06:00
|
|
|
struct pld_driver *driver;
|
2006-11-22 07:03:10 -06:00
|
|
|
void *driver_priv;
|
2009-11-13 10:15:00 -06:00
|
|
|
struct pld_device *next;
|
|
|
|
};
|
2006-11-22 07:03:10 -06:00
|
|
|
|
2009-11-13 15:25:47 -06:00
|
|
|
int pld_register_commands(struct command_context *cmd_ctx);
|
2009-11-09 05:38:34 -06:00
|
|
|
|
2009-11-13 15:25:47 -06:00
|
|
|
int pld_init(struct command_context *cmd_ctx);
|
2009-11-09 05:38:34 -06:00
|
|
|
|
2009-11-13 10:15:00 -06:00
|
|
|
struct pld_device *get_pld_device_by_num(int num);
|
2006-11-22 07:03:10 -06:00
|
|
|
|
|
|
|
#define ERROR_PLD_DEVICE_INVALID (-1000)
|
|
|
|
#define ERROR_PLD_FILE_LOAD_FAILED (-1001)
|
|
|
|
|
|
|
|
#endif /* PLD_H */
|