src/joystick/android/SDL_sysjoystick.c
changeset 6744 4ac2bb6dc80c
parent 6707 70eeb7e3ec2f
child 6885 700f1b25f77f
equal deleted inserted replaced
6743:1835c3299b2a 6744:4ac2bb6dc80c
   129 void
   129 void
   130 SDL_SYS_JoystickQuit(void)
   130 SDL_SYS_JoystickQuit(void)
   131 {
   131 {
   132 }
   132 }
   133 
   133 
   134 JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
   134 SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
   135 {
   135 {
   136     JoystickGUID guid;
   136     SDL_JoystickGUID guid;
   137     // the GUID is just the first 16 chars of the name for now
   137     // the GUID is just the first 16 chars of the name for now
   138     const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
   138     const char *name = SDL_SYS_JoystickNameForDeviceIndex( device_index );
   139     SDL_zero( guid );
   139     SDL_zero( guid );
   140     SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
   140     SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
   141     return guid;
   141     return guid;
   142 }
   142 }
   143 
   143 
   144 JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
   144 SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick)
   145 {
   145 {
   146     JoystickGUID guid;
   146     SDL_JoystickGUID guid;
   147     // the GUID is just the first 16 chars of the name for now
   147     // the GUID is just the first 16 chars of the name for now
   148     const char *name = joystick->name;
   148     const char *name = joystick->name;
   149     SDL_zero( guid );
   149     SDL_zero( guid );
   150     SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
   150     SDL_memcpy( &guid, name, SDL_min( sizeof(guid), SDL_strlen( name ) ) );
   151     return guid;
   151     return guid;