:pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Tue Dec 4 22:45 CET 2001
[gnokii.git] / common / gsm-common.c
1 /*
2
3   $Id$
4
5   G N O K I I
6
7   A Linux/Unix toolset and driver for Nokia mobile phones.
8
9   Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml.
10
11   Released under the terms of the GNU GPL, see file COPYING for more details.
12
13   $Log$
14   Revision 1.1.1.1  2001/11/25 21:58:59  short
15   :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001
16
17   Revision 1.8  2001/11/13 16:12:20  pkot
18   Preparing libsms to get to work. 6210/7110 SMS and SMS Folder updates
19
20   Revision 1.7  2001/11/08 16:34:19  pkot
21   Updates to work with new libsms
22
23   Revision 1.6  2001/09/14 12:15:28  pkot
24   Cleanups from 0.3.3 (part1)
25
26   Revision 1.5  2001/03/22 16:17:05  chris
27   Tidy-ups and fixed gnokii/Makefile and gnokii/ChangeLog which I somehow corrupted.
28
29   Revision 1.4  2001/03/21 23:36:04  chris
30   Added the statemachine
31   This will break gnokii --identify and --monitor except for 6210/7110
32
33   Revision 1.3  2001/02/28 21:26:51  machek
34   Added StrToMemoryType utility function
35
36   Revision 1.2  2001/02/03 23:56:15  chris
37   Start of work on irda support (now we just need fbus-irda.c!)
38   Proper unicode support in 7110 code (from pkot)
39
40   Revision 1.1  2001/01/12 14:28:39  pkot
41   Forgot to add this file. ;-)
42
43
44 */
45
46 #include <string.h>
47 #include "gsm-common.h"
48
49 GSM_Error Unimplemented(void)
50 {
51         return GE_NOTIMPLEMENTED;
52 }
53
54 GSM_MemoryType StrToMemoryType(const char *s)
55 {
56 #define X(a) if (!strcmp(s, #a)) return GMT_##a;
57         X(ME);
58         X(SM);
59         X(FD);
60         X(ON);
61         X(EN);
62         X(DC);
63         X(RC);
64         X(MC);
65         X(LD);
66         X(MT);
67         X(IN);
68         X(OU);
69         X(AR);
70         X(TE);
71         X(F1);
72         X(F2);
73         X(F3);
74         X(F4);
75         X(F5);
76         X(F6);
77         X(F7);
78         X(F8);
79         X(F9);
80         X(F10);
81         X(F11);
82         X(F12);
83         X(F13);
84         X(F14);
85         X(F15);
86         X(F16);
87         X(F17);
88         X(F18);
89         X(F19);
90         X(F20);
91         return GMT_XX;
92 #undef X
93 }
94
95 /* This very small function is just to make it */
96 /* easier to clear the data struct every time one is created */
97 inline void GSM_DataClear(GSM_Data *data)
98 {
99         memset(data, 0, sizeof(GSM_Data));
100 }