davide carboni / Mbed 2 deprecated pymite_http_get

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers img.h Source File

img.h

Go to the documentation of this file.
00001 /*
00002 # This file is Copyright 2003, 2006, 2007, 2009 Dean Hall.
00003 #
00004 # This file is part of the PyMite VM.
00005 # The PyMite VM is free software: you can redistribute it and/or modify
00006 # it under the terms of the GNU GENERAL PUBLIC LICENSE Version 2.
00007 #
00008 # The PyMite VM is distributed in the hope that it will be useful,
00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00011 # A copy of the GNU GENERAL PUBLIC LICENSE Version 2
00012 # is seen in the file COPYING in this directory.
00013 */
00014 
00015 
00016 #ifndef __IMG_H__
00017 #define __IMG_H__
00018 
00019 
00020 /**
00021  * \file
00022  * \brief Image header
00023  *
00024  * Created to eliminate a circular include
00025  * among mem, string and obj.
00026  */
00027 
00028 
00029 /** The maximum number of paths available in PmImgPaths */
00030 #define PM_NUM_IMG_PATHS 4
00031 
00032 
00033 typedef struct PmImgPaths_s
00034 {
00035     PmMemSpace_t memspace[PM_NUM_IMG_PATHS];
00036     uint8_t const *pimg[PM_NUM_IMG_PATHS];
00037     uint8_t pathcount;
00038 }
00039 PmImgPaths_t, *pPmImgPaths_t;
00040 
00041 
00042 /**
00043  * Code image object
00044  *
00045  * A type to hold code images in the heap.
00046  * A code image with an object descriptor at the front.
00047  * Used for storing image objects during ipm;
00048  * the code object keeps a reference to this object.
00049  */
00050 typedef struct PmCodeImgObj_s
00051 {
00052     /** Object descriptor */
00053     PmObjDesc_t od;
00054 
00055     /** Null-term? char array */
00056     uint8_t val[1];
00057 } PmCodeImgObj_t,
00058  *pPmCodeImgObj_t;
00059 
00060 
00061 /**
00062  * Iterates over all paths in the paths array until the named module is found.
00063  * Returns the memspace,address of the head of the module.
00064  *
00065  * @param pname Pointer to the name of the desired module
00066  * @param r_memspace Return by reference the memory space of the module
00067  * @param r_imgaddr Return by reference the address of the module's image
00068  * @return Return status
00069  */
00070 PmReturn_t img_findInPaths(pPmObj_t pname, PmMemSpace_t *r_memspace,
00071                            uint8_t const **r_imgaddr);
00072 
00073 /**
00074  * Appends the given memspace and address to the image path array
00075  *
00076  * @param memspace The memspace
00077  * @param paddr The address
00078  * @return Return status
00079  */
00080 PmReturn_t img_appendToPath(PmMemSpace_t memspace, uint8_t *paddr);
00081 
00082 #endif /* __IMG_H__ */