* In addition to the links derived from the headers links are
* also derived from the names of all the sourcefiles.
* MODIFICATION HISTORY
- * ????-??-?? Frans Slothouber V1.0
+ * ????-??-?? Frans Slothouber V1.0
* 2003-02-03 Frans Slothouber Refactoring
*******
* $Header: /cvsroot/robodoc/robo/Source/links.c,v 1.43 2007/07/10 19:13:52 gumpu Exp $
* SYNOPSIS
*/
void
-RB_CollectLinks( struct RB_Document *document,
+RB_CollectLinks( struct RB_Document *document,
struct RB_header **headers,
unsigned long count )
/*
* INPUTS
- * * document --
+ * * document --
* * headers -- the array with headers.
* * count -- number of headers in the array
* OUTPUT
int k;
struct RB_Part *i_part;
- for ( i = j = 0; i < count; ++i )
+ for ( i = j = 0; i < count; ++i )
{
j += headers[i]->no_names - 1;
}
{
for ( i_part = document->parts; i_part; i_part = i_part->next )
{
- if ( i_part->headers )
+ if ( i_part->headers )
{
link_index_size++;
}
assert( header->file_name );
for( k = 0; k < header->no_names; j++, k++ )
{
- link = RB_Alloc_Link( header->unique_name, function_name(header->names[k]),
- header->file_name );
+ link = RB_Alloc_Link( header->unique_name,
+ header->function_name,
+ header->file_name );
link->htype = header->htype;
link->is_internal = header->is_internal;
link_index[j] = link;
{
for ( i_part = document->parts; i_part; i_part = i_part->next )
{
- if ( i_part->headers )
+ if ( i_part->headers )
{
struct RB_link *link;
* Searches for the given word in the list of links and
* headers. There are three passes (or four, when the C option
* is selected). Each pass uses a different definition of "word":
- * o In the first pass it is any thing that ends with a 'space', a '.'
+ * o In the first pass it is any thing that ends with a 'space', a '.'
* or a ','.
* o In the second pass it is any string that consists of alpha
- * numerics, '_', ':', '.', or '-'.
- * o In the third pass (for C) it is any string that consists
+ * numerics, '_', ':', '.', or '-'.
+ * o In the third pass (for C) it is any string that consists
* of alpha numerics or '_'.
* SYNOPSIS
*/
int
-Find_Link( char *word_begin,
- char **object_name,
+Find_Link( char *word_begin,
+ char **object_name,
char **label_name,
char **file_name )
/*
case 2:
{
for ( cur_char = word_begin;
- utf8_isalnum( *cur_char ) || ( *cur_char == '_');
+ utf8_isalnum( *cur_char ) || ( *cur_char == '_');
cur_char++ );
break;
}
old_char = *cur_char;
*cur_char = '\0'; /*
- * End the word with a '\0'
+ * End the word with a '\0'
*/
if ( strlen( word_begin ) == length )
{
length = strlen( word_begin );
/* RB_Say ("Testing (pass %d) \"%s\"\n", SAY_INFO, pass, word_begin); */
/*
- * Search case sensitive for a link
+ * Search case sensitive for a link
*/
for ( cur_index = 0, low_index = 0, high_index =
link_index_size - 1; high_index >= low_index; )
* Search case insensitive for a link.
* But only when the user asks for this.
*/
- if ( course_of_action.do_ignore_case_when_linking )
+ if ( course_of_action.do_ignore_case_when_linking )
{
for ( cur_index = 0, low_index = 0, high_index =
*/
static struct RB_link *
RB_Alloc_Link( char *label_name, char *object_name, char *file_name )
-/*
+/*
* INPUTS
* char *label_name -- strings to copy into the link
* char *file_name
struct RB_link *new_link;
assert( object_name );
- assert( label_name );
assert( file_name );
RB_Say( "Allocating a link (%s %s %s)\n", SAY_DEBUG, object_name, label_name, file_name );
new_link = malloc( sizeof( struct RB_link ) );
new_link->file_name = RB_StrDup( file_name );
new_link->object_name = RB_StrDup( object_name );
- new_link->label_name = RB_StrDup( label_name );
+ new_link->label_name = label_name ? RB_StrDup( label_name ) : NULL;
return ( new_link );
}
}
/******/
-