1 1.1 christos /* 2 1.1 christos * Copyright 2017-2019 The OpenSSL Project Authors. All Rights Reserved. 3 1.1 christos * 4 1.1 christos * Licensed under the Apache License 2.0 (the "License"). You may not use 5 1.1 christos * this file except in compliance with the License. You can obtain a copy 6 1.1 christos * in the file LICENSE in the source distribution or at 7 1.1 christos * https://www.openssl.org/source/license.html 8 1.1 christos */ 9 1.1 christos 10 1.1 christos #include <string.h> 11 1.1 christos #include "apps.h" 12 1.1 christos #include "function.h" 13 1.1 christos 14 1.1 christos void calculate_columns(FUNCTION *functions, DISPLAY_COLUMNS *dc) 15 1.1 christos { 16 1.1 christos FUNCTION *f; 17 1.1 christos int len, maxlen = 0; 18 1.1 christos 19 1.1 christos for (f = functions; f->name != NULL; ++f) 20 1.1 christos if (f->type == FT_general || f->type == FT_md || f->type == FT_cipher) 21 1.1 christos if ((len = strlen(f->name)) > maxlen) 22 1.1 christos maxlen = len; 23 1.1 christos 24 1.1 christos dc->width = maxlen + 2; 25 1.1 christos dc->columns = (80 - 1) / dc->width; 26 1.1 christos } 27