* Find a new slot for a script, if available. Does not mark as allocated in * any way--this must be done by the caller. */
| 144 | * any way--this must be done by the caller. |
| 145 | */ |
| 146 | static struct ddb_script * |
| 147 | db_script_new(void) |
| 148 | { |
| 149 | int i; |
| 150 | |
| 151 | for (i = 0; i < DB_MAXSCRIPTS; i++) { |
| 152 | if (strlen(db_script_table[i].ds_scriptname) == 0) |
| 153 | return (&db_script_table[i]); |
| 154 | } |
| 155 | return (NULL); |
| 156 | } |
| 157 | |
| 158 | /* |
| 159 | * Perform very rudimentary validation of a proposed script. It would be |