Embed:
(wiki syntax)
Show/hide line numbers
seq.h
Go to the documentation of this file.
00001 /* 00002 # This file is Copyright 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 __SEQ_H__ 00017 #define __SEQ_H__ 00018 00019 00020 /** 00021 * \file 00022 * \brief Sequence Header 00023 */ 00024 00025 00026 /** 00027 * Sequence Iterator Object 00028 * 00029 * Instances of this object are created by GET_ITER and used by FOR_ITER. 00030 * Stores a pointer to a sequence and an index int16_t. 00031 */ 00032 typedef struct PmSeqIter_s 00033 { 00034 /** Object descriptor */ 00035 PmObjDesc_t od; 00036 00037 /** Sequence object */ 00038 pPmObj_t si_sequence; 00039 00040 /** Index value */ 00041 int16_t si_index; 00042 } PmSeqIter_t, 00043 *pPmSeqIter_t; 00044 00045 00046 /** 00047 * Compares two sequences for equality 00048 * 00049 * @param pobj1 Ptr to first sequence. 00050 * @param pobj2 Ptr to second sequence. 00051 * @return C_SAME if the seuqences are equivalent, C_DIFFER otherwise. 00052 */ 00053 int8_t seq_compare(pPmObj_t pobj1, pPmObj_t pobj2); 00054 00055 /** 00056 * Returns the length of the sequence 00057 * 00058 * @param pobj Ptr to sequence. 00059 * @param r_index Return arg, length of sequence 00060 * @return Return status 00061 */ 00062 PmReturn_t seq_getLength(pPmObj_t pobj, int16_t *r_index); 00063 00064 /** 00065 * Returns the object from sequence[index] 00066 * 00067 * @param pobj Ptr to sequence object to get object from 00068 * @param index Int index into the sequence 00069 * @param r_pobj Return arg, object from sequence 00070 * @return Return status 00071 */ 00072 PmReturn_t seq_getSubscript(pPmObj_t pobj, int16_t index, pPmObj_t *r_pobj); 00073 00074 /** 00075 * Returns the next item from the sequence iterator object 00076 * 00077 * @param pobj Ptr to sequence iterator. 00078 * @param r_pitem Return arg, pointer to next item from sequence. 00079 * @return Return status. 00080 */ 00081 PmReturn_t seqiter_getNext(pPmObj_t pobj, pPmObj_t *r_pitem); 00082 00083 00084 /** 00085 * Returns a new sequence iterator object 00086 * 00087 * @param pobj Ptr to sequence. 00088 * @param r_pobj Return by reference, new sequence iterator 00089 * @return Return status. 00090 */ 00091 PmReturn_t seqiter_new(pPmObj_t pobj, pPmObj_t *r_pobj); 00092 00093 #endif /* __SEQ_H__ */
Generated on Tue Jul 12 2022 17:07:01 by
1.7.2