Changeset 2664:e92e6a804a95 in roaraudio


Ignore:
Timestamp:
09/12/09 22:10:07 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

simple for cont_fw_new(), cont_fw_delete()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/container_framework.c

    r2663 r2664  
    3636 
    3737int     cont_fw_new     (struct cont_fw_parent_inst ** inst) { 
    38  return -1; 
     38 struct cont_fw_parent_inst * self; 
     39 
     40 if ( inst == NULL ) 
     41  return -1; 
     42 
     43 if ( (self = malloc(sizeof(struct cont_fw_parent_inst))) == NULL ) { 
     44  *inst = NULL; 
     45  return -1; 
     46 } 
     47 
     48 memset(self, 0, sizeof(struct cont_fw_parent_inst)); 
     49 
     50 *inst = self; 
     51 return 0; 
    3952} 
    4053 
    4154int     cont_fw_delete  (struct cont_fw_parent_inst  * inst) { 
    42  return -1; 
     55 int i; 
     56 
     57 if ( inst == NULL ) 
     58  return -1; 
     59 
     60 // check if there are streams to close... 
     61 for (i = 0; i < CONT_FW_MAX_CHILDS; i++) { 
     62  if ( inst->child[i] != NULL ) { 
     63   return -1; 
     64  } 
     65 } 
     66 
     67 free(inst); 
     68 
     69 return 0; 
    4370} 
    4471 
Note: See TracChangeset for help on using the changeset viewer.