BRL-CAD
ls.c File Reference
#include "common.h"
#include <stdlib.h>
#include <string.h>
#include "bu/cmd.h"
#include "bu/getopt.h"
#include "bu/sort.h"
#include "./ged_private.h"
Include dependency graph for ls.c:

Go to the source code of this file.

Macros

#define RT_TERMINAL_WIDTH   80
 
#define RT_COLUMNS   ((RT_TERMINAL_WIDTH + V4_MAXNAME - 1) / V4_MAXNAME)
 

Functions

struct directory ** _ged_getspace (struct db_i *dbip, size_t num_entries)
 
void _ged_vls_col_pr4v (struct bu_vls *vls, struct directory **list_of_names, size_t num_in_list, int no_decorate)
 
int ged_ls (struct ged *gedp, int argc, const char *argv[])
 

Detailed Description

The ls command.

Definition in file ls.c.

Macro Definition Documentation

#define RT_TERMINAL_WIDTH   80

Definition at line 38 of file ls.c.

Referenced by _ged_vls_col_pr4v().

#define RT_COLUMNS   ((RT_TERMINAL_WIDTH + V4_MAXNAME - 1) / V4_MAXNAME)

Definition at line 39 of file ls.c.

Function Documentation

struct directory** _ged_getspace ( struct db_i dbip,
size_t  num_entries 
)

This routine walks through the directory entry list and mallocs enough space for pointers to hold the number of entries specified by the argument if > 0.

Definition at line 49 of file ls.c.

References bu_calloc(), and db_directory_size().

Referenced by ged_dup(), and ged_ls().

Here is the call graph for this function:

void _ged_vls_col_pr4v ( struct bu_vls vls,
struct directory **  list_of_names,
size_t  num_in_list,
int  no_decorate 
)

Given a pointer to a list of pointers to names and the number of names in that list, sort and print that list in column order over four columns.

Definition at line 84 of file ls.c.

References bu_sort(), bu_vls_printf(), bu_vls_putc(), cmpdirname(), directory::d_flags, directory::d_namep, RT_DIR_COMB, RT_DIR_REGION, and RT_TERMINAL_WIDTH.

Referenced by ged_dup(), ged_ls(), and ged_tops().

Here is the call graph for this function: