root/trunk/mysqlrad.h

Revision 1894, 22.7 KB (checked in by Dylan, 8 weeks ago)

unxsVZ search set operations work continues.

  • Property svn:keywords set to id
Line 
1/*
2FILE
3        unxsVZ/mysqlrad.h
4AUTHOR
5        (C) 2001-2009 Gary Wallis for Unixservice.
6*/
7
8#include <stdio.h>
9#include <stdlib.h>
10#include <pwd.h>
11#include <signal.h>
12#include <time.h>
13#include <sys/types.h>
14#include <sys/stat.h>
15#include <sys/socket.h>
16#include <crypt.h>
17#include <netinet/in.h>
18#include <arpa/inet.h>
19#include <netdb.h>
20#include <string.h>
21#include <sys/file.h>
22
23#include "cgi.h"
24
25#include <mysql/mysql.h>
26
27#include <unistd.h>
28#include <locale.h>
29#include <monetary.h>
30
31#include "language.h"
32#include "local.h"
33
34//tStatus constants
35#define uACTIVE         1
36#define uONHOLD         2
37#define uOFFLINE        3
38#define uAWAITMOD       4
39#define uAWAITDEL       5
40#define uAWAITACT       6
41#define uCANCELED       7
42#define uMODIFIED       8
43#define uMODPROB        9
44#define uINITSETUP      11
45#define uAWAITMIG       21
46#define uSTOPPED        31
47#define uAWAITSTOP      41
48#define uAWAITTML       51
49#define uAWAITHOST      61
50#define uAWAITIP        71
51#define uAWAITCLONE     81
52#define uAWAITFAIL      91
53#define uREMOTEAPPLIANCE 101
54
55//tProperty fixed types aka constants
56//Actually tType constants
57#define PROP_DATACENTER "1"
58#define PROP_NODE "2"
59#define PROP_CONTAINER "3"
60#define PROP_GROUP "4"
61#define PROP_GROUPTYPE "5"
62#define PROP_CONFIG "6"
63#define PROP_NAMESERVER "7"
64#define PROP_OSTEMPLATE "8"
65#define PROP_SEARCHDOMAIN "9"
66#define uPROP_DATACENTER 1
67#define uPROP_NODE 2
68#define uPROP_CONTAINER 3
69#define uPROP_GROUP 4
70#define uPROP_GROUPTYPE 5
71#define uPROP_CONFIG 6
72#define uPROP_NAMESERVER 7
73#define uPROP_OSTEMPLATE 8
74#define uPROP_SEARCHDOMAIN 9
75#define uPROP_RECJOB    10     
76
77//tJobStatus constants
78#define uWAITING        1
79#define uRUNNING        2
80#define uDONEOK         3
81#define uDONEERROR      4
82#define uSUSPENDED      5
83#define uREDUNDANT      6
84#define uCANCELED       7
85#define uREMOTEWAITING  10
86#define uERROR          14
87
88
89#define cLOGFILE "/var/log/unxsvzlog"
90
91extern char gcHost[];
92extern char gcHostname[];
93extern char gcUser[];
94extern int guPermLevel;
95extern unsigned guLoginClient;
96extern unsigned guReseller;
97extern unsigned guCompany;
98
99extern char gcFunction[];
100extern unsigned guListMode;
101extern char gcQuery[];
102extern char *gcQstr;
103extern char *gcBuildInfo;
104extern char *gcRADStatus;
105extern MYSQL gMysql;
106extern unsigned long gluRowid;
107extern unsigned guStart;
108extern unsigned guEnd;
109extern unsigned guI;
110extern unsigned guN;
111extern char gcCommand[];
112extern char gcFilter[];
113extern char gcFind[];
114extern char gcTable[];
115extern unsigned guMode;
116extern int guError;
117extern char gcErrormsg[];
118
119extern pentry entries[];
120extern entry gentries[];
121extern int x;
122
123void unxsVZ(const char *cResult);
124void ConnectDb(void);
125void Footer_ism3(void);
126void Header_ism3(const char *cMsg, int iJs);
127void ProcessControlVars(pentry entries[], int x);
128void OpenRow(const char *cFieldLabel, const char *cColor);
129void OpenFieldSet(char *cLabel, unsigned uWidth);
130void CloseFieldSet(void);
131void LoadConf(void);
132void NoSuchFunction(void);
133void tContainerGroupPullDown(unsigned uGroup, unsigned uMode);
134void tTablePullDown(const char *cTableName, const char *cFieldName,
135                        const char *cOrderby, unsigned uSelector, unsigned uMode);
136void tTablePullDownOwner(const char *cTableName, const char *cFieldName,
137                        const char *cOrderby, unsigned uSelector, unsigned uMode);
138void tTablePullDownReadOnly(const char *cTableName, const char *cFieldName,
139                        const char *cOrderby, unsigned uSelector);
140int ReadPullDown(const char *cTableName,const char *cFieldName,const char *cLabel);
141char *TextAreaSave(char *cField);
142char *TransformAngleBrackets(char *cField);
143char *EncodeDoubleQuotes(char *cField);
144void YesNoPullDown(char *cFieldName,unsigned uSelect,unsigned uMode);
145void YesNo(unsigned uSelect);
146int ReadYesNoPullDown(const char *cLabel);
147const char *ForeignKey(const char *cTableName, const char *cFieldName, unsigned uKey);
148void GetClientOwner(unsigned uClient, unsigned *uOwner);
149void ExtMainShell(int argc, char *argv[]);
150void jsCalendarInput(char *cInputName,char *cValue,unsigned uMode);
151long unsigned luGetModDate(char *cTableName, unsigned uTablePK);
152long unsigned luGetCreatedDate(char *cTableName, unsigned uTablePK);
153void DashBoard(const char *cOptionalMsg);
154void htmlPlainTextError(const char *cError);
155unsigned uAllowMod(const unsigned uOwner, const unsigned uCreatedBy);
156unsigned uAllowDel(const unsigned uOwner, const unsigned uCreatedBy);
157void ExtListSelect(const char *cTable,const char *cVarList);
158void ExtSelect(const char *cTable,const char *cVarList);
159void ExtSelectSearch(const char *cTable,const char *cVarList,const char *cSearchField,const char *cSearch);
160void ExtSelectRow(const char *cTable,const char *cVarList,unsigned uRow);
161void ExtListSelectPublic(const char *cTable,const char *cVarList);
162void ExtSelectPublic(const char *cTable,const char *cVarList);
163void ExtSelectPublicOrder(const char *cTable,const char *cVarList,const char *cOrderBy);
164void ExtSelectSearchPublic(const char *cTable,const char *cVarList,const char *cSearchField,const char *cSearch);
165void ExtSelectRowPublic(const char *cTable,const char *cVarList,unsigned uRow);
166void CloneReport(const char *cOptionalMsg);
167void tTablePullDownResellers(unsigned uSelector,unsigned uBanner);
168void GetConfiguration(const char *cName,char *cValue,
169                unsigned uDatacenter,
170                unsigned uNode,
171                unsigned uContainer,
172                unsigned uHtml);
173void tTablePullDownAvail(const char *cTableName, const char *cFieldName,
174                        const char *cOrderby, unsigned uSelector, unsigned uMode);
175void tTablePullDownOwnerAvail(const char *cTableName, const char *cFieldName,
176                        const char *cOrderby, unsigned uSelector, unsigned uMode);
177void tTablePullDownDatacenter(const char *cTableName, const char *cFieldName,
178                const char *cOrderby, unsigned uSelector, unsigned uMode, const char *cDatacenter,
179                unsigned uType, unsigned uDatacenter);
180void tTablePullDownOwnerAvailDatacenter(const char *cTableName, const char *cFieldName,
181        const char *cOrderby, unsigned uSelector, unsigned uMode,unsigned uDatacenter,unsigned uClient);
182
183char *cURLEncode(char *cURL);
184void unxsVZLog(unsigned uTablePK, char *cTableName, char *cLogEntry);
185
186 //Standard tInputFunc functions
187char *WordToLower(char *cInput);
188char *IPNumber(char *cInput);
189char *IPv4All(char *cInput);
190char *IPv4Range(char *cInput);
191char *IPv4CIDR(char *cInput);
192char *FQDomainName(char *cInput);
193char *EmailInput(char *cInput);
194char *cMoneyInput(char *cInput);
195char *cMoneyDisplay(char *cInput);
196
197 //Standard tValidFunc functions
198const char *EmptyString(const char *cInput);
199const char *BadIPNum(const char *cInput);
200const char *IsZero(const unsigned uInput);
201
202 //External pagination form processing vars
203void PageMachine(char *cFuncName, int iLmode, char *cMsg);
204
205 //Place ModuleCommands() and Module() prototypes here
206#define ISPNAME "OpenISP"
207#define ISPURL "www.openisp.net"
208#define ADMIN 9
209
210//tDatacenter
211int tDatacenterCommands(pentry entries[], int x);
212void tDatacenter(const char *results);
213void ProcesstDatacenterVars(pentry entries[], int x);
214void tDatacenterContent(void);
215void tDatacenterInputContent(void);
216void tDatacenterInput(unsigned uMode);
217void tDatacenterList(void);
218void NewtDatacenter(unsigned uMode);
219void ModtDatacenter(void);
220void CreatetDatacenter(void);
221void DeletetDatacenter(void);
222void ExttDatacenterGetHook(entry gentries[], int x);
223void ExttDatacenterNavBar(void);
224
225//tNode
226int tNodeCommands(pentry entries[], int x);
227void tNode(const char *results);
228void ProcesstNodeVars(pentry entries[], int x);
229void tNodeContent(void);
230void tNodeInputContent(void);
231void tNodeInput(unsigned uMode);
232void tNodeList(void);
233void NewtNode(unsigned uMode);
234void ModtNode(void);
235void CreatetNode(void);
236void DeletetNode(void);
237void ExttNodeGetHook(entry gentries[], int x);
238void ExttNodeNavBar(void);
239
240//tContainer
241int tContainerCommands(pentry entries[], int x);
242void tContainer(const char *results);
243void ProcesstContainerVars(pentry entries[], int x);
244void tContainerContent(void);
245void tContainerInputContent(void);
246void tContainerInput(unsigned uMode);
247void tContainerList(void);
248void NewtContainer(unsigned uMode);
249void ModtContainer(void);
250void CreatetContainer(void);
251void DeletetContainer(void);
252void ExttContainerGetHook(entry gentries[], int x);
253void ExttContainerNavBar(void);
254unsigned CommonCloneContainer(
255                unsigned uContainer,
256                unsigned uOSTemplate,
257                unsigned uConfig,
258                unsigned uNameserver,
259                unsigned uSearchdomain,
260                unsigned uDatacenter,
261                unsigned uTargetDatacenter,
262                unsigned uOwner,
263                const char *cLabel,
264                unsigned uNode,
265                unsigned uStatus,
266                const char *cHostname,
267                const char *cClassC,
268                unsigned uWizIPv4,
269                char *cWizLabel,
270                char *cWizHostname,
271                unsigned uTargetNode,
272                unsigned uSyncPeriod,
273                unsigned uLoginClient,
274                unsigned uCloneStop,
275                unsigned uMode);
276void CopyContainerProps(unsigned uSource, unsigned uTarget);
277unsigned CloneContainerJob(unsigned uDatacenter, unsigned uNode, unsigned uContainer,
278                                unsigned uTargetNode, unsigned uNewVeid, unsigned uPrevStatus,
279                                unsigned uOwner,unsigned uCreatedBy,unsigned uCloneStop);
280
281//tProperty
282int tPropertyCommands(pentry entries[], int x);
283void tProperty(const char *results);
284void ProcesstPropertyVars(pentry entries[], int x);
285void tPropertyContent(void);
286void tPropertyInputContent(void);
287void tPropertyInput(unsigned uMode);
288void tPropertyList(void);
289void NewtProperty(unsigned uMode);
290void ModtProperty(void);
291void CreatetProperty(void);
292void DeletetProperty(void);
293void ExttPropertyGetHook(entry gentries[], int x);
294void ExttPropertyNavBar(void);
295
296//tType
297int tTypeCommands(pentry entries[], int x);
298void tType(const char *results);
299void ProcesstTypeVars(pentry entries[], int x);
300void tTypeContent(void);
301void tTypeInputContent(void);
302void tTypeInput(unsigned uMode);
303void tTypeList(void);
304void NewtType(unsigned uMode);
305void ModtType(void);
306void CreatetType(void);
307void DeletetType(void);
308void ExttTypeGetHook(entry gentries[], int x);
309void ExttTypeNavBar(void);
310
311//tOSTemplate
312int tOSTemplateCommands(pentry entries[], int x);
313void tOSTemplate(const char *results);
314void ProcesstOSTemplateVars(pentry entries[], int x);
315void tOSTemplateContent(void);
316void tOSTemplateInputContent(void);
317void tOSTemplateInput(unsigned uMode);
318void tOSTemplateList(void);
319void NewtOSTemplate(unsigned uMode);
320void ModtOSTemplate(void);
321void CreatetOSTemplate(void);
322void DeletetOSTemplate(void);
323void ExttOSTemplateGetHook(entry gentries[], int x);
324void ExttOSTemplateNavBar(void);
325
326//tNameserver
327int tNameserverCommands(pentry entries[], int x);
328void tNameserver(const char *results);
329void ProcesstNameserverVars(pentry entries[], int x);
330void tNameserverContent(void);
331void tNameserverInputContent(void);
332void tNameserverInput(unsigned uMode);
333void tNameserverList(void);
334void NewtNameserver(unsigned uMode);
335void ModtNameserver(void);
336void CreatetNameserver(void);
337void DeletetNameserver(void);
338void ExttNameserverGetHook(entry gentries[], int x);
339void ExttNameserverNavBar(void);
340
341//tSearchdomain
342int tSearchdomainCommands(pentry entries[], int x);
343void tSearchdomain(const char *results);
344void ProcesstSearchdomainVars(pentry entries[], int x);
345void tSearchdomainContent(void);
346void tSearchdomainInputContent(void);
347void tSearchdomainInput(unsigned uMode);
348void tSearchdomainList(void);
349void NewtSearchdomain(unsigned uMode);
350void ModtSearchdomain(void);
351void CreatetSearchdomain(void);
352void DeletetSearchdomain(void);
353void ExttSearchdomainGetHook(entry gentries[], int x);
354void ExttSearchdomainNavBar(void);
355
356//tConfig
357int tConfigCommands(pentry entries[], int x);
358void tConfig(const char *results);
359void ProcesstConfigVars(pentry entries[], int x);
360void tConfigContent(void);
361void tConfigInputContent(void);
362void tConfigInput(unsigned uMode);
363void tConfigList(void);
364void NewtConfig(unsigned uMode);
365void ModtConfig(void);
366void CreatetConfig(void);
367void DeletetConfig(void);
368void ExttConfigGetHook(entry gentries[], int x);
369void ExttConfigNavBar(void);
370
371//tIP
372int tIPCommands(pentry entries[], int x);
373void tIP(const char *results);
374void ProcesstIPVars(pentry entries[], int x);
375void tIPContent(void);
376void tIPInputContent(void);
377void tIPInput(unsigned uMode);
378void tIPList(void);
379void NewtIP(unsigned uMode);
380void ModtIP(void);
381void CreatetIP(void);
382void DeletetIP(void);
383void ExttIPGetHook(entry gentries[], int x);
384void ExttIPNavBar(void);
385
386//tGroupType
387int tGroupTypeCommands(pentry entries[], int x);
388void tGroupType(const char *results);
389void ProcesstGroupTypeVars(pentry entries[], int x);
390void tGroupTypeContent(void);
391void tGroupTypeInputContent(void);
392void tGroupTypeInput(unsigned uMode);
393void tGroupTypeList(void);
394void NewtGroupType(unsigned uMode);
395void ModtGroupType(void);
396void CreatetGroupType(void);
397void DeletetGroupType(void);
398void ExttGroupTypeGetHook(entry gentries[], int x);
399void ExttGroupTypeNavBar(void);
400
401//tGroup
402int tGroupCommands(pentry entries[], int x);
403void tGroup(const char *results);
404void ProcesstGroupVars(pentry entries[], int x);
405void tGroupContent(void);
406void tGroupInputContent(void);
407void tGroupInput(unsigned uMode);
408void tGroupList(void);
409void NewtGroup(unsigned uMode);
410void ModtGroup(void);
411void CreatetGroup(void);
412void DeletetGroup(void);
413void ExttGroupGetHook(entry gentries[], int x);
414void ExttGroupNavBar(void);
415
416//tGroupGlue
417int tGroupGlueCommands(pentry entries[], int x);
418void tGroupGlue(const char *results);
419void ProcesstGroupGlueVars(pentry entries[], int x);
420void tGroupGlueContent(void);
421void tGroupGlueInputContent(void);
422void tGroupGlueInput(unsigned uMode);
423void tGroupGlueList(void);
424void NewtGroupGlue(unsigned uMode);
425void ModtGroupGlue(void);
426void CreatetGroupGlue(void);
427void DeletetGroupGlue(void);
428void ExttGroupGlueGetHook(entry gentries[], int x);
429void ExttGroupGlueNavBar(void);
430
431//tClient
432int tClientCommands(pentry entries[], int x);
433void tClient(const char *results);
434void ProcesstClientVars(pentry entries[], int x);
435void tClientContent(void);
436void tClientInputContent(void);
437void tClientInput(unsigned uMode);
438void tClientList(void);
439void NewtClient(unsigned uMode);
440void ModtClient(void);
441void CreatetClient(void);
442void DeletetClient(void);
443void ExttClientGetHook(entry gentries[], int x);
444void ExttClientNavBar(void);
445
446//tAuthorize
447int tAuthorizeCommands(pentry entries[], int x);
448void tAuthorize(const char *results);
449void ProcesstAuthorizeVars(pentry entries[], int x);
450void tAuthorizeContent(void);
451void tAuthorizeInputContent(void);
452void tAuthorizeInput(unsigned uMode);
453void tAuthorizeList(void);
454void NewtAuthorize(unsigned uMode);
455void ModtAuthorize(void);
456void CreatetAuthorize(void);
457void DeletetAuthorize(void);
458void ExttAuthorizeGetHook(entry gentries[], int x);
459void ExttAuthorizeNavBar(void);
460
461//tTemplate
462int tTemplateCommands(pentry entries[], int x);
463void tTemplate(const char *results);
464void ProcesstTemplateVars(pentry entries[], int x);
465void tTemplateContent(void);
466void tTemplateInputContent(void);
467void tTemplateInput(unsigned uMode);
468void tTemplateList(void);
469void NewtTemplate(unsigned uMode);
470void ModtTemplate(void);
471void CreatetTemplate(void);
472void DeletetTemplate(void);
473void ExttTemplateGetHook(entry gentries[], int x);
474void ExttTemplateNavBar(void);
475
476//tTemplateSet
477int tTemplateSetCommands(pentry entries[], int x);
478void tTemplateSet(const char *results);
479void ProcesstTemplateSetVars(pentry entries[], int x);
480void tTemplateSetContent(void);
481void tTemplateSetInputContent(void);
482void tTemplateSetInput(unsigned uMode);
483void tTemplateSetList(void);
484void NewtTemplateSet(unsigned uMode);
485void ModtTemplateSet(void);
486void CreatetTemplateSet(void);
487void DeletetTemplateSet(void);
488void ExttTemplateSetGetHook(entry gentries[], int x);
489void ExttTemplateSetNavBar(void);
490
491//tTemplateType
492int tTemplateTypeCommands(pentry entries[], int x);
493void tTemplateType(const char *results);
494void ProcesstTemplateTypeVars(pentry entries[], int x);
495void tTemplateTypeContent(void);
496void tTemplateTypeInputContent(void);
497void tTemplateTypeInput(unsigned uMode);
498void tTemplateTypeList(void);
499void NewtTemplateType(unsigned uMode);
500void ModtTemplateType(void);
501void CreatetTemplateType(void);
502void DeletetTemplateType(void);
503void ExttTemplateTypeGetHook(entry gentries[], int x);
504void ExttTemplateTypeNavBar(void);
505
506//tLog
507int tLogCommands(pentry entries[], int x);
508void tLog(const char *results);
509void ProcesstLogVars(pentry entries[], int x);
510void tLogContent(void);
511void tLogInputContent(void);
512void tLogInput(unsigned uMode);
513void tLogList(void);
514void NewtLog(unsigned uMode);
515void ModtLog(void);
516void CreatetLog(void);
517void DeletetLog(void);
518void ExttLogGetHook(entry gentries[], int x);
519void ExttLogNavBar(void);
520
521//tLogType
522int tLogTypeCommands(pentry entries[], int x);
523void tLogType(const char *results);
524void ProcesstLogTypeVars(pentry entries[], int x);
525void tLogTypeContent(void);
526void tLogTypeInputContent(void);
527void tLogTypeInput(unsigned uMode);
528void tLogTypeList(void);
529void NewtLogType(unsigned uMode);
530void ModtLogType(void);
531void CreatetLogType(void);
532void DeletetLogType(void);
533void ExttLogTypeGetHook(entry gentries[], int x);
534void ExttLogTypeNavBar(void);
535
536//tLogMonth
537int tLogMonthCommands(pentry entries[], int x);
538void tLogMonth(const char *results);
539void ProcesstLogMonthVars(pentry entries[], int x);
540void tLogMonthContent(void);
541void tLogMonthInputContent(void);
542void tLogMonthInput(unsigned uMode);
543void tLogMonthList(void);
544void NewtLogMonth(unsigned uMode);
545void ModtLogMonth(void);
546void CreatetLogMonth(void);
547void DeletetLogMonth(void);
548void ExttLogMonthGetHook(entry gentries[], int x);
549void ExttLogMonthNavBar(void);
550
551//tMonth
552int tMonthCommands(pentry entries[], int x);
553void tMonth(const char *results);
554void ProcesstMonthVars(pentry entries[], int x);
555void tMonthContent(void);
556void tMonthInputContent(void);
557void tMonthInput(unsigned uMode);
558void tMonthList(void);
559void NewtMonth(unsigned uMode);
560void ModtMonth(void);
561void CreatetMonth(void);
562void DeletetMonth(void);
563void ExttMonthGetHook(entry gentries[], int x);
564void ExttMonthNavBar(void);
565
566//tGlossary
567int tGlossaryCommands(pentry entries[], int x);
568void tGlossary(const char *results);
569void ProcesstGlossaryVars(pentry entries[], int x);
570void tGlossaryContent(void);
571void tGlossaryInputContent(void);
572void tGlossaryInput(unsigned uMode);
573void tGlossaryList(void);
574void NewtGlossary(unsigned uMode);
575void ModtGlossary(void);
576void CreatetGlossary(void);
577void DeletetGlossary(void);
578void ExttGlossaryGetHook(entry gentries[], int x);
579void ExttGlossaryNavBar(void);
580
581//tJob
582int tJobCommands(pentry entries[], int x);
583void tJob(const char *results);
584void ProcesstJobVars(pentry entries[], int x);
585void tJobContent(void);
586void tJobInputContent(void);
587void tJobInput(unsigned uMode);
588void tJobList(void);
589void NewtJob(unsigned uMode);
590void ModtJob(void);
591void CreatetJob(void);
592void DeletetJob(void);
593void ExttJobGetHook(entry gentries[], int x);
594void ExttJobNavBar(void);
595
596//tJobStatus
597int tJobStatusCommands(pentry entries[], int x);
598void tJobStatus(const char *results);
599void ProcesstJobStatusVars(pentry entries[], int x);
600void tJobStatusContent(void);
601void tJobStatusInputContent(void);
602void tJobStatusInput(unsigned uMode);
603void tJobStatusList(void);
604void NewtJobStatus(unsigned uMode);
605void ModtJobStatus(void);
606void CreatetJobStatus(void);
607void DeletetJobStatus(void);
608void ExttJobStatusGetHook(entry gentries[], int x);
609void ExttJobStatusNavBar(void);
610
611//tStatus
612int tStatusCommands(pentry entries[], int x);
613void tStatus(const char *results);
614void ProcesstStatusVars(pentry entries[], int x);
615void tStatusContent(void);
616void tStatusInputContent(void);
617void tStatusInput(unsigned uMode);
618void tStatusList(void);
619void NewtStatus(unsigned uMode);
620void ModtStatus(void);
621void CreatetStatus(void);
622void DeletetStatus(void);
623void ExttStatusGetHook(entry gentries[], int x);
624void ExttStatusNavBar(void);
625
626//tConfiguration
627int tConfigurationCommands(pentry entries[], int x);
628void tConfiguration(const char *results);
629void ProcesstConfigurationVars(pentry entries[], int x);
630void tConfigurationContent(void);
631void tConfigurationInputContent(void);
632void tConfigurationInput(unsigned uMode);
633void tConfigurationList(void);
634void NewtConfiguration(unsigned uMode);
635void ModtConfiguration(void);
636void CreatetConfiguration(void);
637void DeletetConfiguration(void);
638void ExttConfigurationGetHook(entry gentries[], int x);
639void ExttConfigurationNavBar(void);
640
641//glossary.c
642void GlossaryGetHook(entry gentries[],int x);
643
644
645//In-line code macros
646
647//Common
648#define _RUN_QUERY mysql_query(&gMysql,gcQuery);if(mysql_errno(&gMysql))
649
650//MySQL run query only w/error checking
651//HTML
652#define MYSQL_RUN _RUN_QUERY htmlPlainTextError(mysql_error(&gMysql))
653//Text
654#define MYSQL_RUN_TEXT _RUN_QUERY{fprintf(stderr,"%s\n",mysql_error(&gMysql));exit(1);}
655
656//Text with return() instead of exit()
657//return(1); if MySQL error
658#define MYSQL_RUN_TEXT_RETURN _RUN_QUERY{fprintf(stderr,"%s\n",mysql_error(&gMysql));return(1);}
659//return; if MySQL error
660#define MYSQL_RUN_TEXT_RET_VOID _RUN_QUERY{fprintf(stderr,"%s\n",mysql_error(&gMysql));return;}
661
662//MySQL run query and store result w/error checking
663//HTML
664#define MYSQL_RUN_STORE(res) MYSQL_RUN;res=mysql_store_result(&gMysql)
665//Text
666#define MYSQL_RUN_STORE_TEXT(res) MYSQL_RUN_TEXT;res=mysql_store_result(&gMysql)
667
668//MySQL run query and store result w/error checking (Text); uses return() call instead of exit()
669//return(1); if MySQL error
670#define MYSQL_RUN_STORE_TEXT_RETURN(res) MYSQL_RUN_TEXT_RETURN res=mysql_store_result(&gMysql)
671//return; if MySQL error
672#define MYSQL_RUN_STORE_TEXT_RET_VOID(res) MYSQL_RUN_TEXT_RET_VOID res=mysql_store_result(&gMysql)
673
674//In-line code macros rev 2
675
676//Common - This macro shouldn't be used directly, as is part of the others only
677#define macro_mySQLQueryBasic mysql_query(&gMysql,gcQuery);\
678                                if(mysql_errno(&gMysql))
679
680//MySQL run query only w/error checking
681//HTML
682#define macro_mySQLQueryHTMLError macro_mySQLQueryBasic \
683                                        htmlPlainTextError(mysql_error(&gMysql))
684//Text
685#define macro_mySQLQueryTextError macro_mySQLQueryBasic\
686                                        {\
687                                                fprintf(stderr,"%s\n",mysql_error(&gMysql));\
688                                                exit(1);\
689                                        }
690
691//Text with return() instead of exit()
692//return(1); if MySQL error
693#define macro_mySQLRunReturnInt macro_mySQLQueryBasic\
694                                {\
695                                        fprintf(stderr,"%s\n",mysql_error(&gMysql));\
696                                        return(1);\
697                                }
698//return void; if MySQL error
699#define macro_mySQLRunReturnVoid macro_mySQLQueryBasic\
700                                {\
701                                        fprintf(stderr,"%s\n",mysql_error(&gMysql));\
702                                        return;\
703                                }
704
705//MySQL run query and store result w/error checking
706//HTML
707#define macro_mySQLRunAndStore(res) macro_mySQLQueryHTMLError;\
708                                        res=mysql_store_result(&gMysql)
709//Text
710#define macro_mySQLRunAndStoreText(res) macro_mySQLQueryTextError;\
711                                        res=mysql_store_result(&gMysql)
712
713//MySQL run query and store result w/error checking (Text); uses return() call instead of exit()
714//return(1); if MySQL error
715#define macro_mySQLRunAndStoreTextIntRet(res) macro_mySQLRunReturnInt;\
716                                                res=mysql_store_result(&gMysql)
717//return; if MySQL error
718#define macro_mySQLRunAndStoreTextVoidRet(res) macro_mySQLRunReturnVoid;\
719                                                res=mysql_store_result(&gMysql)
720
721//Backup container constants
722#define HOT_CLONE 0
723#define WARM_CLONE 1
724#define COLD_CLONE 2
725
726//Table Variables
727
728
729void GetContainerProp(const unsigned uContainer,const char *cName,char *cValue);
730void ChangeGroup(unsigned uContainer, unsigned uGroup);
731unsigned uGetGroup(unsigned uNode, unsigned uContainer);
Note: See TracBrowser for help on using the browser.