static int is_guid_blank(jnx_guid *g) { jnx_int is_blank = 0; jnx_guid local; jnx_char *zero_out = "00000000000000000000000000000000"; jnx_guid_from_string(zero_out,&local); if(jnx_guid_compare(&local,g) == JNX_GUID_STATE_SUCCESS) { is_blank = 1; } return is_blank; }
session_state session_service_create_shared_session(session_service *service,\ jnx_char *input_guid_string,session **osession) { jnx_guid g; jnx_guid_from_string(input_guid_string,&g); session_state e; if((e = session_service_fetch_session(service,&g,osession)) == SESSION_STATE_OKAY) { printf("Returning existing session.\n"); return e; } e = session_service_create_session(service,osession); (*osession)->session_guid = g; return e; }
void test_string() { jnx_int i; for(i=0; i<5; ++i) { jnx_guid g; jnx_guid_create(&g); char *ostr; jnx_guid_to_string(&g,&ostr); JNXLOG(LDEBUG,"GUID A=>%s",ostr); jnx_guid f; jnx_guid_from_string(ostr,&f); char *ostrtwo; jnx_guid_to_string(&f,&ostrtwo); JNXLOG(LDEBUG,"GUID B=>%s",ostrtwo); JNXCHECK(jnx_guid_compare(&g,&f) == JNX_GUID_STATE_SUCCESS); } }
static void generate_blank_guid(jnx_guid *g) { jnx_char *zero_out = "00000000000000000000000000000000"; jnx_guid_from_string(zero_out,g); }