Lines Matching refs:len
394 size_t len = 0; in Petscgetline() local
404 if (!fgets(buf + len, 1024, f)) buf[len] = 0; in Petscgetline()
405 PetscCallAbort(PETSC_COMM_SELF, PetscStrlen(buf, &len)); in Petscgetline()
406 last = len - 1; in Petscgetline()
408 if (len) return buf; in Petscgetline()
454 size_t len; in PetscOptionsInsertFilePetsc() local
492 PetscCall(PetscStrlen(string, &len)); in PetscOptionsInsertFilePetsc()
494 for (size_t i = 0; i < len; i++) { in PetscOptionsInsertFilePetsc()
510 PetscCall(PetscStrlen(tokens[0], &len)); in PetscOptionsInsertFilePetsc()
511 PetscCall(PetscSegBufferGet(vseg, len + 1, &vstring)); in PetscOptionsInsertFilePetsc()
512 PetscCall(PetscArraycpy(vstring, tokens[0], len)); in PetscOptionsInsertFilePetsc()
513 vstring[len] = ' '; in PetscOptionsInsertFilePetsc()
517 PetscCall(PetscStrlen(tokens[1], &len)); in PetscOptionsInsertFilePetsc()
518 PetscCall(PetscSegBufferGet(vseg, len + 3, &vstring)); in PetscOptionsInsertFilePetsc()
520 PetscCall(PetscArraycpy(vstring + 1, tokens[1], len)); in PetscOptionsInsertFilePetsc()
521 vstring[len + 1] = '"'; in PetscOptionsInsertFilePetsc()
522 vstring[len + 2] = ' '; in PetscOptionsInsertFilePetsc()
532 PetscCall(PetscStrlen(tokens[1], &len)); in PetscOptionsInsertFilePetsc()
533 PetscCall(PetscSegBufferGet(aseg, len + 1, &astring)); in PetscOptionsInsertFilePetsc()
534 PetscCall(PetscArraycpy(astring, tokens[1], len)); in PetscOptionsInsertFilePetsc()
535 astring[len] = ' '; in PetscOptionsInsertFilePetsc()
537 PetscCall(PetscStrlen(tokens[2], &len)); in PetscOptionsInsertFilePetsc()
538 PetscCall(PetscSegBufferGet(aseg, len + 1, &astring)); in PetscOptionsInsertFilePetsc()
539 PetscCall(PetscArraycpy(astring, tokens[2], len)); in PetscOptionsInsertFilePetsc()
540 astring[len] = ' '; in PetscOptionsInsertFilePetsc()
842 size_t len = 0; in PetscOptionsInsert() local
876 PetscCall(PetscStrlen(eoptions, &len)); in PetscOptionsInsert()
878 PetscCallMPI(MPI_Bcast(&len, 1, MPIU_SIZE_T, 0, comm)); in PetscOptionsInsert()
879 if (len) { in PetscOptionsInsert()
880 if (rank) PetscCall(PetscMalloc1(len + 1, &eoptions)); in PetscOptionsInsert()
881 PetscCallMPI(MPI_Bcast(eoptions, (PetscMPIInt)len, MPI_CHAR, 0, comm)); in PetscOptionsInsert()
882 if (rank) eoptions[len] = 0; in PetscOptionsInsert()
890 PetscCall(PetscStrlen(eoptions, &len)); in PetscOptionsInsert()
892 PetscCallMPI(MPI_Bcast(&len, 1, MPIU_SIZE_T, 0, comm)); in PetscOptionsInsert()
893 if (len) { in PetscOptionsInsert()
894 if (rank) PetscCall(PetscMalloc1(len + 1, &eoptions)); in PetscOptionsInsert()
895 PetscCallMPI(MPI_Bcast(eoptions, (PetscMPIInt)len, MPI_CHAR, 0, comm)); in PetscOptionsInsert()
896 if (rank) eoptions[len] = 0; in PetscOptionsInsert()
1203 size_t len; in PetscOptionsSetAlias() local
1232 PetscCall(PetscStrlen(newname, &len)); in PetscOptionsSetAlias()
1233 options->aliases1[options->Na] = (char *)malloc((len + 1) * sizeof(char)); in PetscOptionsSetAlias()
1234 PetscCall(PetscStrncpy(options->aliases1[options->Na], newname, len + 1)); in PetscOptionsSetAlias()
1235 PetscCall(PetscStrlen(oldname, &len)); in PetscOptionsSetAlias()
1236 options->aliases2[options->Na] = (char *)malloc((len + 1) * sizeof(char)); in PetscOptionsSetAlias()
1237 PetscCall(PetscStrncpy(options->aliases2[options->Na], oldname, len + 1)); in PetscOptionsSetAlias()
1277 size_t len; in PetscOptionsSetValue_Private() local
1369 len = strlen(name); in PetscOptionsSetValue_Private()
1370 options->names[n] = (char *)malloc((len + 1) * sizeof(char)); in PetscOptionsSetValue_Private()
1377 len = value ? strlen(value) : 0; in PetscOptionsSetValue_Private()
1378 if (len) { in PetscOptionsSetValue_Private()
1379 options->values[n] = (char *)malloc((len + 1) * sizeof(char)); in PetscOptionsSetValue_Private()
1382 options->values[n][len] = '\0'; in PetscOptionsSetValue_Private()
1645 size_t len; in PetscOptionsFindPairPrefix_Private() local
1653 PetscCall(PetscStrlen(opt, &len)); in PetscOptionsFindPairPrefix_Private()
1657 PetscCall(PetscStrncmp(options->names[i], opt, len, &match)); in PetscOptionsFindPairPrefix_Private()
1798 size_t len = 1, lent = 0; in PetscOptionsGetAll() local
1807 len += 2 + lent; in PetscOptionsGetAll()
1810 len += 1 + lent; in PetscOptionsGetAll()
1813 PetscCall(PetscMalloc1(len, &coptions)); in PetscOptionsGetAll()
1816 PetscCall(PetscStrlcat(coptions, "-", len)); in PetscOptionsGetAll()
1817 PetscCall(PetscStrlcat(coptions, options->names[i], len)); in PetscOptionsGetAll()
1818 PetscCall(PetscStrlcat(coptions, " ", len)); in PetscOptionsGetAll()
1820 PetscCall(PetscStrlcat(coptions, options->values[i], len)); in PetscOptionsGetAll()
1821 PetscCall(PetscStrlcat(coptions, " ", len)); in PetscOptionsGetAll()
2148 size_t len; in PetscOptionsStringToBool() local
2152 PetscCall(PetscStrlen(value, &len)); in PetscOptionsStringToBool()
2153 if (!len) { in PetscOptionsStringToBool()
2205 size_t len; in PetscOptionsStringToInt() local
2209 PetscCall(PetscStrlen(name, &len)); in PetscOptionsStringToInt()
2210 …PetscCheck(len, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "character string of length zero has no nume… in PetscOptionsStringToInt()
2231 …PetscCheck((size_t)(endptr - name) == len, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Input strin… in PetscOptionsStringToInt()
2303 size_t len; in PetscOptionsStringToReal() local
2308 PetscCall(PetscStrlen(name, &len)); in PetscOptionsStringToReal()
2309 …PetscCheck(len, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "String of length zero has no numerical valu… in PetscOptionsStringToReal()
2340 …PetscCheck((size_t)(endptr - name) == len, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Input strin… in PetscOptionsStringToReal()
2347 size_t len; in PetscOptionsStringToScalar() local
2352 PetscCall(PetscStrlen(name, &len)); in PetscOptionsStringToScalar()
2353 …PetscCheck(len, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "character string of length zero has no nume… in PetscOptionsStringToScalar()
2356 if ((size_t)(ptr - name) < len) { in PetscOptionsStringToScalar()
2365 …PetscCheck((size_t)(ptr - name) == len, PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Input string %… in PetscOptionsStringToScalar()
2518 size_t alen, len = 0, tlen = 0; in PetscOptionsGetEList() local
2527 if (alen > len) len = alen; in PetscOptionsGetEList()
2528 tlen += len + 1; in PetscOptionsGetEList()
2530 len += 5; /* a little extra space for user mistypes */ in PetscOptionsGetEList()
2531 PetscCall(PetscMalloc1(len, &svalue)); in PetscOptionsGetEList()
2532 PetscCall(PetscOptionsGetString(options, pre, opt, svalue, len, &aset)); in PetscOptionsGetEList()
2851 …ptions options, const char pre[], const char name[], char string[], size_t len, PetscBool *set) Pe… in PetscOptionsGetString() argument
2864 if (value) PetscCall(PetscStrncpy(string, value, len)); in PetscOptionsGetString()
2865 else PetscCall(PetscArrayzero(string, len)); in PetscOptionsGetString()
3034 size_t len; in PetscOptionsGetIntArray() local
3058 PetscCall(PetscStrlen(iivalue, &len)); in PetscOptionsGetIntArray()
3061 for (; i < (int)len; i++) { in PetscOptionsGetIntArray()
3063 …PetscCheck(i != (int)len - 1, PETSC_COMM_SELF, PETSC_ERR_USER, "Error in %" PetscInt_FMT "-th arra… in PetscOptionsGetIntArray()
3069 for (; j < (int)len; j++) { in PetscOptionsGetIntArray()