File: tolua_fcdb.pkg

package info (click to toggle)
freeciv 3.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 242,732 kB
  • sloc: ansic: 459,107; cpp: 33,398; sh: 8,632; makefile: 7,457; python: 2,133; xml: 1,419
file content (62 lines) | stat: -rw-r--r-- 2,155 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*****************************************************************************
 Freeciv - Copyright (C) 2005 - The Freeciv Project
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
*****************************************************************************/

/*****************************************************************************
  ADVERTISEMENT: do not attempt to change the name of the API functions.
  They *must* be compatible between the minor Freeciv versions within the
  same major version. If you really like to change a function name, be sure
  to keep also the old one running.
*****************************************************************************/

$#ifdef HAVE_CONFIG_H
$#include <fc_config.h>
$#endif

/* common/scriptcore */
$#include "luascript_types.h"

/* server/scripting */
$#include "api_fcdb_auth.h"
$#include "api_fcdb_base.h"
$#include "script_fcdb.h"

/* Authentication module. */
module auth {
  const char *api_auth_get_username
    @ get_username(lua_State *L, Connection *pconn);
  const char *api_auth_get_ipaddr
    @ get_ipaddr(lua_State *L, Connection *pconn);
}

/* Freeciv database (fcdb) module. */
module fcdb {
  const char *api_fcdb_option
    @ option(lua_State *L, const char *name);
}

$[
-- Definitions for backward compatibility with Freeciv 2.4.
-- Old database.lua scripts might pass fcdb.param.USER etc to fcdb.option(),
-- but it's deprecated in favour of literal strings, and the strings listed
-- here are only conventional.
fcdb["param"] = {
  HOST       = "host",
  USER       = "user",
  PORT       = "port",
  PASSWORD   = "password",
  DATABASE   = "database",
  TABLE_USER = "table_user",
  TABLE_LOG  = "table_log",
  BACKEND    = "backend"
}
$]