Fix non-integer display_zoom for charcell.
[maemo-rb.git] / firmware / target / hosted / lc-unix.c
blob6e5f15ec9917a2d719a9be9bded9db5a626dc14b
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2010 by Thomas Martitz
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include <string.h> /* size_t */
23 #include <dlfcn.h>
24 #include "debug.h"
25 #include "load_code.h"
27 void *lc_open(const char *filename, unsigned char *buf, size_t buf_size)
29 (void)buf;
30 (void)buf_size;
31 void *handle = dlopen(filename, RTLD_NOW);
32 if (handle == NULL)
34 DEBUGF("failed to load %s\n", filename);
35 DEBUGF("lc_open(%s): %s\n", filename, dlerror());
37 return handle;
40 void *lc_get_header(void *handle)
42 char *ret = dlsym(handle, "__header");
43 if (ret == NULL)
44 ret = dlsym(handle, "___header");
46 return ret;
49 void lc_close(void *handle)
51 dlclose(handle);
54 void *lc_open_from_mem(void *addr, size_t blob_size)
56 (void)addr;
57 (void)blob_size;
58 /* we don't support loading code from memory on application builds,
59 * it doesn't make sense (since it means writing the blob to disk again and
60 * then falling back to load from disk) and requires the ability to write
61 * to an executable directory */
62 return NULL;