Mostly minor fixes up until version 0.8.10.
[irreco.git] / irtrans / irserver / src / fileio.h
bloba48a99a6e01ffb1e700be212541025df08612024
1 /*
2 * Copyright (c) 2007, IRTrans GmbH
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of IRTrans GmbH nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
16 * THIS SOFTWARE IS PROVIDED BY IRTrans GmbH ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL IRTrans GmbH BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 int DBReadCommandFile (char remote[]);
31 int DBStoreRemote (FILE *fp,char newremote[]);
32 int DBStoreTimings (FILE *fp);
33 int DBStoreCommands (FILE *fp);
34 int DBStoreCCFCode (char cd[]);
35 void DBShowStatus (void);
36 void ReadRoutingTable (void);
37 void ReadSwitches (void);
38 void ReadAppConfig (void);
39 void WriteSwitches (void);
40 int FindSwitch (word id,word num,char *rem,char *com,word *mode);
41 int StoreSwitch (word id,word num,char *rem,char *com,word mode);
42 int DBStoreRooms (FILE *fp);
43 void DBStoreRouting (FILE *fp,char section[],ROUTING **pnt,int *cnt);
44 void FreeDatabaseMemory (void);
45 void ReadCalibrateData (byte *pnt,byte *pntcal);
47 FILE *DBOpenFile (char remote[],char mode[]);
48 char *DBReadString (char ln[],FILE *fp,int *fpos);
49 char *DBFindSection (FILE *fp,char section[],char data[],char end[],int *fpos);
50 void StoreIRTiming (IRTIMING *irp,char data[]);
51 void ConvertLcase (char *pnt,int len);
52 int GetFunctionCode (byte type,char *com);
53 int GetKeyCode (char *com);
54 void ConvertIRDARAW (char data[]);
57 int FindLineSection (char ln[],char section[]);
58 void StorePulseTiming (IRTIMING *irp,char cmd[],char data[]);
60 FILE *ASCIIOpenRemote (char name[],NETWORKCLIENT *client);
61 void ASCIITimingSample (FILE *fp,NETWORKCLIENT *client);
62 int ASCIIStoreCommand (FILE *fp,IRDATA *ird,char name[],int timing,int seq_number);
63 int ASCIIFindToggleSeq (FILE *fp,IRDATA *ird,char name[]);
64 int ASCIIStoreTiming (FILE *fp,IRDATA *ird,NETWORKLEARNSTAT *stat);
65 int ASCIIStoreRAW (FILE *fp,IRRAW *ird,char name[]);
66 void ASCIIStoreTimingParam (FILE *fp,IRDATA *ird,int timing);
67 int ASCIIFindCommand (FILE *fp,char name[],NETWORKCLIENT *client);
68 int CompareTiming (IRDATA *ird,IRTIMING *irt);
69 int ASCIIFindTiming (FILE *fp,IRDATA *ird);
70 void GetRemoteAddressMask (int num);
72 int DBFindCommandName (byte command[],char remote[],char name[],byte address,int *remote_num,int *command_num,word *command_num_rel,int start);
73 int DBFindRemoteCommand (char remote[],char command[],int *cmd_num,int *rem_num);
74 int DBFindRemoteCommandEx(char remote[],char command[],IRDATA *ir,byte cal);
75 int DBGetIRCode (int cmd_num,IRDATA *ir,int idx,int *mac_len,int *mac_pause,int *rpt_len,byte calflag);
76 int DBGetRepeatCode (int cmd_num,IRDATA *ir,byte calflag);
77 int DBFindCommand (char command[],int remote);
78 int DBFindRemote (char remote[]);
79 void GetNumericCode (char command[],char numeric[],char rem[],char com[]);
80 void GetRemoteDatabase (REMOTEBUFFER *buf,int offset);
81 int GetCommandDatabase (COMMANDBUFFER *buf,char remote[],int offset);