Esempio n. 1
0
//Checks if application_id is a valid application identifier.
//A valid ID is required for calls to g_application_new() and g_application_set_application_id().
//For convenience, the restrictions on application identifiers are reproduced here:
//*Application identifiers must contain only the ASCII characters "A-Z[0-9]_-." and must not begin with a digit.
//*Application identifiers must contain at least one '.' (period) character (and thus at least three elements).
//*Application identifiers must not begin or end with a '.' (period) character.
//*Application identifiers must not contain consecutive '.' (period) characters.
//*Application identifiers must not exceed 255 characters.
func ApplicationIdIsValid(application_id string) bool {
	cstr := C.CString(application_id)
	defer C.free(unsafe.Pointer(cstr))
	c := C.g_application_id_is_valid((*C.gchar)(cstr))

	return gobool(c)
}
Esempio n. 2
0
// ApplicationIDIsValid is a wrapper around g_application_id_is_valid().
func ApplicationIDIsValid(id string) bool {
	cstr1 := (*C.gchar)(C.CString(id))
	defer C.free(unsafe.Pointer(cstr1))

	return gobool(C.g_application_id_is_valid(cstr1))
}