/*Block Structure Exchanged Between UA and CDS at Run Time*/ A661_INTERNAL int a661_msg_cmd_header(buffer_el msg[], const a661_uchar layer_id, const a661_ushort context_number) { msg[0] = GET_BYTE_0(A661_BEGIN_BLOCK); msg[1] = GET_BYTE_0(layer_id); msg[2] = GET_BYTE_1(context_number); msg[3] = GET_BYTE_0(context_number); return 4; }
A661_INTERNAL int a661_com_msg_Label_A661_VISIBLE(buffer_el msg[], a661_ushort pid, a661_bool A661_VISIBLE_Visible_){ int n3 = 0; int n2 = 0; int n1 = 0; PARAMETER("A661_VISIBLE"); WRITE_USHORT(msg + 0, pid); msg[2] = GET_BYTE_0(A661_VISIBLE_Visible_); msg[3] = GET_BYTE_0(0); return 4 ; }
A661_INTERNAL int a661_com_msg_GpArcCircle_A661_FILL_INDEX(buffer_el msg[], a661_ushort pid, a661_uchar A661_FILL_INDEX_FillIndex_){ int n3 = 0; int n2 = 0; int n1 = 0; PARAMETER("A661_FILL_INDEX"); WRITE_USHORT(msg + 0, pid); msg[2] = GET_BYTE_0(A661_FILL_INDEX_FillIndex_); msg[3] = GET_BYTE_0(0); return 4 ; }
/*set_parameter_structure*/ A661_INTERNAL int a661_msg_csp_header(buffer_el msg[], const a661_ushort wid) { msg[0]= GET_BYTE_1(A661_CMD_SET_PARAMETER); msg[1]= GET_BYTE_0(A661_CMD_SET_PARAMETER); /*size delayed*/ msg[4]= GET_BYTE_1(wid); msg[5]= GET_BYTE_0(wid); msg[6]=0;/*padding*/ msg[7]=0; return 8; }
GString *base64_decode (const gchar *str) { guint i; GString *tmp; char group[4]; guint filled = 0; for (i = 0; str[i]; i++) { if (str[i] != 'A' && str[i] != '=' && !isspace (str[i]) && decoding[(guchar) str[i]] == 0) { DEBUG ("bad character %x at byte %u", (guchar)str[i], i); return NULL; } } tmp = g_string_new (""); for (i = 0; str[i]; i++) { if (isspace (str[i])) continue; group[filled++] = str[i]; if (filled == 4) { if (group[3] == '=') { if (group[2] == '=') { g_string_append_c (tmp, GET_BYTE_0(group)); } else { g_string_append_c (tmp, GET_BYTE_0(group)); g_string_append_c (tmp, GET_BYTE_1(group)); } } else { g_string_append_c (tmp, GET_BYTE_0(group)); g_string_append_c (tmp, GET_BYTE_1(group)); g_string_append_c (tmp, GET_BYTE_2(group)); } filled = 0; } } if (filled) { DEBUG ("insufficient padding at end of base64 string:\n%s", str); g_string_free (tmp, TRUE); return NULL; } return tmp; }