I'd prefer TAB, but most of the src uses SPACEs, so TAB→SPACEs to eliminate the mixture.
authorLars Rohwedder <roker@pep-project.org>
Tue, 19 Apr 2016 14:30:52 +0200
changeset 529976843888de6
parent 528 587f602bf045
child 530 e532b2e282f3
I'd prefer TAB, but most of the src uses SPACEs, so TAB→SPACEs to eliminate the mixture.
src/pEpEngine.c
src/pEpEngine.h
     1.1 --- a/src/pEpEngine.c	Wed Apr 06 17:00:54 2016 +0200
     1.2 +++ b/src/pEpEngine.c	Tue Apr 19 14:30:52 2016 +0200
     1.3 @@ -9,14 +9,14 @@
     1.4  DYNAMIC_API PEP_STATUS init(PEP_SESSION *session)
     1.5  {
     1.6      PEP_STATUS status = PEP_STATUS_OK;
     1.7 -	int int_result;
     1.8 -	static const char *sql_log;
     1.9 -	static const char *sql_trustword;
    1.10 -	static const char *sql_get_identity;
    1.11 -	static const char *sql_set_person;
    1.12 -	static const char *sql_set_pgp_keypair;
    1.13 -	static const char *sql_set_identity;
    1.14 -	static const char *sql_set_trust;
    1.15 +    int int_result;
    1.16 +    static const char *sql_log;
    1.17 +    static const char *sql_trustword;
    1.18 +    static const char *sql_get_identity;
    1.19 +    static const char *sql_set_person;
    1.20 +    static const char *sql_set_pgp_keypair;
    1.21 +    static const char *sql_set_identity;
    1.22 +    static const char *sql_set_trust;
    1.23      static const char *sql_get_trust;
    1.24      static const char *sql_least_trust;
    1.25      static const char *sql_mark_as_compromized;
    1.26 @@ -43,18 +43,18 @@
    1.27      if (init_count == 0)
    1.28          in_first = true;
    1.29  
    1.30 -	assert(session);
    1.31 +    assert(session);
    1.32      if (session == NULL)
    1.33          return PEP_ILLEGAL_VALUE;
    1.34  
    1.35 -	*session = NULL;
    1.36 +    *session = NULL;
    1.37  
    1.38      pEpSession *_session = calloc(1, sizeof(pEpSession));
    1.39 -	assert(_session);
    1.40 -	if (_session == NULL)
    1.41 -		goto enomem;
    1.42 +    assert(_session);
    1.43 +    if (_session == NULL)
    1.44 +        goto enomem;
    1.45  
    1.46 -	_session->version = PEP_ENGINE_VERSION;
    1.47 +    _session->version = PEP_ENGINE_VERSION;
    1.48  
    1.49      assert(LOCAL_DB);
    1.50      if (LOCAL_DB == NULL) {
    1.51 @@ -62,43 +62,43 @@
    1.52          goto pep_error;
    1.53      }
    1.54  
    1.55 -	int_result = sqlite3_open_v2(
    1.56 -			LOCAL_DB,
    1.57 -			&_session->db,
    1.58 -			SQLITE_OPEN_READWRITE
    1.59 -				| SQLITE_OPEN_CREATE
    1.60 -				| SQLITE_OPEN_FULLMUTEX
    1.61 -				| SQLITE_OPEN_PRIVATECACHE,
    1.62 -			NULL 
    1.63 -		);
    1.64 +    int_result = sqlite3_open_v2(
    1.65 +            LOCAL_DB,
    1.66 +            &_session->db,
    1.67 +            SQLITE_OPEN_READWRITE
    1.68 +                | SQLITE_OPEN_CREATE
    1.69 +                | SQLITE_OPEN_FULLMUTEX
    1.70 +                | SQLITE_OPEN_PRIVATECACHE,
    1.71 +            NULL 
    1.72 +        );
    1.73  
    1.74 -	if (int_result != SQLITE_OK) {
    1.75 -		status = PEP_INIT_CANNOT_OPEN_DB;
    1.76 +    if (int_result != SQLITE_OK) {
    1.77 +        status = PEP_INIT_CANNOT_OPEN_DB;
    1.78          goto pep_error;
    1.79 -	}
    1.80 +    }
    1.81  
    1.82 -	sqlite3_busy_timeout(_session->db, BUSY_WAIT_TIME);
    1.83 +    sqlite3_busy_timeout(_session->db, BUSY_WAIT_TIME);
    1.84  
    1.85      assert(SYSTEM_DB);
    1.86      if (SYSTEM_DB == NULL) {
    1.87 -		status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
    1.88 +        status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
    1.89          goto pep_error;
    1.90      }
    1.91  
    1.92 -	int_result = sqlite3_open_v2(
    1.93 -			SYSTEM_DB, &_session->system_db,
    1.94 -			SQLITE_OPEN_READONLY
    1.95 -				| SQLITE_OPEN_FULLMUTEX
    1.96 -				| SQLITE_OPEN_SHAREDCACHE,
    1.97 -			NULL
    1.98 -		);
    1.99 +    int_result = sqlite3_open_v2(
   1.100 +            SYSTEM_DB, &_session->system_db,
   1.101 +            SQLITE_OPEN_READONLY
   1.102 +                | SQLITE_OPEN_FULLMUTEX
   1.103 +                | SQLITE_OPEN_SHAREDCACHE,
   1.104 +            NULL
   1.105 +        );
   1.106  
   1.107 -	if (int_result != SQLITE_OK) {
   1.108 -		status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
   1.109 +    if (int_result != SQLITE_OK) {
   1.110 +        status = PEP_INIT_CANNOT_OPEN_SYSTEM_DB;
   1.111          goto pep_error;
   1.112 -	}
   1.113 +    }
   1.114  
   1.115 -	sqlite3_busy_timeout(_session->system_db, 1000);
   1.116 +    sqlite3_busy_timeout(_session->system_db, 1000);
   1.117  
   1.118      if (in_first) {
   1.119          int_result = sqlite3_exec(
   1.120 @@ -186,7 +186,7 @@
   1.121          sql_log = "insert into log (title, entity, description, comment)"
   1.122                    "values (?1, ?2, ?3, ?4);";
   1.123  
   1.124 -        sql_get_identity =	"select fpr, identity.user_id, username, comm_type, lang"
   1.125 +        sql_get_identity =    "select fpr, identity.user_id, username, comm_type, lang"
   1.126                              "   from identity"
   1.127                              "   join person on id = identity.user_id"
   1.128                              "   join pgp_keypair on fpr = identity.main_key_id"
   1.129 @@ -239,15 +239,15 @@
   1.130  
   1.131      int_result = sqlite3_prepare_v2(_session->db, sql_log, (int)strlen(sql_log),
   1.132              &_session->log, NULL);
   1.133 -	assert(int_result == SQLITE_OK);
   1.134 +    assert(int_result == SQLITE_OK);
   1.135  
   1.136      int_result = sqlite3_prepare_v2(_session->system_db, sql_trustword,
   1.137              (int)strlen(sql_trustword), &_session->trustword, NULL);
   1.138 -	assert(int_result == SQLITE_OK);
   1.139 +    assert(int_result == SQLITE_OK);
   1.140  
   1.141      int_result = sqlite3_prepare_v2(_session->db, sql_get_identity,
   1.142              (int)strlen(sql_get_identity), &_session->get_identity, NULL);
   1.143 -	assert(int_result == SQLITE_OK);
   1.144 +    assert(int_result == SQLITE_OK);
   1.145  
   1.146      int_result = sqlite3_prepare_v2(_session->db, sql_set_person,
   1.147              (int)strlen(sql_set_person), &_session->set_person, NULL);
   1.148 @@ -255,15 +255,15 @@
   1.149  
   1.150      int_result = sqlite3_prepare_v2(_session->db, sql_set_pgp_keypair,
   1.151              (int)strlen(sql_set_pgp_keypair), &_session->set_pgp_keypair, NULL);
   1.152 -	assert(int_result == SQLITE_OK);
   1.153 +    assert(int_result == SQLITE_OK);
   1.154  
   1.155      int_result = sqlite3_prepare_v2(_session->db, sql_set_identity,
   1.156              (int)strlen(sql_set_identity), &_session->set_identity, NULL);
   1.157 -	assert(int_result == SQLITE_OK);
   1.158 +    assert(int_result == SQLITE_OK);
   1.159  
   1.160      int_result = sqlite3_prepare_v2(_session->db, sql_set_trust,
   1.161              (int)strlen(sql_set_trust), &_session->set_trust, NULL);
   1.162 -	assert(int_result == SQLITE_OK);
   1.163 +    assert(int_result == SQLITE_OK);
   1.164  
   1.165      int_result = sqlite3_prepare_v2(_session->db, sql_get_trust,
   1.166              (int)strlen(sql_get_trust), &_session->get_trust, NULL);
   1.167 @@ -283,11 +283,11 @@
   1.168  
   1.169      int_result = sqlite3_prepare_v2(_session->system_db, sql_languagelist,
   1.170              (int)strlen(sql_languagelist), &_session->languagelist, NULL);
   1.171 -	assert(int_result == SQLITE_OK);
   1.172 +    assert(int_result == SQLITE_OK);
   1.173  
   1.174      int_result = sqlite3_prepare_v2(_session->system_db, sql_i18n_token,
   1.175              (int)strlen(sql_i18n_token), &_session->i18n_token, NULL);
   1.176 -	assert(int_result == SQLITE_OK);
   1.177 +    assert(int_result == SQLITE_OK);
   1.178  
   1.179      // blacklist
   1.180  
   1.181 @@ -324,8 +324,8 @@
   1.182      _session->passive_mode = false;
   1.183      _session->unencrypted_subject = false;
   1.184  
   1.185 -	*session = _session;
   1.186 -	return PEP_STATUS_OK;
   1.187 +    *session = _session;
   1.188 +    return PEP_STATUS_OK;
   1.189  
   1.190  enomem:
   1.191      status = PEP_OUT_OF_MEMORY;
   1.192 @@ -340,7 +340,7 @@
   1.193      bool out_last = false;
   1.194  
   1.195      assert(init_count >= 0);
   1.196 -	assert(session);
   1.197 +    assert(session);
   1.198  
   1.199      if (!((init_count >= 0) && session))
   1.200          return;
   1.201 @@ -352,8 +352,8 @@
   1.202          out_last = true;
   1.203      --init_count;
   1.204  
   1.205 -	if (session) {
   1.206 -		if (session->db) {
   1.207 +    if (session) {
   1.208 +        if (session->db) {
   1.209              if (session->log)
   1.210                  sqlite3_finalize(session->log);
   1.211              if (session->trustword)
   1.212 @@ -393,7 +393,7 @@
   1.213                  sqlite3_close_v2(session->db);
   1.214              if (session->system_db)
   1.215                  sqlite3_close_v2(session->system_db);
   1.216 -		}
   1.217 +        }
   1.218  
   1.219          release_transport_system(session, out_last);
   1.220          release_cryptotech(session, out_last);
   1.221 @@ -422,36 +422,36 @@
   1.222          const char *comment
   1.223      )
   1.224  {
   1.225 -	PEP_STATUS status = PEP_STATUS_OK;
   1.226 -	int result;
   1.227 +    PEP_STATUS status = PEP_STATUS_OK;
   1.228 +    int result;
   1.229  
   1.230 -	assert(session);
   1.231 -	assert(title);
   1.232 -	assert(entity);
   1.233 +    assert(session);
   1.234 +    assert(title);
   1.235 +    assert(entity);
   1.236  
   1.237      if (!(session && title && entity))
   1.238          return PEP_ILLEGAL_VALUE;
   1.239  
   1.240 -	sqlite3_reset(session->log);
   1.241 -	sqlite3_bind_text(session->log, 1, title, -1, SQLITE_STATIC);
   1.242 -	sqlite3_bind_text(session->log, 2, entity, -1, SQLITE_STATIC);
   1.243 -	if (description)
   1.244 +    sqlite3_reset(session->log);
   1.245 +    sqlite3_bind_text(session->log, 1, title, -1, SQLITE_STATIC);
   1.246 +    sqlite3_bind_text(session->log, 2, entity, -1, SQLITE_STATIC);
   1.247 +    if (description)
   1.248          sqlite3_bind_text(session->log, 3, description, -1, SQLITE_STATIC);
   1.249 -	else
   1.250 -		sqlite3_bind_null(session->log, 3);
   1.251 -	if (comment)
   1.252 -		sqlite3_bind_text(session->log, 4, comment, -1, SQLITE_STATIC);
   1.253 -	else
   1.254 -		sqlite3_bind_null(session->log, 4);
   1.255 -	do {
   1.256 -		result = sqlite3_step(session->log);
   1.257 -		assert(result == SQLITE_DONE || result == SQLITE_BUSY);
   1.258 -		if (result != SQLITE_DONE && result != SQLITE_BUSY)
   1.259 -			status = PEP_UNKNOWN_ERROR;
   1.260 -	} while (result == SQLITE_BUSY);
   1.261 -	sqlite3_reset(session->log);
   1.262 +    else
   1.263 +        sqlite3_bind_null(session->log, 3);
   1.264 +    if (comment)
   1.265 +        sqlite3_bind_text(session->log, 4, comment, -1, SQLITE_STATIC);
   1.266 +    else
   1.267 +        sqlite3_bind_null(session->log, 4);
   1.268 +    do {
   1.269 +        result = sqlite3_step(session->log);
   1.270 +        assert(result == SQLITE_DONE || result == SQLITE_BUSY);
   1.271 +        if (result != SQLITE_DONE && result != SQLITE_BUSY)
   1.272 +            status = PEP_UNKNOWN_ERROR;
   1.273 +    } while (result == SQLITE_BUSY);
   1.274 +    sqlite3_reset(session->log);
   1.275  
   1.276 -	return status;
   1.277 +    return status;
   1.278  }
   1.279  
   1.280  DYNAMIC_API PEP_STATUS trustword(
   1.281 @@ -459,45 +459,45 @@
   1.282              char **word, size_t *wsize
   1.283          )
   1.284  {
   1.285 -	PEP_STATUS status = PEP_STATUS_OK;
   1.286 -	int result;
   1.287 +    PEP_STATUS status = PEP_STATUS_OK;
   1.288 +    int result;
   1.289  
   1.290 -	assert(session);
   1.291 -	assert(word);
   1.292 -	assert(wsize);
   1.293 +    assert(session);
   1.294 +    assert(word);
   1.295 +    assert(wsize);
   1.296  
   1.297      if (!(session && word && wsize))
   1.298          return PEP_ILLEGAL_VALUE;
   1.299  
   1.300 -	*word = NULL;
   1.301 -	*wsize = 0;
   1.302 +    *word = NULL;
   1.303 +    *wsize = 0;
   1.304  
   1.305 -	if (lang == NULL)
   1.306 -		lang = "en";
   1.307 +    if (lang == NULL)
   1.308 +        lang = "en";
   1.309  
   1.310 -	assert((lang[0] >= 'A' && lang[0] <= 'Z')
   1.311 +    assert((lang[0] >= 'A' && lang[0] <= 'Z')
   1.312              || (lang[0] >= 'a' && lang[0] <= 'z'));
   1.313 -	assert((lang[1] >= 'A' && lang[1] <= 'Z')
   1.314 +    assert((lang[1] >= 'A' && lang[1] <= 'Z')
   1.315              || (lang[1] >= 'a' && lang[1] <= 'z'));
   1.316 -	assert(lang[2] == 0);
   1.317 +    assert(lang[2] == 0);
   1.318  
   1.319 -	sqlite3_reset(session->trustword);
   1.320 +    sqlite3_reset(session->trustword);
   1.321      sqlite3_bind_text(session->trustword, 1, lang, -1, SQLITE_STATIC);
   1.322 -	sqlite3_bind_int(session->trustword, 2, value);
   1.323 +    sqlite3_bind_int(session->trustword, 2, value);
   1.324  
   1.325 -	result = sqlite3_step(session->trustword);
   1.326 -	if (result == SQLITE_ROW) {
   1.327 +    result = sqlite3_step(session->trustword);
   1.328 +    if (result == SQLITE_ROW) {
   1.329          *word = strdup((const char *) sqlite3_column_text(session->trustword,
   1.330                      1));
   1.331 -		if (*word)
   1.332 +        if (*word)
   1.333              *wsize = sqlite3_column_bytes(session->trustword, 1);
   1.334 -		else
   1.335 -			status = PEP_TRUSTWORD_NOT_FOUND;
   1.336 -	} else
   1.337 -		status = PEP_TRUSTWORD_NOT_FOUND;
   1.338 +        else
   1.339 +            status = PEP_TRUSTWORD_NOT_FOUND;
   1.340 +    } else
   1.341 +        status = PEP_TRUSTWORD_NOT_FOUND;
   1.342  
   1.343 -	sqlite3_reset(session->trustword);
   1.344 -	return status;
   1.345 +    sqlite3_reset(session->trustword);
   1.346 +    return status;
   1.347  }
   1.348  
   1.349  DYNAMIC_API PEP_STATUS trustwords(
   1.350 @@ -505,23 +505,23 @@
   1.351          char **words, size_t *wsize, int max_words
   1.352      )
   1.353  {
   1.354 -	const char *source = fingerprint;
   1.355 -	char *buffer;
   1.356 -	char *dest;
   1.357 -	size_t fsize;
   1.358 +    const char *source = fingerprint;
   1.359 +    char *buffer;
   1.360 +    char *dest;
   1.361 +    size_t fsize;
   1.362      PEP_STATUS _status;
   1.363  
   1.364 -	assert(session);
   1.365 -	assert(fingerprint);
   1.366 -	assert(words);
   1.367 -	assert(wsize);
   1.368 -	assert(max_words >= 0);
   1.369 +    assert(session);
   1.370 +    assert(fingerprint);
   1.371 +    assert(words);
   1.372 +    assert(wsize);
   1.373 +    assert(max_words >= 0);
   1.374  
   1.375      if (!(session && fingerprint && words && wsize && max_words >= 0))
   1.376          return PEP_ILLEGAL_VALUE;
   1.377  
   1.378 -	*words = NULL;
   1.379 -	*wsize = 0;
   1.380 +    *words = NULL;
   1.381 +    *wsize = 0;
   1.382  
   1.383      buffer = calloc(1, MAX_TRUSTWORDS_SPACE);
   1.384      assert(buffer);
   1.385 @@ -529,67 +529,67 @@
   1.386          return PEP_OUT_OF_MEMORY;
   1.387      dest = buffer;
   1.388  
   1.389 -	fsize = strlen(fingerprint);
   1.390 +    fsize = strlen(fingerprint);
   1.391  
   1.392 -	if (!lang || !lang[0])
   1.393 -		lang = "en";
   1.394 +    if (!lang || !lang[0])
   1.395 +        lang = "en";
   1.396  
   1.397 -	assert((lang[0] >= 'A' && lang[0] <= 'Z')
   1.398 +    assert((lang[0] >= 'A' && lang[0] <= 'Z')
   1.399              || (lang[0] >= 'a' && lang[0] <= 'z'));
   1.400 -	assert((lang[1] >= 'A' && lang[1] <= 'Z')
   1.401 +    assert((lang[1] >= 'A' && lang[1] <= 'Z')
   1.402              || (lang[1] >= 'a' && lang[1] <= 'z'));
   1.403 -	assert(lang[2] == 0);
   1.404 +    assert(lang[2] == 0);
   1.405  
   1.406 -	int n_words = 0;
   1.407 -	while (source < fingerprint + fsize) {
   1.408 -		uint16_t value;
   1.409 -		char *word;
   1.410 -		size_t _wsize;
   1.411 -		int j;
   1.412 +    int n_words = 0;
   1.413 +    while (source < fingerprint + fsize) {
   1.414 +        uint16_t value;
   1.415 +        char *word;
   1.416 +        size_t _wsize;
   1.417 +        int j;
   1.418  
   1.419          for (value=0, j=0; j < 4 && source < fingerprint + fsize; ) {
   1.420 -			if (*source >= 'a' && *source <= 'f')
   1.421 -				value += (*source - 'a' + 10) << (3 - j++) * 4;
   1.422 -			else if (*source >= 'A' && *source <= 'F')
   1.423 -				value += (*source - 'A' + 10) << (3 - j++) * 4;
   1.424 -			else if (*source >= '0' && *source <= '9')
   1.425 -				value += (*source - '0') << (3 - j++) * 4;
   1.426 -			
   1.427 -			source++;
   1.428 -		}
   1.429 +            if (*source >= 'a' && *source <= 'f')
   1.430 +                value += (*source - 'a' + 10) << (3 - j++) * 4;
   1.431 +            else if (*source >= 'A' && *source <= 'F')
   1.432 +                value += (*source - 'A' + 10) << (3 - j++) * 4;
   1.433 +            else if (*source >= '0' && *source <= '9')
   1.434 +                value += (*source - '0') << (3 - j++) * 4;
   1.435 +            
   1.436 +            source++;
   1.437 +        }
   1.438  
   1.439 -		_status = trustword(session, value, lang, &word, &_wsize);
   1.440 +        _status = trustword(session, value, lang, &word, &_wsize);
   1.441          if (_status == PEP_OUT_OF_MEMORY) {
   1.442              free(buffer);
   1.443              return PEP_OUT_OF_MEMORY;
   1.444          }
   1.445 -		if (word == NULL) {
   1.446 +        if (word == NULL) {
   1.447              free(buffer);
   1.448 -			return PEP_TRUSTWORD_NOT_FOUND;
   1.449 +            return PEP_TRUSTWORD_NOT_FOUND;
   1.450          }
   1.451  
   1.452 -		if (dest + _wsize < buffer + MAX_TRUSTWORDS_SPACE - 1) {
   1.453 -			strncpy(dest, word, _wsize);
   1.454 +        if (dest + _wsize < buffer + MAX_TRUSTWORDS_SPACE - 1) {
   1.455 +            strncpy(dest, word, _wsize);
   1.456              free(word);
   1.457 -			dest += _wsize;
   1.458 -		}
   1.459 -		else {
   1.460 +            dest += _wsize;
   1.461 +        }
   1.462 +        else {
   1.463              free(word);
   1.464 -			break; // buffer full
   1.465 +            break; // buffer full
   1.466          }
   1.467  
   1.468 -		if (source < fingerprint + fsize
   1.469 +        if (source < fingerprint + fsize
   1.470                  && dest + _wsize < buffer + MAX_TRUSTWORDS_SPACE - 1)
   1.471 -			*dest++ = ' ';
   1.472 +            *dest++ = ' ';
   1.473  
   1.474 -		++n_words;
   1.475 -		if (max_words && n_words >= max_words)
   1.476 -			break;
   1.477 -	}
   1.478 +        ++n_words;
   1.479 +        if (max_words && n_words >= max_words)
   1.480 +            break;
   1.481 +    }
   1.482  
   1.483 -	*words = buffer;
   1.484 -	*wsize = dest - buffer;
   1.485 -	return PEP_STATUS_OK;
   1.486 +    *words = buffer;
   1.487 +    *wsize = dest - buffer;
   1.488 +    return PEP_STATUS_OK;
   1.489  }
   1.490  
   1.491  pEp_identity *new_identity(
   1.492 @@ -675,13 +675,13 @@
   1.493          pEp_identity **identity
   1.494      )
   1.495  {
   1.496 -	PEP_STATUS status = PEP_STATUS_OK;
   1.497 -	static pEp_identity *_identity;
   1.498 -	int result;
   1.499 -	const char *_lang;
   1.500 +    PEP_STATUS status = PEP_STATUS_OK;
   1.501 +    static pEp_identity *_identity;
   1.502 +    int result;
   1.503 +    const char *_lang;
   1.504  
   1.505 -	assert(session);
   1.506 -	assert(address);
   1.507 +    assert(session);
   1.508 +    assert(address);
   1.509      assert(address[0]);
   1.510  
   1.511      if (!(session && address && address[0]))
   1.512 @@ -691,8 +691,8 @@
   1.513      sqlite3_bind_text(session->get_identity, 1, address, -1, SQLITE_STATIC);
   1.514  
   1.515      result = sqlite3_step(session->get_identity);
   1.516 -	switch (result) {
   1.517 -	case SQLITE_ROW:
   1.518 +    switch (result) {
   1.519 +    case SQLITE_ROW:
   1.520          _identity = new_identity(
   1.521                  address,
   1.522                  (const char *) sqlite3_column_text(session->get_identity, 0),
   1.523 @@ -706,36 +706,36 @@
   1.524          _identity->comm_type = (PEP_comm_type) sqlite3_column_int(session->get_identity, 3);
   1.525          _lang = (const char *) sqlite3_column_text(session->get_identity, 4);
   1.526          if (_lang && _lang[0]) {
   1.527 -			assert(_lang[0] >= 'a' && _lang[0] <= 'z');
   1.528 -			assert(_lang[1] >= 'a' && _lang[1] <= 'z');
   1.529 -			assert(_lang[2] == 0);
   1.530 -			_identity->lang[0] = _lang[0];
   1.531 -			_identity->lang[1] = _lang[1];
   1.532 +            assert(_lang[0] >= 'a' && _lang[0] <= 'z');
   1.533 +            assert(_lang[1] >= 'a' && _lang[1] <= 'z');
   1.534 +            assert(_lang[2] == 0);
   1.535 +            _identity->lang[0] = _lang[0];
   1.536 +            _identity->lang[1] = _lang[1];
   1.537              _identity->lang[2] = 0;
   1.538 -		}
   1.539 -		*identity = _identity;
   1.540 -		break;
   1.541 -	default:
   1.542 +        }
   1.543 +        *identity = _identity;
   1.544 +        break;
   1.545 +    default:
   1.546          status = PEP_CANNOT_FIND_IDENTITY;
   1.547 -		*identity = NULL;
   1.548 -	}
   1.549 +        *identity = NULL;
   1.550 +    }
   1.551  
   1.552      sqlite3_reset(session->get_identity);
   1.553 -	return status;
   1.554 +    return status;
   1.555  }
   1.556  
   1.557  DYNAMIC_API PEP_STATUS set_identity(
   1.558          PEP_SESSION session, const pEp_identity *identity
   1.559      )
   1.560  {
   1.561 -	int result;
   1.562 +    int result;
   1.563  
   1.564 -	assert(session);
   1.565 -	assert(identity);
   1.566 -	assert(identity->address);
   1.567 -	assert(identity->fpr);
   1.568 -	assert(identity->user_id);
   1.569 -	assert(identity->username);
   1.570 +    assert(session);
   1.571 +    assert(identity);
   1.572 +    assert(identity->address);
   1.573 +    assert(identity->fpr);
   1.574 +    assert(identity->user_id);
   1.575 +    assert(identity->username);
   1.576  
   1.577      if (!(session && identity && identity->address && identity->fpr &&
   1.578                  identity->user_id && identity->username))
   1.579 @@ -750,67 +750,67 @@
   1.580      if (listed)
   1.581          return PEP_KEY_BLACKLISTED;
   1.582  
   1.583 -	sqlite3_exec(session->db, "BEGIN ;", NULL, NULL, NULL);
   1.584 +    sqlite3_exec(session->db, "BEGIN ;", NULL, NULL, NULL);
   1.585  
   1.586 -	sqlite3_reset(session->set_person);
   1.587 +    sqlite3_reset(session->set_person);
   1.588      sqlite3_bind_text(session->set_person, 1, identity->user_id, -1,
   1.589              SQLITE_STATIC);
   1.590      sqlite3_bind_text(session->set_person, 2, identity->username, -1,
   1.591              SQLITE_STATIC);
   1.592 -	if (identity->lang[0])
   1.593 +    if (identity->lang[0])
   1.594          sqlite3_bind_text(session->set_person, 3, identity->lang, 1,
   1.595                  SQLITE_STATIC);
   1.596 -	else
   1.597 -		sqlite3_bind_null(session->set_person, 3);
   1.598 -	result = sqlite3_step(session->set_person);
   1.599 -	sqlite3_reset(session->set_person);
   1.600 -	if (result != SQLITE_DONE) {
   1.601 -		sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   1.602 -		return PEP_CANNOT_SET_PERSON;
   1.603 -	}
   1.604 +    else
   1.605 +        sqlite3_bind_null(session->set_person, 3);
   1.606 +    result = sqlite3_step(session->set_person);
   1.607 +    sqlite3_reset(session->set_person);
   1.608 +    if (result != SQLITE_DONE) {
   1.609 +        sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   1.610 +        return PEP_CANNOT_SET_PERSON;
   1.611 +    }
   1.612  
   1.613 -	sqlite3_reset(session->set_pgp_keypair);
   1.614 +    sqlite3_reset(session->set_pgp_keypair);
   1.615      sqlite3_bind_text(session->set_pgp_keypair, 1, identity->fpr, -1,
   1.616              SQLITE_STATIC);
   1.617 -	result = sqlite3_step(session->set_pgp_keypair);
   1.618 -	sqlite3_reset(session->set_pgp_keypair);
   1.619 -	if (result != SQLITE_DONE) {
   1.620 -		sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   1.621 -		return PEP_CANNOT_SET_PGP_KEYPAIR;
   1.622 -	}
   1.623 +    result = sqlite3_step(session->set_pgp_keypair);
   1.624 +    sqlite3_reset(session->set_pgp_keypair);
   1.625 +    if (result != SQLITE_DONE) {
   1.626 +        sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   1.627 +        return PEP_CANNOT_SET_PGP_KEYPAIR;
   1.628 +    }
   1.629  
   1.630 -	sqlite3_reset(session->set_identity);
   1.631 +    sqlite3_reset(session->set_identity);
   1.632      sqlite3_bind_text(session->set_identity, 1, identity->address, -1,
   1.633              SQLITE_STATIC);
   1.634      sqlite3_bind_text(session->set_identity, 2, identity->fpr, -1,
   1.635              SQLITE_STATIC);
   1.636      sqlite3_bind_text(session->set_identity, 3, identity->user_id, -1,
   1.637              SQLITE_STATIC);
   1.638 -	result = sqlite3_step(session->set_identity);
   1.639 -	sqlite3_reset(session->set_identity);
   1.640 -	if (result != SQLITE_DONE) {
   1.641 -		sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   1.642 -		return PEP_CANNOT_SET_IDENTITY;
   1.643 -	}
   1.644 +    result = sqlite3_step(session->set_identity);
   1.645 +    sqlite3_reset(session->set_identity);
   1.646 +    if (result != SQLITE_DONE) {
   1.647 +        sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   1.648 +        return PEP_CANNOT_SET_IDENTITY;
   1.649 +    }
   1.650  
   1.651 -	sqlite3_reset(session->set_trust);
   1.652 +    sqlite3_reset(session->set_trust);
   1.653      sqlite3_bind_text(session->set_trust, 1, identity->user_id, -1,
   1.654              SQLITE_STATIC);
   1.655      sqlite3_bind_text(session->set_trust, 2, identity->fpr, -1,
   1.656              SQLITE_STATIC);
   1.657 -	sqlite3_bind_int(session->set_trust, 3, identity->comm_type);
   1.658 -	result = sqlite3_step(session->set_trust);
   1.659 -	sqlite3_reset(session->set_trust);
   1.660 -	if (result != SQLITE_DONE) {
   1.661 -		sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   1.662 -		return PEP_CANNOT_SET_IDENTITY;
   1.663 -	}
   1.664 +    sqlite3_bind_int(session->set_trust, 3, identity->comm_type);
   1.665 +    result = sqlite3_step(session->set_trust);
   1.666 +    sqlite3_reset(session->set_trust);
   1.667 +    if (result != SQLITE_DONE) {
   1.668 +        sqlite3_exec(session->db, "ROLLBACK ;", NULL, NULL, NULL);
   1.669 +        return PEP_CANNOT_SET_IDENTITY;
   1.670 +    }
   1.671  
   1.672      result = sqlite3_exec(session->db, "COMMIT ;", NULL, NULL, NULL);
   1.673 -	if (result == SQLITE_OK)
   1.674 -		return PEP_STATUS_OK;
   1.675 -	else
   1.676 -		return PEP_COMMIT_FAILED;
   1.677 +    if (result == SQLITE_OK)
   1.678 +        return PEP_STATUS_OK;
   1.679 +    else
   1.680 +        return PEP_COMMIT_FAILED;
   1.681  }
   1.682  
   1.683  DYNAMIC_API PEP_STATUS mark_as_compromized(
   1.684 @@ -818,19 +818,19 @@
   1.685          const char *fpr
   1.686      )
   1.687  {
   1.688 -	int result;
   1.689 +    int result;
   1.690  
   1.691 -	assert(session);
   1.692 +    assert(session);
   1.693      assert(fpr && fpr[0]);
   1.694  
   1.695      if (!(session && fpr && fpr[0]))
   1.696          return PEP_ILLEGAL_VALUE;
   1.697  
   1.698 -	sqlite3_reset(session->mark_compromized);
   1.699 +    sqlite3_reset(session->mark_compromized);
   1.700      sqlite3_bind_text(session->mark_compromized, 1, fpr, -1,
   1.701              SQLITE_STATIC);
   1.702      result = sqlite3_step(session->mark_compromized);
   1.703 -	sqlite3_reset(session->mark_compromized);
   1.704 +    sqlite3_reset(session->mark_compromized);
   1.705  
   1.706      if (result != SQLITE_DONE)
   1.707          return PEP_CANNOT_SET_IDENTITY;
   1.708 @@ -1328,8 +1328,8 @@
   1.709          return PEP_ILLEGAL_VALUE;
   1.710  
   1.711      sqlite3_reset(session->i18n_token);
   1.712 -	sqlite3_bind_text(session->i18n_token, 1, lang, -1, SQLITE_STATIC);
   1.713 -	sqlite3_bind_int(session->i18n_token, 2, phrase_id);
   1.714 +    sqlite3_bind_text(session->i18n_token, 1, lang, -1, SQLITE_STATIC);
   1.715 +    sqlite3_bind_int(session->i18n_token, 2, phrase_id);
   1.716  
   1.717      const char *_phrase = NULL;
   1.718      int result;
     2.1 --- a/src/pEpEngine.h	Wed Apr 06 17:00:54 2016 +0200
     2.2 +++ b/src/pEpEngine.h	Tue Apr 19 14:30:52 2016 +0200
     2.3 @@ -25,72 +25,72 @@
     2.4  typedef struct _pEpSession * PEP_SESSION;
     2.5  
     2.6  typedef enum {
     2.7 -	PEP_STATUS_OK									= 0,
     2.8 +    PEP_STATUS_OK                                   = 0,
     2.9  
    2.10 -	PEP_INIT_CANNOT_LOAD_GPGME						= 0x0110,
    2.11 -	PEP_INIT_GPGME_INIT_FAILED						= 0x0111,
    2.12 -	PEP_INIT_NO_GPG_HOME							= 0x0112,
    2.13 -	PEP_INIT_NETPGP_INIT_FAILED						= 0x0113,
    2.14 +    PEP_INIT_CANNOT_LOAD_GPGME                      = 0x0110,
    2.15 +    PEP_INIT_GPGME_INIT_FAILED                      = 0x0111,
    2.16 +    PEP_INIT_NO_GPG_HOME                            = 0x0112,
    2.17 +    PEP_INIT_NETPGP_INIT_FAILED                     = 0x0113,
    2.18  
    2.19 -	PEP_INIT_SQLITE3_WITHOUT_MUTEX					= 0x0120,
    2.20 -	PEP_INIT_CANNOT_OPEN_DB							= 0x0121,
    2.21 -	PEP_INIT_CANNOT_OPEN_SYSTEM_DB					= 0x0122,
    2.22 -	
    2.23 -	PEP_KEY_NOT_FOUND						        = 0x0201,
    2.24 -	PEP_KEY_HAS_AMBIG_NAME					        = 0x0202,
    2.25 -	PEP_GET_KEY_FAILED						        = 0x0203,
    2.26 -	
    2.27 -	PEP_CANNOT_FIND_IDENTITY						= 0x0301,
    2.28 -	PEP_CANNOT_SET_PERSON							= 0x0381,
    2.29 -	PEP_CANNOT_SET_PGP_KEYPAIR						= 0x0382,
    2.30 -	PEP_CANNOT_SET_IDENTITY							= 0x0383,
    2.31 +    PEP_INIT_SQLITE3_WITHOUT_MUTEX                  = 0x0120,
    2.32 +    PEP_INIT_CANNOT_OPEN_DB                         = 0x0121,
    2.33 +    PEP_INIT_CANNOT_OPEN_SYSTEM_DB                  = 0x0122,
    2.34 +    
    2.35 +    PEP_KEY_NOT_FOUND                               = 0x0201,
    2.36 +    PEP_KEY_HAS_AMBIG_NAME                          = 0x0202,
    2.37 +    PEP_GET_KEY_FAILED                              = 0x0203,
    2.38 +    
    2.39 +    PEP_CANNOT_FIND_IDENTITY                        = 0x0301,
    2.40 +    PEP_CANNOT_SET_PERSON                           = 0x0381,
    2.41 +    PEP_CANNOT_SET_PGP_KEYPAIR                      = 0x0382,
    2.42 +    PEP_CANNOT_SET_IDENTITY                         = 0x0383,
    2.43      PEP_CANNOT_SET_TRUST                            = 0x0384,
    2.44      PEP_KEY_BLACKLISTED                             = 0x0385,
    2.45 -	
    2.46 -	PEP_UNENCRYPTED									= 0x0400,
    2.47 -	PEP_VERIFIED									= 0x0401,
    2.48 -	PEP_DECRYPTED									= 0x0402,
    2.49 -	PEP_DECRYPTED_AND_VERIFIED						= 0x0403,
    2.50 -	PEP_DECRYPT_WRONG_FORMAT						= 0x0404,
    2.51 -	PEP_DECRYPT_NO_KEY								= 0x0405,
    2.52 -	PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH			= 0x0406,
    2.53 +    
    2.54 +    PEP_UNENCRYPTED                                 = 0x0400,
    2.55 +    PEP_VERIFIED                                    = 0x0401,
    2.56 +    PEP_DECRYPTED                                   = 0x0402,
    2.57 +    PEP_DECRYPTED_AND_VERIFIED                      = 0x0403,
    2.58 +    PEP_DECRYPT_WRONG_FORMAT                        = 0x0404,
    2.59 +    PEP_DECRYPT_NO_KEY                              = 0x0405,
    2.60 +    PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH            = 0x0406,
    2.61      PEP_VERIFY_NO_KEY                               = 0x0407,
    2.62      PEP_VERIFIED_AND_TRUSTED                        = 0x0408,
    2.63 -	PEP_CANNOT_DECRYPT_UNKNOWN						= 0x04ff,
    2.64 +    PEP_CANNOT_DECRYPT_UNKNOWN                      = 0x04ff,
    2.65  
    2.66 -	PEP_TRUSTWORD_NOT_FOUND							= 0x0501,
    2.67 +    PEP_TRUSTWORD_NOT_FOUND                         = 0x0501,
    2.68  
    2.69      PEP_CANNOT_CREATE_KEY                           = 0x0601,
    2.70      PEP_CANNOT_SEND_KEY                             = 0x0602,
    2.71  
    2.72      PEP_PHRASE_NOT_FOUND                            = 0x0701,
    2.73  
    2.74 -	PEP_COMMIT_FAILED								= 0xff01,
    2.75 +    PEP_COMMIT_FAILED                               = 0xff01,
    2.76  
    2.77      PEP_CANNOT_CREATE_TEMP_FILE                     = -5,
    2.78      PEP_ILLEGAL_VALUE                               = -4,
    2.79      PEP_BUFFER_TOO_SMALL                            = -3,
    2.80 -	PEP_OUT_OF_MEMORY								= -2,
    2.81 -	PEP_UNKNOWN_ERROR								= -1
    2.82 +    PEP_OUT_OF_MEMORY                               = -2,
    2.83 +    PEP_UNKNOWN_ERROR                               = -1
    2.84  } PEP_STATUS;
    2.85  
    2.86  
    2.87  // INIT_STATUS init() - initialize pEpEngine for a thread
    2.88  //
    2.89  //  parameters:
    2.90 -//		session (out)	init() allocates session memory and returns a pointer
    2.91 -//		                as a handle
    2.92 +//        session (out)   init() allocates session memory and returns a pointer
    2.93 +//                        as a handle
    2.94  //
    2.95  //  return value:
    2.96 -//		PEP_STATUS_OK = 0					if init() succeeds
    2.97 -//		PEP_INIT_SQLITE3_WITHOUT_MUTEX		if SQLite3 was compiled with
    2.98 -//		                                    SQLITE_THREADSAFE 0
    2.99 -//		PEP_INIT_CANNOT_LOAD_GPGME			if libgpgme.dll cannot be found
   2.100 -//		PEP_INIT_GPGME_INIT_FAILED			if GPGME init fails
   2.101 -//		PEP_INIT_CANNOT_OPEN_DB				if user's management db cannot be
   2.102 -//		                                    opened
   2.103 -//		PEP_INIT_CANNOT_OPEN_SYSTEM_DB		if system's management db cannot be
   2.104 -//		                                    opened
   2.105 +//        PEP_STATUS_OK = 0                 if init() succeeds
   2.106 +//        PEP_INIT_SQLITE3_WITHOUT_MUTEX    if SQLite3 was compiled with
   2.107 +//                                            SQLITE_THREADSAFE 0
   2.108 +//        PEP_INIT_CANNOT_LOAD_GPGME        if libgpgme.dll cannot be found
   2.109 +//        PEP_INIT_GPGME_INIT_FAILED        if GPGME init fails
   2.110 +//        PEP_INIT_CANNOT_OPEN_DB           if user's management db cannot be
   2.111 +//                                            opened
   2.112 +//        PEP_INIT_CANNOT_OPEN_SYSTEM_DB    if system's management db cannot be
   2.113 +//                                            opened
   2.114  //
   2.115  //  caveat:
   2.116  //      the pointer is valid only if the return value is PEP_STATUS_OK
   2.117 @@ -106,11 +106,11 @@
   2.118  // void release() - release thread session handle
   2.119  //
   2.120  //  parameters:
   2.121 -//		session (in)	session handle to release
   2.122 +//        session (in)    session handle to release
   2.123  //
   2.124 -//	caveat:
   2.125 -//	    the last release() can be called only when all other release() calls
   2.126 -//	    are done
   2.127 +//    caveat:
   2.128 +//        the last release() can be called only when all other release() calls
   2.129 +//        are done
   2.130  
   2.131  DYNAMIC_API void release(PEP_SESSION session);
   2.132  
   2.133 @@ -135,27 +135,27 @@
   2.134  
   2.135  // decrypt_and_verify() - decrypt and/or verify a message
   2.136  //
   2.137 -//	parameters:
   2.138 -//		session (in)	session handle
   2.139 -//		ctext (in)		cipher text to decrypt and/or verify
   2.140 -//		csize (in)		size of cipher text
   2.141 -//		ptext (out)		pointer to internal buffer with plain text
   2.142 -//		psize (out)		size of plain text
   2.143 -//		keylist (out)	list of key ids which where used to encrypt
   2.144 +//    parameters:
   2.145 +//        session (in)    session handle
   2.146 +//        ctext (in)      cipher text to decrypt and/or verify
   2.147 +//        csize (in)      size of cipher text
   2.148 +//        ptext (out)     pointer to internal buffer with plain text
   2.149 +//        psize (out)     size of plain text
   2.150 +//        keylist (out)   list of key ids which where used to encrypt
   2.151  //
   2.152 -//	return value:
   2.153 -//		PEP_UNENCRYPTED				message was unencrypted and not signed
   2.154 -//		PEP_VERIFIED				message was unencrypted, signature matches
   2.155 -//		PEP_DECRYPTED				message is decrypted now, no signature
   2.156 -//		PEP_DECRYPTED_AND_VERIFIED	message is decrypted now and verified
   2.157 -//		PEP_DECRYPT_WRONG_FORMAT	message has wrong format to handle
   2.158 -//		PEP_DECRYPT_NO_KEY			key not available to decrypt and/or verify
   2.159 -//		PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH	wrong signature
   2.160 +//    return value:
   2.161 +//        PEP_UNENCRYPTED               message was unencrypted and not signed
   2.162 +//        PEP_VERIFIED                  message was unencrypted, signature matches
   2.163 +//        PEP_DECRYPTED                 message is decrypted now, no signature
   2.164 +//        PEP_DECRYPTED_AND_VERIFIED    message is decrypted now and verified
   2.165 +//        PEP_DECRYPT_WRONG_FORMAT      message has wrong format to handle
   2.166 +//        PEP_DECRYPT_NO_KEY            key not available to decrypt and/or verify
   2.167 +//        PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH    wrong signature
   2.168  //
   2.169 -//	caveat:
   2.170 -//	    the ownerships of ptext as well as keylist are going to the caller
   2.171 -//	    the caller must use free() (or an Windoze pEp_free()) and
   2.172 -//	    free_stringlist() to free them
   2.173 +//    caveat:
   2.174 +//        the ownerships of ptext as well as keylist are going to the caller
   2.175 +//        the caller must use free() (or an Windoze pEp_free()) and
   2.176 +//        free_stringlist() to free them
   2.177  //
   2.178  //      if this function failes an error message may be the first element of
   2.179  //      keylist and the other elements may be the keys used for encryption
   2.180 @@ -174,13 +174,13 @@
   2.181  //      size (in)       size of text
   2.182  //      signature (in)  signature text
   2.183  //      sig_size (in)   size of signature
   2.184 -//		keylist (out)	list of key ids which where used to encrypt or NULL on
   2.185 -//		                error
   2.186 +//      keylist (out)   list of key ids which where used to encrypt or NULL on
   2.187 +//                        error
   2.188  //
   2.189  //  return value:
   2.190 -//		PEP_VERIFIED				message was unencrypted, signature matches
   2.191 -//		PEP_DECRYPT_NO_KEY			key not available to decrypt and/or verify
   2.192 -//		PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH	wrong signature
   2.193 +//        PEP_VERIFIED                message was unencrypted, signature matches
   2.194 +//        PEP_DECRYPT_NO_KEY          key not available to decrypt and/or verify
   2.195 +//        PEP_DECRYPT_SIGNATURE_DOES_NOT_MATCH    wrong signature
   2.196  
   2.197  DYNAMIC_API PEP_STATUS verify_text(
   2.198          PEP_SESSION session, const char *text, size_t size,
   2.199 @@ -190,24 +190,24 @@
   2.200  
   2.201  // encrypt_and_sign() - encrypt and sign a message
   2.202  //
   2.203 -//	parameters:
   2.204 -//		session (in)	session handle
   2.205 -//		keylist (in)	list of key ids to encrypt with as C strings
   2.206 -//		ptext (in)		plain text to decrypt and/or verify
   2.207 -//		psize (in)		size of plain text
   2.208 -//		ctext (out)		pointer to internal buffer with cipher text
   2.209 -//		csize (out)		size of cipher text
   2.210 +//    parameters:
   2.211 +//        session (in)    session handle
   2.212 +//        keylist (in)    list of key ids to encrypt with as C strings
   2.213 +//        ptext (in)      plain text to decrypt and/or verify
   2.214 +//        psize (in)      size of plain text
   2.215 +//        ctext (out)     pointer to internal buffer with cipher text
   2.216 +//        csize (out)     size of cipher text
   2.217  //
   2.218 -//	return value:
   2.219 -//		PEP_STATUS_OK = 0				encryption and signing succeeded
   2.220 -//		PEP_KEY_NOT_FOUND	            at least one of the receipient keys
   2.221 -//		                                could not be found
   2.222 -//		PEP_KEY_HAS_AMBIG_NAME          at least one of the receipient keys has
   2.223 -//		                                an ambiguous name
   2.224 -//		PEP_GET_KEY_FAILED		        cannot retrieve key
   2.225 +//    return value:
   2.226 +//        PEP_STATUS_OK = 0            encryption and signing succeeded
   2.227 +//        PEP_KEY_NOT_FOUND            at least one of the receipient keys
   2.228 +//                                     could not be found
   2.229 +//        PEP_KEY_HAS_AMBIG_NAME       at least one of the receipient keys has
   2.230 +//                                     an ambiguous name
   2.231 +//        PEP_GET_KEY_FAILED           cannot retrieve key
   2.232  //
   2.233 -//	caveat:
   2.234 -//	    the ownership of ctext is going to the caller
   2.235 +//    caveat:
   2.236 +//      the ownership of ctext is going to the caller
   2.237  //      the caller is responsible to free() it (on Windoze use pEp_free())
   2.238  //      the first key in keylist is being used to sign the message
   2.239  //      this implies there has to be a private key for that keypair
   2.240 @@ -221,17 +221,17 @@
   2.241  // log_event() - log a user defined event defined by UTF-8 encoded strings into
   2.242  // management log
   2.243  //
   2.244 -//	parameters:
   2.245 -//		session (in)		session handle
   2.246 -//		title (in)			C string with event name
   2.247 -//		entity (in)			C string with name of entity which is logging
   2.248 -//		description (in)	C string with long description for event or NULL if
   2.249 -//		                    omitted
   2.250 -//		comment (in)		C string with user defined comment or NULL if
   2.251 -//		                    omitted
   2.252 +//    parameters:
   2.253 +//        session (in)        session handle
   2.254 +//        title (in)          C string with event name
   2.255 +//        entity (in)         C string with name of entity which is logging
   2.256 +//        description (in)    C string with long description for event or NULL if
   2.257 +//                            omitted
   2.258 +//        comment (in)        C string with user defined comment or NULL if
   2.259 +//                            omitted
   2.260  //
   2.261 -//	return value:
   2.262 -//	    PEP_STATUS_OK       log entry created
   2.263 +//    return value:
   2.264 +//        PEP_STATUS_OK       log entry created
   2.265  
   2.266  DYNAMIC_API PEP_STATUS log_event(
   2.267          PEP_SESSION session,
   2.268 @@ -244,21 +244,21 @@
   2.269  
   2.270  // trustword() - get the corresponding trustword for a 16 bit value
   2.271  //
   2.272 -//	parameters:
   2.273 -//		session (in)		    session handle
   2.274 -//		value (in)			    value to find a trustword for
   2.275 -//		lang (in)			    C string with ISO 639-1 language code
   2.276 -//		word (out)			    pointer to C string with trustword UTF-8 encoded
   2.277 -//							    NULL if language is not supported or trustword
   2.278 -//							    wordlist is damaged or unavailable
   2.279 -//		wsize (out)			    length of trustword
   2.280 +//    parameters:
   2.281 +//        session (in)            session handle
   2.282 +//        value (in)              value to find a trustword for
   2.283 +//        lang (in)               C string with ISO 639-1 language code
   2.284 +//        word (out)              pointer to C string with trustword UTF-8 encoded
   2.285 +//                                NULL if language is not supported or trustword
   2.286 +//                                wordlist is damaged or unavailable
   2.287 +//        wsize (out)             length of trustword
   2.288  //
   2.289 -//	return value:
   2.290 -//	    PEP_STATUS_OK           trustword retrieved
   2.291 -//	    PEP_TRUSTWORD_NOT_FOUND  trustword not found
   2.292 +//    return value:
   2.293 +//        PEP_STATUS_OK            trustword retrieved
   2.294 +//        PEP_TRUSTWORD_NOT_FOUND  trustword not found
   2.295  //
   2.296 -//	caveat:
   2.297 -//		the word pointer goes to the ownership of the caller
   2.298 +//    caveat:
   2.299 +//        the word pointer goes to the ownership of the caller
   2.300  //      the caller is responsible to free() it (on Windoze use pEp_free())
   2.301  
   2.302  DYNAMIC_API PEP_STATUS trustword(
   2.303 @@ -269,25 +269,25 @@
   2.304  
   2.305  // trustwords() - get trustwords for a string of hex values of a fingerprint
   2.306  //
   2.307 -//	parameters:
   2.308 -//		session (in)		session handle
   2.309 -//		fingerprint (in)	C string with hex values to find trustwords for
   2.310 -//		lang (in)			C string with ISO 639-1 language code
   2.311 -//		words (out)			pointer to C string with trustwords UTF-8 encoded,
   2.312 -//		                    separated by a blank each
   2.313 -//							NULL if language is not supported or trustword
   2.314 -//							wordlist is damaged or unavailable
   2.315 -//		wsize (out)			length of trustwords string
   2.316 -//		max_words (in)		only generate a string with max_words;
   2.317 -//							if max_words == 0 there is no such limit
   2.318 +//    parameters:
   2.319 +//        session (in)        session handle
   2.320 +//        fingerprint (in)    C string with hex values to find trustwords for
   2.321 +//        lang (in)           C string with ISO 639-1 language code
   2.322 +//        words (out)         pointer to C string with trustwords UTF-8 encoded,
   2.323 +//                            separated by a blank each
   2.324 +//                            NULL if language is not supported or trustword
   2.325 +//                            wordlist is damaged or unavailable
   2.326 +//        wsize (out)         length of trustwords string
   2.327 +//        max_words (in)      only generate a string with max_words;
   2.328 +//                            if max_words == 0 there is no such limit
   2.329  //
   2.330 -//	return value:
   2.331 -//	    PEP_STATUS_OK           trustwords retrieved
   2.332 -//      PEP_OUT_OF_MEMORY       out of memory
   2.333 -//	    PEP_TRUSTWORD_NOT_FOUND at least one trustword not found
   2.334 +//    return value:
   2.335 +//        PEP_STATUS_OK            trustwords retrieved
   2.336 +//        PEP_OUT_OF_MEMORY        out of memory
   2.337 +//        PEP_TRUSTWORD_NOT_FOUND  at least one trustword not found
   2.338  //
   2.339 -//	caveat:
   2.340 -//		the word pointer goes to the ownership of the caller
   2.341 +//    caveat:
   2.342 +//        the word pointer goes to the ownership of the caller
   2.343  //      the caller is responsible to free() it (on Windoze use pEp_free())
   2.344  //
   2.345  //  DON'T USE THIS FUNCTION FROM HIGH LEVEL LANGUAGES!
   2.346 @@ -325,7 +325,7 @@
   2.347      // range 0x10 to 0x3f: unconfirmed encryption
   2.348  
   2.349      PEP_ct_unconfirmed_encryption = 0x10,       // generic
   2.350 -    PEP_ct_OpenPGP_weak_unconfirmed = 0x11,	    // RSA 1024 is weak
   2.351 +    PEP_ct_OpenPGP_weak_unconfirmed = 0x11,     // RSA 1024 is weak
   2.352  
   2.353      PEP_ct_to_be_checked = 0x20,                // generic
   2.354      PEP_ct_SMIME_unconfirmed = 0x21,
   2.355 @@ -346,34 +346,34 @@
   2.356      // range 0x90 to 0xbf: confirmed encryption
   2.357  
   2.358      PEP_ct_confirmed_encryption = 0x90,         // generic
   2.359 -	PEP_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak
   2.360 +    PEP_ct_OpenPGP_weak = 0x91,                 // RSA 1024 is weak
   2.361  
   2.362      PEP_ct_to_be_checked_confirmed = 0xa0,      //generic
   2.363      PEP_ct_SMIME = 0xa1,
   2.364      PEP_ct_CMS = 0xa2,
   2.365  
   2.366      PEP_ct_strong_encryption = 0xb0,            // generic
   2.367 -	PEP_ct_OpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
   2.368 -	PEP_ct_OTR = 0xba,
   2.369 +    PEP_ct_OpenPGP = 0xb8,                      // key at least 2048 bit RSA or EC
   2.370 +    PEP_ct_OTR = 0xba,
   2.371  
   2.372      // range 0xc0 to 0xff: confirmed encryption and anonymization
   2.373  
   2.374      PEP_ct_confirmed_enc_anon = 0xc0,           // generic
   2.375 -	PEP_ct_pEp = 0xff
   2.376 +    PEP_ct_pEp = 0xff
   2.377  } PEP_comm_type;
   2.378  
   2.379  typedef struct _pEp_identity {
   2.380 -	size_t struct_size;			// size of whole struct
   2.381 -	char *address;		        // C string with address UTF-8 encoded
   2.382 -	size_t address_size;		// size of address
   2.383 -	char *fpr;			        // C string with fingerprint UTF-8 encoded
   2.384 -	size_t fpr_size;			// size of fingerprint
   2.385 -	char *user_id;		        // C string with user ID UTF-8 encoded
   2.386 -	size_t user_id_size;		// size of user ID
   2.387 -	char *username;		        // C string with user name UTF-8 encoded
   2.388 -	size_t username_size;		// size of user name
   2.389 -	PEP_comm_type comm_type;	// type of communication with this ID
   2.390 -    char lang[3];				// language of conversation
   2.391 +    size_t struct_size;         // size of whole struct
   2.392 +    char *address;              // C string with address UTF-8 encoded
   2.393 +    size_t address_size;        // size of address
   2.394 +    char *fpr;                  // C string with fingerprint UTF-8 encoded
   2.395 +    size_t fpr_size;            // size of fingerprint
   2.396 +    char *user_id;              // C string with user ID UTF-8 encoded
   2.397 +    size_t user_id_size;        // size of user ID
   2.398 +    char *username;             // C string with user name UTF-8 encoded
   2.399 +    size_t username_size;       // size of user name
   2.400 +    PEP_comm_type comm_type;    // type of communication with this ID
   2.401 +    char lang[3];               // language of conversation
   2.402                                  // ISO 639-1 ALPHA-2, last byte is 0
   2.403      bool me;                    // if this is the local user herself/himself
   2.404  } pEp_identity;
   2.405 @@ -429,18 +429,18 @@
   2.406  
   2.407  // get_identity() - get identity information
   2.408  //
   2.409 -//	parameters:
   2.410 -//		session (in)		session handle
   2.411 -//		address (in)		C string with communication address, UTF-8 encoded
   2.412 -//		identity (out)		pointer to pEp_identity structure with results or
   2.413 -//		                    NULL if failure
   2.414 +//    parameters:
   2.415 +//        session (in)        session handle
   2.416 +//        address (in)        C string with communication address, UTF-8 encoded
   2.417 +//        identity (out)      pointer to pEp_identity structure with results or
   2.418 +//                            NULL if failure
   2.419  //
   2.420 -//	caveat:
   2.421 -//	    the address string is being copied; the original string remains in the
   2.422 -//	    ownership of the caller
   2.423 -//		the resulting pEp_identity structure goes to the ownership of the
   2.424 -//		caller and has to be freed with free_identity() when not in use any
   2.425 -//		more
   2.426 +//    caveat:
   2.427 +//        the address string is being copied; the original string remains in the
   2.428 +//        ownership of the caller
   2.429 +//        the resulting pEp_identity structure goes to the ownership of the
   2.430 +//        caller and has to be freed with free_identity() when not in use any
   2.431 +//        more
   2.432  
   2.433  DYNAMIC_API PEP_STATUS get_identity(
   2.434          PEP_SESSION session, const char *address,
   2.435 @@ -450,22 +450,22 @@
   2.436  
   2.437  // set_identity() - set identity information
   2.438  //
   2.439 -//	parameters:
   2.440 -//		session (in)		session handle
   2.441 -//		identity (in)		pointer to pEp_identity structure
   2.442 +//    parameters:
   2.443 +//        session (in)        session handle
   2.444 +//        identity (in)       pointer to pEp_identity structure
   2.445  //
   2.446 -//	return value:
   2.447 -//		PEP_STATUS_OK = 0			    encryption and signing succeeded
   2.448 -//		PEP_CANNOT_SET_PERSON		    writing to table person failed
   2.449 -//		PEP_CANNOT_SET_PGP_KEYPAIR	    writing to table pgp_keypair failed
   2.450 -//		PEP_CANNOT_SET_IDENTITY		    writing to table identity failed
   2.451 -//		PEP_COMMIT_FAILED			    SQL commit failed
   2.452 +//    return value:
   2.453 +//        PEP_STATUS_OK = 0             encryption and signing succeeded
   2.454 +//        PEP_CANNOT_SET_PERSON         writing to table person failed
   2.455 +//        PEP_CANNOT_SET_PGP_KEYPAIR    writing to table pgp_keypair failed
   2.456 +//        PEP_CANNOT_SET_IDENTITY       writing to table identity failed
   2.457 +//        PEP_COMMIT_FAILED             SQL commit failed
   2.458  //      PEP_KEY_BLACKLISTED             Key blacklisted, cannot set identity
   2.459  //
   2.460 -//	caveat:
   2.461 -//		in the identity structure you need to set the const char * fields to
   2.462 -//		UTF-8 C strings
   2.463 -//		the size fields are ignored
   2.464 +//    caveat:
   2.465 +//        in the identity structure you need to set the const char * fields to
   2.466 +//        UTF-8 C strings
   2.467 +//        the size fields are ignored
   2.468  
   2.469  DYNAMIC_API PEP_STATUS set_identity(
   2.470          PEP_SESSION session, const pEp_identity *identity
   2.471 @@ -474,9 +474,9 @@
   2.472  
   2.473  // mark_as_compromized() - mark key in trust db as compromized
   2.474  //
   2.475 -//	parameters:
   2.476 -//		session (in)		session handle
   2.477 -//		fpr (in)            fingerprint of key to mark
   2.478 +//    parameters:
   2.479 +//        session (in)        session handle
   2.480 +//        fpr (in)            fingerprint of key to mark
   2.481  
   2.482  DYNAMIC_API PEP_STATUS mark_as_compromized(
   2.483          PEP_SESSION session,
   2.484 @@ -488,12 +488,12 @@
   2.485  //
   2.486  //  parameters:
   2.487  //      session (in)            session handle
   2.488 -//		identity (inout)	    pointer to pEp_identity structure
   2.489 +//        identity (inout)      pointer to pEp_identity structure
   2.490  //
   2.491 -//	return value:
   2.492 -//		PEP_STATUS_OK = 0	    encryption and signing succeeded
   2.493 -//		PEP_ILLEGAL_VALUE       illegal values for identity fields given
   2.494 -//		PEP_CANNOT_CREATE_KEY   key engine is on strike
   2.495 +//    return value:
   2.496 +//        PEP_STATUS_OK = 0       encryption and signing succeeded
   2.497 +//        PEP_ILLEGAL_VALUE       illegal values for identity fields given
   2.498 +//        PEP_CANNOT_CREATE_KEY   key engine is on strike
   2.499  //
   2.500  //  caveat:
   2.501  //      address and username fields must be set to UTF-8 strings
   2.502 @@ -546,7 +546,7 @@
   2.503  //      session (in)            session handle
   2.504  //      fpr (in)                key id or fingerprint of key
   2.505  //      key_data (out)          ASCII armored OpenPGP key
   2.506 -//      size (out)               amount of data to handle
   2.507 +//      size (out)              amount of data to handle
   2.508  //
   2.509  //  return value:
   2.510  //      PEP_STATUS_OK = 0       key was successfully exported
   2.511 @@ -581,8 +581,8 @@
   2.512  //      keylist (out)           list of fingerprints found or NULL on error
   2.513  //
   2.514  //  caveat:
   2.515 -//	    the ownerships of keylist isgoing to the caller
   2.516 -//	    the caller must use free_stringlist() to free it
   2.517 +//        the ownerships of keylist isgoing to the caller
   2.518 +//        the caller must use free_stringlist() to free it
   2.519  
   2.520  
   2.521  DYNAMIC_API PEP_STATUS find_keys(
   2.522 @@ -753,7 +753,7 @@
   2.523  //
   2.524  //  parameters:
   2.525  //      session (in)            session handle
   2.526 -//		lang (in)			    C string with ISO 639-1 language code
   2.527 +//      lang (in)               C string with ISO 639-1 language code
   2.528  //      phrase_id (in)          id of phrase in i18n
   2.529  //      phrase (out)            phrase as UTF-8 string
   2.530  //