Truxton url get url

From truxwiki.com
Revision as of 14:39, 19 January 2021 by Sam (talk | contribs) (Created page with "This retrieves the URL that was visited. =Syntax= <source lang="C"> void truxton_url_get_url( uint64_t url_handle, char * destination_string, size_t max_size ); </source> =P...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This retrieves the URL that was visited.

Syntax

void truxton_url_get_url( uint64_t url_handle, char * destination_string, size_t max_size );

Parameters

url_handle

This handle comes from calling truxton_url_create(), or truxton_file_create_url().

destination_string

The string to be written to.

max_size

The maximum number of characters that can be written to destination_string.

Sample

 1 void dump_url(uint64_t url_handle)
 2 {
 3    uint64_t integer_value = 0;
 4 
 5    char temp_string[ 1024 ];
 6 
 7    truxton_url_get_id( url_handle, temp_string, sizeof(temp_string) );
 8    printf( "URL ID is %s\n", temp_string );
 9 
10    truxton_url_get_media_id( url_handle, temp_string, sizeof(temp_string) );
11    printf( "Media ID is %s\n", temp_string );
12 
13    truxton_url_get_file_id( url_handle, temp_string, sizeof(temp_string) );
14    printf( "File ID is %s\n", temp_string );
15 
16    truxton_url_get_account( url_handle, temp_string, sizeof(temp_string) );
17    printf( "Account is \"%s\"\n", temp_string );
18 
19    integer_value = truxton_url_get_account_offset( url_handle );
20 
21    if ( integer_value == 0xFFFFFFFFFFFFFFFF )
22    {
23       printf( "Account offset is not known\n" );
24    }
25    else
26    {
27       printf( "Account offset is %" PRIu64 "\n", integer_value );
28    }
29 
30    integer_value = truxton_url_get_url_offset( url_handle );
31 
32    if ( integer_value == 0xFFFFFFFFFFFFFFFF )
33    {
34       printf( "URL offset is not known, probably came from a SQLite database\n" );
35    }
36    else
37    {
38       printf( "URL offset is %" PRIu64 "\n", integer_value );
39    }
40 
41    integer_value = truxton_url_get_format( url_handle );
42    printf( "Format is %" PRIu64 "\n", integer_value );
43 
44    integer_value = truxton_url_get_method( url_handle );
45    printf( "Method is %" PRIu64 "\n", integer_value );
46 
47    integer_value = truxton_url_get_type( url_handle );
48    printf( "Type is %" PRIu64 "\n", integer_value );
49 
50    integer_value = truxton_url_get_when( url_handle );
51    printf( "When is %" PRIu64 "\n", integer_value );
52 
53    truxton_url_get_url( url_handle, temp_string, sizeof(temp_string) );
54    printf( "URL is \"%s\"\n", temp_string);
55 }