I don't think you can read the version number that way. Internally it's 2.1.18.I'm not sure how Apple number their libraries.Ah! Thanks. Is there a way I could have found that out without asking the list, or is it just Something One Knows?
No. I did it the lazy way: % strings /usr/lib/libsasl2.dylib | grep 2\.1 2.1.18But you can also do it the official way, e.g. something like this (probably way more #includes than necessary):
#include <stdio.h> #include <strings.h> #include <ctype.h> #include <assert.h> #include <stdarg.h> #include <unistd.h> #include <sys/types.h> #include <sys/uio.h> #include <stdlib.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include "sysexits.h" #include "sasl.h" void saslerr(int why, const char *what) { fprintf(stderr, "%s: %s", what, sasl_errstring(why, NULL, NULL)); } void saslfail(int why, const char *what) { saslerr(why, what); exit(EX_TEMPFAIL); } int main(int argc, char *argv[]) { sasl_conn_t *conn; int r; int sasl_version_number = 0; const char *sasl_implementation; /* initialize the sasl library */ r = sasl_client_init(NULL); if (r != SASL_OK) saslfail(r, "initializing libsasl"); sasl_implementation = (char *) malloc(80); sasl_version(&sasl_implementation, &sasl_version_number);printf("Locally used implementation: %s, version: %d.%d.%d\n", sasl_implementation, sasl_version_number >> 24, (sasl_version_number >> 16) & 0xFF, sasl_version_number & 0xFFFF);
sasl_dispose(&conn); sasl_done(); return 0; } -- Sebastian Hagedorn - RZKR-R1 (Flachbau), Zi. 18, Robert-Koch-Str. 10 Zentrum für angewandte Informatik - Universitätsweiter Service RRZK Universität zu Köln / Cologne University - Tel. +49-221-478-5587
Attachment:
pgpjb9gzfRURe.pgp
Description: PGP signature