Главная » Просмотр файлов » Стандарт языка Си С99 TC

Стандарт языка Си С99 TC (1113411), страница 73

Файл №1113411 Стандарт языка Си С99 TC (Стандарт языка Си С99 + TC) 73 страницаСтандарт языка Си С99 TC (1113411) страница 732019-04-24СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 73)

If conversion stopped due toreaching a terminating null character and if dst is not a null pointer, the resulting statedescribed is the initial conversion state.Returns4If the input conversion encounters a sequence of bytes that do not form a valid multibytecharacter, an encoding error occurs: the mbsrtowcs function stores the value of themacro EILSEQ in errno and returns (size_t)(-1); the conversion state isunspecified. Otherwise, it returns the number of multibyte characters successfullyconverted, not including the terminating null character (if any).301) Thus, the value of len is ignored if dst is a null pointer.§7.24.6.4.1Library391ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.24.6.4.2 The wcsrtombs functionSynopsis1#include <wchar.h>size_t wcsrtombs(char * restrict dst,const wchar_t ** restrict src,size_t len,mbstate_t * restrict ps);Description2The wcsrtombs function converts a sequence of wide characters from the arrayindirectly pointed to by src into a sequence of corresponding multibyte characters thatbegins in the conversion state described by the object pointed to by ps.

If dst is not anull pointer, the converted characters are then stored into the array pointed to by dst.Conversion continues up to and including a terminating null wide character, which is alsostored. Conversion stops earlier in two cases: when a wide character is reached that doesnot correspond to a valid multibyte character, or (if dst is not a null pointer) when thenext multibyte character would exceed the limit of len total bytes to be stored into thearray pointed to by dst. Each conversion takes place as if by a call to the wcrtombfunction.302)3If dst is not a null pointer, the pointer object pointed to by src is assigned either a nullpointer (if conversion stopped due to reaching a terminating null wide character) or theaddress just past the last wide character converted (if any).

If conversion stopped due toreaching a terminating null wide character, the resulting state described is the initialconversion state.Returns4If conversion stops because a wide character is reached that does not correspond to avalid multibyte character, an encoding error occurs: the wcsrtombs function stores thevalue of the macro EILSEQ in errno and returns (size_t)(-1); the conversionstate is unspecified. Otherwise, it returns the number of bytes in the resulting multibytecharacter sequence, not including the terminating null character (if any).302) If conversion stops because a terminating null wide character has been reached, the bytes storedinclude those necessary to reach the initial shift state immediately before the null byte.392Library§7.24.6.4.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.25 Wide character classification and mapping utilities <wctype.h>7.25.1 Introduction1The header <wctype.h> declares three data types, one macro, and many functions.303)2The types declared arewint_tdescribed in 7.24.1;wctrans_twhich is a scalar type that can hold values which represent locale-specific charactermappings; andwctype_twhich is a scalar type that can hold values which represent locale-specific characterclassifications.3The macro defined is WEOF (described in 7.24.1).4The functions declared are grouped as follows:— Functions that provide wide character classification;— Extensible functions that provide wide character classification;— Functions that provide wide character case mapping;— Extensible functions that provide wide character mapping.5For all functions described in this subclause that accept an argument of type wint_t, thevalue shall be representable as a wchar_t or shall equal the value of the macro WEOF.

