Difference between revisions of "Truxton url get id"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the file. This corresponds to the <code>[ID]</code> column of the <code><nowiki>[</now...")
 
Line 1: Line 1:
This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the file.
+
This retrieves the [https://en.wikipedia.org/wiki/Universally_unique_identifier GUID] of the URL.
 
This corresponds to the <code>[ID]</code> column of the <code><nowiki>[</nowiki>[[WebsiteVisit Table|WebsiteVisit]]<nowiki>]</nowiki></code> table.
 
This corresponds to the <code>[ID]</code> column of the <code><nowiki>[</nowiki>[[WebsiteVisit Table|WebsiteVisit]]<nowiki>]</nowiki></code> table.
  

Revision as of 06:55, 19 January 2021

This retrieves the GUID of the URL. This corresponds to the [ID] column of the [WebsiteVisit] table.

Syntax

void truxton_url_get_id( 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

void dump_url(uint64_t url_handle)
{
   uint64_t integer_value = 0;

   char temp_string[ 1024 ];

   truxton_url_get_id( url_handle, temp_string, sizeof(temp_string) );
   printf( "URL ID is %s\n", temp_string );

   truxton_url_get_media_id( url_handle, temp_string, sizeof(temp_string) );
   printf( "Media ID is %s\n", temp_string );

   truxton_url_get_file_id( url_handle, temp_string, sizeof(temp_string) );
   printf( "File ID is %s\n", temp_string );

   truxton_url_get_account( url_handle, temp_string, sizeof(temp_string) );
   printf( "Account is \"%s\"\n", temp_string );

   integer_value = truxton_url_get_account_offset( url_handle );

   if ( integer_value == 0xFFFFFFFFFFFFFFFF )
   {
      printf( "Account offset is not known\n" );
   }
   else
   {
      printf( "Account offset is %" PRIu64 "\n", integer_value );
   }

   integer_value = truxton_url_get_url_offset( url_handle );

   if ( integer_value == 0xFFFFFFFFFFFFFFFF )
   {
      printf( "URL offset is not known, probably came from a SQLite database\n" );
   }
   else
   {
      printf( "URL offset is %" PRIu64 "\n", integer_value );
   }

   integer_value = truxton_url_get_format( url_handle );
   printf( "Format is %" PRIu64 "\n", integer_value );

   integer_value = truxton_url_get_method( url_handle );
   printf( "Method is %" PRIu64 "\n", integer_value );

   integer_value = truxton_url_get_type( url_handle );
   printf( "Type is %" PRIu64 "\n", integer_value );

   integer_value = truxton_url_get_when( url_handle );
   printf( "When is %" PRIu64 "\n", integer_value );
}