/* $Id: devxxxyyy.c,v 1.2 2012/01/13 19:56:14 sonya Exp $ */ /* To fill in this template search for * xxx (record type) * yyy (device type) */ /*============================================================================= Name: devxxxyyy.c Abs: yyy Device support for xxx. Auth: 10-oct-2006, Till Straumann (TSS) Rev: -----------------------------------------------------------------------------*/ #if 0 #include "copyright_SLAC.h" /* SLAC copyright comments */ #endif /*----------------------------------------------------------------------------- Mod: (see CVS log) =============================================================================*/ #include #include #include #include #include #include #include #include #define DEVSUPNAM "devxxxyyy" static IOSCANPVT scanlist; typedef struct yyyDpvt_ts_ { IOSCANPVT *scan_p; } yyyDpvt_ts, *yyyDpvt_tps; static long report(int interest) { epicsPrintf(DEVSUPNAM": yyy device support for xxx\n"); return 0; } static long init(int after) { if ( !after ) { scanIoInit(&scanlist); } return 0; } static long init_record(void *record_p) { xxxRecord *xxx_ps = record_p; yyyDpvt_tps dpvt_ps; if ( !(dpvt_ps = xxx_ps->dpvt = malloc(sizeof(*dpvt_ps))) ) { epicsPrintf(DEVSUPNAM": No memory to allocate DPVT\n"); xxx_ps->pact = 1; return -1; } dpvt_ps->scan_p = &scanlist; return 0; } static long get_ioint_info(int cmd, struct dbCommon *record_ps, IOSCANPVT *pvt_ps) { yyyDpvt_tps dpvt_ps = record_ps->dpvt; *pvt_ps = *dpvt_ps->scan_p; return 0; } static long read_xxx(void *record_p) { xxxRecord *xxx_ps = record_p; yyyDpvt_tps dpvt_ps = xxx_ps->dpvt; return 0; } struct { long number; DEVSUPFUN report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN get_ioint_info; DEVSUPFUN read; } devxxxyyy = { 5, report, init, init_record, get_ioint_info, read_xxx }; epicsExportAddress(dset, devxxxyyy);