MQTT C Client Libraries Internals
Macros | Typedefs | Functions | Variables
MQTTVersion.c File Reference

MQTTVersion - display the version and build information strings for a library. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <ctype.h>
#include "MQTTAsync.h"
#include <dlfcn.h>
#include <sys/mman.h>
#include <unistd.h>
Include dependency graph for MQTTVersion.c:

Macros

#define ARRAY_SIZE(a)   (sizeof(a) / sizeof(a[0]))
 

Typedefs

typedef MQTTAsync_nameValue *(* func_type) (void)
 

Functions

char * FindString (char *filename, const char *eyecatcher_input)
 Finds an eyecatcher in a binary file and returns the following value. More...
 
int printVersionInfo (MQTTAsync_nameValue *info)
 
int loadandcall (const char *libname)
 
void printEyecatchers (char *filename)
 
int main (int argc, char **argv)
 

Variables

static const char * libraries [] = {"paho-mqtt3c", "paho-mqtt3cs", "paho-mqtt3a", "paho-mqtt3as"}
 
static const char * eyecatchers []
 

Detailed Description

MQTTVersion - display the version and build information strings for a library.

With no arguments, we try to load and call the version string for the libraries we know about: mqttv3c, mqttv3cs, mqttv3a, mqttv3as. With an argument: 1) we try to load the named library, call getVersionInfo and display those values. 2) If that doesn't work, we look through the binary for eyecatchers, and display those.
This will work if the library is not executable in the current environment.

Function Documentation

◆ FindString()

char * FindString ( char *  filename,
const char *  eyecatcher_input 
)

Finds an eyecatcher in a binary file and returns the following value.

Parameters
filenamethe name of the file
eyecatcher_inputthe eyecatcher string to look for
Returns
the value found - "" if not found

Variable Documentation

◆ eyecatchers

const char* eyecatchers[]
static
Initial value:
= {"MQTTAsyncV3_Version", "MQTTAsyncV3_Timestamp",
"MQTTClientV3_Version", "MQTTClientV3_Timestamp"}