libgeda

s_slib.c File Reference

#include <config.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <dirent.h>
#include "libgeda_priv.h"
Include dependency graph for s_slib.c:

Go to the source code of this file.

Data Structures

struct  st_slib

Defines

#define MAX_SLIBS   128

Functions

int s_slib_add_entry (char *new_path)
int s_slib_search_for_dirname (char *dir_name)
char * s_slib_search_dirs (const char *basename)
char * s_slib_search_lowlevel (const char *basename)
char * s_slib_getbasename (const char *rawname)
 Get the base file name from a raw file name string.
char * s_slib_search (const char *filename, int flag)
 Search SLIB for a particular file name.
char * s_slib_search_single (const char *filename)
 Search SLIB for a particular file name.
void s_slib_free ()
void s_slib_init ()
char * s_slib_getdir (int index)
char * s_slib_getfiles (char *directory, int flag)
void s_slib_print (void)
int s_slib_uniq (char *path)
void s_slib_print_dirs (void)

Variables

static int slib_index = 0
static struct st_slib slib [128]
 and eventually make this unlimited hack hack

Define Documentation

#define MAX_SLIBS   128

Definition at line 52 of file s_slib.c.


Function Documentation

int s_slib_add_entry ( char *  new_path)
Todo:
Finish function documentation!!!
Function Description

Definition at line 65 of file s_slib.c.

int s_slib_search_for_dirname ( char *  dir_name)
Todo:
Finish function documentation!!!
Function Description
Returns:
1 if directory is found, zero otherwise.

Definition at line 87 of file s_slib.c.

char* s_slib_search_dirs ( const char *  basename)
Todo:
Finish function documentation!!!
Function Description
Warning:
Caller must g_free returned pointer.

Definition at line 107 of file s_slib.c.

char* s_slib_search_lowlevel ( const char *  basename)
Todo:
Finish function documentation!!!
Function Description
Warning:
Caller must g_free returned pointer.

Definition at line 161 of file s_slib.c.

Here is the call graph for this function:

char* s_slib_getbasename ( const char *  rawname)
Todo:
Finish function documentation!!!
Function Description
This function takes a raw file name and returns a processed file name. It takes the raw file name and copies everything up to the first period and removes any _# (where # is any number of digits.
Parameters:
[in]rawnameCharacter string with the raw file name to parse.
Returns:
The base file name in a character string.
Warning:
Caller must g_free returned pointer.

Definition at line 200 of file s_slib.c.

char* s_slib_search ( const char *  filename,
int  flag 
)
Todo:
Finish function documentation!!!
Function Description
This function will search the SLIB for a particular file name starting at a location specified by the flag parameter.
Parameters:
[in]filenameCharacter string with file name to search for.
[in]flagSpecifies search start location. (See below...)

The flag parameter can be one of the following values:

SLIB_SEARCH_START
Starts a new search for a source file.
SLIB_SEARCH_NEXT
Returns the next instance of the file if one exists.
SLIB_SEARCH_DONE
Finish searching.

Filename is the raw symbol/whatever file name. This function does all the required stripping (up to the first period).

Warning:
Caller must g_free returned pointer.

Definition at line 293 of file s_slib.c.

Here is the call graph for this function:

char* s_slib_search_single ( const char *  filename)
Todo:
Finish function documentation!!!
Function Description
This function will search the SLIB for a particular file name starting at a location specified by the flag parameter.
Parameters:
[in]filenameCharacter string with file name to search for.

Filename is the raw symbol/whatever file name. This function only looks for the file name as is and does no other changes to it.

Warning:
Caller must g_free returned pointer.

Definition at line 352 of file s_slib.c.

Here is the call graph for this function:

void s_slib_free ( void  )
Todo:
Finish function documentation!!!
Function Description

Definition at line 367 of file s_slib.c.

void s_slib_init ( void  )
Todo:
Finish function documentation!!!
Function Description

Definition at line 383 of file s_slib.c.

char* s_slib_getdir ( int  index)
Todo:
Finish function documentation!!!
Function Description
Warning:
Caller must not free the returned pointer.

Definition at line 399 of file s_slib.c.

char* s_slib_getfiles ( char *  directory,
int  flag 
)
Todo:
Finish function documentation!!!
Function Description
Parameters:
[in]directoryCharacter string with directory to get files from.
[in]flagSearch control flag. (See below...)
Returns:
A file name if one is found, NULL otherwise.
Warning:
Caller must g_free returned pointer.

The flag parameter can be one of the following values:

OPEN_DIR
Opens the directory and returns NULL.
READ_DIR
Returns the next non "." entry.
CLOSE_DIR
Closes the directory.
Bug:
This is TOTTALLY BROKEN! statics are not allowed anymore
Warning:
this function is not reentrant

Definition at line 429 of file s_slib.c.

void s_slib_print ( void  )
Todo:
Finish function documentation!!!
Function Description

Definition at line 537 of file s_slib.c.

int s_slib_uniq ( char *  path)
Todo:
Finish function documentation!!!
Function Description

Definition at line 551 of file s_slib.c.

Here is the call graph for this function:

void s_slib_print_dirs ( void  )
Todo:
Finish function documentation!!!
Function Description

Definition at line 574 of file s_slib.c.

Here is the call graph for this function:


Variable Documentation

int slib_index = 0 [static]

Definition at line 49 of file s_slib.c.

struct st_slib slib[128] [static]

Definition at line 58 of file s_slib.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines