Lines Matching defs:this

5  * you may not use this file except in compliance with the License.
51 typedef pico_status_t (* picodata_cbPutItemMethod) (register picodata_CharBuffer this,
55 typedef pico_status_t (* picodata_cbGetItemMethod) (register picodata_CharBuffer this,
59 typedef pico_status_t (* picodata_cbSubResetMethod) (register picodata_CharBuffer this);
60 typedef pico_status_t (* picodata_cbSubDeallocateMethod) (register picodata_CharBuffer this, picoos_MemoryManager mm);
81 static pico_status_t data_cbPutItem(register picodata_CharBuffer this,
85 static pico_status_t data_cbGetItem(register picodata_CharBuffer this,
89 pico_status_t picodata_cbReset(register picodata_CharBuffer this)
91 this->rear = 0;
92 this->front = 0;
93 this->len = 0;
94 if (NULL != this->subObj) {
95 return this->subReset(this);
106 picodata_CharBuffer this;
108 this = (picodata_CharBuffer) picoos_allocate(mm, sizeof(*this));
110 if (NULL == this) {
113 this->buf = picoos_allocate(mm, size);
114 if (NULL == this->buf) {
115 picoos_deallocate(mm, (void*) &this);
118 this->size = size;
119 this->common = common;
121 this->getItem = data_cbGetItem;
122 this->putItem = data_cbPutItem;
124 this->subReset = NULL;
125 this->subDeallocate = NULL;
126 this->subObj = NULL;
128 picodata_cbReset(this);
129 return this;
133 picodata_CharBuffer *this)
135 if (NULL != (*this)) {
137 if (NULL != (*this)->subObj) {
138 (*this)->subDeallocate(*this,mm);
140 picoos_deallocate(mm,(void*)&(*this)->buf);
141 picoos_deallocate(mm,(void*)this);
145 pico_status_t picodata_cbPutCh(register picodata_CharBuffer this,
148 if (this->len < this->size) {
149 this->buf[this->rear++] = ch;
150 this->rear %= this->size;
151 this->len++;
159 picoos_int16 picodata_cbGetCh(register picodata_CharBuffer this)
162 if (this->len > 0) {
163 ch = this->buf[this->front++];
164 this->front %= this->size;
165 this->len--;
176 static pico_status_t data_cbGetItem(register picodata_CharBuffer this,
182 if (this->len < PICODATA_ITEM_HEADSIZE) { /* item not in cb? */
184 if (this->len == 0) { /* is cb empty? */
192 *blen = PICODATA_ITEM_HEADSIZE + (picoos_uint8)(this->buf[((this->front) +
193 PICODATA_ITEMIND_LEN) % this->size]);
198 if (this->buf[this->front] != PICODATA_ITEM_FRAME) {
200 this->buf[this->front]));
202 this->front++;
203 this->front %= this->size;
204 this->len--;
211 if (*blen > this->len) { /* item in cb not complete? */
213 "blen=%d, len=%d", *blen, this->len));
227 this->front++;
228 this->front %= this->size;
229 this->len--;
236 buf[i] = (picoos_uint8)(this->buf[this->front++]);
237 this->front %= this->size;
238 this->len--;
261 static pico_status_t data_cbPutItem(register picodata_CharBuffer this,
273 if (*blen > (this->size - this->len)) { /* cb not enough space? */
302 this->buf[this->rear++] = (picoos_char)buf[i];
303 this->rear %= this->size;
304 this->len++;
312 * Function: gets one item from 'this' and writes it on 'blenmax' sized 'buf'.
313 * gets one item from 'this' and writes the speech data to
316 * PICO_EOF : 'this' is empty; no new items available
317 * PICO_BUF_UNDERFLOW : 'this' doesn't contain a full/valid item
321 pico_status_t picodata_cbGetItem(register picodata_CharBuffer this,
325 return this->getItem(this, buf, blenmax, blen, FALSE);
328 pico_status_t picodata_cbGetSpeechData(register picodata_CharBuffer this,
333 return this->getItem(this, buf, blenmax, blen, TRUE);
337 pico_status_t picodata_cbPutItem(register picodata_CharBuffer this,
342 return this->putItem(this,buf,blenmax,blen);
346 picoos_uint8 picodata_cbGetFrontItemType(register picodata_CharBuffer this)
348 return this->buf[this->front];
577 static pico_status_t puSimpleInitialize (register picodata_ProcessingUnit this, picoos_int32 resetMode) {
581 static pico_status_t puSimpleTerminate (register picodata_ProcessingUnit this) {
585 static picodata_step_result_t puSimpleStep (register picodata_ProcessingUnit this,
590 mode = mode; /*PP 13.10.08 : fix warning "var not used in this function"*/
592 while ((result == PICO_OK) && (ch = picodata_cbGetCh(this->cbIn)) != PICO_EOF) {
593 result = picodata_cbPutCh(this->cbOut,(picoos_char) ch);
614 picodata_ProcessingUnit this = (picodata_ProcessingUnit) picoos_allocate(mm, sizeof(*this));
615 if (this == NULL) {
619 this->common = common;
620 this->cbIn = cbIn;
621 this->cbOut = cbOut;
622 this->voice = voice;
623 this->initialize = puSimpleInitialize;
624 this->terminate = puSimpleTerminate;
625 this->step = puSimpleStep;
626 this->subDeallocate = NULL;
627 this->subObj = NULL;
628 return this;
633 picodata_ProcessingUnit * this)
635 if (NULL != (*this)) {
637 if (NULL != (*this)->subObj) {
638 (*this)->subDeallocate(*this,mm);
640 picoos_deallocate(mm,(void *)this);
646 picodata_CharBuffer picodata_getCbIn(picodata_ProcessingUnit this)
648 if (NULL == this) {
649 picoos_emRaiseException(this->common->em,PICO_ERR_NULLPTR_ACCESS,NULL,NULL);
652 return this->cbIn;
656 picodata_CharBuffer picodata_getCbOut(picodata_ProcessingUnit this)
658 if (NULL == this) {
659 picoos_emRaiseException(this->common->em,PICO_ERR_NULLPTR_ACCESS,NULL,NULL);
662 return this->cbOut;
666 pico_status_t picodata_setCbIn(picodata_ProcessingUnit this, picodata_CharBuffer cbIn)
668 if (NULL == this) {
669 picoos_emRaiseException(this->common->em,PICO_ERR_NULLPTR_ACCESS,NULL,NULL);
672 this->cbIn = cbIn;
678 pico_status_t picodata_setCbOut(picodata_ProcessingUnit this, picodata_CharBuffer cbOut)
680 if (NULL == this) {
681 picoos_emRaiseException(this->common->em,PICO_ERR_NULLPTR_ACCESS,NULL,NULL);
684 this->cbOut = cbOut;