remove symbian
This commit is contained in:
parent
043aa32cc2
commit
495f5ff51b
13 changed files with 1 additions and 460 deletions
|
@ -21,11 +21,6 @@
|
|||
#include <re_dbg.h>
|
||||
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
extern int get_symbiandns(struct sa *nsv, uint32_t *n);
|
||||
#endif
|
||||
|
||||
|
||||
static int parse_resolv_conf(char *domain, size_t dsize,
|
||||
struct sa *srvv, uint32_t *n)
|
||||
{
|
||||
|
@ -147,10 +142,6 @@ int dns_srv_get(char *domain, size_t dsize, struct sa *srvv, uint32_t *n)
|
|||
err = get_windns(domain, dsize, srvv, n);
|
||||
#endif
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
err = get_symbiandns(srvv, n);
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
err = get_android_dns(srvv, n);
|
||||
#endif
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
/**
|
||||
* @file srv.cpp Get DNS Server IP code for Symbian OS
|
||||
*
|
||||
* Copyright (C) 2010 Creytiv.com
|
||||
*/
|
||||
#include <es_sock.h>
|
||||
#include <in_sock.h>
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include <re_types.h>
|
||||
#include <re_fmt.h>
|
||||
#include <re_list.h>
|
||||
#include <re_sa.h>
|
||||
#include <re_net.h>
|
||||
#include <re_dns.h>
|
||||
extern int get_symbiandns(struct sa *nsv, uint32_t *n);
|
||||
}
|
||||
|
||||
|
||||
int get_symbiandns(struct sa *nsv, uint32_t *n)
|
||||
{
|
||||
RSocketServ serv;
|
||||
RSocket sock;
|
||||
uint32_t i = 0;
|
||||
int ret;
|
||||
|
||||
if (!nsv || !n || !*n)
|
||||
return EINVAL;
|
||||
|
||||
ret = serv.Connect();
|
||||
if (KErrNone != ret)
|
||||
return kerr2errno(ret);
|
||||
ret = sock.Open(serv, KAfInet, KSockStream, KProtocolInetTcp);
|
||||
if (KErrNone != ret) {
|
||||
serv.Close();
|
||||
return kerr2errno(ret);
|
||||
}
|
||||
sock.SetOpt(KSoInetEnumInterfaces, KSolInetIfCtrl);
|
||||
|
||||
TPckgBuf<TSoInetInterfaceInfo> ifinfo;
|
||||
while (sock.GetOpt(KSoInetNextInterface, KSolInetIfCtrl,
|
||||
ifinfo)==KErrNone) {
|
||||
struct sa sa;
|
||||
|
||||
if (EIfUp != ifinfo().iState)
|
||||
continue;
|
||||
|
||||
sa_set_in(&sa, ifinfo().iAddress.Address(), 0);
|
||||
|
||||
if (sa_is_loopback(&sa))
|
||||
continue;
|
||||
|
||||
if (sa_is_linklocal(&sa))
|
||||
continue;
|
||||
|
||||
if (ifinfo().iNameSer1.Address()) {
|
||||
sa_set_in(&nsv[i], ifinfo().iNameSer1.Address(),
|
||||
DNS_PORT);
|
||||
++i;
|
||||
}
|
||||
|
||||
if (i >= *n)
|
||||
break;
|
||||
|
||||
if (ifinfo().iNameSer2.Address()) {
|
||||
sa_set_in(&nsv[i], ifinfo().iNameSer2.Address(),
|
||||
DNS_PORT);
|
||||
++i;
|
||||
}
|
||||
|
||||
if (i >= *n)
|
||||
break;
|
||||
}
|
||||
|
||||
sock.Close();
|
||||
serv.Close();
|
||||
|
||||
if (i == 0)
|
||||
return ENOENT;
|
||||
|
||||
*n = i;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
/**
|
||||
* @file rmutex.cpp Symbian RMutex locking
|
||||
*
|
||||
* Copyright (C) 2010 Creytiv.com
|
||||
*/
|
||||
#include <e32std.h>
|
||||
|
||||
extern "C" {
|
||||
#include <re_types.h>
|
||||
#include <re_mem.h>
|
||||
#include <re_lock.h>
|
||||
}
|
||||
|
||||
|
||||
struct lock {
|
||||
RMutex m;
|
||||
};
|
||||
|
||||
|
||||
static void lock_destructor(void *data)
|
||||
{
|
||||
struct lock *l = (struct lock *)data;
|
||||
|
||||
l->m.Close();
|
||||
}
|
||||
|
||||
|
||||
int lock_alloc(struct lock **lp)
|
||||
{
|
||||
struct lock *l;
|
||||
|
||||
if (!lp)
|
||||
return EINVAL;
|
||||
|
||||
l = (struct lock *)mem_zalloc(sizeof(*l), lock_destructor);
|
||||
if (!l)
|
||||
return ENOMEM;
|
||||
|
||||
const TInt ret = l->m.CreateLocal();
|
||||
if (KErrNone != ret) {
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
*lp = l;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void lock_read_get(struct lock *l)
|
||||
{
|
||||
if (!l)
|
||||
return;
|
||||
|
||||
l->m.Wait();
|
||||
}
|
||||
|
||||
|
||||
void lock_write_get(struct lock *l)
|
||||
{
|
||||
if (!l)
|
||||
return;
|
||||
|
||||
l->m.Wait();
|
||||
}
|
||||
|
||||
|
||||
int lock_read_try(struct lock *l)
|
||||
{
|
||||
(void)l;
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
|
||||
int lock_write_try(struct lock *l)
|
||||
{
|
||||
(void)l;
|
||||
return ENOSYS;
|
||||
}
|
||||
|
||||
|
||||
void lock_rel(struct lock *l)
|
||||
{
|
||||
if (!l)
|
||||
return;
|
||||
|
||||
l->m.Signal();
|
||||
}
|
|
@ -14,8 +14,6 @@
|
|||
#endif
|
||||
#ifdef WIN32
|
||||
#include <winsock.h>
|
||||
#elif defined(__SYMBIAN32__)
|
||||
#define bzero(b,len) memset(b,0,len)
|
||||
#endif
|
||||
#ifdef HAVE_SIGNAL
|
||||
#include <signal.h>
|
||||
|
|
|
@ -1,169 +0,0 @@
|
|||
/**
|
||||
* @file actsched.cpp Symbian Active Scheduler
|
||||
*
|
||||
* Copyright (C) 2010 Creytiv.com
|
||||
*/
|
||||
#include <e32base.h>
|
||||
#include <stdio.h>
|
||||
#include "../main.h"
|
||||
|
||||
extern "C" {
|
||||
#include <re_types.h>
|
||||
#include <re_list.h>
|
||||
#include <re_tmr.h>
|
||||
|
||||
#define DEBUG_MODULE "actsched"
|
||||
#define DEBUG_LEVEL 5
|
||||
#include <re_dbg.h>
|
||||
|
||||
extern struct list *tmrl_get(void);
|
||||
}
|
||||
|
||||
|
||||
class CMyTimer : public CTimer
|
||||
{
|
||||
public:
|
||||
static CMyTimer *NewL(TInt aPriority);
|
||||
void Start();
|
||||
|
||||
protected:
|
||||
CMyTimer(TInt aPriority);
|
||||
virtual void RunL();
|
||||
};
|
||||
|
||||
static CMyTimer *t;
|
||||
static CActiveScheduler as;
|
||||
static bool inited = false;
|
||||
static bool running = false;
|
||||
|
||||
|
||||
CMyTimer *CMyTimer::NewL(TInt aPriority)
|
||||
{
|
||||
CMyTimer *t = new CMyTimer(aPriority);
|
||||
t->ConstructL();
|
||||
return t;
|
||||
}
|
||||
|
||||
|
||||
CMyTimer::CMyTimer(TInt aPriority)
|
||||
:CTimer(aPriority)
|
||||
{
|
||||
CActiveScheduler::Add(this);
|
||||
}
|
||||
|
||||
|
||||
void CMyTimer::Start()
|
||||
{
|
||||
Cancel();
|
||||
|
||||
/*
|
||||
CTimer range is +-2147483647, which is +-35 minutes, 47 seconds.
|
||||
*/
|
||||
uint64_t to = tmr_next_timeout(tmrl_get());
|
||||
if (to) {
|
||||
if (to >= 2147482) {
|
||||
to = 2147482;
|
||||
}
|
||||
After(1000*to);
|
||||
}
|
||||
else {
|
||||
DEBUG_INFO("idle.. no timers\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CMyTimer::RunL()
|
||||
{
|
||||
tmr_poll(tmrl_get());
|
||||
|
||||
if (!t)
|
||||
return;
|
||||
|
||||
Start();
|
||||
}
|
||||
|
||||
|
||||
void actsched_init(void)
|
||||
{
|
||||
DEBUG_INFO("actsched init (inited=%d)\n", inited);
|
||||
|
||||
if (inited)
|
||||
return;
|
||||
|
||||
inited = true;
|
||||
|
||||
/* Setup the Active Scheduler */
|
||||
if (CActiveScheduler::Current()) {
|
||||
DEBUG_INFO("Active Scheduler already installed\n");
|
||||
}
|
||||
else {
|
||||
DEBUG_INFO("Installing new Active Scheduler\n");
|
||||
CActiveScheduler::Install(&as);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int actsched_start(void)
|
||||
{
|
||||
actsched_init();
|
||||
|
||||
DEBUG_INFO("actsched start: (running=%d)\n", running);
|
||||
|
||||
if (running) {
|
||||
DEBUG_WARNING("actsched start: already running\n");
|
||||
return EALREADY;
|
||||
}
|
||||
|
||||
running = true;
|
||||
|
||||
if (!t) {
|
||||
t = CMyTimer::NewL(0);
|
||||
t->After(1000);
|
||||
}
|
||||
|
||||
/* Main loop */
|
||||
if (CActiveScheduler::Current() == &as) {
|
||||
DEBUG_INFO("Starting own Active Scheduler\n");
|
||||
CActiveScheduler::Start(); /* loop here */
|
||||
running = false;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void actsched_stop(void)
|
||||
{
|
||||
DEBUG_INFO("actsched stop (inited=%d)\n", inited);
|
||||
|
||||
if (!running)
|
||||
return;
|
||||
|
||||
/* Must be called from same thread as ::Start() */
|
||||
if (CActiveScheduler::Current() == &as) {
|
||||
DEBUG_INFO("Stopping own Active Scheduler\n");
|
||||
CActiveScheduler::Stop();
|
||||
}
|
||||
|
||||
if (t) {
|
||||
delete t;
|
||||
t = NULL;
|
||||
}
|
||||
|
||||
inited = false;
|
||||
running = false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Called from tmr_start() when a new timer is added.
|
||||
*
|
||||
* TODO: this is a hack; consider moving it to tmr.c
|
||||
*/
|
||||
void actsched_restart_timer(void)
|
||||
{
|
||||
if (!t)
|
||||
return;
|
||||
|
||||
t->Start();
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
/**
|
||||
* @file rlib.cpp Dynamic library loading for Symbian
|
||||
*
|
||||
* Copyright (C) 2010 Creytiv.com
|
||||
*/
|
||||
#include <e32std.h>
|
||||
#include <re_types.h>
|
||||
#include "../mod_internal.h"
|
||||
|
||||
|
||||
extern "C" {
|
||||
#define DEBUG_MODULE "rlib"
|
||||
#define DEBUG_LEVEL 5
|
||||
#include <re_dbg.h>
|
||||
}
|
||||
|
||||
|
||||
void *_mod_open(const char *name)
|
||||
{
|
||||
TBuf<128> buf;
|
||||
TBuf8<128> buf8;
|
||||
buf8.Copy((unsigned char *)name);
|
||||
buf.Copy(buf8);
|
||||
|
||||
DEBUG_INFO("rlib open (%s)\n", name);
|
||||
|
||||
RLibrary *lib = new RLibrary;
|
||||
if (!lib) {
|
||||
DEBUG_WARNING("open: could not allocate RLibrary (%s)\n",
|
||||
name);
|
||||
return NULL;
|
||||
}
|
||||
TInt err = lib->Load(buf);
|
||||
if (KErrNone != err) {
|
||||
DEBUG_WARNING("open: Load failed with err=%d (%s)\n", err,
|
||||
name);
|
||||
delete lib;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return lib;
|
||||
}
|
||||
|
||||
|
||||
void *_mod_sym(void *h, const char *symbol)
|
||||
{
|
||||
RLibrary *lib = (RLibrary *)h;
|
||||
|
||||
(void)symbol;
|
||||
|
||||
/* NOTE: symbol lookup is done by ordinal.
|
||||
*/
|
||||
TLibraryFunction func = lib->Lookup(1);
|
||||
TInt ret = func();
|
||||
|
||||
DEBUG_INFO("rlib sym: ret=0x%08x\n", func, ret);
|
||||
|
||||
return (void *)ret;
|
||||
}
|
||||
|
||||
|
||||
void _mod_close(void *h)
|
||||
{
|
||||
RLibrary *lib = (RLibrary *)h;
|
||||
|
||||
delete lib;
|
||||
}
|
|
@ -138,7 +138,6 @@ int net_if_getaddr(const char *ifname, int af, struct sa *ip)
|
|||
}
|
||||
|
||||
|
||||
#ifndef __SYMBIAN32__
|
||||
static bool if_debug_handler(const char *ifname, const struct sa *sa,
|
||||
void *arg)
|
||||
{
|
||||
|
@ -174,7 +173,6 @@ int net_if_debug(struct re_printf *pf, void *unused)
|
|||
|
||||
return err;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static bool linklocal_handler(const char *ifname, const struct sa *sa,
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
/** Platform independent buffer type cast */
|
||||
#ifdef WIN32
|
||||
#define BUF_CAST (char *)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
#define BUF_CAST (void *)
|
||||
#else
|
||||
#define BUF_CAST
|
||||
#endif
|
||||
|
|
|
@ -83,14 +83,6 @@ int fs_gethome(char *path, size_t sz)
|
|||
|
||||
return 0;
|
||||
|
||||
#elif defined(__SYMBIAN32__)
|
||||
if (!path || !sz)
|
||||
return EINVAL;
|
||||
|
||||
str_ncpy(path, "c:\\Data", sz);
|
||||
|
||||
return 0;
|
||||
|
||||
#elif defined(HAVE_PWD_H)
|
||||
const char *loginname;
|
||||
struct passwd *pw;
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
/**
|
||||
* @file sleep.cpp System sleep for Symbian
|
||||
*
|
||||
* Copyright (C) 2010 Creytiv.com
|
||||
*/
|
||||
|
||||
#include <e32std.h>
|
||||
|
||||
extern "C" {
|
||||
#include <re_types.h>
|
||||
#include <re_sys.h>
|
||||
}
|
||||
|
||||
|
||||
void sys_usleep(unsigned int us)
|
||||
{
|
||||
User::After(us);
|
||||
}
|
|
@ -98,9 +98,7 @@ int sys_kernel_get(struct re_printf *pf, void *unused)
|
|||
|
||||
(void)unused;
|
||||
|
||||
#if defined (__SYMBIAN32__)
|
||||
str = "Symbian OS";
|
||||
#elif defined(WIN32)
|
||||
#if defined(WIN32)
|
||||
str = "Win32";
|
||||
#else
|
||||
str = "?";
|
||||
|
|
|
@ -42,10 +42,6 @@
|
|||
#define SOK_CAST (int)
|
||||
#define SIZ_CAST (int)
|
||||
#define close closesocket
|
||||
#elif defined (__SYMBIAN32__)
|
||||
#define BUF_CAST (void *)
|
||||
#define SOK_CAST
|
||||
#define SIZ_CAST
|
||||
#else
|
||||
#define BUF_CAST
|
||||
#define SOK_CAST
|
||||
|
|
|
@ -44,10 +44,6 @@
|
|||
#define SOK_CAST (int)
|
||||
#define SIZ_CAST (int)
|
||||
#define close closesocket
|
||||
#elif defined (__SYMBIAN32__)
|
||||
#define BUF_CAST (void *)
|
||||
#define SOK_CAST
|
||||
#define SIZ_CAST
|
||||
#else
|
||||
#define BUF_CAST
|
||||
#define SOK_CAST
|
||||
|
|
Loading…
Add table
Reference in a new issue