Logo Search packages:      
Sourcecode: libmpdclient version File versions  Download package

mpd_pure int mpd_connection_cmp_server_version ( const struct mpd_connection connection,
unsigned  major,
unsigned  minor,
unsigned  patch 
)

Compares the MPD protocol version with the specified triple.

Returns:
-1 if the server is older, 1 if it is newer, 0 if it is equal

Definition at line 344 of file connection.c.

References mpd_connection_cmp_server_version(), and mpd_connection::version.

Referenced by mpd_connection_cmp_server_version().

{
      const unsigned *v = connection->version;

      if (v[0] > major || (v[0] == major &&
                       (v[1] > minor || (v[1] == minor &&
                                     v[2] > patch))))
            return 1;
      else if (v[0] == major && v[1] == minor && v[2] == patch)
            return 0;
      else
            return -1;
}


Generated by  Doxygen 1.6.0   Back to index