/* Appends a new boot property to the end of the internal list. */ int boot_property_add2( const char* name, int namelen, const char* value, int valuelen ) { BootProperty* prop; /* check the lengths */ if (namelen > PROPERTY_MAX_NAME) return -1; if (valuelen > PROPERTY_MAX_VALUE) return -2; /* check that there are not invalid characters in the * property name */ const char* reject = " =$*?'\""; int nn; for (nn = 0; nn < namelen; nn++) { if (strchr(reject, name[nn]) != NULL) return -3; } /* init service if needed */ if (!_inited) { boot_property_init_service(); _inited = 1; } D("Adding boot property: '%.*s' = '%.*s'", namelen, name, valuelen, value); /* add to the end of the internal list */ prop = boot_property_alloc(name, namelen, value, valuelen); *_boot_properties_tail = prop; _boot_properties_tail = &prop->next; return 0; }
int boot_property_add2( const char* name, int namelen, const char* value, int valuelen ) { BootProperty* prop; if (namelen > PROPERTY_MAX_NAME) return -1; if (valuelen > PROPERTY_MAX_VALUE) return -2; const char* reject = " =$*?'\""; int nn; for (nn = 0; nn < namelen; nn++) { if (strchr(reject, name[nn]) != NULL) return -3; } if (!_inited) { boot_property_init_service(); _inited = 1; } D("Adding boot property: '%.*s' = '%.*s'", namelen, name, valuelen, value); prop = boot_property_alloc(name, namelen, value, valuelen); *_boot_properties_tail = prop; _boot_properties_tail = &prop->next; return 0; }