src/gui/keyboard/keyboard.c
////////////////////////////
// CALLBACK MANAGEMENT
// Append callback, returning assigned id
CALLBACK MANAGEMENT
Append callback, returning assigned id
CALLBACK MANAGEMENT Append callback returning assigned id
int pg_keyboard_appendCb(struct pg_keyboard_dataStruct *data, void (*function)(gslc_tsGui *, char*)) {
  if (data->cbLen < data->cbMax) {
    struct pg_keyboard_dataCbStruct *cb = (struct pg_keyboard_dataCbStruct*)malloc(sizeof(struct pg_keyboard_dataCbStruct));
    cb->id = data->cbLen;
    cb->ptr = function;
    data->cb[data->cbLen] = cb;
    return data->cbLen++;
  }
  return -1;
}
int pg_keyboard_appendCb ( struct pg_keyboard_dataStruct * data , void ( * function ) ( gslc_tsGui * , char * ) ) { if ( data -> cbLen < data -> cbMax ) { struct pg_keyboard_dataCbStruct * cb = ( struct pg_keyboard_dataCbStruct * ) malloc ( sizeof ( struct pg_keyboard_dataCbStruct ) ) ; cb -> id = data -> cbLen ; cb -> ptr = function ; data -> cb [ data -> cbLen ] = cb ; return data -> cbLen ++ ; } return -1 ; }
CALLBACK MANAGEMENT
Append callback, returning assigned id
CALLBACK MANAGEMENT Append callback returning assigned id