Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void
- priority_arg_create (gchar *arg)
- {
- gchar **argvp;
- gint argcp;
- gint i;
- gint j;
- argvp = get_arg_vector ();
- argcp = 0;
- i = 0;
- /* obtain arg count not including the `NULL` terminator. */
- while (argvp[argcp])
- {
- argcp++;
- }
- g_print ("From `rt_priority.c` line 42: %d\n", argcp);
- /* Here we look for the jack arg `-Px` with the for loop then the if
- statement. If it does not exist then we add it to arg vector with
- `else/if` statement. */
- for (i = 0; i <= argcp + 1; i++)
- {
- if (g_strcmp0 (argvp[i], arg) == 0)
- {
- g_print ("From `rt_priority.c` line 51: %d\n", i);
- break;
- }
- /* If `priority arg` is found but the number does not match
- execute else/if statement. */
- else if (strncmp (argvp[i], "-P", 2) == 0)
- {
- argvp[i] = arg;
- break;
- }
- else if (argvp[i] == NULL)
- {
- g_print ("From `rt_priority.c` line 65\n");
- /* Add space to arg vector for the jackd arg `-R`. */
- argcp = argcp + 1;
- /* If realtime arg exists then place priority arg right
- after that.*/
- if ((strncmp (argvp[1], "-r", 2) == 0) ||
- (strncmp (argvp[1], "-R", 2) == 0))
- {
- /* Here we move the args over one to place `-Px` as the
- third arg in the vector. */
- for (j = argcp; j >= 2; j--)
- {
- argvp[j] = argvp[j - 1];
- }
- argvp[2] = arg;
- }
- else
- {
- /* Here we move the args over one to place `-Px` as the
- second arg in the vector. */
- for (j = argcp; j >= 1; j--)
- {
- argvp[j] = argvp[j - 1];
- }
- argvp[1] = arg;
- }
- break;
- }
- }
- file_input (argvp, argcp);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement