diff options
author | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-03-18 16:31:19 -0400 |
---|---|---|
committer | Adam Jackson <ajax@benzedrine.nwnk.net> | 2007-03-20 18:37:02 -0400 |
commit | 021fc5cb2cb4a7972b4a6fcb570c1da92787d68d (patch) | |
tree | 58063be57aef43d15f51822264d4a7a789ee7c77 /xkb/XKBMAlloc.c | |
parent | 9398d62f27ee1b287e4458fd8b011c10f7b59efd (diff) |
Static markup and dead code cull over xkb/.
The former <X11/extensions/XKBsrv.h> has been pulled into the server now as
include/xkbsrv.h, and the world updated to look for it in the new place,
since it made no sense to define server API in an extension header. Any
further work along this line will need to do similar things with XKBgeom.h
and friends.
Diffstat (limited to 'xkb/XKBMAlloc.c')
-rw-r--r-- | xkb/XKBMAlloc.c | 80 |
1 files changed, 2 insertions, 78 deletions
diff --git a/xkb/XKBMAlloc.c b/xkb/XKBMAlloc.c index ef4097dad..4b7428b2e 100644 --- a/xkb/XKBMAlloc.c +++ b/xkb/XKBMAlloc.c @@ -39,7 +39,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "inputstr.h" #include <X11/keysym.h> #define XKBSRV_NEED_FILE_FUNCS -#include <X11/extensions/XKBsrv.h> +#include <xkbsrv.h> /***====================================================================***/ @@ -220,7 +220,7 @@ XkbServerMapPtr map; /***====================================================================***/ -Status +static Status XkbCopyKeyType(XkbKeyTypePtr from,XkbKeyTypePtr into) { if ((!from)||(!into)) @@ -275,82 +275,6 @@ register int i,rtrn; return Success; } -XkbKeyTypePtr -XkbAddKeyType( XkbDescPtr xkb, - Atom name, - int map_count, - Bool want_preserve, - int num_lvls) -{ -register int i; -unsigned tmp; -XkbKeyTypePtr type; -XkbClientMapPtr map; - - if ((!xkb)||(num_lvls<1)) - return NULL; - map= xkb->map; - if ((map)&&(map->types)) { - for (i=0;i<map->num_types;i++) { - if (map->types[i].name==name) { - Status status; - status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls); - return (status==Success?&map->types[i]:NULL); - } - } - } - if ((!map)||(!map->types)||(!map->num_types<XkbNumRequiredTypes)) { - tmp= XkbNumRequiredTypes+1; - if (XkbAllocClientMap(xkb,XkbKeyTypesMask,tmp)!=Success) - return NULL; - map = xkb->map; - tmp= 0; - if (map->num_types<=XkbKeypadIndex) - tmp|= XkbKeypadMask; - if (map->num_types<=XkbAlphabeticIndex) - tmp|= XkbAlphabeticMask; - if (map->num_types<=XkbTwoLevelIndex) - tmp|= XkbTwoLevelMask; - if (map->num_types<=XkbOneLevelIndex) - tmp|= XkbOneLevelMask; - if (XkbInitCanonicalKeyTypes(xkb,tmp,XkbNoModifier)==Success) { - for (i=0;i<map->num_types;i++) { - Status status; - if (map->types[i].name!=name) - continue; - status=XkbResizeKeyType(xkb,i,map_count,want_preserve,num_lvls); - return (status==Success?&map->types[i]:NULL); - } - } - } - if ((map->num_types<=map->size_types)&& - (XkbAllocClientMap(xkb,XkbKeyTypesMask,map->num_types+1)!=Success)) { - return NULL; - } - type= &map->types[map->num_types]; - map->num_types++; - bzero((char *)type,sizeof(XkbKeyTypeRec)); - type->num_levels= num_lvls; - type->map_count= map_count; - type->name= name; - if (map_count>0) { - type->map= _XkbTypedCalloc(map_count,XkbKTMapEntryRec); - if (!type->map) { - map->num_types--; - return NULL; - } - if (want_preserve) { - type->preserve= _XkbTypedCalloc(map_count,XkbModsRec); - if (!type->preserve) { - _XkbFree(type->map); - map->num_types--; - return NULL; - } - } - } - return type; -} - Status XkbResizeKeyType( XkbDescPtr xkb, int type_ndx, |