~ubuntu-branches/debian/experimental/ion/experimental

« back to all changes in this revision

Viewing changes to ici/library/symtab.c

  • Committer: Package Import Robot
  • Author(s): Leo Iannacone
  • Date: 2012-02-01 09:46:31 UTC
  • Revision ID: package-import@ubuntu.com-20120201094631-qpfwehc1b7ftkjgx
Tags: upstream-2.5.3~dfsg1
ImportĀ upstreamĀ versionĀ 2.5.3~dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
        symtab.c:       baseline private symbol table for ION stack
 
3
                        with definition of sm_FindFunction(), which 
 
4
                        accesses this table.
 
5
                        
 
6
                        Note that this is a canonical private symbol
 
7
                        table, provided as a model for mission-
 
8
                        specific symbol tables.  A mission desiring
 
9
                        to override this file should place a copy
 
10
                        of it in a mission-specific "include"
 
11
                        directory, modify that copy, and modify
 
12
                        the ici Makefile to ensure that the compiler
 
13
                        looks for symtab.c in that mission-specific
 
14
                        include directory rather than in ici/library.
 
15
 
 
16
        Author: Scott Burleigh, JPL
 
17
 
 
18
        Copyright (c) 2006, California Institute of Technology.
 
19
        ALL RIGHTS RESERVED.  U.S. Government Sponsorship
 
20
        acknowledged.
 
21
                                                                        */
 
22
 
 
23
extern int      ionadmin(int, int, int, int, int, int, int, int, int, int);
 
24
extern int      ionexit(int, int, int, int, int, int, int, int, int, int);
 
25
extern int      ltpadmin(int, int, int, int, int, int, int, int, int, int);
 
26
extern int      bpadmin(int, int, int, int, int, int, int, int, int, int);
 
27
extern int      ipnadmin(int, int, int, int, int, int, int, int, int, int);
 
28
extern int      rfxclock(int, int, int, int, int, int, int, int, int, int);
 
29
extern int      ltpclock(int, int, int, int, int, int, int, int, int, int);
 
30
extern int      ltpmeter(int, int, int, int, int, int, int, int, int, int);
 
31
extern int      bpclock(int, int, int, int, int, int, int, int, int, int);
 
32
extern int      ipnfw(int, int, int, int, int, int, int, int, int, int);
 
33
extern int      ltpcli(int, int, int, int, int, int, int, int, int, int);
 
34
extern int      ltpclo(int, int, int, int, int, int, int, int, int, int);
 
35
extern int      udplsi(int, int, int, int, int, int, int, int, int, int);
 
36
extern int      udplso(int, int, int, int, int, int, int, int, int, int);
 
37
extern int      aoslsi(int, int, int, int, int, int, int, int, int, int);
 
38
extern int      aoslso(int, int, int, int, int, int, int, int, int, int);
 
39
extern int      udpcli(int, int, int, int, int, int, int, int, int, int);
 
40
extern int      udpclo(int, int, int, int, int, int, int, int, int, int);
 
41
extern int      tcpcli(int, int, int, int, int, int, int, int, int, int);
 
42
extern int      tcpclo(int, int, int, int, int, int, int, int, int, int);
 
43
extern int      brsccla(int, int, int, int, int, int, int, int, int, int);
 
44
extern int      brsscla(int, int, int, int, int, int, int, int, int, int);
 
45
extern int      ipnadminep(int, int, int, int, int, int, int, int, int, int);
 
46
 
 
47
typedef struct
 
48
{
 
49
        char    *name;
 
50
        FUNCPTR funcPtr;
 
51
        int     priority;
 
52
        int     stackSize;
 
53
} SymTabEntry;
 
54
 
 
55
FUNCPTR sm_FindFunction(char *name, int *priority, int *stackSize)
 
56
{
 
57
        static SymTabEntry      symbols[] =
 
58
        {
 
59
                { "ionadmin",   (FUNCPTR) ionadmin,     ICI_PRIORITY,   32768 },
 
60
                { "ionexit",    (FUNCPTR) ionexit,      ICI_PRIORITY,   32768 },
 
61
                { "ltpadmin",   (FUNCPTR) ltpadmin,     ICI_PRIORITY,   32768 },
 
62
                { "bpadmin",    (FUNCPTR) bpadmin,      ICI_PRIORITY,   32768 },
 
63
                { "ipnadmin",   (FUNCPTR) ipnadmin,     ICI_PRIORITY,   32768 },
 
64
                { "rfxclock",   (FUNCPTR) rfxclock,     ICI_PRIORITY,   32768 },
 
65
                { "ltpclock",   (FUNCPTR) ltpclock,     ICI_PRIORITY,   32768 },
 
66
                { "ltpmeter",   (FUNCPTR) ltpmeter,     ICI_PRIORITY,   32768 },
 
67
                { "bpclock",    (FUNCPTR) bpclock,      ICI_PRIORITY,   4096  },
 
68
                { "ipnfw",      (FUNCPTR) ipnfw,        ICI_PRIORITY,   65536 },
 
69
                { "ltpcli",     (FUNCPTR) ltpcli,       ICI_PRIORITY,   32768 },
 
70
                { "ltpclo",     (FUNCPTR) ltpclo,       ICI_PRIORITY,   32768 },
 
71
                { "udplsi",     (FUNCPTR) udplsi,       ICI_PRIORITY,   32768 },
 
72
                { "udplso",     (FUNCPTR) udplso,       ICI_PRIORITY,   32768 },
 
73
                { "aoslsi",     (FUNCPTR) aoslsi,       ICI_PRIORITY,   32768 },
 
74
                { "aoslso",     (FUNCPTR) aoslso,       ICI_PRIORITY,   32768 },
 
75
                { "udpcli",     (FUNCPTR) udpcli,       ICI_PRIORITY,   32768 },
 
76
                { "udpclo",     (FUNCPTR) udpclo,       ICI_PRIORITY,   32768 },
 
77
                { "tcpcli",     (FUNCPTR) tcpcli,       ICI_PRIORITY,   4096  },
 
78
                { "tcpclo",     (FUNCPTR) tcpclo,       ICI_PRIORITY,   4096  },
 
79
                { "brsccla",    (FUNCPTR) brsccla,      ICI_PRIORITY,   32768 },
 
80
                { "brsscla",    (FUNCPTR) brsscla,      ICI_PRIORITY,   32768 },
 
81
                { "ipnadminep", (FUNCPTR) ipnadminep,   ICI_PRIORITY,   24576 }
 
82
        };
 
83
        static int      numSymbols = sizeof symbols / sizeof(SymTabEntry);
 
84
        int             i;
 
85
 
 
86
        CHKNULL(name);
 
87
        CHKNULL(priority);
 
88
        CHKNULL(stackSize);
 
89
        for (i = 0; i < numSymbols; i++)
 
90
        {
 
91
                if (strcmp(name, symbols[i].name) == 0)
 
92
                {
 
93
                        if (*priority == 0)     /*      Use default.    */
 
94
                        {
 
95
                                *priority = symbols[i].priority;
 
96
                        }
 
97
 
 
98
                        if (*stackSize == 0)    /*      Use default.    */
 
99
                        {
 
100
                                *stackSize = symbols[i].stackSize;
 
101
                        }
 
102
 
 
103
                        return symbols[i].funcPtr;
 
104
                }
 
105
        }
 
106
 
 
107
        return NULL;
 
108
}