taskrambler  0.1.9
Web server and task management solution.
_format3or5.c File Reference
#include <string.h>
#include <arpa/inet.h>
#include <uuid/uuid.h>
#include "class.h"
#include "uuid.h"
+ Include dependency graph for _format3or5.c:

Go to the source code of this file.

Functions

void _uuidFormat3or5 (Uuid uuid, unsigned char hash[16], int version)
 

Detailed Description

Author
Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file _format3or5.c.

Function Documentation

void _uuidFormat3or5 ( Uuid  uuid,
unsigned char  hash[16],
int  version 
)

Definition at line 36 of file _format3or5.c.

Referenced by uuidVersion3(), and uuidVersion5().

37 {
38  /* convert UUID to local byte order */
39  memcpy((uuid->uuid).value, hash, 16);
40 
41  (uuid->uuid).elements.time_low =
42  ntohl((uuid->uuid).elements.time_low);
43  (uuid->uuid).elements.time_mid =
44  ntohs((uuid->uuid).elements.time_mid);
45  (uuid->uuid).elements.time_hi_version =
46  ntohs((uuid->uuid).elements.time_hi_version);
47 
48  /* put in the variant and version bits */
49  (uuid->uuid).elements.time_hi_version &= 0x0FFF;
50  (uuid->uuid).elements.time_hi_version |= (version << 12);
51  (uuid->uuid).elements.clk_seq_hi_res &= 0x3F;
52  (uuid->uuid).elements.clk_seq_hi_res |= 0x80;
53 }

+ Here is the caller graph for this function: