IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 18, 2012, 8:44:13 PM (14 years ago)
Author:
eugene
Message:

some support functions for dvo_client; mextract example nearly complete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20111122/Ohana/src/opihi/lib.shell/string.c

    r31667 r33308  
    301301  *out = *in;
    302302}
     303
     304// paste together argv[0] .. argv[N] into a single string
     305char *paste_args (int argc, char **argv) {
     306
     307  int i;
     308
     309  int length = 0;
     310  for (i = 0; i < argc; i++) {
     311    length += strlen(argv[i]) + 1;
     312  }
     313 
     314  char *string = NULL;
     315  ALLOCATE (string, char, length);
     316  string[0] = 0;
     317  for (i = 0; i < argc; i++) {
     318    strcat (string, argv[i]);
     319    if (i < argc - 1) strcat (string, " ");
     320  }
     321  return string;
     322}
     323
Note: See TracChangeset for help on using the changeset viewer.