Ifthis argument has any other value, the behavior is undefined.6The behavior of these functions is affected by the LC_CTYPE category of the currentlocale.303) See ‘‘future library directions’’ (7.26.13).§7.25.1Library393ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.25.2 Wide character classification utilities1The header <wctype.h> declares several functions useful for classifying widecharacters.2The term printing wide character refers to a member of a locale-specific set of widecharacters, each of which occupies at least one printing position on a display device. Theterm control wide character refers to a member of a locale-specific set of wide charactersthat are not printing wide characters.7.25.2.1 Wide character classification functions1The functions in this subclause return nonzero (true) if and only if the value of theargument wc conforms to that in the description of the function.2Each of the following functions returns true for each wide character that corresponds (asif by a call to the wctob function) to a single-byte character for which the correspondingcharacter classification function from 7.4.1 returns true, except that the iswgraph andiswpunct functions may differ with respect to wide characters other than L' ' that areboth printing and white-space wide characters.304)Forward references: the wctob function (7.24.6.1.2).7.25.2.1.1 The iswalnum functionSynopsis1#include <wctype.h>int iswalnum(wint_t wc);Description2The iswalnum function tests for any wide character for which iswalpha oriswdigit is true.7.25.2.1.2 The iswalpha functionSynopsis1#include <wctype.h>int iswalpha(wint_t wc);Description2The iswalpha function tests for any wide character for which iswupper oriswlower is true, or any wide character that is one of a locale-specific set of alphabetic304) For example, if the expression isalpha(wctob(wc)) evaluates to true, then the calliswalpha(wc) also returns true.

But, if the expression isgraph(wctob(wc)) evaluates to true(which cannot occur for wc == L' ' of course), then either iswgraph(wc) or iswprint(wc)&& iswspace(wc) is true, but not both.394Library§7.25.2.1.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3wide characters for which none of iswcntrl, iswdigit, iswpunct, or iswspaceis true.305)7.25.2.1.3 The iswblank functionSynopsis1#include <wctype.h>int iswblank(wint_t wc);Description2The iswblank function tests for any wide character that is a standard blank widecharacter or is one of a locale-specific set of wide characters for which iswspace is trueand that is used to separate words within a line of text. The standard blank widecharacters are the following: space (L' '), and horizontal tab (L'\t'). In the "C"locale, iswblank returns true only for the standard blank characters.7.25.2.1.4 The iswcntrl functionSynopsis1#include <wctype.h>int iswcntrl(wint_t wc);Description2The iswcntrl function tests for any control wide character.7.25.2.1.5 The iswdigit functionSynopsis1#include <wctype.h>int iswdigit(wint_t wc);Description2The iswdigit function tests for any wide character that corresponds to a decimal-digitcharacter (as defined in 5.2.1).7.25.2.1.6 The iswgraph functionSynopsis1#include <wctype.h>int iswgraph(wint_t wc);305) The functions iswlower and iswupper test true or false separately for each of these additionalwide characters; all four combinations are possible.§7.25.2.1.6Library395ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256Description2The iswgraph function tests for any wide character for which iswprint is true andiswspace is false.306)7.25.2.1.7 The iswlower functionSynopsis1#include <wctype.h>int iswlower(wint_t wc);Description2The iswlower function tests for any wide character that corresponds to a lowercaseletter or is one of a locale-specific set of wide characters for which none of iswcntrl,iswdigit, iswpunct, or iswspace is true.7.25.2.1.8 The iswprint functionSynopsis1#include <wctype.h>int iswprint(wint_t wc);Description2The iswprint function tests for any printing wide character.7.25.2.1.9 The iswpunct functionSynopsis1#include <wctype.h>int iswpunct(wint_t wc);Description2The iswpunct function tests for any printing wide character that is one of a localespecific set of punctuation wide characters for which neither iswspace nor iswalnumis true.306)7.25.2.1.10 The iswspace functionSynopsis1#include <wctype.h>int iswspace(wint_t wc);306) Note that the behavior of the iswgraph and iswpunct functions may differ from theircorresponding functions in 7.4.1 with respect to printing, white-space, single-byte executioncharacters other than ' '.396Library§7.25.2.1.10WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3Description2The iswspace function tests for any wide character that corresponds to a locale-specificset of white-space wide characters for which none of iswalnum, iswgraph, oriswpunct is true.7.25.2.1.11 The iswupper functionSynopsis1#include <wctype.h>int iswupper(wint_t wc);Description2The iswupper function tests for any wide character that corresponds to an uppercaseletter or is one of a locale-specific set of wide characters for which none of iswcntrl,iswdigit, iswpunct, or iswspace is true.7.25.2.1.12 The iswxdigit functionSynopsis1#include <wctype.h>int iswxdigit(wint_t wc);Description2The iswxdigit function tests for any wide character that corresponds to ahexadecimal-digit character (as defined in 6.4.4.1).7.25.2.2 Extensible wide character classification functions1The functions wctype and iswctype provide extensible wide character classificationas well as testing equivalent to that performed by the functions described in the previoussubclause (7.25.2.1).7.25.2.2.1 The iswctype functionSynopsis1#include <wctype.h>int iswctype(wint_t wc, wctype_t desc);Description2The iswctype function determines whether the wide character wc has the propertydescribed by desc.

