Lines Matching refs:avail
177 int index, avail = -1, i = 0, j = 0; in switch_create() local
188 if (avail < 0 && !inst[index].obj) { in switch_create()
189 avail = index; in switch_create()
193 if (avail < 0) { in switch_create()
200 (void)memset(&switch_data[avail], 0, sizeof(switch_data[avail])); in switch_create()
201 switch_data[avail].obj_inst_id = obj_inst_id; in switch_create()
203 (void)memset(res[avail], 0, in switch_create()
204 sizeof(res[avail][0]) * ARRAY_SIZE(res[avail])); in switch_create()
205 init_res_instance(res_inst[avail], ARRAY_SIZE(res_inst[avail])); in switch_create()
208 INIT_OBJ_RES(DIGITAL_INPUT_STATE_RID, res[avail], i, res_inst[avail], in switch_create()
209 j, 1, false, true, &switch_data[avail].state, in switch_create()
210 sizeof(switch_data[avail].state), in switch_create()
212 INIT_OBJ_RES_DATA(DIGITAL_INPUT_COUNTER_RID, res[avail], i, in switch_create()
213 res_inst[avail], j, &switch_data[avail].counter, in switch_create()
214 sizeof(switch_data[avail].counter)); in switch_create()
215 INIT_OBJ_RES_OPT(ON_TIME_RID, res[avail], i, in switch_create()
216 res_inst[avail], j, 1, false, true, in switch_create()
218 INIT_OBJ_RES_OPT(OFF_TIME_RID, res[avail], i, in switch_create()
219 res_inst[avail], j, 1, false, true, in switch_create()
221 INIT_OBJ_RES_OPTDATA(APPLICATION_TYPE_RID, res[avail], i, in switch_create()
222 res_inst[avail], j); in switch_create()
224 INIT_OBJ_RES_OPTDATA(TIMESTAMP_RID, res[avail], i, res_inst[avail], j); in switch_create()
225 INIT_OBJ_RES_OPTDATA(FRACTIONAL_TIMESTAMP_RID, res[avail], i, in switch_create()
226 res_inst[avail], j); in switch_create()
229 inst[avail].resources = res[avail]; in switch_create()
230 inst[avail].resource_count = i; in switch_create()
234 return &inst[avail]; in switch_create()