diff options
author | Chris Johns <chrisj@rtems.org> | 2018-04-12 17:46:49 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2018-04-12 17:57:40 +1000 |
commit | f59d435d16261b04f97e293ab075e79624caf11d (patch) | |
tree | d37bc351bc95541388740069541f605af71203ff /cpukit/libdl/rtl-shell.c | |
parent | testsuites/dl06: Add a test for RAP format. (diff) | |
download | rtems-f59d435d16261b04f97e293ab075e79624caf11d.tar.bz2 |
libdl: Remove _t from all structures as this is reserved for the standards
Diffstat (limited to 'cpukit/libdl/rtl-shell.c')
-rw-r--r-- | cpukit/libdl/rtl-shell.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/cpukit/libdl/rtl-shell.c b/cpukit/libdl/rtl-shell.c index e1a197ed62..5c144977a0 100644 --- a/cpukit/libdl/rtl-shell.c +++ b/cpukit/libdl/rtl-shell.c @@ -1,5 +1,5 @@ /* - * COPYRIGHT (c) 2012 Chris Johns <chrisj@rtems.org> + * COPYRIGHT (c) 2012, 2018 Chris Johns <chrisj@rtems.org> * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at @@ -33,17 +33,17 @@ /** * The type of the shell handlers we have. */ -typedef int (*rtems_rtl_shell_handler_t) (rtems_rtl_data_t* rtl, int argc, char *argv[]); +typedef int (*rtems_rtl_shell_handler) (rtems_rtl_data* rtl, int argc, char *argv[]); /** * Table of handlers we parse to invoke the command. */ typedef struct { - const char* name; /**< The sub-command's name. */ - rtems_rtl_shell_handler_t handler; /**< The sub-command's handler. */ - const char* help; /**< The sub-command's help. */ -} rtems_rtl_shell_cmd_t; + const char* name; /**< The sub-command's name. */ + rtems_rtl_shell_handler handler; /**< The sub-command's handler. */ + const char* help; /**< The sub-command's help. */ +} rtems_rtl_shell_cmd; /** * Object summary data. @@ -53,7 +53,7 @@ typedef struct int count; /**< The number of object files. */ size_t exec; /**< The amount of executable memory allocated. */ size_t symbols; /**< The amount of symbol memory allocated. */ -} rtems_rtl_obj_summary_t; +} rtems_rtl_obj_summary; /** * Object summary iterator. @@ -61,8 +61,8 @@ typedef struct static bool rtems_rtl_obj_summary_iterator (rtems_chain_node* node, void* data) { - rtems_rtl_obj_summary_t* summary = data; - rtems_rtl_obj_t* obj = (rtems_rtl_obj_t*) node; + rtems_rtl_obj_summary* summary = data; + rtems_rtl_obj* obj = (rtems_rtl_obj*) node; ++summary->count; summary->exec += obj->exec_size; summary->symbols += obj->global_size; @@ -73,7 +73,7 @@ rtems_rtl_obj_summary_iterator (rtems_chain_node* node, void* data) * Count the number of symbols. */ static int -rtems_rtl_count_symbols (rtems_rtl_data_t* rtl) +rtems_rtl_count_symbols (rtems_rtl_data* rtl) { int count; int bucket; @@ -83,10 +83,10 @@ rtems_rtl_count_symbols (rtems_rtl_data_t* rtl) } static int -rtems_rtl_shell_status (rtems_rtl_data_t* rtl, int argc, char *argv[]) +rtems_rtl_shell_status (rtems_rtl_data* rtl, int argc, char *argv[]) { - rtems_rtl_obj_summary_t summary; - size_t total_memory; + rtems_rtl_obj_summary summary; + size_t total_memory; summary.count = 0; summary.exec = 0; @@ -98,7 +98,7 @@ rtems_rtl_shell_status (rtems_rtl_data_t* rtl, int argc, char *argv[]) * Currently does not include the name strings in the obj struct. */ total_memory = - sizeof (*rtl) + (summary.count * sizeof (rtems_rtl_obj_t)) + + sizeof (*rtl) + (summary.count * sizeof (rtems_rtl_obj)) + summary.exec + summary.symbols; printf ("Runtime Linker Status:\n"); @@ -117,14 +117,14 @@ rtems_rtl_shell_status (rtems_rtl_data_t* rtl, int argc, char *argv[]) */ typedef struct { - rtems_rtl_data_t* rtl; /**< The RTL data. */ - int indent; /**< Spaces to indent. */ - bool oname; /**< Print object names. */ - bool names; /**< Print details of all names. */ - bool memory_map; /**< Print the memory map. */ - bool symbols; /**< Print the global symbols. */ - bool base; /**< Include the base object file. */ -} rtems_rtl_obj_print_t; + rtems_rtl_data* rtl; /**< The RTL data. */ + int indent; /**< Spaces to indent. */ + bool oname; /**< Print object names. */ + bool names; /**< Print details of all names. */ + bool memory_map; /**< Print the memory map. */ + bool symbols; /**< Print the global symbols. */ + bool base; /**< Include the base object file. */ +} rtems_rtl_obj_print; /** * Return the different between 2 void*. @@ -172,7 +172,7 @@ rtems_rtl_symbols_arg (int argc, char *argv[]) * Object printer. */ static bool -rtems_rtl_obj_printer (rtems_rtl_obj_print_t* print, rtems_rtl_obj_t* obj) +rtems_rtl_obj_printer (rtems_rtl_obj_print* print, rtems_rtl_obj* obj) { char flags_str[33]; @@ -239,10 +239,10 @@ rtems_rtl_obj_printer (rtems_rtl_obj_print_t* print, rtems_rtl_obj_t* obj) * Object unresolved symbols printer. */ static bool -rtems_rtl_unresolved_printer (rtems_rtl_unresolv_rec_t* rec, - void* data) +rtems_rtl_unresolved_printer (rtems_rtl_unresolv_rec* rec, + void* data) { - rtems_rtl_obj_print_t* print = (rtems_rtl_obj_print_t*) data; + rtems_rtl_obj_print* print = (rtems_rtl_obj_print*) data; if (rec->type == rtems_rtl_unresolved_name) printf ("%-*c%s\n", print->indent + 2, ' ', rec->rec.name.name); return false; @@ -254,15 +254,15 @@ rtems_rtl_unresolved_printer (rtems_rtl_unresolv_rec_t* rec, static bool rtems_rtl_obj_print_iterator (rtems_chain_node* node, void* data) { - rtems_rtl_obj_print_t* print = data; - rtems_rtl_obj_t* obj = (rtems_rtl_obj_t*) node; + rtems_rtl_obj_print* print = data; + rtems_rtl_obj* obj = (rtems_rtl_obj*) node; return rtems_rtl_obj_printer (print, obj); } static int -rtems_rtl_shell_list (rtems_rtl_data_t* rtl, int argc, char *argv[]) +rtems_rtl_shell_list (rtems_rtl_data* rtl, int argc, char *argv[]) { - rtems_rtl_obj_print_t print; + rtems_rtl_obj_print print; print.rtl = rtl; print.indent = 1; print.oname = true; @@ -277,9 +277,9 @@ rtems_rtl_shell_list (rtems_rtl_data_t* rtl, int argc, char *argv[]) } static int -rtems_rtl_shell_sym (rtems_rtl_data_t* rtl, int argc, char *argv[]) +rtems_rtl_shell_sym (rtems_rtl_data* rtl, int argc, char *argv[]) { - rtems_rtl_obj_print_t print; + rtems_rtl_obj_print print; print.rtl = rtl; print.indent = 1; print.oname = true; @@ -296,7 +296,7 @@ rtems_rtl_shell_sym (rtems_rtl_data_t* rtl, int argc, char *argv[]) } static int -rtems_rtl_shell_object (rtems_rtl_data_t* rtl, int argc, char *argv[]) +rtems_rtl_shell_object (rtems_rtl_data* rtl, int argc, char *argv[]) { return 0; } @@ -315,7 +315,7 @@ rtems_rtl_shell_usage (const char* arg) int rtems_rtl_shell_command (int argc, char* argv[]) { - const rtems_rtl_shell_cmd_t table[] = + const rtems_rtl_shell_cmd table[] = { { "status", rtems_rtl_shell_status, "Display the status of the RTL" }, @@ -343,7 +343,7 @@ rtems_rtl_shell_command (int argc, char* argv[]) case 'l': printf ("%s: commands are:\n", argv[0]); for (t = 0; - t < (sizeof (table) / sizeof (const rtems_rtl_shell_cmd_t)); + t < (sizeof (table) / sizeof (const rtems_rtl_shell_cmd)); ++t) printf (" %s\t%s\n", table[t].name, table[t].help); return 0; @@ -358,13 +358,13 @@ rtems_rtl_shell_command (int argc, char* argv[]) else { for (t = 0; - t < (sizeof (table) / sizeof (const rtems_rtl_shell_cmd_t)); + t < (sizeof (table) / sizeof (const rtems_rtl_shell_cmd)); ++t) { if (strncmp (argv[arg], table[t].name, strlen (argv[arg])) == 0) { - rtems_rtl_data_t* rtl = rtems_rtl_data (); - int r; + rtems_rtl_data* rtl = rtems_rtl_lock (); + int r; if (!rtl) { printf ("error: cannot lock the linker\n"); |