The current setting of the LC_CTYPE category shall be the same asduring the call to wctype that returned the value desc.3Each of the following expressions has a truth-value equivalent to the call to the widecharacter classification function (7.25.2.1) in the comment that follows the expression:§7.25.2.2.1Library397ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,iswctype(wc,wctype("alnum"))wctype("alpha"))wctype("blank"))wctype("cntrl"))wctype("digit"))wctype("graph"))wctype("lower"))wctype("print"))wctype("punct"))wctype("space"))wctype("upper"))wctype("xdigit"))////////////////////////WG14/N1256iswalnum(wc)iswalpha(wc)iswblank(wc)iswcntrl(wc)iswdigit(wc)iswgraph(wc)iswlower(wc)iswprint(wc)iswpunct(wc)iswspace(wc)iswupper(wc)iswxdigit(wc)Returns4The iswctype function returns nonzero (true) if and only if the value of the widecharacter wc has the property described by desc.Forward references: the wctype function (7.25.2.2.2).7.25.2.2.2 The wctype functionSynopsis1#include <wctype.h>wctype_t wctype(const char *property);Description2The wctype function constructs a value with type wctype_t that describes a class ofwide characters identified by the string argument property.3The strings listed in the description of the iswctype function shall be valid in alllocales as property arguments to the wctype function.Returns4If property identifies a valid class of wide characters according to the LC_CTYPEcategory of the current locale, the wctype function returns a nonzero value that is validas the second argument to the iswctype function; otherwise, it returns zero.∗398Library§7.25.2.2.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37.25.3 Wide character case mapping utilities1The header <wctype.h> declares several functions useful for mapping wide characters.7.25.3.1 Wide character case mapping functions7.25.3.1.1 The towlower functionSynopsis1#include <wctype.h>wint_t towlower(wint_t wc);Description2The towlower function converts an uppercase letter to a corresponding lowercase letter.Returns3If the argument is a wide character for which iswupper is true and there are one ormore corresponding wide characters, as specified by the current locale, for whichiswlower is true, the towlower function returns one of the corresponding widecharacters (always the same one for any given locale); otherwise, the argument isreturned unchanged.7.25.3.1.2 The towupper functionSynopsis1#include <wctype.h>wint_t towupper(wint_t wc);Description2The towupper function converts a lowercase letter to a corresponding uppercase letter.Returns3If the argument is a wide character for which iswlower is true and there are one ormore corresponding wide characters, as specified by the current locale, for whichiswupper is true, the towupper function returns one of the corresponding widecharacters (always the same one for any given locale); otherwise, the argument isreturned unchanged.7.25.3.2 Extensible wide character case mapping functions1The functions wctrans and towctrans provide extensible wide character mapping aswell as case mapping equivalent to that performed by the functions described in theprevious subclause (7.25.3.1).§7.25.3.2Library399ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.25.3.2.1 The towctrans functionSynopsis1#include <wctype.h>wint_t towctrans(wint_t wc, wctrans_t desc);Description2The towctrans function maps the wide character wc using the mapping described bydesc.

Характеристики

Тип файла
PDF-файл
Размер
3,61 Mb
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
А знаете ли Вы, что из года в год задания практически не меняются? Математика, преподаваемая в учебных заведениях, никак не менялась минимум 30 лет. Найдите нужный учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6367
Авторов
на СтудИзбе
310
Средний доход
с одного платного файла
Обучение Подробнее